Add warning for jobs missing profile information.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<babeledit_project version="1.2" be_version="2.7.1">
|
<babeledit_project be_version="2.7.1" version="1.2">
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
BabelEdit project file
|
BabelEdit project file
|
||||||
@@ -31108,6 +31108,27 @@
|
|||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>missingprofileinfo</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>multipayers</name>
|
<name>multipayers</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { Alert } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
export default function JobProfileDataWarning({ job }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
let missingProfileInfo =
|
||||||
|
Object.keys(job.cieca_pft).length === 0 ||
|
||||||
|
Object.keys(job.cieca_pfl).length === 0 ||
|
||||||
|
Object.keys(job.materials).length === 0;
|
||||||
|
|
||||||
|
if (missingProfileInfo)
|
||||||
|
return (
|
||||||
|
<Alert type="error" message={t("jobs.labels.missingprofileinfo")}></Alert>
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
@@ -54,6 +54,7 @@ import JobsDocumentsLocalGallery from "../../components/jobs-documents-local-gal
|
|||||||
import UndefinedToNull from "../../utils/undefinedtonull";
|
import UndefinedToNull from "../../utils/undefinedtonull";
|
||||||
import NoteUpsertModalComponent from "../../components/note-upsert-modal/note-upsert-modal.container";
|
import NoteUpsertModalComponent from "../../components/note-upsert-modal/note-upsert-modal.container";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import JobProfileDataWarning from "../../components/job-profile-data-warning/job-profile-data-warning.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -288,6 +289,7 @@ export function JobsDetailPage({
|
|||||||
/>
|
/>
|
||||||
<JobsDetailHeader job={job} />
|
<JobsDetailHeader job={job} />
|
||||||
<Divider type="horizontal" />
|
<Divider type="horizontal" />
|
||||||
|
<JobProfileDataWarning job={job} />
|
||||||
<FormFieldsChanged form={form} />
|
<FormFieldsChanged form={form} />
|
||||||
<Tabs
|
<Tabs
|
||||||
defaultActiveKey={search.tab}
|
defaultActiveKey={search.tab}
|
||||||
|
|||||||
@@ -1824,6 +1824,7 @@
|
|||||||
"materials": {
|
"materials": {
|
||||||
"mapa": ""
|
"mapa": ""
|
||||||
},
|
},
|
||||||
|
"missingprofileinfo": "This job has missing tax profile info. To ensure correct totals calculations, re-import the job.",
|
||||||
"multipayers": "Additional Payers",
|
"multipayers": "Additional Payers",
|
||||||
"net_repairs": "Net Repairs",
|
"net_repairs": "Net Repairs",
|
||||||
"notes": "Notes",
|
"notes": "Notes",
|
||||||
|
|||||||
@@ -1824,6 +1824,7 @@
|
|||||||
"materials": {
|
"materials": {
|
||||||
"mapa": ""
|
"mapa": ""
|
||||||
},
|
},
|
||||||
|
"missingprofileinfo": "",
|
||||||
"multipayers": "",
|
"multipayers": "",
|
||||||
"net_repairs": "",
|
"net_repairs": "",
|
||||||
"notes": "Notas",
|
"notes": "Notas",
|
||||||
|
|||||||
@@ -1824,6 +1824,7 @@
|
|||||||
"materials": {
|
"materials": {
|
||||||
"mapa": ""
|
"mapa": ""
|
||||||
},
|
},
|
||||||
|
"missingprofileinfo": "",
|
||||||
"multipayers": "",
|
"multipayers": "",
|
||||||
"net_repairs": "",
|
"net_repairs": "",
|
||||||
"notes": "Remarques",
|
"notes": "Remarques",
|
||||||
|
|||||||
Reference in New Issue
Block a user