Removed whiteboard from front page. Added dates fields. Added rates fields. Started refactoring lines page.
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { useMutation, useLazyQuery } from "react-apollo";
|
||||
import {
|
||||
DELETE_AVAILABLE_JOB,
|
||||
QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK
|
||||
} from "../../graphql/available-jobs.queries";
|
||||
import JobsAvailablePageComponent from "./jobs-available.page.component";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function JobsAvailablePageContainer() {
|
||||
const [deleteJob] = useMutation(DELETE_AVAILABLE_JOB);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const estDataLazyLoad = useLazyQuery(
|
||||
QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK,
|
||||
@@ -15,6 +17,11 @@ export default function JobsAvailablePageContainer() {
|
||||
fetchPolicy: "network-only"
|
||||
}
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("titles.jobsavailable");
|
||||
}, [t]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<JobsAvailablePageComponent
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
FaRegStickyNote,
|
||||
FaShieldAlt
|
||||
} from "react-icons/fa";
|
||||
import JobsLines from '../../components/job-detail-lines/job-lines.component'
|
||||
import JobsLinesContainer from "../../components/job-detail-lines/job-lines.container";
|
||||
import JobsDetailClaims from "../../components/jobs-detail-claims/jobs-detail-claims.component";
|
||||
import JobsDetailFinancials from "../../components/jobs-detail-financial/jobs-detail-financial.component";
|
||||
import JobsDetailHeader from "../../components/jobs-detail-header/jobs-detail-header.component";
|
||||
@@ -15,6 +15,7 @@ import JobsDetailInsurance from "../../components/jobs-detail-insurance/jobs-det
|
||||
import JobsDocumentsContainer from "../../components/jobs-documents/jobs-documents.container";
|
||||
import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container";
|
||||
import JobDetailFormContext from "./jobs-detail.page.context";
|
||||
import JobsDetailDatesComponent from "../../components/jobs-detail-dates/jobs-detail-dates.component";
|
||||
|
||||
export default function JobsDetailPage({
|
||||
job,
|
||||
@@ -94,7 +95,7 @@ export default function JobsDetailPage({
|
||||
}
|
||||
key="repairdata"
|
||||
>
|
||||
<JobsLines job={job} />
|
||||
<JobsLinesContainer jobId={job.id} />
|
||||
</Tabs.TabPane>
|
||||
|
||||
<Tabs.TabPane
|
||||
@@ -142,7 +143,7 @@ export default function JobsDetailPage({
|
||||
}
|
||||
key="dates"
|
||||
>
|
||||
Dates
|
||||
<JobsDetailDatesComponent job={job} />}
|
||||
</Tabs.TabPane>
|
||||
|
||||
<Tabs.TabPane
|
||||
@@ -152,7 +153,7 @@ export default function JobsDetailPage({
|
||||
{t("jobs.labels.documents")}
|
||||
</span>
|
||||
}
|
||||
key="#documents"
|
||||
key="documents"
|
||||
>
|
||||
<JobsDocumentsContainer jobId={job.id} />
|
||||
</Tabs.TabPane>
|
||||
@@ -163,7 +164,7 @@ export default function JobsDetailPage({
|
||||
{t("jobs.labels.notes")}
|
||||
</span>
|
||||
}
|
||||
key="#notes"
|
||||
key="notes"
|
||||
>
|
||||
<JobNotesContainer jobId={job.id} />
|
||||
</Tabs.TabPane>
|
||||
|
||||
@@ -4,7 +4,11 @@ import { useMutation, useQuery } from "react-apollo";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import AlertComponent from "../../components/alert/alert.component";
|
||||
import SpinComponent from "../../components/loading-spinner/loading-spinner.component";
|
||||
import { CONVERT_JOB_TO_RO, GET_JOB_BY_PK, UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import {
|
||||
CONVERT_JOB_TO_RO,
|
||||
GET_JOB_BY_PK,
|
||||
UPDATE_JOB
|
||||
} from "../../graphql/jobs.queries";
|
||||
import JobsDetailPage from "./jobs-detail.page.component";
|
||||
import JobDetailFormContext from "./jobs-detail.page.context";
|
||||
|
||||
@@ -21,11 +25,13 @@ function JobsDetailPageContainer({ match, form }) {
|
||||
|
||||
useEffect(() => {
|
||||
document.title = loading
|
||||
? "..."
|
||||
? t("titles.app")
|
||||
: error
|
||||
? t("titles.app")
|
||||
: t("titles.jobsdetail", {
|
||||
ro_number: data.jobs_by_pk.ro_number
|
||||
ro_number: data.jobs_by_pk.converted
|
||||
? data.jobs_by_pk.ro_number
|
||||
: `EST ${data.jobs_by_pk.est_number}`
|
||||
});
|
||||
}, [loading, data, t, error]);
|
||||
|
||||
@@ -54,7 +60,7 @@ function JobsDetailPageContainer({ match, form }) {
|
||||
};
|
||||
|
||||
if (loading) return <SpinComponent />;
|
||||
if (error) return <AlertComponent message={error.message} type='error' />;
|
||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||
|
||||
return data.jobs_by_pk ? (
|
||||
<JobDetailFormContext.Provider value={form}>
|
||||
@@ -68,7 +74,7 @@ function JobsDetailPageContainer({ match, form }) {
|
||||
/>
|
||||
</JobDetailFormContext.Provider>
|
||||
) : (
|
||||
<AlertComponent message={t("jobs.errors.noaccess")} type='error' />
|
||||
<AlertComponent message={t("jobs.errors.noaccess")} type="error" />
|
||||
);
|
||||
}
|
||||
export default Form.create({ name: "JobsDetailPageContainer" })(
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import React from 'react'
|
||||
|
||||
export default function ManageRootPageComponent() {
|
||||
return (
|
||||
<div>
|
||||
Temporary Home Page.
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import React from 'react'
|
||||
import ManageRootPageComponent from './manage-root.page.component'
|
||||
|
||||
export default function ManageRootPageContainer() {
|
||||
return (
|
||||
<ManageRootPageComponent />
|
||||
)
|
||||
}
|
||||
@@ -1,17 +1,20 @@
|
||||
import { BackTop, Layout } from "antd";
|
||||
import React, { lazy, Suspense, useEffect } from "react";
|
||||
import { Route } from "react-router";
|
||||
import { Layout, BackTop } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { Route } from "react-router";
|
||||
import ChatWindowContainer from "../../components/chat-window/chat-window.container";
|
||||
import ErrorBoundary from "../../components/error-boundary/error-boundary.component";
|
||||
import FooterComponent from "../../components/footer/footer.component";
|
||||
//Component Imports
|
||||
import HeaderContainer from "../../components/header/header.container";
|
||||
import FooterComponent from "../../components/footer/footer.component";
|
||||
import ErrorBoundary from "../../components/error-boundary/error-boundary.component";
|
||||
|
||||
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||
import "./manage.page.styles.scss";
|
||||
import ChatWindowContainer from "../../components/chat-window/chat-window.container";
|
||||
|
||||
const WhiteBoardPage = lazy(() => import("../white-board/white-board.page"));
|
||||
|
||||
//const WhiteBoardPage = lazy(() => import("../white-board/white-board.page"));
|
||||
const ManageRootPage = lazy(() =>
|
||||
import("../manage-root/manage-root.page.container")
|
||||
);
|
||||
const JobsPage = lazy(() => import("../jobs/jobs.page"));
|
||||
const JobsDetailPage = lazy(() =>
|
||||
import("../jobs-detail/jobs-detail.page.container")
|
||||
@@ -39,11 +42,14 @@ export default function Manage({ match }) {
|
||||
<HeaderContainer />
|
||||
</Header>
|
||||
|
||||
<Content className='content-container'>
|
||||
<Content className="content-container">
|
||||
<ErrorBoundary>
|
||||
<Suspense
|
||||
fallback={<div>TODO: Suspended Loading in Manage Page...</div>}>
|
||||
<Route exact path={`${match.path}`} component={WhiteBoardPage} />
|
||||
fallback={
|
||||
<LoadingSpinner message={t("general.labels.loadingapp")} />
|
||||
}
|
||||
>
|
||||
<Route exact path={`${match.path}`} component={ManageRootPage} />
|
||||
|
||||
<Route exact path={`${match.path}/jobs`} component={JobsPage} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user