Added job lookup framework to tech console. BOD-95 BOD-96
This commit is contained in:
25
client/src/pages/tech-lookup/tech-lookup.container.jsx
Normal file
25
client/src/pages/tech-lookup/tech-lookup.container.jsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { useQuery } from "@apollo/react-hooks";
|
||||
import queryString from "query-string";
|
||||
import React from "react";
|
||||
import { useHistory, useLocation } from "react-router-dom";
|
||||
import TechLookupJobsList from "../../components/tech-lookup-jobs-list/tech-lookup-jobs-list.component";
|
||||
import { SEARCH_FOR_JOBS } from "../../graphql/jobs.queries";
|
||||
import { Row, Col } from "antd";
|
||||
import TechLookupJobsDrawer from "../../components/tech-lookup-jobs-drawer/tech-lookup-jobs-drawer.component";
|
||||
|
||||
export default function TechLookupContainer() {
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const history = useHistory();
|
||||
|
||||
const { loading, error, data, refetch } = useQuery(SEARCH_FOR_JOBS, {
|
||||
variables: { search: `%${search.ro_number}%` },
|
||||
skip: !!!search.ro_number,
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<TechLookupJobsList />
|
||||
<TechLookupJobsDrawer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -20,7 +20,13 @@ const PrintCenterModalContainer = lazy(() =>
|
||||
const TechLogin = lazy(() =>
|
||||
import("../../components/tech-login/tech-login.component")
|
||||
);
|
||||
|
||||
const TechLookup = lazy(() => import("../tech-lookup/tech-lookup.container"));
|
||||
const ProductionListPage = lazy(() =>
|
||||
import("../production-list/production-list.container")
|
||||
);
|
||||
const ProductionBoardPage = lazy(() =>
|
||||
import("../production-board/production-board.container")
|
||||
);
|
||||
const { Content } = Layout;
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
@@ -38,18 +44,19 @@ export function TechPage({ technician, match }) {
|
||||
}, [t]);
|
||||
|
||||
return (
|
||||
<Layout className='tech-layout-container'>
|
||||
<Layout className="tech-layout-container">
|
||||
<TechSider />
|
||||
<Layout>
|
||||
{technician ? null : <Redirect to={`${match.path}/login`} />}
|
||||
<TechHeader />
|
||||
<Content className='tech-content-container'>
|
||||
<Content className="tech-content-container">
|
||||
<FcmNotification />
|
||||
<ErrorBoundary>
|
||||
<Suspense
|
||||
fallback={
|
||||
<LoadingSpinner message={t("general.labels.loadingapp")} />
|
||||
}>
|
||||
}
|
||||
>
|
||||
<TimeTicketModalContainer />
|
||||
<PrintCenterModalContainer />
|
||||
<Switch>
|
||||
@@ -58,6 +65,21 @@ export function TechPage({ technician, match }) {
|
||||
path={`${match.path}/login`}
|
||||
component={TechLogin}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`${match.path}/joblookup`}
|
||||
component={TechLookup}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`${match.path}/list`}
|
||||
component={ProductionListPage}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`${match.path}/board`}
|
||||
component={ProductionBoardPage}
|
||||
/>
|
||||
</Switch>
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
|
||||
Reference in New Issue
Block a user