@hmcts/ccd-case-ui-toolkit 7.0.52 → 7.0.53-task-event-completion-info-2
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/case-edit.component.mjs +50 -17
- package/esm2022/lib/shared/components/event-start/event-guard/event-start.guard.mjs +18 -3
- package/esm2022/lib/shared/components/event-start/services/event-start-state-machine.service.mjs +14 -1
- package/esm2022/lib/shared/components/search-result/search-result.component.mjs +11 -18
- package/esm2022/lib/shared/domain/work-allocation/Task.mjs +1 -1
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +89 -35
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts +4 -1
- package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
- package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts.map +1 -1
- package/lib/shared/components/event-start/services/event-start-state-machine.service.d.ts.map +1 -1
- package/lib/shared/domain/work-allocation/Task.d.ts +9 -1
- package/lib/shared/domain/work-allocation/Task.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -9326,27 +9326,41 @@ class CaseEditComponent {
|
|
|
9326
9326
|
// We have to run the event completion checks if task in session storage
|
|
9327
9327
|
// and if the task is in session storage, then is it associated to the case
|
|
9328
9328
|
let taskInSessionStorage;
|
|
9329
|
-
let
|
|
9329
|
+
let taskEventCompletionInfo;
|
|
9330
|
+
let userInfo;
|
|
9330
9331
|
const taskStr = this.sessionStorageService.getItem('taskToComplete');
|
|
9331
|
-
const
|
|
9332
|
+
const taskEventCompletionStr = this.sessionStorageService.getItem('taskEventCompletionInfo');
|
|
9333
|
+
const userInfoStr = this.sessionStorageService.getItem('userDetails');
|
|
9332
9334
|
if (taskStr) {
|
|
9333
9335
|
taskInSessionStorage = JSON.parse(taskStr);
|
|
9334
9336
|
}
|
|
9335
|
-
if (
|
|
9336
|
-
|
|
9337
|
+
if (taskEventCompletionStr) {
|
|
9338
|
+
taskEventCompletionInfo = JSON.parse(taskEventCompletionStr);
|
|
9339
|
+
}
|
|
9340
|
+
if (userInfoStr) {
|
|
9341
|
+
userInfo = JSON.parse(userInfoStr);
|
|
9337
9342
|
}
|
|
9338
9343
|
const eventId = this.getEventId(form);
|
|
9339
9344
|
const caseId = this.getCaseId(caseDetails);
|
|
9340
|
-
|
|
9345
|
+
const userId = userInfo.uid;
|
|
9346
|
+
const eventDetails = { eventId, caseId, userId };
|
|
9347
|
+
if (this.taskExistsForThisEvent(taskInSessionStorage, taskEventCompletionInfo, eventDetails)) {
|
|
9341
9348
|
// Show event completion component to perform event completion checks
|
|
9342
9349
|
this.eventCompletionParams = ({
|
|
9343
9350
|
caseId,
|
|
9344
9351
|
eventId,
|
|
9345
9352
|
task: taskInSessionStorage
|
|
9346
9353
|
});
|
|
9347
|
-
// add
|
|
9348
|
-
|
|
9349
|
-
|
|
9354
|
+
// add taskEventCompletionInfo again to ensure link current event with task id
|
|
9355
|
+
// note: previous usage was created here so this is to ensure correct functionality continues
|
|
9356
|
+
const taskEventCompletionInfo = {
|
|
9357
|
+
caseId,
|
|
9358
|
+
eventId,
|
|
9359
|
+
userId,
|
|
9360
|
+
taskId: taskInSessionStorage.id,
|
|
9361
|
+
createdTimestamp: Date.now()
|
|
9362
|
+
};
|
|
9363
|
+
this.sessionStorageService.setItem('taskEventCompletionInfo', JSON.stringify(taskEventCompletionInfo));
|
|
9350
9364
|
this.isEventCompletionChecksRequired = true;
|
|
9351
9365
|
}
|
|
9352
9366
|
else {
|
|
@@ -9511,9 +9525,9 @@ class CaseEditComponent {
|
|
|
9511
9525
|
return this.postCompleteTaskIfRequired();
|
|
9512
9526
|
}), finalize(() => {
|
|
9513
9527
|
this.loadingService.unregister(loadingSpinnerToken);
|
|
9514
|
-
// on event completion ensure the previous event taskToComplete/
|
|
9528
|
+
// on event completion ensure the previous event taskToComplete/taskEventCompletionInfo removed
|
|
9515
9529
|
this.sessionStorageService.removeItem('taskToComplete');
|
|
9516
|
-
this.sessionStorageService.removeItem('
|
|
9530
|
+
this.sessionStorageService.removeItem('taskEventCompletionInfo');
|
|
9517
9531
|
this.isSubmitting = false;
|
|
9518
9532
|
}))
|
|
9519
9533
|
.subscribe(() => {
|
|
@@ -9573,19 +9587,24 @@ class CaseEditComponent {
|
|
|
9573
9587
|
}
|
|
9574
9588
|
}
|
|
9575
9589
|
// checks whether current taskToComplete relevant for the event
|
|
9576
|
-
|
|
9577
|
-
if (!taskInSessionStorage || taskInSessionStorage.case_id !== caseId) {
|
|
9590
|
+
taskExistsForThisEvent(taskInSessionStorage, taskEventCompletionInfo, eventDetails) {
|
|
9591
|
+
if (!taskInSessionStorage || taskInSessionStorage.case_id !== eventDetails.caseId) {
|
|
9578
9592
|
return false;
|
|
9579
9593
|
}
|
|
9580
|
-
if (!
|
|
9594
|
+
if (!taskEventCompletionInfo) {
|
|
9581
9595
|
// if no task event present then there is no task to complete from previous event present
|
|
9582
9596
|
return true;
|
|
9583
9597
|
}
|
|
9584
9598
|
else {
|
|
9585
|
-
if (
|
|
9599
|
+
if (taskEventCompletionInfo.taskId !== taskInSessionStorage.id) {
|
|
9600
|
+
return true;
|
|
9601
|
+
}
|
|
9602
|
+
else if ((taskEventCompletionInfo.taskId === taskInSessionStorage.id &&
|
|
9603
|
+
this.eventDetailsDoNotMatch(taskEventCompletionInfo, eventDetails))
|
|
9604
|
+
|| this.eventMoreThanDayAgo(taskEventCompletionInfo.createdTimestamp)) {
|
|
9586
9605
|
// if the session storage not related to event, ignore it and remove
|
|
9587
9606
|
this.sessionStorageService.removeItem('taskToComplete');
|
|
9588
|
-
this.sessionStorageService.removeItem('
|
|
9607
|
+
this.sessionStorageService.removeItem('taskEventCompletionInfo');
|
|
9589
9608
|
return false;
|
|
9590
9609
|
}
|
|
9591
9610
|
return true;
|
|
@@ -9608,6 +9627,20 @@ class CaseEditComponent {
|
|
|
9608
9627
|
hasCallbackFailed(response) {
|
|
9609
9628
|
return response['callback_response_status'] !== 'CALLBACK_COMPLETED';
|
|
9610
9629
|
}
|
|
9630
|
+
eventMoreThanDayAgo(timestamp) {
|
|
9631
|
+
if ((new Date().getTime() - timestamp) > (24 * 60 * 60 * 1000)) {
|
|
9632
|
+
return true;
|
|
9633
|
+
}
|
|
9634
|
+
return false;
|
|
9635
|
+
}
|
|
9636
|
+
eventDetailsDoNotMatch(taskEventCompletionInfo, eventDetails) {
|
|
9637
|
+
if (taskEventCompletionInfo.eventId !== eventDetails.eventId
|
|
9638
|
+
|| taskEventCompletionInfo.caseId !== eventDetails.caseId
|
|
9639
|
+
|| taskEventCompletionInfo.userId !== eventDetails.userId) {
|
|
9640
|
+
return true;
|
|
9641
|
+
}
|
|
9642
|
+
return false;
|
|
9643
|
+
}
|
|
9611
9644
|
static ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService)); };
|
|
9612
9645
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditComponent, selectors: [["ccd-case-edit"]], inputs: { eventTrigger: "eventTrigger", submit: "submit", validate: "validate", saveDraft: "saveDraft", caseDetails: "caseDetails" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, features: [i0.ɵɵProvidersFeature([GreyBarService])], decls: 1, vars: 0, template: function CaseEditComponent_Template(rf, ctx) { if (rf & 1) {
|
|
9613
9646
|
i0.ɵɵelement(0, "router-outlet");
|
|
@@ -9631,7 +9664,7 @@ class CaseEditComponent {
|
|
|
9631
9664
|
}], submitted: [{
|
|
9632
9665
|
type: Output
|
|
9633
9666
|
}] }); })();
|
|
9634
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber:
|
|
9667
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 34 }); })();
|
|
9635
9668
|
|
|
9636
9669
|
function CaseEditConfirmComponent_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
9637
9670
|
i0.ɵɵelement(0, "div");
|
|
@@ -33554,12 +33587,18 @@ class EventStartGuard {
|
|
|
33554
33587
|
const caseId = route.params['cid'];
|
|
33555
33588
|
const eventId = route.params['eid'];
|
|
33556
33589
|
const taskId = route.queryParams['tid'];
|
|
33590
|
+
let userId;
|
|
33591
|
+
const userInfoStr = this.sessionStorageService.getItem('userDetails');
|
|
33592
|
+
if (userInfoStr) {
|
|
33593
|
+
const userInfo = JSON.parse(userInfoStr);
|
|
33594
|
+
userId = userInfo?.uid ? userInfo.uid : null;
|
|
33595
|
+
}
|
|
33557
33596
|
const caseInfoStr = this.sessionStorageService.getItem('caseInfo');
|
|
33558
33597
|
if (caseInfoStr) {
|
|
33559
33598
|
const caseInfo = JSON.parse(caseInfoStr);
|
|
33560
33599
|
if (caseInfo && caseInfo.cid === caseId) {
|
|
33561
33600
|
return this.workAllocationService.getTasksByCaseIdAndEventId(eventId, caseId, caseInfo.caseType, caseInfo.jurisdiction)
|
|
33562
|
-
.pipe(switchMap((payload) => this.checkForTasks(payload, caseId, eventId, taskId)));
|
|
33601
|
+
.pipe(switchMap((payload) => this.checkForTasks(payload, caseId, eventId, taskId, userId)));
|
|
33563
33602
|
}
|
|
33564
33603
|
}
|
|
33565
33604
|
return of(false);
|
|
@@ -33602,10 +33641,19 @@ class EventStartGuard {
|
|
|
33602
33641
|
removeTaskFromSessionStorage() {
|
|
33603
33642
|
this.sessionStorageService.removeItem(EventStartGuard.TASK_TO_COMPLETE);
|
|
33604
33643
|
}
|
|
33605
|
-
checkForTasks(payload, caseId, eventId, taskId) {
|
|
33644
|
+
checkForTasks(payload, caseId, eventId, taskId, userId) {
|
|
33606
33645
|
if (taskId && payload?.tasks?.length > 0) {
|
|
33607
33646
|
const task = payload.tasks.find((t) => t.id == taskId);
|
|
33608
33647
|
if (task) {
|
|
33648
|
+
// Store task to session
|
|
33649
|
+
const taskEventCompletionInfo = {
|
|
33650
|
+
caseId: caseId,
|
|
33651
|
+
eventId: eventId,
|
|
33652
|
+
userId: userId,
|
|
33653
|
+
taskId: task.id,
|
|
33654
|
+
createdTimestamp: Date.now()
|
|
33655
|
+
};
|
|
33656
|
+
this.sessionStorageService.setItem('taskEventCompletionInfo', JSON.stringify(taskEventCompletionInfo));
|
|
33609
33657
|
this.sessionStorageService.setItem(EventStartGuard.TASK_TO_COMPLETE, JSON.stringify(task));
|
|
33610
33658
|
}
|
|
33611
33659
|
else {
|
|
@@ -33774,8 +33822,21 @@ class EventStartStateMachineService {
|
|
|
33774
33822
|
task = context.tasks[0];
|
|
33775
33823
|
}
|
|
33776
33824
|
const taskStr = JSON.stringify(task);
|
|
33825
|
+
let userInfo;
|
|
33826
|
+
const userInfoStr = context.sessionStorageService.getItem('userDetails');
|
|
33827
|
+
if (userInfoStr) {
|
|
33828
|
+
userInfo = JSON.parse(userInfoStr);
|
|
33829
|
+
}
|
|
33777
33830
|
console.log('entryActionForStateOneTaskAssignedToUser: setting taskToComplete to ' + taskStr);
|
|
33778
33831
|
// Store task to session
|
|
33832
|
+
const taskEventCompletionInfo = {
|
|
33833
|
+
caseId: context.caseId,
|
|
33834
|
+
eventId: context.eventId,
|
|
33835
|
+
userId: userInfo.uid,
|
|
33836
|
+
taskId: task.id,
|
|
33837
|
+
createdTimestamp: Date.now()
|
|
33838
|
+
};
|
|
33839
|
+
context.sessionStorageService.setItem('taskEventCompletionInfo', JSON.stringify(taskEventCompletionInfo));
|
|
33779
33840
|
context.sessionStorageService.setItem('taskToComplete', taskStr);
|
|
33780
33841
|
// Allow user to perform the event
|
|
33781
33842
|
context.router.navigate([`/cases/case-details/${context.caseId}/trigger/${context.eventId}`], { relativeTo: context.route });
|
|
@@ -36176,9 +36237,8 @@ function SearchResultComponent_table_0_th_10_Template(rf, ctx) { if (rf & 1) {
|
|
|
36176
36237
|
i0.ɵɵelementStart(0, "th", 21)(1, "div", 22)(2, "input", 23);
|
|
36177
36238
|
i0.ɵɵlistener("change", function SearchResultComponent_table_0_th_10_Template_input_change_2_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.selectAll()); });
|
|
36178
36239
|
i0.ɵɵelementEnd();
|
|
36179
|
-
i0.ɵɵ
|
|
36180
|
-
i0.ɵɵ
|
|
36181
|
-
i0.ɵɵelementEnd()()();
|
|
36240
|
+
i0.ɵɵelement(3, "label", 24);
|
|
36241
|
+
i0.ɵɵelementEnd()();
|
|
36182
36242
|
} if (rf & 2) {
|
|
36183
36243
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
36184
36244
|
i0.ɵɵadvance(2);
|
|
@@ -36223,9 +36283,8 @@ function SearchResultComponent_table_0_ng_container_14_tr_1_td_1_Template(rf, ct
|
|
|
36223
36283
|
i0.ɵɵelementStart(0, "td", 21)(1, "div", 22)(2, "input", 33);
|
|
36224
36284
|
i0.ɵɵlistener("change", function SearchResultComponent_table_0_ng_container_14_tr_1_td_1_Template_input_change_2_listener() { i0.ɵɵrestoreView(_r7); const result_r8 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.changeSelection(result_r8)); });
|
|
36225
36285
|
i0.ɵɵelementEnd();
|
|
36226
|
-
i0.ɵɵ
|
|
36227
|
-
i0.ɵɵ
|
|
36228
|
-
i0.ɵɵelementEnd()()();
|
|
36286
|
+
i0.ɵɵelement(3, "label", 34);
|
|
36287
|
+
i0.ɵɵelementEnd()();
|
|
36229
36288
|
} if (rf & 2) {
|
|
36230
36289
|
const result_r8 = i0.ɵɵnextContext().$implicit;
|
|
36231
36290
|
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
@@ -36235,8 +36294,6 @@ function SearchResultComponent_table_0_ng_container_14_tr_1_td_1_Template(rf, ct
|
|
|
36235
36294
|
i0.ɵɵproperty("checked", ctx_r0.isSelected(result_r8))("disabled", !ctx_r0.canBeShared(result_r8));
|
|
36236
36295
|
i0.ɵɵadvance();
|
|
36237
36296
|
i0.ɵɵpropertyInterpolate1("for", "select-", result_r8.case_id, "");
|
|
36238
|
-
i0.ɵɵadvance();
|
|
36239
|
-
i0.ɵɵtextInterpolate1(" Select case ", result_r8.case_id, " ");
|
|
36240
36297
|
} }
|
|
36241
36298
|
function SearchResultComponent_table_0_ng_container_14_tr_1_td_2_a_1_ng_container_2_ccd_field_read_1_Template(rf, ctx) { if (rf & 1) {
|
|
36242
36299
|
i0.ɵɵelement(0, "ccd-field-read", 42);
|
|
@@ -36315,7 +36372,7 @@ function SearchResultComponent_table_0_ng_container_14_tr_1_td_3_Template(rf, ct
|
|
|
36315
36372
|
} }
|
|
36316
36373
|
function SearchResultComponent_table_0_ng_container_14_tr_1_Template(rf, ctx) { if (rf & 1) {
|
|
36317
36374
|
i0.ɵɵelementStart(0, "tr");
|
|
36318
|
-
i0.ɵɵtemplate(1, SearchResultComponent_table_0_ng_container_14_tr_1_td_1_Template,
|
|
36375
|
+
i0.ɵɵtemplate(1, SearchResultComponent_table_0_ng_container_14_tr_1_td_1_Template, 4, 8, "td", 9)(2, SearchResultComponent_table_0_ng_container_14_tr_1_td_2_Template, 3, 2, "td", 32)(3, SearchResultComponent_table_0_ng_container_14_tr_1_td_3_Template, 3, 4, "td", 1);
|
|
36319
36376
|
i0.ɵɵelementEnd();
|
|
36320
36377
|
} if (rf & 2) {
|
|
36321
36378
|
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
@@ -36341,9 +36398,8 @@ function SearchResultComponent_table_0_ng_container_15_tr_1_td_1_Template(rf, ct
|
|
|
36341
36398
|
i0.ɵɵelementStart(0, "td", 21)(1, "div", 22)(2, "input", 44);
|
|
36342
36399
|
i0.ɵɵlistener("change", function SearchResultComponent_table_0_ng_container_15_tr_1_td_1_Template_input_change_2_listener() { i0.ɵɵrestoreView(_r12); const result_r13 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.changeSelection(result_r13)); })("keyup", function SearchResultComponent_table_0_ng_container_15_tr_1_td_1_Template_input_keyup_2_listener($event) { i0.ɵɵrestoreView(_r12); const result_r13 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.onKeyUp($event, result_r13)); });
|
|
36343
36400
|
i0.ɵɵelementEnd();
|
|
36344
|
-
i0.ɵɵ
|
|
36345
|
-
i0.ɵɵ
|
|
36346
|
-
i0.ɵɵelementEnd()()();
|
|
36401
|
+
i0.ɵɵelement(3, "label", 34);
|
|
36402
|
+
i0.ɵɵelementEnd()();
|
|
36347
36403
|
} if (rf & 2) {
|
|
36348
36404
|
const result_r13 = i0.ɵɵnextContext().$implicit;
|
|
36349
36405
|
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
@@ -36353,8 +36409,6 @@ function SearchResultComponent_table_0_ng_container_15_tr_1_td_1_Template(rf, ct
|
|
|
36353
36409
|
i0.ɵɵproperty("checked", ctx_r0.isSelected(result_r13))("disabled", !ctx_r0.canBeShared(result_r13));
|
|
36354
36410
|
i0.ɵɵadvance();
|
|
36355
36411
|
i0.ɵɵpropertyInterpolate1("for", "select-", result_r13.case_id, "");
|
|
36356
|
-
i0.ɵɵadvance();
|
|
36357
|
-
i0.ɵɵtextInterpolate1(" Select case ", result_r13.case_id, " ");
|
|
36358
36412
|
} }
|
|
36359
36413
|
function SearchResultComponent_table_0_ng_container_15_tr_1_td_2_a_1_ng_container_2_ccd_field_read_1_Template(rf, ctx) { if (rf & 1) {
|
|
36360
36414
|
i0.ɵɵelement(0, "ccd-field-read", 42);
|
|
@@ -36433,7 +36487,7 @@ function SearchResultComponent_table_0_ng_container_15_tr_1_td_3_Template(rf, ct
|
|
|
36433
36487
|
} }
|
|
36434
36488
|
function SearchResultComponent_table_0_ng_container_15_tr_1_Template(rf, ctx) { if (rf & 1) {
|
|
36435
36489
|
i0.ɵɵelementStart(0, "tr");
|
|
36436
|
-
i0.ɵɵtemplate(1, SearchResultComponent_table_0_ng_container_15_tr_1_td_1_Template,
|
|
36490
|
+
i0.ɵɵtemplate(1, SearchResultComponent_table_0_ng_container_15_tr_1_td_1_Template, 4, 8, "td", 9)(2, SearchResultComponent_table_0_ng_container_15_tr_1_td_2_Template, 3, 2, "td", 32)(3, SearchResultComponent_table_0_ng_container_15_tr_1_td_3_Template, 3, 4, "td", 1);
|
|
36437
36491
|
i0.ɵɵelementEnd();
|
|
36438
36492
|
} if (rf & 2) {
|
|
36439
36493
|
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
@@ -36463,7 +36517,7 @@ function SearchResultComponent_table_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
36463
36517
|
i0.ɵɵtemplate(5, SearchResultComponent_table_0_div_5_Template, 11, 12, "div", 5)(6, SearchResultComponent_table_0_div_6_Template, 18, 18, "div", 6)(7, SearchResultComponent_table_0_div_7_Template, 6, 6, "div", 7);
|
|
36464
36518
|
i0.ɵɵelementEnd();
|
|
36465
36519
|
i0.ɵɵelementStart(8, "thead")(9, "tr", 8);
|
|
36466
|
-
i0.ɵɵtemplate(10, SearchResultComponent_table_0_th_10_Template,
|
|
36520
|
+
i0.ɵɵtemplate(10, SearchResultComponent_table_0_th_10_Template, 4, 2, "th", 9)(11, SearchResultComponent_table_0_th_11_Template, 6, 5, "th", 10)(12, SearchResultComponent_table_0_th_12_Template, 2, 0, "th", 11);
|
|
36467
36521
|
i0.ɵɵelementEnd()();
|
|
36468
36522
|
i0.ɵɵelementStart(13, "tbody");
|
|
36469
36523
|
i0.ɵɵtemplate(14, SearchResultComponent_table_0_ng_container_14_Template, 3, 8, "ng-container", 1)(15, SearchResultComponent_table_0_ng_container_15_Template, 4, 11, "ng-container", 1);
|
|
@@ -36862,7 +36916,7 @@ class SearchResultComponent {
|
|
|
36862
36916
|
}
|
|
36863
36917
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SearchResultComponent, [{
|
|
36864
36918
|
type: Component,
|
|
36865
|
-
args: [{ selector: 'ccd-search-result', template: "<table *ngIf=\"hasResults() || hasDrafts()\">\n <caption>\n <h2 class=\"heading-h2\" id=\"search-result-heading__text\" tabindex=\"-1\">{{ (caseState ? 'Your cases' : 'Search result') | rpxTranslate}}</h2>\n\n <div class=\"govuk-warning-text pagination-limit-warning\" *ngIf=\"paginationLimitEnforced\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{'The total size of the result set is' | rpxTranslate}} {{paginationMetadata.totalResultsCount | number}}. {{'Only the first 10,000 records are available for display.' | rpxTranslate}}\n </strong>\n </div>\n\n <div *ngIf=\"(hasResults() || hasDrafts())\" class=\"pagination-top\">\n <output [attr.aria-label]=\"getTotalResults() + ' results have been found' | rpxTranslate\"></output>\n <span class=\"text-16\" id=\"search-result-summary__text\">{{'Showing' | rpxTranslate}}\n <span class=\"govuk-!-font-weight-bold\">{{ getFirstResult() }}</span>\n {{'to' | rpxTranslate}}\n <span class=\"govuk-!-font-weight-bold\">{{ getLastResult() }}</span>\n {{'of' | rpxTranslate}}\n <span class=\"govuk-!-font-weight-bold\">{{ getTotalResults() }}</span> {{'results' | rpxTranslate}}</span>\n </div>\n <div *ngIf=\"(hasResults() || hasDrafts()) && selectionEnabled\" class=\"reset-selection\"\n [attr.aria-label]=\"'Reset selection' | rpxTranslate\">\n <span><a class=\"search-result-reset-link\" href=\"javascript:void(0)\" (click)=\"clearSelection()\">{{'Reset case selection' | rpxTranslate}}</a></span>\n </div>\n </caption>\n <thead>\n <tr scope=\"row\">\n <th *ngIf=\"selectionEnabled\" class=\"govuk-table__checkbox\" scope=\"col\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"select-all\" name=\"select-all\" type=\"checkbox\" (change)=\"selectAll()\" [checked]=\"allOnPageSelected()\" [disabled]=\"!canAnyBeShared()\" />\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"select-all\">\n
|
|
36919
|
+
args: [{ selector: 'ccd-search-result', template: "<table *ngIf=\"hasResults() || hasDrafts()\">\n <caption>\n <h2 class=\"heading-h2\" id=\"search-result-heading__text\" tabindex=\"-1\">{{ (caseState ? 'Your cases' : 'Search result') | rpxTranslate}}</h2>\n\n <div class=\"govuk-warning-text pagination-limit-warning\" *ngIf=\"paginationLimitEnforced\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{'The total size of the result set is' | rpxTranslate}} {{paginationMetadata.totalResultsCount | number}}. {{'Only the first 10,000 records are available for display.' | rpxTranslate}}\n </strong>\n </div>\n\n <div *ngIf=\"(hasResults() || hasDrafts())\" class=\"pagination-top\">\n <output [attr.aria-label]=\"getTotalResults() + ' results have been found' | rpxTranslate\"></output>\n <span class=\"text-16\" id=\"search-result-summary__text\">{{'Showing' | rpxTranslate}}\n <span class=\"govuk-!-font-weight-bold\">{{ getFirstResult() }}</span>\n {{'to' | rpxTranslate}}\n <span class=\"govuk-!-font-weight-bold\">{{ getLastResult() }}</span>\n {{'of' | rpxTranslate}}\n <span class=\"govuk-!-font-weight-bold\">{{ getTotalResults() }}</span> {{'results' | rpxTranslate}}</span>\n </div>\n <div *ngIf=\"(hasResults() || hasDrafts()) && selectionEnabled\" class=\"reset-selection\"\n [attr.aria-label]=\"'Reset selection' | rpxTranslate\">\n <span><a class=\"search-result-reset-link\" href=\"javascript:void(0)\" (click)=\"clearSelection()\">{{'Reset case selection' | rpxTranslate}}</a></span>\n </div>\n </caption>\n <thead>\n <tr scope=\"row\">\n <th *ngIf=\"selectionEnabled\" class=\"govuk-table__checkbox\" scope=\"col\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"select-all\" name=\"select-all\" type=\"checkbox\" (change)=\"selectAll()\" [checked]=\"allOnPageSelected()\" [disabled]=\"!canAnyBeShared()\" />\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"select-all\">\n </label>\n </div>\n </th>\n <th *ngFor=\"let col of resultView.columns\" class=\"search-result-column-header\"\n [attr.aria-sort]=\"isSortAscending(col) === null ? null : (isSortAscending(col) ? 'ascending' : 'descending')\">\n <div>\n <div class=\"search-result-column-label\" (click)=\"sort(col)\" (keyup)=\"noop()\">\n {{col.label | rpxTranslate}}\n </div>\n <div *ngIf=\"comparator(col)\" class=\"search-result-column-sort\">\n <a (click)=\"sort(col)\" class=\"sort-widget\" [innerHTML]=\"sortWidget(col)\" href=\"javascript:void(0)\"></a>\n </div>\n </div>\n </th>\n <th *ngIf=\"activityEnabled()\" style=\"width: 110px;\">​</th>\n </tr>\n </thead>\n\n <tbody>\n <!-- sorted by consumer -->\n <ng-container *ngIf=\"consumerSortingEnabled\">\n <tr *ngFor=\"let result of resultView.results | paginate: { itemsPerPage: paginationPageSize, currentPage: selected.page, totalItems: resultTotal }\">\n <td *ngIf=\"selectionEnabled\" class=\"govuk-table__checkbox\" scope=\"col\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"select-{{ result.case_id }}\" name=\"select-{{ result.case_id }}\"\n type=\"checkbox\" (change)=\"changeSelection(result)\" [checked]=\"isSelected(result)\" [disabled]=\"!canBeShared(result)\" />\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"select-{{ result.case_id }}\">\n </label>\n </div>\n </td>\n <td class=\"search-result-column-cell\" *ngFor=\"let col of resultView.columns; let colIndex = index\" scope=\"row\">\n <a *ngIf=\"colIndex == 0\" [routerLink]=\"prepareCaseLinkUrl(result.case_id)\"\n attr.aria-label=\"go to case with Case reference:{{ result.case_id | ccdCaseReference }}\" class=\"govuk-link\">\n <ng-container class=\"text-16\" *ngIf=\"!hideRows\">\n <ccd-field-read *ngIf=\"draftPrefixOrGet(col, result); else case_reference\"\n ccdLabelSubstitutor [caseField]=\"getColumnsWithPrefix(result.columns[col.case_field_id], result)\"\n [contextFields]=\"result.hydrated_case_fields\"\n [elementsToSubstitute]=\"['value']\"></ccd-field-read>\n <ng-template #case_reference>{{result.case_id | ccdCaseReference}}</ng-template>\n </ng-container>\n </a>\n <div *ngIf=\"colIndex != 0\" class=\"text-16\" [style.visibility]=\"hideRows ? 'hidden' : 'visible'\">\n <ccd-field-read ccdLabelSubstitutor\n [caseField]=\"result.columns[col.case_field_id]\"\n [contextFields]=\"result.hydrated_case_fields\"\n [elementsToSubstitute]=\"['value']\"></ccd-field-read>\n </div>\n </td>\n <td *ngIf=\"activityEnabled()\">\n <div [style.visibility]=\"hideRows ? 'hidden' : 'visible'\">\n <ccd-activity [caseId]=\"result.case_id\" [displayMode]=\"ICON\"></ccd-activity>\n </div>\n </td>\n </tr>\n </ng-container>\n <!-- sorted by toolkit -->\n <ng-container *ngIf=\"!consumerSortingEnabled\">\n <tr *ngFor=\"let result of resultView.results | ccdSortSearchResult : sortParameters | paginate: { itemsPerPage: paginationPageSize, currentPage: selected.page, totalItems: resultTotal }\">\n <td *ngIf=\"selectionEnabled\" class=\"govuk-table__checkbox\" scope=\"col\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"select-{{ result.case_id }}\" name=\"select-{{ result.case_id }}\"\n type=\"checkbox\" (change)=\"changeSelection(result)\" [checked]=\"isSelected(result)\" [disabled]=\"!canBeShared(result)\" (keyup)=\"onKeyUp($event, result)\" />\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"select-{{ result.case_id }}\">\n </label>\n </div>\n </td>\n <td class=\"search-result-column-cell\" *ngFor=\"let col of resultView.columns; let colIndex = index\" scope=\"row\">\n\n <a *ngIf=\"colIndex == 0\" [routerLink]=\"prepareCaseLinkUrl(result.case_id)\"\n attr.aria-label=\"go to case with Case reference:{{ result.case_id | ccdCaseReference }}\" class=\"govuk-link\">\n <ng-container class=\"text-16\" *ngIf=\"!hideRows\">\n <ccd-field-read *ngIf=\"draftPrefixOrGet(col, result); else case_reference\"\n ccdLabelSubstitutor [caseField]=\"getColumnsWithPrefix(result.columns[col.case_field_id], result)\"\n [contextFields]=\"result.hydrated_case_fields\"\n [elementsToSubstitute]=\"['value']\"></ccd-field-read>\n <ng-template #case_reference>{{result.case_id | ccdCaseReference}}</ng-template>\n </ng-container>\n </a>\n <div *ngIf=\"colIndex != 0\" class=\"text-16\" [style.visibility]=\"hideRows ? 'hidden' : 'visible'\">\n <ccd-field-read ccdLabelSubstitutor\n [caseField]=\"result.columns[col.case_field_id]\"\n [contextFields]=\"result.hydrated_case_fields\"\n [elementsToSubstitute]=\"['value']\"></ccd-field-read>\n </div>\n </td>\n <td *ngIf=\"activityEnabled()\">\n <div [style.visibility]=\"hideRows ? 'hidden' : 'visible'\">\n <ccd-activity [caseId]=\"result.case_id\" [displayMode]=\"ICON\"></ccd-activity>\n </div>\n </td>\n </tr>\n </ng-container>\n\n </tbody>\n</table>\n\n<ccd-pagination\n *ngIf=\"hasResults()\"\n (pageChange)=\"goToPage($event)\"\n [visibilityLabel]=\"hideRows ? 'hidden' : 'visible'\"\n [autoHide]=\"true\"\n [maxSize]=\"8\"\n [screenReaderPaginationLabel]=\"'Pagination'\"\n [screenReaderPageLabel]=\"page\"\n [screenReaderCurrentLabel]=\"'You\\'re on page'\"></ccd-pagination>\n\n<div *ngIf=\"!(hasResults() || hasDrafts())\" class=\"notification\"\n[attr.aria-describedby]=\"'No cases found. Try using different filters.' | rpxTranslate\">\n{{'No cases found. Try using different filters.' | rpxTranslate}}\n</div>\n", styles: ["table thead tr th{vertical-align:top}table tbody tr td{font-size:16px;word-wrap:break-word}table tbody tr td a{float:left}table .caseid-col{white-space:nowrap}.notification{text-align:center;padding:30px 0;margin-top:75px}a:hover{color:#005ea5}.search-result-reset-link{padding-right:15px;padding-left:15px}.search-result-column-header{width:unset;table-layout:normal}.search-result-column-header div{display:table-cell;width:auto}@media screen and (max-width: 379px){.search-result-column-header div{display:block;float:right}}.search-result-column-label{font-size:16px;font-weight:700;word-wrap:break-word;cursor:pointer;padding-right:15px}.search-result-column-sort{font-size:16px}.sort-widget{cursor:pointer;text-decoration:none;color:#231f20}span.heading-medium{margin-top:-20px}.govuk-table__checkbox{vertical-align:middle;padding-left:3px}#search-result-heading__text:focus{outline:none}\n"] }]
|
|
36866
36920
|
}], () => [{ type: SearchResultViewItemComparatorFactory }, { type: AbstractAppConfig }, { type: ActivityService }, { type: CaseReferencePipe }, { type: PlaceholderService }, { type: BrowserService }, { type: SessionStorageService }], { caseLinkUrlTemplate: [{
|
|
36867
36921
|
type: Input
|
|
36868
36922
|
}], jurisdiction: [{
|