Merged in feature/IO-2297-datetime-improvement (pull request #798)

IO-2297 added optimistic response and click outside function

Approved-by: Patrick Fic
This commit is contained in:
John Allen Delos Reyes
2023-05-23 23:32:11 +00:00
committed by Patrick Fic
3 changed files with 15 additions and 9 deletions

View File

@@ -25,6 +25,7 @@ export default function ProductionListDate({
// } // }
//e.stopPropagation(); //e.stopPropagation();
updateAlert({ updateAlert({
variables: { variables: {
jobId: record.id, jobId: record.id,
@@ -32,6 +33,11 @@ export default function ProductionListDate({
[field]: date, [field]: date,
}, },
}, },
optimisticResponse: {
update_jobs: {
[field]: date,
},
},
}).then(() => { }).then(() => {
if (record.refetch) record.refetch(); if (record.refetch) record.refetch();
if (!time) { if (!time) {
@@ -49,9 +55,11 @@ export default function ProductionListDate({
(moment().add(1, "day").isSame(moment(record[field]), "day") && (moment().add(1, "day").isSame(moment(record[field]), "day") &&
"production-completion-soon")); "production-completion-soon"));
} }
return ( return (
<Dropdown <Dropdown
//trigger={["click"]} trigger={["click"]}
onVisibleChange={(v) => setVisible(v)}
visible={visible} visible={visible}
style={{ style={{
height: "19px", height: "19px",

View File

@@ -1075,6 +1075,9 @@ export const UPDATE_JOB = gql`
lbr_adjustments lbr_adjustments
suspended suspended
queued_for_parts queued_for_parts
scheduled_completion
actual_in
date_repairstarted
} }
} }
} }

View File

@@ -4312,14 +4312,9 @@ tslib@^1.11.1:
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
tslib@^2.0.1, tslib@^2.1.0: tslib@^2.0.1, tslib@^2.1.0:
version "2.5.2"
tslib@^2.3.1, tslib@^2.5.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.2.tgz#1b6f07185c881557b0ffa84b111a0106989e8338"
version "2.5.0" integrity sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
version "2.5.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
tslib@^2.3.1, tslib@^2.5.0: tslib@^2.3.1, tslib@^2.5.0:
version "2.5.0" version "2.5.0"