Added fields to claim data page.
This commit is contained in:
@@ -4,11 +4,7 @@ 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";
|
||||
|
||||
@@ -24,12 +20,13 @@ function JobsDetailPageContainer({ match, form }) {
|
||||
const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO);
|
||||
|
||||
useEffect(() => {
|
||||
document.title =
|
||||
loading && !error
|
||||
? "..."
|
||||
: t("titles.jobsdetail", {
|
||||
ro_number: data.jobs_by_pk.ro_number
|
||||
});
|
||||
document.title = loading
|
||||
? "..."
|
||||
: error
|
||||
? t("titles.app")
|
||||
: t("titles.jobsdetail", {
|
||||
ro_number: data.jobs_by_pk.ro_number
|
||||
});
|
||||
}, [loading, data, t, error]);
|
||||
|
||||
const handleSubmit = e => {
|
||||
@@ -58,6 +55,7 @@ function JobsDetailPageContainer({ match, form }) {
|
||||
|
||||
if (loading) return <SpinComponent />;
|
||||
if (error) return <AlertComponent message={error.message} type='error' />;
|
||||
|
||||
return data.jobs_by_pk ? (
|
||||
<JobDetailFormContext.Provider value={form}>
|
||||
<JobsDetailPage
|
||||
|
||||
Reference in New Issue
Block a user