Fix found bugs during demo
This commit is contained in:
@@ -30,9 +30,6 @@ const CsiPage = lazy(() => import("../pages/csi/csi.container.page"));
|
|||||||
const MobilePaymentContainer = lazy(() =>
|
const MobilePaymentContainer = lazy(() =>
|
||||||
import("../pages/mobile-payment/mobile-payment.container")
|
import("../pages/mobile-payment/mobile-payment.container")
|
||||||
);
|
);
|
||||||
const ManageRootPage = lazy(() =>
|
|
||||||
import("../pages/manage-root/manage-root.page.container")
|
|
||||||
);
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
online: selectOnline,
|
online: selectOnline,
|
||||||
@@ -117,15 +114,14 @@ export function App({
|
|||||||
<Route path="/csi/:surveyId" element={<ErrorBoundary><CsiPage/></ErrorBoundary>}/>
|
<Route path="/csi/:surveyId" element={<ErrorBoundary><CsiPage/></ErrorBoundary>}/>
|
||||||
<Route path="/disclaimer" element={<ErrorBoundary><DisclaimerPage/></ErrorBoundary>}/>
|
<Route path="/disclaimer" element={<ErrorBoundary><DisclaimerPage/></ErrorBoundary>}/>
|
||||||
<Route path="/mp/:paymentIs" element={<ErrorBoundary><MobilePaymentContainer/></ErrorBoundary>}/>
|
<Route path="/mp/:paymentIs" element={<ErrorBoundary><MobilePaymentContainer/></ErrorBoundary>}/>
|
||||||
<Route path="/manage" element={<ErrorBoundary><PrivateRoute isAuthorized={currentUser.authorized}/></ErrorBoundary>}>
|
<Route path="/manage/*" element={<ErrorBoundary><PrivateRoute isAuthorized={currentUser.authorized}/></ErrorBoundary>}>
|
||||||
<Route path='/manage/' element={<ManageRootPage/>}/>
|
<Route path="*" element={<ManagePage/>}/>
|
||||||
<Route path="/manage/*" element={<ManagePage/>}/>
|
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/tech" element={<ErrorBoundary><PrivateRoute isAuthorized={currentUser.authorized}/></ErrorBoundary>}>
|
<Route path="/tech/*" element={<ErrorBoundary><PrivateRoute isAuthorized={currentUser.authorized}/></ErrorBoundary>}>
|
||||||
<Route path="/tech/*" element={<TechPageContainer/>}/>
|
<Route path="*" element={<TechPageContainer/>}/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/edit" element={<PrivateRoute isAuthorized={currentUser.authorized}/>}>
|
<Route path="/edit/*" element={<PrivateRoute isAuthorized={currentUser.authorized}/>}>
|
||||||
<Route path="/edit/*" element={<DocumentEditorContainer/>}/>
|
<Route path="*" element={<DocumentEditorContainer/>}/>
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ export function LandingPage({ currentUser }) {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!currentUser.authorized) {
|
if (currentUser.authorized) {
|
||||||
navigate('/manage/');
|
navigate('/manage/jobs');
|
||||||
}
|
}
|
||||||
}, [currentUser, navigate]);
|
}, [currentUser, navigate]);
|
||||||
|
|
||||||
|
|||||||
@@ -164,6 +164,9 @@ const Dms = lazy(() => import("../dms/dms.container"));
|
|||||||
const DmsPayables = lazy(() =>
|
const DmsPayables = lazy(() =>
|
||||||
import("../dms-payables/dms-payables.container")
|
import("../dms-payables/dms-payables.container")
|
||||||
);
|
);
|
||||||
|
const ManageRootPage = lazy(() =>
|
||||||
|
import("../manage-root/manage-root.page.container")
|
||||||
|
);
|
||||||
|
|
||||||
const {Content, Footer} = Layout;
|
const {Content, Footer} = Layout;
|
||||||
|
|
||||||
@@ -203,6 +206,7 @@ export function Manage({conflict, bodyshop}) {
|
|||||||
<PrintCenterModalContainer/>
|
<PrintCenterModalContainer/>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path='/_test' element={<TestComponent/>}/>
|
<Route path='/_test' element={<TestComponent/>}/>
|
||||||
|
<Route path='/' element={<ManageRootPage/>}/>
|
||||||
<Route path='/jobs' element={<JobsPage/>}/>
|
<Route path='/jobs' element={<JobsPage/>}/>
|
||||||
<Route
|
<Route
|
||||||
path='/jobs/:jobId/intake'
|
path='/jobs/:jobId/intake'
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import Icon, { FieldTimeOutlined } from "@ant-design/icons";
|
import Icon, { FieldTimeOutlined } from "@ant-design/icons";
|
||||||
import { Tabs } from "antd";
|
import { Tabs } from "antd";
|
||||||
|
import queryString from "query-string";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { FaShieldAlt } from "react-icons/fa";
|
import { FaShieldAlt } from "react-icons/fa";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import { useNavigate, useLocation } from "react-router-dom";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
import FeatureWrapper from "../../components/feature-wrapper/feature-wrapper.component";
|
import FeatureWrapper from "../../components/feature-wrapper/feature-wrapper.component";
|
||||||
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||||
import ScoreboardDisplay from "../../components/scoreboard-display/scoreboard-display.component";
|
import ScoreboardDisplay from "../../components/scoreboard-display/scoreboard-display.component";
|
||||||
@@ -14,9 +17,6 @@ import {
|
|||||||
setSelectedHeader,
|
setSelectedHeader,
|
||||||
} from "../../redux/application/application.actions";
|
} from "../../redux/application/application.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { useNavigate, useLocation } from "react-router-dom";
|
|
||||||
import {createStructuredSelector} from "reselect";
|
|
||||||
import queryString from "query-string";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -29,9 +29,9 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
|
|
||||||
export function ScoreboardContainer({ setBreadcrumbs, setSelectedHeader }) {
|
export function ScoreboardContainer({ setBreadcrumbs, setSelectedHeader }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const searchParams = queryString.parse(useLocation().search);
|
const searchParams = queryString.parse(useLocation().search);
|
||||||
const { tab } = searchParams;
|
const { tab } = searchParams;
|
||||||
const navigate = useNavigate();
|
const history = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.title = t("titles.scoreboard");
|
document.title = t("titles.scoreboard");
|
||||||
setSelectedHeader("scoreboard");
|
setSelectedHeader("scoreboard");
|
||||||
@@ -44,58 +44,60 @@ export function ScoreboardContainer({ setBreadcrumbs, setSelectedHeader }) {
|
|||||||
}, [t, setBreadcrumbs, setSelectedHeader]);
|
}, [t, setBreadcrumbs, setSelectedHeader]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FeatureWrapper featureName="scoreboard">
|
<FeatureWrapper featureName="scoreboard">
|
||||||
<RbacWrapper action="scoreboard:view">
|
<RbacWrapper action="scoreboard:view">
|
||||||
<Tabs
|
<Tabs
|
||||||
activeKey={tab || "sb"}
|
activeKey={tab || "sb"}
|
||||||
destroyInactiveTabPane
|
destroyInactiveTabPane
|
||||||
onChange={(key) => {
|
onChange={(key) => {
|
||||||
searchParams.set("tab", key);
|
searchParams.tab = key;
|
||||||
navigate({ search: searchParams.toString() });
|
history({
|
||||||
}}
|
search: queryString.stringify(searchParams),
|
||||||
>
|
});
|
||||||
<Tabs.TabPane
|
}}
|
||||||
tab={
|
>
|
||||||
<span>
|
<Tabs.TabPane
|
||||||
|
tab={
|
||||||
|
<span>
|
||||||
<Icon component={FaShieldAlt} />
|
<Icon component={FaShieldAlt} />
|
||||||
{t("scoreboard.labels.jobs")}
|
{t("scoreboard.labels.jobs")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
destroyInactiveTabPane
|
destroyInactiveTabPane
|
||||||
key="sb"
|
key="sb"
|
||||||
>
|
>
|
||||||
<ScoreboardDisplay />
|
<ScoreboardDisplay />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
tab={
|
tab={
|
||||||
<span>
|
<span>
|
||||||
<FieldTimeOutlined />
|
<FieldTimeOutlined />
|
||||||
{t("scoreboard.labels.timeticketsemployee")}
|
{t("scoreboard.labels.timeticketsemployee")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
destroyInactiveTabPane
|
destroyInactiveTabPane
|
||||||
key="tickets"
|
key="tickets"
|
||||||
>
|
>
|
||||||
<ScoreboardTimeTickets />
|
<ScoreboardTimeTickets />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
tab={
|
tab={
|
||||||
<span>
|
<span>
|
||||||
<FieldTimeOutlined />
|
<FieldTimeOutlined />
|
||||||
{t("scoreboard.labels.allemployeetimetickets")}
|
{t("scoreboard.labels.allemployeetimetickets")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
destroyInactiveTabPane
|
destroyInactiveTabPane
|
||||||
key="ticketsstats"
|
key="ticketsstats"
|
||||||
>
|
>
|
||||||
<ScoreboardTimeTicketsStats />
|
<ScoreboardTimeTicketsStats />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
</FeatureWrapper>
|
</FeatureWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(ScoreboardContainer);
|
)(ScoreboardContainer);
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Tabs } from "antd";
|
import { Tabs } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useNavigate, useLocation } from "react-router-dom";
|
import { useNavigate, useLocation } 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 ShopEmployeesContainer from "../../components/shop-employees/shop-employees.container";
|
||||||
import ShopInfoContainer from "../../components/shop-info/shop-info.container";
|
import ShopInfoContainer from "../../components/shop-info/shop-info.container";
|
||||||
@@ -15,7 +16,6 @@ import {
|
|||||||
} from "../../redux/application/application.actions";
|
} from "../../redux/application/application.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import ShopInfoUsersComponent from "../../components/shop-users/shop-users.component";
|
import ShopInfoUsersComponent from "../../components/shop-users/shop-users.component";
|
||||||
import queryString from "query-string";
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
@@ -26,9 +26,9 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
|
|
||||||
export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) {
|
export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const navigate = useNavigate();
|
const history = useNavigate();
|
||||||
const searchParams = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const { tab } = searchParams;
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.title = t("titles.shop");
|
document.title = t("titles.shop");
|
||||||
setSelectedHeader("shop");
|
setSelectedHeader("shop");
|
||||||
@@ -41,32 +41,29 @@ export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) {
|
|||||||
}, [t, setSelectedHeader, setBreadcrumbs, bodyshop.shopname]);
|
}, [t, setSelectedHeader, setBreadcrumbs, bodyshop.shopname]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!tab) navigate({ search: "?tab=info" });
|
if (!search.tab) history({ search: "?tab=info" });
|
||||||
}, [navigate, tab]);
|
}, [history, search]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="shop:config">
|
<RbacWrapper action="shop:config">
|
||||||
<Tabs
|
<Tabs
|
||||||
defaultActiveKey={tab}
|
defaultActiveKey={search.tab}
|
||||||
onChange={(key) => {
|
onChange={(key) => history({ search: `?tab=${key}` })}
|
||||||
searchParams.set("tab", key);
|
>
|
||||||
navigate({ search: searchParams.toString() });
|
<Tabs.TabPane tab={t("bodyshop.labels.shopinfo")} key="info">
|
||||||
}}
|
<ShopInfoContainer />
|
||||||
>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane tab={t("bodyshop.labels.shopinfo")} key="info">
|
<Tabs.TabPane tab={t("bodyshop.labels.employees")} key="employees">
|
||||||
<ShopInfoContainer />
|
<ShopEmployeesContainer />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane tab={t("bodyshop.labels.employees")} key="employees">
|
<Tabs.TabPane tab={t("bodyshop.labels.licensing")} key="licensing">
|
||||||
<ShopEmployeesContainer />
|
<ShopInfoUsersComponent />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane tab={t("bodyshop.labels.licensing")} key="licensing">
|
<Tabs.TabPane tab={t("bodyshop.labels.csiq")} key="csiq">
|
||||||
<ShopInfoUsersComponent />
|
<ShopCsiConfig />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane tab={t("bodyshop.labels.csiq")} key="csiq">
|
</Tabs>
|
||||||
<ShopCsiConfig />
|
</RbacWrapper>
|
||||||
</Tabs.TabPane>
|
|
||||||
</Tabs>
|
|
||||||
</RbacWrapper>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(ShopPage);
|
export default connect(mapStateToProps, mapDispatchToProps)(ShopPage);
|
||||||
@@ -68,7 +68,6 @@ export function TechPage({ technician }) {
|
|||||||
<Layout>
|
<Layout>
|
||||||
<UpdateAlert />
|
<UpdateAlert />
|
||||||
<TechHeader />
|
<TechHeader />
|
||||||
|
|
||||||
<Content className="tech-content-container">
|
<Content className="tech-content-container">
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<Suspense
|
<Suspense
|
||||||
@@ -82,7 +81,7 @@ export function TechPage({ technician }) {
|
|||||||
<PrintCenterModalContainer />
|
<PrintCenterModalContainer />
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path='/login' element={<TechLogin />} />
|
<Route path='/login' element={<TechLogin />} />
|
||||||
<Route path='/joblokup' element={<TechLookup />} />
|
<Route path='/joblookup' element={<TechLookup />} />
|
||||||
<Route path='/list' element={<ProductionListPage />} />
|
<Route path='/list' element={<ProductionListPage />} />
|
||||||
<Route path='/jobclock' element={<TechJobClock />} />
|
<Route path='/jobclock' element={<TechJobClock />} />
|
||||||
<Route path='/shiftclock' element={<TechShiftClock />} />
|
<Route path='/shiftclock' element={<TechShiftClock />} />
|
||||||
@@ -91,7 +90,6 @@ export function TechPage({ technician }) {
|
|||||||
</FeatureWrapper>
|
</FeatureWrapper>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
|
||||||
<BackTop />
|
<BackTop />
|
||||||
</Content>
|
</Content>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|||||||
@@ -25,10 +25,12 @@ export function TechPageContainer({ bodyshop, setBodyshop }) {
|
|||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
});
|
});
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data) setBodyshop(data.bodyshops[0]);
|
if (data) setBodyshop(data.bodyshops[0]);
|
||||||
}, [data, setBodyshop]);
|
}, [data, setBodyshop]);
|
||||||
|
|
||||||
|
|
||||||
if (loading || !bodyshop)
|
if (loading || !bodyshop)
|
||||||
return <LoadingSpinner message={t("general.labels.loadingshop")} />;
|
return <LoadingSpinner message={t("general.labels.loadingshop")} />;
|
||||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function Prompt(props) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Prompt
|
export default Prompt;
|
||||||
|
|
||||||
|
|
||||||
// Potential new solution:
|
// Potential new solution:
|
||||||
|
|||||||
Reference in New Issue
Block a user