@hmcts/ccd-case-ui-toolkit 7.0.38 → 7.0.39-callback-event-errors-rework
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/esm2020/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.mjs +24 -35
- package/esm2020/lib/shared/components/case-viewer/services/event-trigger.resolver.mjs +17 -4
- package/esm2020/lib/shared/components/error/callback-errors.component.mjs +2 -1
- package/esm2020/lib/shared/components/error/domain/error-context.mjs +1 -1
- package/esm2020/lib/shared/components/event-trigger/event-trigger.component.mjs +20 -8
- package/esm2020/lib/shared/services/error/error-notifier.service.mjs +3 -3
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs +60 -45
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs +54 -44
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts +3 -4
- package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
- package/lib/shared/components/case-viewer/services/event-trigger.resolver.d.ts +7 -2
- package/lib/shared/components/case-viewer/services/event-trigger.resolver.d.ts.map +1 -1
- package/lib/shared/components/error/callback-errors.component.d.ts.map +1 -1
- package/lib/shared/components/error/domain/error-context.d.ts +1 -0
- package/lib/shared/components/error/domain/error-context.d.ts.map +1 -1
- package/lib/shared/components/event-trigger/event-trigger.component.d.ts +6 -3
- package/lib/shared/components/event-trigger/event-trigger.component.d.ts.map +1 -1
- package/lib/shared/services/error/error-notifier.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -6601,7 +6601,7 @@ DocumentManagementService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token
|
|
|
6601
6601
|
|
|
6602
6602
|
class ErrorNotifierService {
|
|
6603
6603
|
constructor() {
|
|
6604
|
-
this.errorSource = new
|
|
6604
|
+
this.errorSource = new BehaviorSubject(null);
|
|
6605
6605
|
this.error = this.errorSource.asObservable();
|
|
6606
6606
|
}
|
|
6607
6607
|
announceError(error) {
|
|
@@ -10372,6 +10372,7 @@ class CallbackErrorsComponent {
|
|
|
10372
10372
|
errorContext.ignoreWarning = false;
|
|
10373
10373
|
errorContext.triggerText = this.triggerTextContinue;
|
|
10374
10374
|
}
|
|
10375
|
+
errorContext.eventId = this.error?.details?.eventId;
|
|
10375
10376
|
return errorContext;
|
|
10376
10377
|
}
|
|
10377
10378
|
hasInvalidData() {
|
|
@@ -30309,11 +30310,14 @@ CaseResolver.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseResolve
|
|
|
30309
30310
|
}], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1$1.Router }, { type: SessionStorageService }, { type: AbstractAppConfig }]; }, null); })();
|
|
30310
30311
|
|
|
30311
30312
|
class EventTriggerResolver {
|
|
30312
|
-
constructor(casesService, alertService, profileService, profileNotifier) {
|
|
30313
|
+
constructor(casesService, alertService, profileService, profileNotifier, router, appConfig, errorNotifier) {
|
|
30313
30314
|
this.casesService = casesService;
|
|
30314
30315
|
this.alertService = alertService;
|
|
30315
30316
|
this.profileService = profileService;
|
|
30316
30317
|
this.profileNotifier = profileNotifier;
|
|
30318
|
+
this.router = router;
|
|
30319
|
+
this.appConfig = appConfig;
|
|
30320
|
+
this.errorNotifier = errorNotifier;
|
|
30317
30321
|
}
|
|
30318
30322
|
resolve(route) {
|
|
30319
30323
|
return this.isRootTriggerEventRoute(route) ? this.getAndCacheEventTrigger(route)
|
|
@@ -30345,7 +30349,11 @@ class EventTriggerResolver {
|
|
|
30345
30349
|
return this.casesService
|
|
30346
30350
|
.getEventTrigger(caseTypeId, eventTriggerId, cid, ignoreWarning)
|
|
30347
30351
|
.pipe(map(eventTrigger => this.cachedEventTrigger = eventTrigger), catchError(error => {
|
|
30352
|
+
error.details = { eventId: eventTriggerId, ...error.details };
|
|
30353
|
+
this.alertService.setPreserveAlerts(true);
|
|
30348
30354
|
this.alertService.error(error.message);
|
|
30355
|
+
this.errorNotifier.announceError(error);
|
|
30356
|
+
this.router.navigate([`/cases/case-details/${cid}/tasks`]);
|
|
30349
30357
|
return throwError(error);
|
|
30350
30358
|
})).toPromise();
|
|
30351
30359
|
}
|
|
@@ -30354,11 +30362,11 @@ EventTriggerResolver.PARAM_CASE_ID = 'cid';
|
|
|
30354
30362
|
EventTriggerResolver.PARAM_EVENT_ID = 'eid';
|
|
30355
30363
|
EventTriggerResolver.IGNORE_WARNING = 'ignoreWarning';
|
|
30356
30364
|
EventTriggerResolver.IGNORE_WARNING_VALUES = ['true', 'false'];
|
|
30357
|
-
EventTriggerResolver.ɵfac = function EventTriggerResolver_Factory(t) { return new (t || EventTriggerResolver)(i0.ɵɵinject(CasesService), i0.ɵɵinject(AlertService), i0.ɵɵinject(ProfileService), i0.ɵɵinject(ProfileNotifier)); };
|
|
30365
|
+
EventTriggerResolver.ɵfac = function EventTriggerResolver_Factory(t) { return new (t || EventTriggerResolver)(i0.ɵɵinject(CasesService), i0.ɵɵinject(AlertService), i0.ɵɵinject(ProfileService), i0.ɵɵinject(ProfileNotifier), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(ErrorNotifierService)); };
|
|
30358
30366
|
EventTriggerResolver.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventTriggerResolver, factory: EventTriggerResolver.ɵfac });
|
|
30359
30367
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventTriggerResolver, [{
|
|
30360
30368
|
type: Injectable
|
|
30361
|
-
}], function () { return [{ type: CasesService }, { type: AlertService }, { type: ProfileService }, { type: ProfileNotifier }]; }, null); })();
|
|
30369
|
+
}], function () { return [{ type: CasesService }, { type: AlertService }, { type: ProfileService }, { type: ProfileNotifier }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: ErrorNotifierService }]; }, null); })();
|
|
30362
30370
|
|
|
30363
30371
|
function CaseEventTriggerComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
30364
30372
|
const _r2 = i0.ɵɵgetCurrentView();
|
|
@@ -30986,7 +30994,7 @@ function CaseFullAccessViewComponent_div_8_Template(rf, ctx) { if (rf & 1) {
|
|
|
30986
30994
|
} if (rf & 2) {
|
|
30987
30995
|
const ctx_r3 = i0.ɵɵnextContext();
|
|
30988
30996
|
i0.ɵɵadvance(1);
|
|
30989
|
-
i0.ɵɵproperty("isDisabled", ctx_r3.isTriggerButtonDisabled())("triggers", ctx_r3.caseDetails.triggers)("triggerText", ctx_r3.triggerText);
|
|
30997
|
+
i0.ɵɵproperty("isDisabled", ctx_r3.isTriggerButtonDisabled())("triggers", ctx_r3.caseDetails.triggers)("triggerText", ctx_r3.triggerText)("eventId", ctx_r3.eventId);
|
|
30990
30998
|
} }
|
|
30991
30999
|
function CaseFullAccessViewComponent_div_9_Template(rf, ctx) { if (rf & 1) {
|
|
30992
31000
|
const _r13 = i0.ɵɵgetCurrentView();
|
|
@@ -31157,23 +31165,20 @@ class CaseFullAccessViewComponent {
|
|
|
31157
31165
|
this.caseFlagsExternalUser = false;
|
|
31158
31166
|
this.caseFlagsReadExternalMode = '#ARGUMENT(READ,EXTERNAL)';
|
|
31159
31167
|
this.subs = [];
|
|
31160
|
-
this.callbackErrorsSubject = new Subject();
|
|
31161
31168
|
}
|
|
31162
31169
|
ngOnInit() {
|
|
31170
|
+
this.callbackErrorsSubject = this.errorNotifierService.errorSource.pipe(filter((x) => {
|
|
31171
|
+
if (x && x.status !== 401 && x.status !== 403) {
|
|
31172
|
+
this.error = x;
|
|
31173
|
+
return true;
|
|
31174
|
+
}
|
|
31175
|
+
return false;
|
|
31176
|
+
}));
|
|
31163
31177
|
initDialog();
|
|
31164
31178
|
this.init();
|
|
31165
|
-
this.callbackErrorsSubject.subscribe(errorEvent => {
|
|
31166
|
-
this.error = errorEvent;
|
|
31167
|
-
});
|
|
31168
|
-
this.errorSubscription = this.errorNotifierService.error.subscribe(error => {
|
|
31169
|
-
if (error && error.status !== 401 && error.status !== 403) {
|
|
31170
|
-
this.error = error;
|
|
31171
|
-
this.callbackErrorsSubject.next(this.error);
|
|
31172
|
-
}
|
|
31173
|
-
});
|
|
31174
31179
|
this.markdownUseHrefAsRouterLink = true;
|
|
31175
|
-
this.sessionStorageService
|
|
31176
|
-
this.subscription = this.convertHrefToRouterService
|
|
31180
|
+
this.sessionStorageService?.removeItem('eventUrl');
|
|
31181
|
+
this.subscription = this.convertHrefToRouterService?.getHrefMarkdownLinkContent().subscribe((hrefMarkdownLinkContent) => {
|
|
31177
31182
|
// do not convert router with initial default value; convert to router only on updated link content
|
|
31178
31183
|
if (hrefMarkdownLinkContent !== 'Default') {
|
|
31179
31184
|
this.convertHrefToRouterService.callAngularRouter(hrefMarkdownLinkContent);
|
|
@@ -31233,7 +31238,7 @@ class CaseFullAccessViewComponent {
|
|
|
31233
31238
|
}));
|
|
31234
31239
|
}
|
|
31235
31240
|
postViewActivity() {
|
|
31236
|
-
return this.activityPollingService.postViewActivity(this.caseDetails
|
|
31241
|
+
return this.activityPollingService.postViewActivity(this.caseDetails?.case_id);
|
|
31237
31242
|
}
|
|
31238
31243
|
clearErrorsAndWarnings() {
|
|
31239
31244
|
this.resetErrors();
|
|
@@ -31241,7 +31246,7 @@ class CaseFullAccessViewComponent {
|
|
|
31241
31246
|
this.triggerText = CaseFullAccessViewComponent.TRIGGER_TEXT_START;
|
|
31242
31247
|
}
|
|
31243
31248
|
async applyTrigger(trigger) {
|
|
31244
|
-
this.
|
|
31249
|
+
this.errorNotifierService.announceError(null);
|
|
31245
31250
|
const theQueryParams = {};
|
|
31246
31251
|
if (this.ignoreWarning) {
|
|
31247
31252
|
theQueryParams['ignoreWarning'] = this.ignoreWarning;
|
|
@@ -31289,6 +31294,7 @@ class CaseFullAccessViewComponent {
|
|
|
31289
31294
|
callbackErrorsNotify(callbackErrorsContext) {
|
|
31290
31295
|
this.ignoreWarning = callbackErrorsContext.ignoreWarning;
|
|
31291
31296
|
this.triggerText = callbackErrorsContext.triggerText;
|
|
31297
|
+
this.eventId = callbackErrorsContext.eventId;
|
|
31292
31298
|
}
|
|
31293
31299
|
isDraft() {
|
|
31294
31300
|
return Draft.isDraft(this.caseDetails.case_id);
|
|
@@ -31398,7 +31404,7 @@ class CaseFullAccessViewComponent {
|
|
|
31398
31404
|
}
|
|
31399
31405
|
hasActiveCaseFlags() {
|
|
31400
31406
|
// Determine which tab contains the FlagLauncher CaseField type, from the CaseView object in the snapshot data
|
|
31401
|
-
const caseFlagsTab = this.caseDetails
|
|
31407
|
+
const caseFlagsTab = this.caseDetails?.tabs
|
|
31402
31408
|
? (this.caseDetails.tabs).filter(tab => tab.fields && tab.fields.some(caseField => FieldsUtils.isFlagLauncherCaseField(caseField)))[0]
|
|
31403
31409
|
: null;
|
|
31404
31410
|
if (caseFlagsTab) {
|
|
@@ -31445,24 +31451,23 @@ class CaseFullAccessViewComponent {
|
|
|
31445
31451
|
}
|
|
31446
31452
|
init() {
|
|
31447
31453
|
// Clone and sort tabs array
|
|
31448
|
-
this.sortedTabs = this.orderService.sort(this.caseDetails
|
|
31454
|
+
this.sortedTabs = this.orderService.sort(this.caseDetails?.tabs);
|
|
31449
31455
|
this.caseFields = this.getTabFields();
|
|
31450
31456
|
this.sortedTabs = this.sortTabFieldsAndFilterTabs(this.sortedTabs);
|
|
31451
31457
|
this.formGroup = this.buildFormGroup(this.caseFields);
|
|
31452
|
-
if (this.caseDetails
|
|
31458
|
+
if (this.caseDetails?.triggers && this.error) {
|
|
31453
31459
|
this.resetErrors();
|
|
31454
31460
|
}
|
|
31455
31461
|
}
|
|
31456
31462
|
sortTabFieldsAndFilterTabs(tabs) {
|
|
31457
|
-
return tabs
|
|
31458
|
-
.map(tab => Object.assign({}, tab, { fields: this.orderService.sort(tab.fields) }))
|
|
31463
|
+
return tabs?.map(tab => Object.assign({}, tab, { fields: this.orderService.sort(tab.fields) }))
|
|
31459
31464
|
.filter(tab => ShowCondition.getInstance(tab.show_condition).matchByContextFields(this.caseFields));
|
|
31460
31465
|
}
|
|
31461
31466
|
getTabFields() {
|
|
31462
|
-
const caseDataFields = this.sortedTabs
|
|
31467
|
+
const caseDataFields = this.sortedTabs?.reduce((acc, tab) => {
|
|
31463
31468
|
return acc.concat(plainToClass(CaseField, tab.fields));
|
|
31464
31469
|
}, []);
|
|
31465
|
-
return caseDataFields
|
|
31470
|
+
return caseDataFields?.concat(this.caseDetails.metadataFields);
|
|
31466
31471
|
}
|
|
31467
31472
|
/**
|
|
31468
31473
|
* For EUI-3825:
|
|
@@ -31483,16 +31488,9 @@ class CaseFullAccessViewComponent {
|
|
|
31483
31488
|
return new FormGroup({ data: new FormControl(value) });
|
|
31484
31489
|
}
|
|
31485
31490
|
resetErrors() {
|
|
31486
|
-
this.
|
|
31487
|
-
this.callbackErrorsSubject.next(null);
|
|
31491
|
+
this.errorNotifierService.announceError(null);
|
|
31488
31492
|
this.alertService.clear();
|
|
31489
31493
|
}
|
|
31490
|
-
getUrlFragment(url) {
|
|
31491
|
-
return url.split('#')[url.split('#').length - 1];
|
|
31492
|
-
}
|
|
31493
|
-
getTabIndexByTabLabel(tabGroup, tabLabel) {
|
|
31494
|
-
return tabGroup._tabs.toArray().findIndex((t) => t.textLabel.toLowerCase() === tabLabel.toLowerCase());
|
|
31495
|
-
}
|
|
31496
31494
|
}
|
|
31497
31495
|
CaseFullAccessViewComponent.ORIGIN_QUERY_PARAM = 'origin';
|
|
31498
31496
|
CaseFullAccessViewComponent.TRIGGER_TEXT_START = 'Go';
|
|
@@ -31505,7 +31503,7 @@ CaseFullAccessViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
31505
31503
|
} if (rf & 2) {
|
|
31506
31504
|
let _t;
|
|
31507
31505
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabGroup = _t.first);
|
|
31508
|
-
} }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0.ɵɵNgOnChangesFeature], decls: 13, vars: 12, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "onTriggerChange", "onTriggerSubmit"], [3, "notificationBannerConfig", "linkClicked"], ["animationDuration", "0ms", 3, "disableRipple", "selectedIndex", "selectedIndexChange"], ["tabGroup", ""], [3, "id", "label", 4, "ngFor", "ngForOf"], [3, "id", "label"], ["matTabContent", ""], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], ["id", "case-viewer-field-label", 4, "ngIf"], ["scope", "col", 3, "id"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], ["id", "case-viewer-field-label"], [1, "case-viewer-label", "text-16"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) { if (rf & 1) {
|
|
31506
|
+
} }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0.ɵɵNgOnChangesFeature], decls: 13, vars: 12, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "eventId", "onTriggerChange", "onTriggerSubmit"], [3, "notificationBannerConfig", "linkClicked"], ["animationDuration", "0ms", 3, "disableRipple", "selectedIndex", "selectedIndexChange"], ["tabGroup", ""], [3, "id", "label", 4, "ngFor", "ngForOf"], [3, "id", "label"], ["matTabContent", ""], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], ["id", "case-viewer-field-label", 4, "ngIf"], ["scope", "col", 3, "id"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], ["id", "case-viewer-field-label"], [1, "case-viewer-label", "text-16"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) { if (rf & 1) {
|
|
31509
31507
|
i0.ɵɵtemplate(0, CaseFullAccessViewComponent_div_0_Template, 14, 12, "div", 0);
|
|
31510
31508
|
i0.ɵɵtemplate(1, CaseFullAccessViewComponent_div_1_Template, 8, 7, "div", 0);
|
|
31511
31509
|
i0.ɵɵelementStart(2, "ccd-callback-errors", 1);
|
|
@@ -31516,7 +31514,7 @@ CaseFullAccessViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
31516
31514
|
i0.ɵɵelement(6, "ccd-case-header", 5);
|
|
31517
31515
|
i0.ɵɵtemplate(7, CaseFullAccessViewComponent_div_7_Template, 4, 3, "div", 6);
|
|
31518
31516
|
i0.ɵɵelementEnd();
|
|
31519
|
-
i0.ɵɵtemplate(8, CaseFullAccessViewComponent_div_8_Template, 2,
|
|
31517
|
+
i0.ɵɵtemplate(8, CaseFullAccessViewComponent_div_8_Template, 2, 4, "div", 7);
|
|
31520
31518
|
i0.ɵɵelementEnd();
|
|
31521
31519
|
i0.ɵɵtemplate(9, CaseFullAccessViewComponent_div_9_Template, 3, 1, "div", 8);
|
|
31522
31520
|
i0.ɵɵelementStart(10, "div", 3)(11, "div", 9);
|
|
@@ -31543,7 +31541,7 @@ CaseFullAccessViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
31543
31541
|
} }, styles: ["th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:0}.case-viewer-controls[_ngcontent-%COMP%]{margin-top:47px;margin-bottom:20px}ccd-case-header[_ngcontent-%COMP%]{float:left;margin-right:10px}ccd-event-trigger[_ngcontent-%COMP%]{float:right}.case-viewer-label[_ngcontent-%COMP%]{min-width:300px;white-space:normal}.markdown[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:0}"] });
|
|
31544
31542
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFullAccessViewComponent, [{
|
|
31545
31543
|
type: Component,
|
|
31546
|
-
args: [{ selector: 'ccd-case-full-access-view', template: "<!-- Generic error heading and error message to be displayed only if there are no specific callback errors or warnings, or no error details -->\n<div *ngIf=\"error && !(error.callbackErrors || error.callbackWarnings || error.details)\" class=\"error-summary\"\n role=\"group\" aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h1 class=\"heading-h1 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n {{'Something went wrong' | rpxTranslate}}\n </h1>\n <div class=\"govuk-error-summary__body\" id=\"edit-case-event_error-summary-body\">\n <p>{{\"We're working to fix the problem. Try again shortly.\" | rpxTranslate}}</p>\n <p>\n <a href=\"get-help\" target=\"_blank\">\n {{\"Contact us\" | rpxTranslate}}</a> {{\"if you're still having problems.\" | rpxTranslate}}\n </p>\n </div>\n</div>\n<!-- Callback error heading and error message to be displayed if there are specific error details -->\n<div *ngIf=\"error && error.details\" class=\"error-summary\" role=\"group\"\n aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-h2 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n {{'The callback data failed validation' | rpxTranslate}}\n </h2>\n <p>{{error.message | rpxTranslate}}</p>\n <ul *ngIf=\"error.details?.field_errors\" class=\"error-summary-list\">\n <li *ngFor=\"let fieldError of error.details.field_errors\">\n {{fieldError.message | rpxTranslate}}\n </li>\n </ul>\n</div>\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<ccd-activity [caseId]=\"caseDetails.case_id\" [displayMode]=\"BANNER\"></ccd-activity>\n<div class=\"grid-row\">\n <div class=\"column-one-half\">\n <ccd-case-header [caseDetails]=\"caseDetails\"></ccd-case-header>\n <div class=\"case-viewer-controls\" *ngIf=\"hasPrint && !isDraft() && isPrintEnabled()\">\n <a id=\"case-viewer-control-print\" routerLink=\"print\" class=\"button button-secondary\">{{'Print' | rpxTranslate}}</a>\n </div>\n </div>\n <div *ngIf=\"hasEventSelector\" class=\"column-one-half\">\n <ccd-event-trigger [isDisabled]=\"isTriggerButtonDisabled()\" [triggers]=\"caseDetails.triggers\"\n [triggerText]=\"triggerText\"
|
|
31544
|
+
args: [{ selector: 'ccd-case-full-access-view', template: "<!-- Generic error heading and error message to be displayed only if there are no specific callback errors or warnings, or no error details -->\n<div *ngIf=\"error && !(error.callbackErrors || error.callbackWarnings || error.details)\" class=\"error-summary\"\n role=\"group\" aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h1 class=\"heading-h1 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n {{'Something went wrong' | rpxTranslate}}\n </h1>\n <div class=\"govuk-error-summary__body\" id=\"edit-case-event_error-summary-body\">\n <p>{{\"We're working to fix the problem. Try again shortly.\" | rpxTranslate}}</p>\n <p>\n <a href=\"get-help\" target=\"_blank\">\n {{\"Contact us\" | rpxTranslate}}</a> {{\"if you're still having problems.\" | rpxTranslate}}\n </p>\n </div>\n</div>\n<!-- Callback error heading and error message to be displayed if there are specific error details -->\n<div *ngIf=\"error && error.details\" class=\"error-summary\" role=\"group\"\n aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-h2 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n {{'The callback data failed validation' | rpxTranslate}}\n </h2>\n <p>{{error.message | rpxTranslate}}</p>\n <ul *ngIf=\"error.details?.field_errors\" class=\"error-summary-list\">\n <li *ngFor=\"let fieldError of error.details.field_errors\">\n {{fieldError.message | rpxTranslate}}\n </li>\n </ul>\n</div>\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<ccd-activity [caseId]=\"caseDetails.case_id\" [displayMode]=\"BANNER\"></ccd-activity>\n<div class=\"grid-row\">\n <div class=\"column-one-half\">\n <ccd-case-header [caseDetails]=\"caseDetails\"></ccd-case-header>\n <div class=\"case-viewer-controls\" *ngIf=\"hasPrint && !isDraft() && isPrintEnabled()\">\n <a id=\"case-viewer-control-print\" routerLink=\"print\" class=\"button button-secondary\">{{'Print' | rpxTranslate}}</a>\n </div>\n </div>\n <div *ngIf=\"hasEventSelector\" class=\"column-one-half\">\n <ccd-event-trigger [isDisabled]=\"isTriggerButtonDisabled()\" [triggers]=\"caseDetails.triggers\"\n [triggerText]=\"triggerText\"\n [eventId]=\"eventId\"\n (onTriggerChange)=\"clearErrorsAndWarnings()\"\n (onTriggerSubmit)=\"applyTrigger($event)\"></ccd-event-trigger>\n </div>\n</div>\n<div class=\"grid-row\" *ngIf=\"activeCaseFlags && !caseFlagsExternalUser\">\n <div class=\"column-full\">\n <ccd-notification-banner [notificationBannerConfig]=\"notificationBannerConfig\" (linkClicked)=\"onLinkClicked($event)\">\n </ccd-notification-banner>\n </div>\n</div>\n<div class=\"grid-row\">\n <div class=\"column-full\">\n <ng-container *ngIf=\"hasTabsPresent()\">\n <mat-tab-group #tabGroup animationDuration=\"0ms\" (selectedIndexChange)=\"tabChanged($event)\" [disableRipple]=\"true\"\n [selectedIndex]=\"selectedTabIndex\">\n <mat-tab *ngFor=\"let tab of prependedTabs\" [id]=\"tab.id\" [label]=\"tab.label | rpxTranslate\">\n </mat-tab>\n <mat-tab *ngFor=\"let tab of sortedTabs; let curIdx=index\" [id]=\"tab.id\" [label]=\"tab.label | rpxTranslate\">\n <ng-template matTabContent>\n <table [class]=\"tab.id\" [attr.aria-label]=\"'case viewer table' | rpxTranslate\">\n <tbody>\n <ng-container *ngFor=\"let field of tab | ccdTabFields | ccdReadFieldsFilter:false :undefined :true : formGroup.controls['data']\">\n <div ccdLabelSubstitutor [caseField]=\"field\" [contextFields]=\"caseFields\" [hidden]=\"field.hidden\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\">\n <th id=\"case-viewer-field-label\" *ngIf=\"!isFieldToHaveNoLabel(field)\">\n <div class=\"case-viewer-label text-16\">\n {{field.label | rpxTranslate}}</div>\n </th>\n <td [id]=\"'case-viewer-field-read--' + field.id\" scope=\"col\">\n <span class=\"text-16\">\n <ccd-field-read [topLevelFormGroup]=\"formGroup.controls['data']\"\n [caseField]=\"field\" [caseReference]=\"caseDetails.case_id\"\n [markdownUseHrefAsRouterLink]=\"markdownUseHrefAsRouterLink\">\n </ccd-field-read>\n </span>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\">\n <th [id]=\"'case-viewer-field-read--' + field.id\" scope=\"col\">\n <span class=\"text-16\">\n <ccd-field-read [topLevelFormGroup]=\"formGroup.controls['data']\"\n [caseField]=\"field\" [caseReference]=\"caseDetails.case_id\"\n [markdownUseHrefAsRouterLink]=\"markdownUseHrefAsRouterLink\">\n </ccd-field-read>\n </span>\n </th>\n </tr>\n </ng-container>\n </div>\n </ng-container>\n </tbody>\n </table>\n </ng-template>\n </mat-tab>\n <mat-tab *ngFor=\"let tab of appendedTabs\" [id]=\"tab.id\" [label]=\"tab.label | rpxTranslate\">\n </mat-tab>\n </mat-tab-group>\n <router-outlet *ngIf=\"(prependedTabs && prependedTabs.length) || (appendedTabs && appendedTabs.length)\"></router-outlet>\n </ng-container>\n </div>\n</div>\n", styles: ["th{width:1%;white-space:nowrap;vertical-align:top}.compound-field th{padding:0}.case-viewer-controls{margin-top:47px;margin-bottom:20px}ccd-case-header{float:left;margin-right:10px}ccd-event-trigger{float:right}.case-viewer-label{min-width:300px;white-space:normal}.markdown h3{margin-bottom:0}\n"] }]
|
|
31547
31545
|
}], function () { return [{ type: i0.NgZone }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: NavigationNotifierService }, { type: OrderService }, { type: ActivityPollingService }, { type: i1$3.MatLegacyDialog }, { type: AlertService }, { type: DraftService }, { type: ErrorNotifierService }, { type: ConvertHrefToRouterService }, { type: i4.Location }, { type: i0.ChangeDetectorRef }, { type: SessionStorageService }, { type: i1.RpxTranslatePipe }]; }, { hasPrint: [{
|
|
31548
31546
|
type: Input
|
|
31549
31547
|
}], hasEventSelector: [{
|
|
@@ -32693,9 +32691,9 @@ function EventTriggerComponent_form_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
32693
32691
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
32694
32692
|
i0.ɵɵproperty("formGroup", ctx_r0.triggerForm);
|
|
32695
32693
|
i0.ɵɵadvance(3);
|
|
32696
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4,
|
|
32694
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 8, "Next step"));
|
|
32697
32695
|
i0.ɵɵadvance(2);
|
|
32698
|
-
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(
|
|
32696
|
+
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c0$4, !ctx_r0.triggerForm.value["trigger"]))("compareWith", ctx_r0.compareFn);
|
|
32699
32697
|
i0.ɵɵadvance(1);
|
|
32700
32698
|
i0.ɵɵproperty("ngIf", 1 !== ctx_r0.triggers.length);
|
|
32701
32699
|
i0.ɵɵadvance(1);
|
|
@@ -32703,23 +32701,33 @@ function EventTriggerComponent_form_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
32703
32701
|
i0.ɵɵadvance(1);
|
|
32704
32702
|
i0.ɵɵproperty("disabled", ctx_r0.isButtonDisabled());
|
|
32705
32703
|
i0.ɵɵadvance(1);
|
|
32706
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10,
|
|
32704
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10, 10, ctx_r0.triggerText));
|
|
32707
32705
|
} }
|
|
32708
32706
|
class EventTriggerComponent {
|
|
32709
32707
|
constructor(fb, orderService) {
|
|
32710
32708
|
this.fb = fb;
|
|
32711
32709
|
this.orderService = orderService;
|
|
32710
|
+
this.eventId = '';
|
|
32712
32711
|
this.onTriggerSubmit = new EventEmitter();
|
|
32713
32712
|
this.onTriggerChange = new EventEmitter();
|
|
32714
32713
|
}
|
|
32714
|
+
ngOnInit() {
|
|
32715
|
+
this.triggers = this.orderService.sort(this.triggers);
|
|
32716
|
+
if (this.eventId) {
|
|
32717
|
+
const eventBundle = this.triggers.find(ev => ev.id === this.eventId);
|
|
32718
|
+
this.triggerForm.controls['trigger'].patchValue({ id: eventBundle.id, name: eventBundle.name, description: eventBundle.description });
|
|
32719
|
+
}
|
|
32720
|
+
}
|
|
32715
32721
|
ngOnChanges(changes) {
|
|
32716
32722
|
if (changes.triggers && changes.triggers.currentValue) {
|
|
32717
|
-
this.triggers = this.orderService.sort(this.triggers);
|
|
32718
32723
|
this.triggerForm = this.fb.group({
|
|
32719
32724
|
trigger: [this.getDefault(), Validators.required]
|
|
32720
32725
|
});
|
|
32721
32726
|
}
|
|
32722
32727
|
}
|
|
32728
|
+
compareFn(c1, c2) {
|
|
32729
|
+
return c1 && c2 ? c1.id === c2.id : c1 === c2;
|
|
32730
|
+
}
|
|
32723
32731
|
isButtonDisabled() {
|
|
32724
32732
|
return !this.triggerForm.valid || this.isDisabled;
|
|
32725
32733
|
}
|
|
@@ -32734,20 +32742,22 @@ class EventTriggerComponent {
|
|
|
32734
32742
|
}
|
|
32735
32743
|
}
|
|
32736
32744
|
EventTriggerComponent.ɵfac = function EventTriggerComponent_Factory(t) { return new (t || EventTriggerComponent)(i0.ɵɵdirectiveInject(i3.FormBuilder), i0.ɵɵdirectiveInject(OrderService)); };
|
|
32737
|
-
EventTriggerComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EventTriggerComponent, selectors: [["ccd-event-trigger"]], inputs: { triggers: "triggers", triggerText: "triggerText", isDisabled: "isDisabled" }, outputs: { onTriggerSubmit: "onTriggerSubmit", onTriggerChange: "onTriggerChange" }, features: [i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["class", "event-trigger", 3, "formGroup", "ngSubmit", 4, "ngIf"], [1, "event-trigger", 3, "formGroup", "ngSubmit"], [1, "form-group", 2, "width", "350px !important"], ["for", "next-step", 1, "form-label"], ["id", "next-step", "formControlName", "trigger", 1, "form-control", "ccd-dropdown", 3, "ngClass", "change"], ["value", "", "data-default", "", 4, "ngIf"], [3, "ngValue", "title", 4, "ngFor", "ngForOf"], ["type", "submit", 1, "button", 3, "disabled"], ["value", "", "data-default", ""], [3, "ngValue", "title"]], template: function EventTriggerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
32738
|
-
i0.ɵɵtemplate(0, EventTriggerComponent_form_0_Template, 11,
|
|
32745
|
+
EventTriggerComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EventTriggerComponent, selectors: [["ccd-event-trigger"]], inputs: { triggers: "triggers", triggerText: "triggerText", isDisabled: "isDisabled", eventId: "eventId" }, outputs: { onTriggerSubmit: "onTriggerSubmit", onTriggerChange: "onTriggerChange" }, features: [i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["class", "event-trigger", 3, "formGroup", "ngSubmit", 4, "ngIf"], [1, "event-trigger", 3, "formGroup", "ngSubmit"], [1, "form-group", 2, "width", "350px !important"], ["for", "next-step", 1, "form-label"], ["id", "next-step", "formControlName", "trigger", 1, "form-control", "ccd-dropdown", 3, "ngClass", "compareWith", "change"], ["value", "", "data-default", "", 4, "ngIf"], [3, "ngValue", "title", 4, "ngFor", "ngForOf"], ["type", "submit", 1, "button", 3, "disabled"], ["value", "", "data-default", ""], [3, "ngValue", "title"]], template: function EventTriggerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
32746
|
+
i0.ɵɵtemplate(0, EventTriggerComponent_form_0_Template, 11, 14, "form", 0);
|
|
32739
32747
|
} if (rf & 2) {
|
|
32740
32748
|
i0.ɵɵproperty("ngIf", ctx.triggers && ctx.triggers.length);
|
|
32741
32749
|
} }, dependencies: [i4.NgClass, i4.NgForOf, i4.NgIf, i3.ɵNgNoValidate, i3.NgSelectOption, i3.ɵNgSelectMultipleOption, i3.SelectControlValueAccessor, i3.NgControlStatus, i3.NgControlStatusGroup, i3.FormGroupDirective, i3.FormControlName, i1.RpxTranslatePipe], styles: [".event-trigger[_ngcontent-%COMP%]{width:auto;margin-top:40px;margin-bottom:20px}.event-trigger[_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%]{margin-top:3px;margin-right:10px;margin-bottom:0;float:left;text-align:right;width:325px}.event-trigger[_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] .form-label[_ngcontent-%COMP%]{float:left;margin-top:5px}.event-trigger[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:250px}.event-trigger[_ngcontent-%COMP%] select.EventTrigger-empty[_ngcontent-%COMP%], .event-trigger[_ngcontent-%COMP%] select[_ngcontent-%COMP%] [data-default][_ngcontent-%COMP%]{color:#6f777b}"] });
|
|
32742
32750
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventTriggerComponent, [{
|
|
32743
32751
|
type: Component,
|
|
32744
|
-
args: [{ selector: 'ccd-event-trigger', template: "<form *ngIf=\"triggers && triggers.length\" class=\"event-trigger\" (ngSubmit)=\"triggerSubmit()\" [formGroup]=\"triggerForm\">\n <div class=\"form-group\" style=\"width: 350px !important;\">\n <label class=\"form-label\" for=\"next-step\">{{'Next step' | rpxTranslate}}</label>\n <select class=\"form-control ccd-dropdown\" id=\"next-step\" (change)=\"triggerChange()\" formControlName=\"trigger\" [ngClass]=\"{\n 'EventTrigger-empty': !triggerForm.value['trigger']\n }\">\n <option *ngIf=\"1 !== triggers.length\" value=\"\" data-default>{{'Select action' | rpxTranslate}}</option>\n <option *ngFor=\"let trigger of triggers\" [ngValue]=\"trigger\"
|
|
32752
|
+
args: [{ selector: 'ccd-event-trigger', template: "<form *ngIf=\"triggers && triggers.length\" class=\"event-trigger\" (ngSubmit)=\"triggerSubmit()\" [formGroup]=\"triggerForm\">\n <div class=\"form-group\" style=\"width: 350px !important;\">\n <label class=\"form-label\" for=\"next-step\">{{'Next step' | rpxTranslate}}</label>\n <select class=\"form-control ccd-dropdown\" id=\"next-step\" (change)=\"triggerChange()\" formControlName=\"trigger\" [ngClass]=\"{\n 'EventTrigger-empty': !triggerForm.value['trigger']\n }\" [compareWith]=\"compareFn\">\n <option *ngIf=\"1 !== triggers.length\" value=\"\" data-default>{{'Select action' | rpxTranslate}}</option>\n <option *ngFor=\"let trigger of triggers\" [ngValue]=\"trigger\" [title]=\"trigger.description\">{{trigger.name | rpxTranslate}}</option>\n </select>\n </div>\n <button [disabled]=\"isButtonDisabled()\" type=\"submit\" class=\"button\">{{triggerText | rpxTranslate}}</button>\n</form>\n", styles: [".event-trigger{width:auto;margin-top:40px;margin-bottom:20px}.event-trigger .form-group{margin-top:3px;margin-right:10px;margin-bottom:0;float:left;text-align:right;width:325px}.event-trigger .form-group .form-label{float:left;margin-top:5px}.event-trigger select{width:250px}.event-trigger select.EventTrigger-empty,.event-trigger select [data-default]{color:#6f777b}\n"] }]
|
|
32745
32753
|
}], function () { return [{ type: i3.FormBuilder }, { type: OrderService }]; }, { triggers: [{
|
|
32746
32754
|
type: Input
|
|
32747
32755
|
}], triggerText: [{
|
|
32748
32756
|
type: Input
|
|
32749
32757
|
}], isDisabled: [{
|
|
32750
32758
|
type: Input
|
|
32759
|
+
}], eventId: [{
|
|
32760
|
+
type: Input
|
|
32751
32761
|
}], onTriggerSubmit: [{
|
|
32752
32762
|
type: Output
|
|
32753
32763
|
}], onTriggerChange: [{
|