@hmcts/ccd-case-ui-toolkit 7.0.77-ungrey-back-button-4 → 7.0.77-ungrey-back-button-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.mjs +8 -1
- package/esm2022/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.mjs +12 -1
- package/esm2022/lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.mjs +4 -1
- package/esm2022/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.mjs +15 -4
- package/esm2022/lib/shared/components/palette/linked-cases/services/linked-cases.service.mjs +8 -1
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +42 -3
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.d.ts.map +1 -1
- package/lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.d.ts.map +1 -1
- package/lib/shared/components/palette/linked-cases/services/linked-cases.service.d.ts +2 -0
- package/lib/shared/components/palette/linked-cases/services/linked-cases.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -10254,7 +10254,9 @@ class LinkedCasesService {
|
|
|
10254
10254
|
storedCaseNumber = '';
|
|
10255
10255
|
cameFromFinalStep = false;
|
|
10256
10256
|
hasNavigatedInJourney = false;
|
|
10257
|
+
hasContinuedFromStart = false;
|
|
10257
10258
|
cachedFieldValues;
|
|
10259
|
+
initialCaseLinkRefs = [];
|
|
10258
10260
|
constructor(jurisdictionService, searchService) {
|
|
10259
10261
|
this.jurisdictionService = jurisdictionService;
|
|
10260
10262
|
this.searchService = searchService;
|
|
@@ -10281,11 +10283,16 @@ class LinkedCasesService {
|
|
|
10281
10283
|
};
|
|
10282
10284
|
}
|
|
10283
10285
|
resetLinkedCaseData() {
|
|
10286
|
+
//remove the newly added linked case using the linked case
|
|
10284
10287
|
this.caseFieldValue = [];
|
|
10285
10288
|
this.linkedCases = [];
|
|
10289
|
+
this.initialCaseLinks = [];
|
|
10290
|
+
this.initialCaseLinkRefs = [];
|
|
10286
10291
|
this.storedCaseNumber = '';
|
|
10287
10292
|
this.cameFromFinalStep = false;
|
|
10288
10293
|
this.hasNavigatedInJourney = false;
|
|
10294
|
+
this.caseDetails = null;
|
|
10295
|
+
this.hasContinuedFromStart = false;
|
|
10289
10296
|
}
|
|
10290
10297
|
mapResponse(esSearchCasesResponse) {
|
|
10291
10298
|
const caseInfo = this.caseFieldValue.find(item => item.value && item.value.CaseReference === esSearchCasesResponse.case_id);
|
|
@@ -11022,6 +11029,13 @@ class CaseEditPageComponent {
|
|
|
11022
11029
|
}
|
|
11023
11030
|
cancel() {
|
|
11024
11031
|
if (this.isLinkedCasesJourney()) {
|
|
11032
|
+
// if the user cancels the journey we need to clean up the data
|
|
11033
|
+
const linkedCasesTab = this.caseEdit.caseDetails.tabs.find((tab) => tab?.fields?.some((field) => field.id === 'caseLinks'))?.fields?.[0] ?? null;
|
|
11034
|
+
const initalLinks = this.linkedCasesService.initialCaseLinkRefs;
|
|
11035
|
+
if (linkedCasesTab && linkedCasesTab?.value.length !== initalLinks.length) {
|
|
11036
|
+
const initialCaseRefs = this.linkedCasesService.initialCaseLinkRefs;
|
|
11037
|
+
linkedCasesTab.value = linkedCasesTab.value.filter((item) => initialCaseRefs.includes(item.value.CaseReference));
|
|
11038
|
+
}
|
|
11025
11039
|
this.linkedCasesService.resetLinkedCaseData();
|
|
11026
11040
|
}
|
|
11027
11041
|
if (this.eventTrigger.can_save_draft) {
|
|
@@ -16508,11 +16522,22 @@ class BeforeYouStartComponent extends AbstractJourneyComponent {
|
|
|
16508
16522
|
this.isLinkCasesJourney = this.linkedCasesService.isLinkedCasesEventTrigger;
|
|
16509
16523
|
this.serverLinkedApiError = this.linkedCasesService.serverLinkedApiError;
|
|
16510
16524
|
// re-initiate the state based on the casefield value
|
|
16511
|
-
const
|
|
16512
|
-
this.linkedCasesService.linkedCases = this.linkedCasesService.linkedCases.filter(item =>
|
|
16513
|
-
this.linkedCasesService.
|
|
16525
|
+
const linkedCaseReferenceIds = this.linkedCasesService.caseFieldValue.filter((item) => item).map((item) => item.id);
|
|
16526
|
+
this.linkedCasesService.linkedCases = this.linkedCasesService.linkedCases.filter((item) => linkedCaseReferenceIds.indexOf(item.caseReference) !== -1);
|
|
16527
|
+
if (this.linkedCasesService.linkedCases.length === 0 && this.linkedCasesService.caseFieldValue.length !== 0 && !this.linkedCasesService.hasContinuedFromStart) {
|
|
16528
|
+
this.linkedCasesService.caseFieldValue.forEach((item) => {
|
|
16529
|
+
this.linkedCasesService.initialCaseLinkRefs.push(item.id);
|
|
16530
|
+
});
|
|
16531
|
+
}
|
|
16532
|
+
else {
|
|
16533
|
+
this.linkedCasesService.linkedCases.forEach((item) => {
|
|
16534
|
+
this.linkedCasesService.initialCaseLinkRefs.push(item.caseReference);
|
|
16535
|
+
});
|
|
16536
|
+
this.linkedCasesService.initialCaseLinks = this.linkedCasesService.linkedCases;
|
|
16537
|
+
}
|
|
16514
16538
|
}
|
|
16515
16539
|
onNext() {
|
|
16540
|
+
this.linkedCasesService.hasContinuedFromStart = true;
|
|
16516
16541
|
this.linkedCasesStateEmitter.emit({
|
|
16517
16542
|
currentLinkedCasesPage: LinkedCasesPages.BEFORE_YOU_START,
|
|
16518
16543
|
errorMessages: this.errorMessages,
|
|
@@ -26152,6 +26177,9 @@ class ConfirmFlagStatusComponent extends AbstractJourneyComponent {
|
|
|
26152
26177
|
this.statusReasonCharLimitInfo = ConfirmStatusStep.CHARACTER_LIMIT_INFO;
|
|
26153
26178
|
this.formGroup.addControl(this.selectedStatusControlName, new FormControl(this.flagCreationStatuses.find(key => CaseFlagStatus[key] === this.defaultStatus)));
|
|
26154
26179
|
this.formGroup.addControl(this.statusReasonControlName, new FormControl(''));
|
|
26180
|
+
if (this.multipageComponentStateService.getJourneyCollectionMainObject().journeyPageNumber === CaseFlagFieldState.FLAG_STATUS) {
|
|
26181
|
+
this.multipageComponentStateService.getJourneyCollectionMainObject().journeyPageNumber = CaseFlagFieldState.FLAG_COMMENTS;
|
|
26182
|
+
}
|
|
26155
26183
|
}
|
|
26156
26184
|
onNext() {
|
|
26157
26185
|
// Validate status reason entry
|
|
@@ -29703,6 +29731,10 @@ class CaseEditSubmitComponent {
|
|
|
29703
29731
|
}
|
|
29704
29732
|
submit() {
|
|
29705
29733
|
if (this.summary.valid && this.description.valid) {
|
|
29734
|
+
if (this.caseEdit.isLinkedCasesSubmission) {
|
|
29735
|
+
// once the user submits the linked cases we need to reset the service so data isnt retained if they open the event again
|
|
29736
|
+
this.linkedCasesService.resetLinkedCaseData();
|
|
29737
|
+
}
|
|
29706
29738
|
this.caseEdit.submitForm({
|
|
29707
29739
|
eventTrigger: this.eventTrigger,
|
|
29708
29740
|
form: this.editForm,
|
|
@@ -29753,6 +29785,13 @@ class CaseEditSubmitComponent {
|
|
|
29753
29785
|
}
|
|
29754
29786
|
cancel() {
|
|
29755
29787
|
if (this.caseEdit.isLinkedCasesSubmission) {
|
|
29788
|
+
// if they cancel on the last CYA page we should ensure there is no unsubmitted data in the caseDetails
|
|
29789
|
+
const linkedCasesTab = this.caseEdit.caseDetails.tabs.find((tab) => tab?.fields?.some((field) => field.id === 'caseLinks'))?.fields?.[0] ?? null;
|
|
29790
|
+
const initalLinks = this.linkedCasesService.initialCaseLinkRefs;
|
|
29791
|
+
if (linkedCasesTab && linkedCasesTab?.value.length !== initalLinks.length) {
|
|
29792
|
+
const initialCaseRefs = this.linkedCasesService.initialCaseLinkRefs;
|
|
29793
|
+
linkedCasesTab.value = linkedCasesTab.value.filter((item) => initialCaseRefs.includes(item.value.CaseReference));
|
|
29794
|
+
}
|
|
29756
29795
|
this.linkedCasesService.resetLinkedCaseData();
|
|
29757
29796
|
}
|
|
29758
29797
|
if (this.eventTrigger.can_save_draft) {
|