From 13fdd51c93e4df47e159298ac601a805461a84f0 Mon Sep 17 00:00:00 2001 From: olewandowski1 Date: Mon, 8 Jan 2024 16:34:02 +0100 Subject: [PATCH 1/3] OP-1725: remove null/empty option from dropdowns --- src/components/ContractHeadPanel.js | 3 +-- src/dialogs/CreateContractDetailsDialog.js | 4 ++-- src/dialogs/UpdateContractDetailsDialog.js | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/ContractHeadPanel.js b/src/components/ContractHeadPanel.js index cff61f6..9ff4616 100644 --- a/src/components/ContractHeadPanel.js +++ b/src/components/ContractHeadPanel.js @@ -174,8 +174,7 @@ class ContractHeadPanel extends FormPanel { this.updateAttribute("policyHolder", v)} readOnly={ diff --git a/src/dialogs/CreateContractDetailsDialog.js b/src/dialogs/CreateContractDetailsDialog.js index 6ddd2dc..c2d4b4f 100644 --- a/src/dialogs/CreateContractDetailsDialog.js +++ b/src/dialogs/CreateContractDetailsDialog.js @@ -139,7 +139,7 @@ class CreateContractDetailsDialog extends Component { this.updateAttribute('insuree', v)} @@ -148,7 +148,7 @@ class CreateContractDetailsDialog extends Component { Date: Thu, 8 Feb 2024 14:37:14 +0100 Subject: [PATCH 2/3] OP-1806: fix calendar picker to allow selecting future dates --- src/components/ContractHeadPanel.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/ContractHeadPanel.js b/src/components/ContractHeadPanel.js index 9ff4616..9f12f9e 100644 --- a/src/components/ContractHeadPanel.js +++ b/src/components/ContractHeadPanel.js @@ -280,10 +280,13 @@ class ContractHeadPanel extends FormPanel { module="contract" label="dateValidFrom" required - maxDate={!!edited && !!edited.dateValidTo && edited.dateValidTo} value={!!edited && !!edited.dateValidFrom && edited.dateValidFrom} onChange={(v) => this.updateAttribute("dateValidFrom", v)} readOnly={readOnlyFields.includes("dateValidFrom") || isAmendment} + // NOTE: maxDate cannot be passed if endDate does not exist. + // Passing any other falsy value will block months manipulation. + // eslint-disable-next-line react/jsx-props-no-spreading + {...(edited.dateValidTo ? { maxDate: edited.dateValidTo } : null)} /> @@ -292,12 +295,13 @@ class ContractHeadPanel extends FormPanel { module="contract" label="dateValidTo" required - minDate={ - !!edited && !!edited.dateValidFrom && edited.dateValidFrom - } value={!!edited && !!edited.dateValidTo && edited.dateValidTo} onChange={(v) => this.updateAttribute("dateValidTo", v)} readOnly={readOnlyFields.includes("dateValidTo")} + // NOTE: minDate cannot be passed if startDate does not exist. + // Passing any other falsy value will block months manipulation. + // eslint-disable-next-line react/jsx-props-no-spreading + {...(edited.dateValidFrom ? { minDate: edited.dateValidFrom } : null)} /> From 03fdd7ce2bea80ba8efb4a15a0eb5d2de134b2d2 Mon Sep 17 00:00:00 2001 From: olewandowski1 Date: Thu, 8 Feb 2024 14:40:55 +0100 Subject: [PATCH 3/3] OP-1806: fix docs --- src/components/ContractHeadPanel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ContractHeadPanel.js b/src/components/ContractHeadPanel.js index 9f12f9e..5cbb82b 100644 --- a/src/components/ContractHeadPanel.js +++ b/src/components/ContractHeadPanel.js @@ -283,7 +283,7 @@ class ContractHeadPanel extends FormPanel { value={!!edited && !!edited.dateValidFrom && edited.dateValidFrom} onChange={(v) => this.updateAttribute("dateValidFrom", v)} readOnly={readOnlyFields.includes("dateValidFrom") || isAmendment} - // NOTE: maxDate cannot be passed if endDate does not exist. + // NOTE: maxDate cannot be passed if dateValidTo does not exist. // Passing any other falsy value will block months manipulation. // eslint-disable-next-line react/jsx-props-no-spreading {...(edited.dateValidTo ? { maxDate: edited.dateValidTo } : null)} @@ -298,7 +298,7 @@ class ContractHeadPanel extends FormPanel { value={!!edited && !!edited.dateValidTo && edited.dateValidTo} onChange={(v) => this.updateAttribute("dateValidTo", v)} readOnly={readOnlyFields.includes("dateValidTo")} - // NOTE: minDate cannot be passed if startDate does not exist. + // NOTE: minDate cannot be passed if dateValidFrom does not exist. // Passing any other falsy value will block months manipulation. // eslint-disable-next-line react/jsx-props-no-spreading {...(edited.dateValidFrom ? { minDate: edited.dateValidFrom } : null)}