BOD-17 Added header blocks to contract detail.
This commit is contained in:
@@ -3024,6 +3024,27 @@
|
|||||||
<folder_node>
|
<folder_node>
|
||||||
<name>labels</name>
|
<name>labels</name>
|
||||||
<children>
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>courtesycar</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>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
<name>fuel</name>
|
<name>fuel</name>
|
||||||
<children>
|
<children>
|
||||||
@@ -3218,6 +3239,27 @@
|
|||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>vehicle</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>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
@@ -8331,6 +8373,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>job</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>lines</name>
|
<name>lines</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { Descriptions, Card } from "antd";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
export default function ContractCourtesyCarBlock({ courtesyCar }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<Link to={`/manage/courtesycars/${courtesyCar && courtesyCar.id}`}>
|
||||||
|
<Card title={t("courtesycars.labels.courtesycar")}>
|
||||||
|
<Descriptions size="small" column={1}>
|
||||||
|
<Descriptions.Item label={t("courtesycars.fields.fleetnumber")}>
|
||||||
|
{(courtesyCar && courtesyCar.fleetnumber) || ""}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label={t("courtesycars.fields.plate")}>
|
||||||
|
{(courtesyCar && courtesyCar.plate) || ""}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label={t("courtesycars.labels.vehicle")}>
|
||||||
|
{`${(courtesyCar && courtesyCar.year) || ""} ${(courtesyCar &&
|
||||||
|
courtesyCar.make) ||
|
||||||
|
""} ${(courtesyCar && courtesyCar.model) || ""}`}
|
||||||
|
</Descriptions.Item>
|
||||||
|
</Descriptions>
|
||||||
|
</Card>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -10,26 +10,30 @@ export default function ContractFormComponent() {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Input value={state} onChange={e => setState(e.target.value)} />
|
<div style={{ background: "#f00" }}>
|
||||||
<Button
|
TEST AREA
|
||||||
onClick={() => {
|
<Input value={state} onChange={e => setState(e.target.value)} />
|
||||||
console.log("state", state);
|
<Button
|
||||||
//let data = state;
|
onClick={() => {
|
||||||
|
console.log("state", state);
|
||||||
|
//let data = state;
|
||||||
|
|
||||||
|
var data =
|
||||||
|
"%FLDELRAY BEACH^DOE$JOHN$^4818 S FEDERAL BLVD^ ? ;6360100462172082009=2101198299090=? #! 33435 I 1600 ECCECC00000?";
|
||||||
|
data = data.replace(/\n/, "");
|
||||||
|
// replace spaces with regular space
|
||||||
|
data = data.replace(/\s/g, " ");
|
||||||
|
var track = data.match(/(.*?\?)(.*?\?)(.*?\?)/);
|
||||||
|
console.log("data", data);
|
||||||
|
console.log("track", track);
|
||||||
|
const a = aamva.stripe(data);
|
||||||
|
console.log(JSON.stringify(a));
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Decode
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
var data =
|
|
||||||
"%FLDELRAY BEACH^DOE$JOHN$^4818 S FEDERAL BLVD^ ? ;6360100462172082009=2101198299090=? #! 33435 I 1600 ECCECC00000?";
|
|
||||||
data = data.replace(/\n/, "");
|
|
||||||
// replace spaces with regular space
|
|
||||||
data = data.replace(/\s/g, " ");
|
|
||||||
var track = data.match(/(.*?\?)(.*?\?)(.*?\?)/);
|
|
||||||
console.log("data", data);
|
|
||||||
console.log("track", track);
|
|
||||||
const a = aamva.stripe(data);
|
|
||||||
console.log(JSON.stringify(a));
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Decode
|
|
||||||
</Button>
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("contracts.fields.status")}
|
label={t("contracts.fields.status")}
|
||||||
name="status"
|
name="status"
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { Descriptions, Card } from "antd";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
export default function ContractJobBlock({ job }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<Link to={`/manage/jobs/${job && job.id}`}>
|
||||||
|
<Card title={t("jobs.labels.job")}>
|
||||||
|
<Descriptions size="small" column={1}>
|
||||||
|
<Descriptions.Item label={t("jobs.fields.ro_number")}>
|
||||||
|
{(job && job.ro_number) || ""}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label={t("jobs.fields.vehicle")}>
|
||||||
|
{`${(job && job.v_model_yr) || ""} ${(job && job.v_make_desc) ||
|
||||||
|
""} ${(job && job.v_model_desc) || ""}`}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label={t("jobs.fields.owner")}>
|
||||||
|
{`${(job && job.ownr_fn) || ""} ${(job && job.ownr_ln) ||
|
||||||
|
""} ${(job && job.ownr_co_nm) || ""}`}
|
||||||
|
</Descriptions.Item>
|
||||||
|
</Descriptions>
|
||||||
|
</Card>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -15,10 +15,7 @@ export const UPDATE_CONTRACT = gql`
|
|||||||
$contractId: uuid!
|
$contractId: uuid!
|
||||||
$cccontract: cccontracts_set_input!
|
$cccontract: cccontracts_set_input!
|
||||||
) {
|
) {
|
||||||
update_cccontracts(
|
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
|
||||||
where: { id: { _eq: $contractId } }
|
|
||||||
_set: $cccontract
|
|
||||||
) {
|
|
||||||
returning {
|
returning {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
@@ -49,12 +46,31 @@ export const QUERY_CONTRACT_BY_PK = gql`
|
|||||||
driver_zip
|
driver_zip
|
||||||
id
|
id
|
||||||
jobid
|
jobid
|
||||||
|
job {
|
||||||
|
id
|
||||||
|
est_number
|
||||||
|
ro_number
|
||||||
|
v_make_desc
|
||||||
|
v_model_desc
|
||||||
|
ownr_fn
|
||||||
|
ownr_ln
|
||||||
|
ownr_co_nm
|
||||||
|
scheduled_completion
|
||||||
|
}
|
||||||
kmend
|
kmend
|
||||||
kmstart
|
kmstart
|
||||||
scheduledreturn
|
scheduledreturn
|
||||||
start
|
start
|
||||||
status
|
status
|
||||||
updated_at
|
updated_at
|
||||||
|
courtesycar {
|
||||||
|
id
|
||||||
|
fleetnumber
|
||||||
|
make
|
||||||
|
model
|
||||||
|
year
|
||||||
|
plate
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -2,14 +2,18 @@ import React from "react";
|
|||||||
import ContractFormComponent from "../../components/contract-form/contract-form.component";
|
import ContractFormComponent from "../../components/contract-form/contract-form.component";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
export default function ContractDetailPage() {
|
import ContractJobBlock from "../../components/contract-job-block/contract-job-block.component";
|
||||||
|
import ContractCourtesyCarBlock from "../../components/contract-courtesy-car-block/contract-courtesy-car-block.component";
|
||||||
|
|
||||||
|
export default function ContractDetailPage({ job, courtesyCar }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Button type="primary" htmlType="submit">
|
<Button type="primary" htmlType="submit">
|
||||||
{t("general.actions.save")}
|
{t("general.actions.save")}
|
||||||
</Button>
|
</Button>
|
||||||
SOME SORT OF HEADER INFORMATION HERE.
|
<ContractJobBlock job={job} />
|
||||||
|
<ContractCourtesyCarBlock courtesyCar={courtesyCar} />
|
||||||
<ContractFormComponent />
|
<ContractFormComponent />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -78,7 +78,10 @@ export default function ContractDetailPageContainer() {
|
|||||||
: {}
|
: {}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ContractDetailPageComponent />
|
<ContractDetailPageComponent
|
||||||
|
job={data ? data.cccontracts_by_pk.job : null}
|
||||||
|
courtesyCar={data ? data.cccontracts_by_pk.courtesycar : null}
|
||||||
|
/>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,6 +203,7 @@
|
|||||||
"year": "Year"
|
"year": "Year"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"courtesycar": "Courtesy Car",
|
||||||
"fuel": {
|
"fuel": {
|
||||||
"12": "1/2",
|
"12": "1/2",
|
||||||
"14": "1/4",
|
"14": "1/4",
|
||||||
@@ -213,7 +214,8 @@
|
|||||||
"78": "7/8",
|
"78": "7/8",
|
||||||
"empty": "Empty",
|
"empty": "Empty",
|
||||||
"full": "Full"
|
"full": "Full"
|
||||||
}
|
},
|
||||||
|
"vehicle": "Vehicle Description"
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"in": "Available",
|
"in": "Available",
|
||||||
@@ -535,6 +537,7 @@
|
|||||||
"creating_new_job": "Creating new job...",
|
"creating_new_job": "Creating new job...",
|
||||||
"documents": "Documents",
|
"documents": "Documents",
|
||||||
"existing_jobs": "Existing Jobs",
|
"existing_jobs": "Existing Jobs",
|
||||||
|
"job": "Job Details",
|
||||||
"lines": "Estimate Lines",
|
"lines": "Estimate Lines",
|
||||||
"notes": "Notes",
|
"notes": "Notes",
|
||||||
"override_header": "Override estimate header on import?",
|
"override_header": "Override estimate header on import?",
|
||||||
|
|||||||
@@ -203,6 +203,7 @@
|
|||||||
"year": ""
|
"year": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"courtesycar": "",
|
||||||
"fuel": {
|
"fuel": {
|
||||||
"12": "",
|
"12": "",
|
||||||
"14": "",
|
"14": "",
|
||||||
@@ -213,7 +214,8 @@
|
|||||||
"78": "",
|
"78": "",
|
||||||
"empty": "",
|
"empty": "",
|
||||||
"full": ""
|
"full": ""
|
||||||
}
|
},
|
||||||
|
"vehicle": ""
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"in": "",
|
"in": "",
|
||||||
@@ -535,6 +537,7 @@
|
|||||||
"creating_new_job": "Creando nuevo trabajo ...",
|
"creating_new_job": "Creando nuevo trabajo ...",
|
||||||
"documents": "documentos",
|
"documents": "documentos",
|
||||||
"existing_jobs": "Empleos existentes",
|
"existing_jobs": "Empleos existentes",
|
||||||
|
"job": "",
|
||||||
"lines": "Líneas estimadas",
|
"lines": "Líneas estimadas",
|
||||||
"notes": "Notas",
|
"notes": "Notas",
|
||||||
"override_header": "¿Anular encabezado estimado al importar?",
|
"override_header": "¿Anular encabezado estimado al importar?",
|
||||||
|
|||||||
@@ -203,6 +203,7 @@
|
|||||||
"year": ""
|
"year": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"courtesycar": "",
|
||||||
"fuel": {
|
"fuel": {
|
||||||
"12": "",
|
"12": "",
|
||||||
"14": "",
|
"14": "",
|
||||||
@@ -213,7 +214,8 @@
|
|||||||
"78": "",
|
"78": "",
|
||||||
"empty": "",
|
"empty": "",
|
||||||
"full": ""
|
"full": ""
|
||||||
}
|
},
|
||||||
|
"vehicle": ""
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"in": "",
|
"in": "",
|
||||||
@@ -535,6 +537,7 @@
|
|||||||
"creating_new_job": "Création d'un nouvel emploi ...",
|
"creating_new_job": "Création d'un nouvel emploi ...",
|
||||||
"documents": "Les documents",
|
"documents": "Les documents",
|
||||||
"existing_jobs": "Emplois existants",
|
"existing_jobs": "Emplois existants",
|
||||||
|
"job": "",
|
||||||
"lines": "Estimer les lignes",
|
"lines": "Estimer les lignes",
|
||||||
"notes": "Remarques",
|
"notes": "Remarques",
|
||||||
"override_header": "Remplacer l'en-tête d'estimation à l'importation?",
|
"override_header": "Remplacer l'en-tête d'estimation à l'importation?",
|
||||||
|
|||||||
Reference in New Issue
Block a user