diff --git a/client/src/components/email-overlay/email-overlay.component.jsx b/client/src/components/email-overlay/email-overlay.component.jsx index ebb222b17..d648eddb0 100644 --- a/client/src/components/email-overlay/email-overlay.component.jsx +++ b/client/src/components/email-overlay/email-overlay.component.jsx @@ -191,7 +191,7 @@ export function EmailOverlayComponent({ items={[ { key: "documents", - tab: t("emails.labels.documents"), + label: t("emails.labels.documents"), children: ( {bodyshop.uselocalmediaserver && emailConfig.jobid && ( diff --git a/client/src/components/shop-info/shop-info.component.jsx b/client/src/components/shop-info/shop-info.component.jsx index c6e75842a..3c0e988e7 100644 --- a/client/src/components/shop-info/shop-info.component.jsx +++ b/client/src/components/shop-info/shop-info.component.jsx @@ -39,6 +39,63 @@ export function ShopInfoComponent({bodyshop, form, saveLoading}) { const location = useLocation(); const search = queryString.parse(location.search); + const tabItems = [ + { + key: "general", + label: t("bodyshop.labels.shopinfo"), + children: , + }, + { + key: "speedprint", + label: t("bodyshop.labels.speedprint"), + children: , + }, + { + key: "rbac", + label: t("bodyshop.labels.rbac"), + children: , + }, + { + key: "roStatus", + label: t("bodyshop.labels.jobstatuses"), + children: , + }, + { + key: "scheduling", + label: t("bodyshop.labels.scheduling"), + children: , + }, + { + key: "orderStatus", + label: t("bodyshop.labels.orderstatuses"), + children: , + }, + { + key: "responsibilityCenters", + label: t("bodyshop.labels.responsibilitycenters.title"), + children: , + }, + { + key: "checklists", + label: t("bodyshop.labels.checklists"), + children: , + }, + { + key: "laborrates", + label: t("bodyshop.labels.laborrates"), + children: , + }, + ...(CriticalPartsScanning.treatment === "on" + ? [ + { + key: "partsscan", + label: t("bodyshop.labels.partsscan"), + children: , + }, + ] + : []), + ]; + return ( , - }, - { - key: "speedprint", - tab: t("bodyshop.labels.speedprint"), - children: , - }, - { - key: "rbac", - tab: t("bodyshop.labels.rbac"), - children: , - }, - { - key: "roStatus", - tab: t("bodyshop.labels.jobstatuses"), - children: , - }, - { - key: "scheduling", - tab: t("bodyshop.labels.scheduling"), - children: , - }, - { - key: "orderStatus", - tab: t("bodyshop.labels.orderstatuses"), - children: , - }, - { - key: "responsibilityCenters", - tab: t("bodyshop.labels.responsibilitycenters.title"), - children: , - }, - { - key: "checklists", - tab: t("bodyshop.labels.checklists"), - children: , - }, - { - key: "laborrates", - tab: t("bodyshop.labels.laborrates"), - children: , - }, - ...(CriticalPartsScanning.treatment === "on" - ? [ - { - key: "partsscan", - tab: t("bodyshop.labels.partsscan"), - children: , - }, - ] - : []), - ]} + items={tabItems} /> ); diff --git a/client/src/components/shop-info/shop-info.container.jsx b/client/src/components/shop-info/shop-info.container.jsx index 5708d72fd..3e9393504 100644 --- a/client/src/components/shop-info/shop-info.container.jsx +++ b/client/src/components/shop-info/shop-info.container.jsx @@ -19,6 +19,7 @@ export default function ShopInfoContainer() { nextFetchPolicy: "network-only", }); + const handleFinish = (values) => { setSaveLoading(true); logImEXEvent("shop_update"); diff --git a/client/src/components/tech-lookup-jobs-drawer/tech-lookup-jobs-drawer.component.jsx b/client/src/components/tech-lookup-jobs-drawer/tech-lookup-jobs-drawer.component.jsx index dc2a8670a..a54453284 100644 --- a/client/src/components/tech-lookup-jobs-drawer/tech-lookup-jobs-drawer.component.jsx +++ b/client/src/components/tech-lookup-jobs-drawer/tech-lookup-jobs-drawer.component.jsx @@ -112,7 +112,7 @@ export function TechLookupJobsDrawer({bodyshop, setPrintCenterContext}) { items={[ { key: "lines", - tab: t("jobs.labels.lines"), + label: t("jobs.labels.lines"), children: ( , }, ]} diff --git a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx index 894ae0d2c..87e86ae2f 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx @@ -261,7 +261,7 @@ export function JobsDetailPage({ items={[ { key: "general", - tab: ( + label: ( {t("menus.jobsdetail.general")} ), forceRender: true, @@ -269,7 +269,7 @@ export function JobsDetailPage({ }, { key: "repairdata", - tab: ( + label: ( {t("menus.jobsdetail.repairdata")} ), forceRender: true, @@ -284,7 +284,7 @@ export function JobsDetailPage({ }, { key: "rates", - tab: ( + label: ( {t("menus.jobsdetail.rates")} ), forceRender: true, @@ -292,28 +292,28 @@ export function JobsDetailPage({ }, { key: "totals", - tab: ( + label: ( {t("menus.jobsdetail.totals")} ), children: , }, { key: "partssublet", - tab: ( + label: ( {t("menus.jobsdetail.partssublet")} ), children: , }, { key: "labor", - tab: ( + label: ( {t("menus.jobsdetail.labor")} ), children: , }, { key: "dates", - tab: ( + label: ( {t("menus.jobsdetail.dates")} ), forceRender: true, @@ -321,7 +321,7 @@ export function JobsDetailPage({ }, { key: "documents", - tab: ( + label: ( {t("jobs.labels.documents")} ), children: bodyshop.uselocalmediaserver ? ( @@ -332,14 +332,14 @@ export function JobsDetailPage({ }, { key: "notes", - tab: ( + label: ( {t("jobs.labels.notes")} ), children: , }, { key: "audit", - tab: ({t("jobs.labels.audit")} + label: ({t("jobs.labels.audit")} ), children: , }, diff --git a/client/src/pages/scoreboard/scoreboard.page.container.jsx b/client/src/pages/scoreboard/scoreboard.page.container.jsx index f4b6002ae..e7098d015 100644 --- a/client/src/pages/scoreboard/scoreboard.page.container.jsx +++ b/client/src/pages/scoreboard/scoreboard.page.container.jsx @@ -77,21 +77,21 @@ export function ScoreboardContainer({ setBreadcrumbs, setSelectedHeader }) { items={[ { key: "sb", - tab: ({t("scoreboard.labels.jobs")} + label: ({t("scoreboard.labels.jobs")} ), forceRender: true, children: , }, { key: "tickets", - tab: ({t("scoreboard.labels.timeticketsemployee")} + label: ({t("scoreboard.labels.timeticketsemployee")} ), forceRender: true, children: , }, { key: "ticketsstats", - tab: ({t("scoreboard.labels.allemployeetimetickets")} + label: ({t("scoreboard.labels.allemployeetimetickets")} ), forceRender: true, children: , diff --git a/client/src/pages/shop/shop.page.component.jsx b/client/src/pages/shop/shop.page.component.jsx index 47f55acbb..28c04d0d8 100644 --- a/client/src/pages/shop/shop.page.component.jsx +++ b/client/src/pages/shop/shop.page.component.jsx @@ -1,78 +1,77 @@ -import { Tabs } from "antd"; -import React, { useEffect } from "react"; -import { useNavigate, useLocation } from "react-router-dom"; +import {Tabs} from "antd"; +import React, {useEffect} from "react"; +import {useLocation, useNavigate} from "react-router-dom"; import queryString from "query-string"; -import { useTranslation } from "react-i18next"; +import {useTranslation} from "react-i18next"; import ShopEmployeesContainer from "../../components/shop-employees/shop-employees.container"; import ShopInfoContainer from "../../components/shop-info/shop-info.container"; import ShopCsiConfig from "../../components/shop-csi-config/shop-csi-config.component"; import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component"; -import { connect } from "react-redux"; -import { createStructuredSelector } from "reselect"; -import { - setSelectedHeader, - setBreadcrumbs, -} from "../../redux/application/application.actions"; -import { selectBodyshop } from "../../redux/user/user.selectors"; +import {connect} from "react-redux"; +import {createStructuredSelector} from "reselect"; +import {setBreadcrumbs, setSelectedHeader,} from "../../redux/application/application.actions"; +import {selectBodyshop} from "../../redux/user/user.selectors"; import ShopInfoUsersComponent from "../../components/shop-users/shop-users.component"; + const mapStateToProps = createStructuredSelector({ - bodyshop: selectBodyshop, + bodyshop: selectBodyshop, }); const mapDispatchToProps = (dispatch) => ({ - setSelectedHeader: (key) => dispatch(setSelectedHeader(key)), - setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)), + setSelectedHeader: (key) => dispatch(setSelectedHeader(key)), + setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)), }); -export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) { - const { t } = useTranslation(); - const history = useNavigate(); - const search = queryString.parse(useLocation().search); +export function ShopPage({bodyshop, setSelectedHeader, setBreadcrumbs}) { + const {t} = useTranslation(); + const history = useNavigate(); + const search = queryString.parse(useLocation().search); - useEffect(() => { - document.title = t("titles.shop"); - setSelectedHeader("shop"); - setBreadcrumbs([ - { - link: "/manage/shop", - label: t("titles.bc.shop", { shopname: bodyshop.shopname }), - }, - ]); - }, [t, setSelectedHeader, setBreadcrumbs, bodyshop.shopname]); + useEffect(() => { + document.title = t("titles.shop"); + setSelectedHeader("shop"); + setBreadcrumbs([ + { + link: "/manage/shop", + label: t("titles.bc.shop", {shopname: bodyshop.shopname}), + }, + ]); + }, [t, setSelectedHeader, setBreadcrumbs, bodyshop.shopname]); - useEffect(() => { - if (!search.tab) history({ search: "?tab=info" }); - }, [history, search]); + useEffect(() => { + if (!search.tab) history({search: "?tab=info"}); + }, [history, search]); - return ( - - history({ search: `?tab=${key}` })} - tabs={[ - { - key: "info", - tab: t("bodyshop.labels.shopinfo"), - children: , - }, - { - key: "employees", - tab: t("bodyshop.labels.employees"), - children: , - }, - { - key: "licensing", - tab: t("bodyshop.labels.licensing"), - children: , - }, - { - key: "csiq", - tab: t("bodyshop.labels.csiq"), - children: , - }, - ]} - /> - - ); + return ( + + history({search: `?tab=${key}`})} + items={[ + { + key: "info", + label: t("bodyshop.labels.shopinfo"), + children: , + }, + { + key: "employees", + label: t("bodyshop.labels.employees"), + children: , + }, + { + key: "licensing", + label: t("bodyshop.labels.licensing"), + children: , + }, + { + key: "csiq", + label: t("bodyshop.labels.csiq"), + children: , + }, + ]} + /> + + ); } + export default connect(mapStateToProps, mapDispatchToProps)(ShopPage);