From e302f5abbf12a581751587c3ac62f817f683f4ee Mon Sep 17 00:00:00 2001 From: CameronEYDS <53542131+cameron-eyds@users.noreply.github.com> Date: Mon, 23 Oct 2023 10:30:55 -0700 Subject: [PATCH 1/4] Reset Exemption Validations for Staff (#1592) --- ppr-ui/package-lock.json | 4 ++-- ppr-ui/package.json | 2 +- ppr-ui/src/composables/exemption/useExemptions.ts | 11 ++++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index af8c47768..78ede419c 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "2.1.18", + "version": "2.1.19", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "2.1.18", + "version": "2.1.19", "dependencies": { "@bcrs-shared-components/corp-type-module": "^1.0.7", "@bcrs-shared-components/enums": "^1.0.19", diff --git a/ppr-ui/package.json b/ppr-ui/package.json index f486fc907..51856f351 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "2.1.18", + "version": "2.1.19", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/composables/exemption/useExemptions.ts b/ppr-ui/src/composables/exemption/useExemptions.ts index 403765991..fd95b4419 100644 --- a/ppr-ui/src/composables/exemption/useExemptions.ts +++ b/ppr-ui/src/composables/exemption/useExemptions.ts @@ -16,7 +16,12 @@ import { APIMhrDescriptionTypes, MhApiStatusTypes, RouteNames, UnitNoteDocTypes export const useExemptions = () => { const { goToRoute } = useNavigation() const { setMhrExemption, setMhrExemptionNote, setMhrExemptionValidation, setMhrExemptionValue } = useStore() - const { getMhrExemption, isRoleStaffReg, isRoleQualifiedSupplier } = storeToRefs(useStore()) + const { + getMhrExemption, + getMhrExemptionValidation, + isRoleStaffReg, + isRoleQualifiedSupplier + } = storeToRefs(useStore()) /** Returns true when staff or qualified supplier and the feature flag is enabled **/ const isExemptionEnabled: ComputedRef = computed((): boolean => { @@ -92,6 +97,10 @@ export const useExemptions = () => { updateValidation('documentId', true) updateValidation('submittingParty', true) updateValidation('staffPayment', true) + } else { + const validationState = getMhrExemptionValidation.value + // eslint-disable-next-line no-return-assign + Object.keys(validationState).forEach(flag => validationState[flag] = false) } } From bcbae33138eb4d2953ee494246d2602a12a76915 Mon Sep 17 00:00:00 2001 From: Dima K Date: Mon, 23 Oct 2023 14:01:36 -0400 Subject: [PATCH 2/4] Exempt state for MHR Information (#1591) * Updates for exempt state of Mhr Info * Add unit tests for exempt Mhr Info * Updates for Non-Res Exemption --- .../unitNotes/UnitNoteContentInfo.vue | 13 +++-- .../components/unitNotes/UnitNotePanel.vue | 2 +- .../components/unitNotes/UnitNotePanels.vue | 24 +++++++-- .../composables/exemption/useExemptions.ts | 25 ++++++--- ppr-ui/src/enums/registrationTypes.ts | 3 +- .../resources/exemptions/componentContent.ts | 2 +- ppr-ui/src/resources/unitNotes.ts | 11 ++++ .../views/mhrInformation/MhrInformation.vue | 21 ++++++-- ppr-ui/tests/unit/MhrInformation.spec.ts | 28 +++++++++- ppr-ui/tests/unit/Tombstone.spec.ts | 12 ++--- ppr-ui/tests/unit/TombstoneDischarge.spec.ts | 21 +++++++- ppr-ui/tests/unit/UnitNotePanels.spec.ts | 51 ++++++++++++++++++- .../unit/test-data/mock-registration-new.ts | 14 ++++- .../tests/unit/test-data/mock-unit-notes.ts | 13 +++++ 14 files changed, 205 insertions(+), 35 deletions(-) diff --git a/ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue b/ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue index 4a1428c0c..dce20d643 100644 --- a/ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue +++ b/ppr-ui/src/components/unitNotes/UnitNoteContentInfo.vue @@ -2,7 +2,7 @@
- +

Remarks

@@ -61,12 +61,12 @@
- +

{{ contactInfoTitle }}

@@ -174,7 +174,10 @@ export default defineComponent({ props.note.documentType === UnitNoteDocTypes.NOTICE_OF_TAX_SALE ? collectorInformationContent.title : personGivingNoticeContent.title - ) + ), + isExemptionNoteType: computed((): boolean => + [UnitNoteDocTypes.RESIDENTIAL_EXEMPTION_ORDER, UnitNoteDocTypes.NON_RESIDENTIAL_EXEMPTION] + .includes(props.note.documentType)) }) const getNoticePartyIcon = (givingNoticeParty: PartyIF): string => { diff --git a/ppr-ui/src/components/unitNotes/UnitNotePanel.vue b/ppr-ui/src/components/unitNotes/UnitNotePanel.vue index ed2596b02..206375748 100644 --- a/ppr-ui/src/components/unitNotes/UnitNotePanel.vue +++ b/ppr-ui/src/components/unitNotes/UnitNotePanel.vue @@ -1,5 +1,5 @@ - +