IO-992 Audit trail bugfixes.
This commit is contained in:
@@ -20730,6 +20730,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>special_coverage_policy</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>specialcoveragepolicy</name>
|
<name>specialcoveragepolicy</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -14,12 +14,25 @@ import IndefiniteLoading from "../indefinite-loading/indefinite-loading.componen
|
|||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import ProductionBoardFilters from "../production-board-filters/production-board-filters.component";
|
import ProductionBoardFilters from "../production-board-filters/production-board-filters.component";
|
||||||
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
technician: selectTechnician,
|
technician: selectTechnician,
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ProductionBoardKanbanComponent({ data, bodyshop, technician }) {
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
|
});
|
||||||
|
|
||||||
|
export function ProductionBoardKanbanComponent({
|
||||||
|
data,
|
||||||
|
bodyshop,
|
||||||
|
technician,
|
||||||
|
insertAuditTrail,
|
||||||
|
}) {
|
||||||
const [boardLanes, setBoardLanes] = useState({
|
const [boardLanes, setBoardLanes] = useState({
|
||||||
columns: [{ id: "Loading...", title: "Loading...", cards: [] }],
|
columns: [{ id: "Loading...", title: "Loading...", cards: [] }],
|
||||||
});
|
});
|
||||||
@@ -104,6 +117,11 @@ export function ProductionBoardKanbanComponent({ data, bodyshop, technician }) {
|
|||||||
newChildCardNewParent
|
newChildCardNewParent
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: card.id,
|
||||||
|
operation: AuditTrailMapping.jobstatuschange(destination.toColumnId),
|
||||||
|
});
|
||||||
|
|
||||||
if (update.errors) {
|
if (update.errors) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("production.errors.boardupdate", {
|
message: t("production.errors.boardupdate", {
|
||||||
@@ -130,4 +148,7 @@ export function ProductionBoardKanbanComponent({ data, bodyshop, technician }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(mapStateToProps, null)(ProductionBoardKanbanComponent);
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ProductionBoardKanbanComponent);
|
||||||
|
|||||||
@@ -16,24 +16,32 @@ import { connect } from "react-redux";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
|
||||||
const iconStyle = { marginLeft: ".3rem" };
|
const iconStyle = { marginLeft: ".3rem" };
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ProductionListEmpAssignment({ bodyshop, record, type }) {
|
export function ProductionListEmpAssignment({
|
||||||
|
insertAuditTrail,
|
||||||
|
bodyshop,
|
||||||
|
record,
|
||||||
|
type,
|
||||||
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updateJob] = useMutation(UPDATE_JOB);
|
const [updateJob] = useMutation(UPDATE_JOB);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const handleAdd = async (assignment) => {
|
const handleAdd = async (assignment) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { operation, employeeid } = assignment;
|
const { operation, employeeid, name } = assignment;
|
||||||
logImEXEvent("job_assign_employee", { operation });
|
logImEXEvent("job_assign_employee", { operation });
|
||||||
|
|
||||||
let empAssignment = determineFieldName(operation);
|
let empAssignment = determineFieldName(operation);
|
||||||
@@ -44,6 +52,11 @@ export function ProductionListEmpAssignment({ bodyshop, record, type }) {
|
|||||||
awaitRefetchQueries: true,
|
awaitRefetchQueries: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: record.id,
|
||||||
|
operation: AuditTrailMapping.jobassignmentchange(empAssignment, name),
|
||||||
|
});
|
||||||
|
|
||||||
if (!!result.errors) {
|
if (!!result.errors) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("jobs.errors.assigning", {
|
message: t("jobs.errors.assigning", {
|
||||||
@@ -64,6 +77,11 @@ export function ProductionListEmpAssignment({ bodyshop, record, type }) {
|
|||||||
awaitRefetchQueries: true,
|
awaitRefetchQueries: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: record.id,
|
||||||
|
operation: AuditTrailMapping.jobassignmentremoved(empAssignment),
|
||||||
|
});
|
||||||
|
|
||||||
if (!!result.errors) {
|
if (!!result.errors) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("jobs.errors.assigning", {
|
message: t("jobs.errors.assigning", {
|
||||||
@@ -80,8 +98,8 @@ export function ProductionListEmpAssignment({ bodyshop, record, type }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [visibility, setVisibility] = useState(false);
|
const [visibility, setVisibility] = useState(false);
|
||||||
const onChange = (e) => {
|
const onChange = (e, option) => {
|
||||||
setAssignment({ ...assignment, employeeid: e });
|
setAssignment({ ...assignment, employeeid: e, name: option.name });
|
||||||
};
|
};
|
||||||
|
|
||||||
const popContent = (
|
const popContent = (
|
||||||
@@ -99,7 +117,11 @@ export function ProductionListEmpAssignment({ bodyshop, record, type }) {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{bodyshop.employees.map((emp) => (
|
{bodyshop.employees.map((emp) => (
|
||||||
<Select.Option value={emp.id} key={emp.id}>
|
<Select.Option
|
||||||
|
value={emp.id}
|
||||||
|
key={emp.id}
|
||||||
|
name={`${emp.first_name} ${emp.last_name}`}
|
||||||
|
>
|
||||||
{`${emp.first_name} ${emp.last_name}`}
|
{`${emp.first_name} ${emp.last_name}`}
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -6,12 +6,21 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
export function ProductionListColumnStatus({ record, bodyshop }) {
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
|
});
|
||||||
|
export function ProductionListColumnStatus({
|
||||||
|
record,
|
||||||
|
bodyshop,
|
||||||
|
insertAuditTrail,
|
||||||
|
}) {
|
||||||
const [updateJob] = useMutation(UPDATE_JOB);
|
const [updateJob] = useMutation(UPDATE_JOB);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
@@ -28,6 +37,11 @@ export function ProductionListColumnStatus({ record, bodyshop }) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: record.id,
|
||||||
|
operation: AuditTrailMapping.jobstatuschange(key),
|
||||||
|
});
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -52,4 +66,7 @@ export function ProductionListColumnStatus({ record, bodyshop }) {
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(mapStateToProps, null)(ProductionListColumnStatus);
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ProductionListColumnStatus);
|
||||||
|
|||||||
@@ -162,7 +162,9 @@ export function JobsDetailPage({
|
|||||||
jobid: job.id,
|
jobid: job.id,
|
||||||
operation: AuditTrailMapping.jobfieldchange(
|
operation: AuditTrailMapping.jobfieldchange(
|
||||||
key,
|
key,
|
||||||
changedAuditFields[key]
|
changedAuditFields[key] instanceof moment
|
||||||
|
? moment(changedAuditFields[key]).format("MM/DD/YYYY hh:mm a")
|
||||||
|
: changedAuditFields[key]
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1247,6 +1247,7 @@
|
|||||||
"servicecar": "Service Car",
|
"servicecar": "Service Car",
|
||||||
"servicing_dealer": "Servicing Dealer",
|
"servicing_dealer": "Servicing Dealer",
|
||||||
"servicing_dealer_contact": "Servicing Dealer Contact",
|
"servicing_dealer_contact": "Servicing Dealer Contact",
|
||||||
|
"special_coverage_policy": "Special Coverage Policy",
|
||||||
"specialcoveragepolicy": "Special Coverage Policy",
|
"specialcoveragepolicy": "Special Coverage Policy",
|
||||||
"state_tax_rate": "Provincial/State Tax Rate",
|
"state_tax_rate": "Provincial/State Tax Rate",
|
||||||
"status": "Job Status",
|
"status": "Job Status",
|
||||||
|
|||||||
@@ -1247,6 +1247,7 @@
|
|||||||
"servicecar": "Auto de servicio",
|
"servicecar": "Auto de servicio",
|
||||||
"servicing_dealer": "Distribuidor de servicio",
|
"servicing_dealer": "Distribuidor de servicio",
|
||||||
"servicing_dealer_contact": "Servicio Contacto con el concesionario",
|
"servicing_dealer_contact": "Servicio Contacto con el concesionario",
|
||||||
|
"special_coverage_policy": "Política de cobertura especial",
|
||||||
"specialcoveragepolicy": "Política de cobertura especial",
|
"specialcoveragepolicy": "Política de cobertura especial",
|
||||||
"state_tax_rate": "",
|
"state_tax_rate": "",
|
||||||
"status": "Estado del trabajo",
|
"status": "Estado del trabajo",
|
||||||
|
|||||||
@@ -1247,6 +1247,7 @@
|
|||||||
"servicecar": "Voiture de service",
|
"servicecar": "Voiture de service",
|
||||||
"servicing_dealer": "Concessionnaire",
|
"servicing_dealer": "Concessionnaire",
|
||||||
"servicing_dealer_contact": "Contacter le concessionnaire",
|
"servicing_dealer_contact": "Contacter le concessionnaire",
|
||||||
|
"special_coverage_policy": "Politique de couverture spéciale",
|
||||||
"specialcoveragepolicy": "Politique de couverture spéciale",
|
"specialcoveragepolicy": "Politique de couverture spéciale",
|
||||||
"state_tax_rate": "",
|
"state_tax_rate": "",
|
||||||
"status": "Statut de l'emploi",
|
"status": "Statut de l'emploi",
|
||||||
|
|||||||
Reference in New Issue
Block a user