Add warning for jobs missing profile information.

This commit is contained in:
Patrick Fic
2023-10-11 14:44:07 -07:00
parent 6f16c47d4f
commit 8807e282f4
6 changed files with 45 additions and 1 deletions

View File

@@ -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
@@ -31108,6 +31108,27 @@
</concept_node>
</children>
</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>
<name>multipayers</name>
<definition_loaded>false</definition_loaded>

View File

@@ -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;
}

View File

@@ -54,6 +54,7 @@ import JobsDocumentsLocalGallery from "../../components/jobs-documents-local-gal
import UndefinedToNull from "../../utils/undefinedtonull";
import NoteUpsertModalComponent from "../../components/note-upsert-modal/note-upsert-modal.container";
import _ from "lodash";
import JobProfileDataWarning from "../../components/job-profile-data-warning/job-profile-data-warning.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -288,6 +289,7 @@ export function JobsDetailPage({
/>
<JobsDetailHeader job={job} />
<Divider type="horizontal" />
<JobProfileDataWarning job={job} />
<FormFieldsChanged form={form} />
<Tabs
defaultActiveKey={search.tab}

View File

@@ -1824,6 +1824,7 @@
"materials": {
"mapa": ""
},
"missingprofileinfo": "This job has missing tax profile info. To ensure correct totals calculations, re-import the job.",
"multipayers": "Additional Payers",
"net_repairs": "Net Repairs",
"notes": "Notes",

View File

@@ -1824,6 +1824,7 @@
"materials": {
"mapa": ""
},
"missingprofileinfo": "",
"multipayers": "",
"net_repairs": "",
"notes": "Notas",

View File

@@ -1824,6 +1824,7 @@
"materials": {
"mapa": ""
},
"missingprofileinfo": "",
"multipayers": "",
"net_repairs": "",
"notes": "Remarques",