@hmcts/ccd-case-ui-toolkit 7.1.37 → 7.1.38-doc-upload-clear-message-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.
Files changed (44) hide show
  1. package/esm2022/lib/shared/components/case-editor/case-edit/case-edit.component.mjs +37 -15
  2. package/esm2022/lib/shared/components/case-editor/case-edit-utils/case-edit.utils.mjs +13 -1
  3. package/esm2022/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.mjs +3 -2
  4. package/esm2022/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.mjs +4 -3
  5. package/esm2022/lib/shared/components/case-editor/services/cases.service.mjs +4 -3
  6. package/esm2022/lib/shared/components/case-editor/services/event-completion-state-machine.service.mjs +5 -4
  7. package/esm2022/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.mjs +10 -5
  8. package/esm2022/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.mjs +16 -6
  9. package/esm2022/lib/shared/components/case-viewer/services/event-trigger.resolver.mjs +9 -5
  10. package/esm2022/lib/shared/components/event-start/event-guard/event-start.guard.mjs +36 -48
  11. package/esm2022/lib/shared/components/event-start/services/event-start-state-machine.service.mjs +5 -3
  12. package/esm2022/lib/shared/components/palette/document/write-document-field.component.mjs +27 -35
  13. package/esm2022/lib/shared/components/palette/history/event-log/event-log-table.component.mjs +2 -2
  14. package/esm2022/lib/shared/domain/work-allocation/Task.mjs +1 -1
  15. package/esm2022/lib/shared/services/http/http-error.service.mjs +11 -4
  16. package/esm2022/lib/shared/services/loading/loading.service.mjs +13 -1
  17. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +659 -613
  18. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  19. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts +6 -2
  20. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
  21. package/lib/shared/components/case-editor/case-edit-utils/case-edit.utils.d.ts +2 -0
  22. package/lib/shared/components/case-editor/case-edit-utils/case-edit.utils.d.ts.map +1 -1
  23. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.d.ts.map +1 -1
  24. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts.map +1 -1
  25. package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
  26. package/lib/shared/components/case-editor/services/event-completion-state-machine.service.d.ts.map +1 -1
  27. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts +3 -2
  28. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts.map +1 -1
  29. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts +4 -2
  30. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
  31. package/lib/shared/components/case-viewer/services/event-trigger.resolver.d.ts +3 -1
  32. package/lib/shared/components/case-viewer/services/event-trigger.resolver.d.ts.map +1 -1
  33. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts +2 -3
  34. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts.map +1 -1
  35. package/lib/shared/components/event-start/services/event-start-state-machine.service.d.ts.map +1 -1
  36. package/lib/shared/components/palette/document/write-document-field.component.d.ts.map +1 -1
  37. package/lib/shared/components/palette/history/event-log/event-log-table.component.d.ts.map +1 -1
  38. package/lib/shared/domain/work-allocation/Task.d.ts +1 -0
  39. package/lib/shared/domain/work-allocation/Task.d.ts.map +1 -1
  40. package/lib/shared/services/http/http-error.service.d.ts +3 -1
  41. package/lib/shared/services/http/http-error.service.d.ts.map +1 -1
  42. package/lib/shared/services/loading/loading.service.d.ts +4 -0
  43. package/lib/shared/services/loading/loading.service.d.ts.map +1 -1
  44. package/package.json +1 -1
@@ -8,10 +8,10 @@ import * as i1$1 from '@angular/router';
8
8
  import { RouterModule, NavigationStart, NavigationEnd } from '@angular/router';
9
9
  import * as i4 from '@angular/forms';
10
10
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
11
- import { throwError, Subject, EMPTY, Observable, BehaviorSubject, of, timer, fromEvent, forkJoin, Subscription, combineLatest } from 'rxjs';
11
+ import { BehaviorSubject, throwError, Subject, EMPTY, Observable, of, timer, fromEvent, forkJoin, Subscription, combineLatest } from 'rxjs';
12
12
  import * as i1$2 from '@angular/common/http';
13
13
  import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
14
- import { catchError, map, publish, refCount, switchMap, debounceTime, delay, distinctUntilChanged, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
14
+ import { distinctUntilChanged, catchError, map, publish, refCount, switchMap, debounceTime, delay, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
15
15
  import { polling } from 'rx-polling-hmcts';
16
16
  import { Type, Expose, plainToClassFromExist, plainToClass } from 'class-transformer';
17
17
  import moment from 'moment';
@@ -1400,10 +1400,70 @@ class AuthService {
1400
1400
  args: [DOCUMENT]
1401
1401
  }] }], null); })();
1402
1402
 
1403
+ class LoadingService {
1404
+ registered = new Map();
1405
+ loading = new BehaviorSubject(false);
1406
+ sharedSpinners = [];
1407
+ get isLoading() {
1408
+ return this.loading.pipe(distinctUntilChanged());
1409
+ }
1410
+ register() {
1411
+ const token = this.generateToken();
1412
+ this.registered.set(token, token);
1413
+ this.loading.next(true);
1414
+ return token;
1415
+ }
1416
+ unregister(token) {
1417
+ this.registered.delete(token);
1418
+ this.loading.next(this.registered.size > 0);
1419
+ }
1420
+ addSharedSpinner(spinnerId) {
1421
+ this.sharedSpinners.push(spinnerId);
1422
+ }
1423
+ hasSharedSpinner() {
1424
+ return this.sharedSpinners.length > 0;
1425
+ }
1426
+ unregisterSharedSpinner() {
1427
+ this.registered.delete(this.sharedSpinners[0]);
1428
+ this.sharedSpinners.shift();
1429
+ this.loading.next(this.registered.size > 0);
1430
+ }
1431
+ generateToken() {
1432
+ const timestamp = window.performance.now();
1433
+ return `toolkit-loading-${timestamp}`; // format: [source-library]-[unique incrementing number]
1434
+ }
1435
+ static ɵfac = function LoadingService_Factory(t) { return new (t || LoadingService)(); };
1436
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LoadingService, factory: LoadingService.ɵfac });
1437
+ }
1438
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingService, [{
1439
+ type: Injectable
1440
+ }], null, null); })();
1441
+
1442
+ class LoadingModule {
1443
+ static ɵfac = function LoadingModule_Factory(t) { return new (t || LoadingModule)(); };
1444
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: LoadingModule });
1445
+ static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
1446
+ LoadingService
1447
+ ] });
1448
+ }
1449
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingModule, [{
1450
+ type: NgModule,
1451
+ args: [{
1452
+ imports: [],
1453
+ declarations: [],
1454
+ exports: [],
1455
+ providers: [
1456
+ LoadingService
1457
+ ]
1458
+ }]
1459
+ }], null, null); })();
1460
+
1403
1461
  class HttpErrorService {
1404
1462
  authService;
1405
- constructor(authService) {
1463
+ loadingService;
1464
+ constructor(authService, loadingService) {
1406
1465
  this.authService = authService;
1466
+ this.loadingService = loadingService;
1407
1467
  }
1408
1468
  static CONTENT_TYPE = 'Content-Type';
1409
1469
  static JSON = 'json';
@@ -1447,18 +1507,21 @@ class HttpErrorService {
1447
1507
  handle(error, redirectIfNotAuthorised = true) {
1448
1508
  console.error('Handling error in http error service.');
1449
1509
  console.error(error);
1510
+ if (this.loadingService.hasSharedSpinner()) {
1511
+ this.loadingService.unregisterSharedSpinner();
1512
+ }
1450
1513
  const httpError = HttpErrorService.convertToHttpError(error);
1451
1514
  if (redirectIfNotAuthorised && httpError.status === 401) {
1452
1515
  this.authService.signIn();
1453
1516
  }
1454
1517
  return throwError(httpError);
1455
1518
  }
1456
- static ɵfac = function HttpErrorService_Factory(t) { return new (t || HttpErrorService)(i0.ɵɵinject(AuthService)); };
1519
+ static ɵfac = function HttpErrorService_Factory(t) { return new (t || HttpErrorService)(i0.ɵɵinject(AuthService), i0.ɵɵinject(LoadingService)); };
1457
1520
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: HttpErrorService, factory: HttpErrorService.ɵfac });
1458
1521
  }
1459
1522
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpErrorService, [{
1460
1523
  type: Injectable
1461
- }], () => [{ type: AuthService }], null); })();
1524
+ }], () => [{ type: AuthService }, { type: LoadingService }], null); })();
1462
1525
 
1463
1526
  class HttpService {
1464
1527
  httpclient;
@@ -7319,33 +7382,6 @@ class RequestOptionsBuilder {
7319
7382
  type: Injectable
7320
7383
  }], null, null); })();
7321
7384
 
7322
- class LoadingService {
7323
- registered = new Map();
7324
- loading = new BehaviorSubject(false);
7325
- get isLoading() {
7326
- return this.loading.pipe(distinctUntilChanged());
7327
- }
7328
- register() {
7329
- const token = this.generateToken();
7330
- this.registered.set(token, token);
7331
- this.loading.next(true);
7332
- return token;
7333
- }
7334
- unregister(token) {
7335
- this.registered.delete(token);
7336
- this.loading.next(this.registered.size > 0);
7337
- }
7338
- generateToken() {
7339
- const timestamp = window.performance.now();
7340
- return `toolkit-loading-${timestamp}`; // format: [source-library]-[unique incrementing number]
7341
- }
7342
- static ɵfac = function LoadingService_Factory(t) { return new (t || LoadingService)(); };
7343
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LoadingService, factory: LoadingService.ɵfac });
7344
- }
7345
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingService, [{
7346
- type: Injectable
7347
- }], null, null); })();
7348
-
7349
7385
  class SearchService {
7350
7386
  appConfig;
7351
7387
  httpService;
@@ -7798,25 +7834,6 @@ class BrowserService {
7798
7834
  type: Injectable
7799
7835
  }], null, null); })();
7800
7836
 
7801
- class LoadingModule {
7802
- static ɵfac = function LoadingModule_Factory(t) { return new (t || LoadingModule)(); };
7803
- static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: LoadingModule });
7804
- static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
7805
- LoadingService
7806
- ] });
7807
- }
7808
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingModule, [{
7809
- type: NgModule,
7810
- args: [{
7811
- imports: [],
7812
- declarations: [],
7813
- exports: [],
7814
- providers: [
7815
- LoadingService
7816
- ]
7817
- }]
7818
- }], null, null); })();
7819
-
7820
7837
  class CaseAccessUtils {
7821
7838
  // User role mapping
7822
7839
  static JUDGE_ROLE = 'judge';
@@ -8036,455 +8053,6 @@ class WizardPageFieldToCaseFieldMapper {
8036
8053
  }]
8037
8054
  }], null, null); })();
8038
8055
 
8039
- function convertNonASCIICharacter(character) {
8040
- if (character === '£') {
8041
- // pound sign will be frequently used and works for btoa despite being non-ASCII
8042
- // note: this could be done for other characters provided they work for btoa()
8043
- return character;
8044
- }
8045
- // Note: Will convert to HTML entity
8046
- return CaseEditUtils.PREFIX + character.charCodeAt(0) + CaseEditUtils.SUFFIX;
8047
- }
8048
- class CaseEditUtils {
8049
- static PREFIX = '&#';
8050
- static SUFFIX = ';';
8051
- convertNonASCIICharacters(rawString) {
8052
- return rawString ? rawString.replace(/[^\x20-\x7E]/g, function (c) {
8053
- return convertNonASCIICharacter(c);
8054
- }) : '';
8055
- }
8056
- convertHTMLEntities(editedString) {
8057
- const revertedCharacterList = editedString.split(CaseEditUtils.PREFIX);
8058
- let rawString = revertedCharacterList[0];
8059
- for (let index = 1; index < revertedCharacterList.length; index++) {
8060
- const currentSection = revertedCharacterList[index];
8061
- if (!currentSection.includes(CaseEditUtils.SUFFIX)) {
8062
- return rawString.concat(currentSection);
8063
- }
8064
- else {
8065
- const suffixSplitList = currentSection.split(CaseEditUtils.SUFFIX);
8066
- const characterCode = Number(suffixSplitList[0]);
8067
- rawString = rawString.concat(String.fromCharCode(characterCode), suffixSplitList[1]);
8068
- }
8069
- }
8070
- return rawString;
8071
- }
8072
- }
8073
-
8074
- class CasesService {
8075
- http;
8076
- appConfig;
8077
- orderService;
8078
- errorService;
8079
- wizardPageFieldToCaseFieldMapper;
8080
- loadingService;
8081
- sessionStorageService;
8082
- retryUtil;
8083
- // Internal (UI) API
8084
- static V2_MEDIATYPE_CASE_VIEW = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-case-view.v2+json';
8085
- static V2_MEDIATYPE_START_CASE_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-case-trigger.v2+json;charset=UTF-8';
8086
- static V2_MEDIATYPE_START_EVENT_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-event-trigger.v2+json;charset=UTF-8';
8087
- static V2_MEDIATYPE_START_DRAFT_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-draft-trigger.v2+json;charset=UTF-8';
8088
- // External (Data Store) API
8089
- static V2_MEDIATYPE_CASE_DOCUMENTS = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.case-documents.v2+json;charset=UTF-8';
8090
- static V2_MEDIATYPE_CASE_DATA_VALIDATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.case-data-validate.v2+json;charset=UTF-8';
8091
- static V2_MEDIATYPE_CREATE_EVENT = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-event.v2+json;charset=UTF-8';
8092
- static V2_MEDIATYPE_CREATE_CASE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-case.v2+json;charset=UTF-8';
8093
- static PUI_CASE_MANAGER = 'pui-case-manager';
8094
- get = this.getCaseView;
8095
- static updateChallengedAccessRequestAttributes(httpClient, caseId, attributesToUpdate) {
8096
- return httpClient.post(`/api/challenged-access-request/update-attributes`, {
8097
- caseId,
8098
- attributesToUpdate
8099
- });
8100
- }
8101
- static updateSpecificAccessRequestAttributes(httpClient, caseId, attributesToUpdate) {
8102
- return httpClient.post(`/api/specific-access-request/update-attributes`, {
8103
- caseId,
8104
- attributesToUpdate
8105
- });
8106
- }
8107
- constructor(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, loadingService, sessionStorageService, retryUtil) {
8108
- this.http = http;
8109
- this.appConfig = appConfig;
8110
- this.orderService = orderService;
8111
- this.errorService = errorService;
8112
- this.wizardPageFieldToCaseFieldMapper = wizardPageFieldToCaseFieldMapper;
8113
- this.loadingService = loadingService;
8114
- this.sessionStorageService = sessionStorageService;
8115
- this.retryUtil = retryUtil;
8116
- }
8117
- getCaseView(jurisdictionId, caseTypeId, caseId) {
8118
- const url = `${this.appConfig.getApiUrl()}/caseworkers/:uid/jurisdictions/${jurisdictionId}/case-types/${caseTypeId}/cases/${caseId}`;
8119
- const loadingToken = this.loadingService.register();
8120
- return this.http
8121
- .get(url)
8122
- .pipe(catchError(error => {
8123
- this.errorService.setError(error);
8124
- return throwError(error);
8125
- }), finalize(() => this.loadingService.unregister(loadingToken)));
8126
- }
8127
- getCaseViewV2(caseId) {
8128
- const url = `${this.appConfig.getCaseDataUrl()}/internal/cases/${caseId}`;
8129
- const headers = new HttpHeaders()
8130
- .set('experimental', 'true')
8131
- .set('Accept', CasesService.V2_MEDIATYPE_CASE_VIEW)
8132
- .set('Content-Type', 'application/json');
8133
- const loadingToken = this.loadingService.register();
8134
- let http$ = this.http.get(url, { headers, observe: 'body' });
8135
- const artificialDelay = this.appConfig.getTimeoutsCaseRetrievalArtificialDelay();
8136
- const timeoutPeriods = this.appConfig.getTimeoutsForCaseRetrieval();
8137
- console.log(`Timeout periods: ${timeoutPeriods} seconds.`);
8138
- if (timeoutPeriods && timeoutPeriods.length > 0 && timeoutPeriods[0] > 0) {
8139
- http$ = this.retryUtil.pipeTimeoutMechanismOn(http$, artificialDelay, timeoutPeriods);
8140
- }
8141
- else {
8142
- console.warn('Skipping to pipe a retry mechanism!');
8143
- }
8144
- http$ = this.pipeErrorProcessor(http$);
8145
- http$ = http$.pipe(finalize(() => this.finalizeGetCaseViewWith(caseId, loadingToken)));
8146
- return http$;
8147
- }
8148
- pipeErrorProcessor(in$) {
8149
- const out$ = in$.pipe(catchError(error => {
8150
- console.error(`Error while getting case view with getCaseViewV2! Error type: '${typeof error}, Error name: '${error?.name}'`);
8151
- console.error(error);
8152
- this.errorService.setError(error);
8153
- return throwError(error);
8154
- }));
8155
- return out$;
8156
- }
8157
- finalizeGetCaseViewWith(caseId, loadingToken) {
8158
- this.loadingService.unregister(loadingToken);
8159
- }
8160
- syncWait(seconds) {
8161
- const end = Date.now() + seconds * 1000;
8162
- while (Date.now() < end)
8163
- continue;
8164
- }
8165
- getEventTrigger(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
8166
- ignoreWarning = undefined !== ignoreWarning ? ignoreWarning : 'false';
8167
- const url = this.buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning);
8168
- let headers = new HttpHeaders();
8169
- headers = headers.set('experimental', 'true');
8170
- headers = headers.set('Content-Type', 'application/json');
8171
- headers = this.addClientContextHeader(headers);
8172
- if (Draft.isDraft(caseId)) {
8173
- headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_DRAFT_TRIGGER);
8174
- }
8175
- else if (caseId !== undefined && caseId !== null) {
8176
- headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_EVENT_TRIGGER);
8177
- }
8178
- else {
8179
- headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_CASE_TRIGGER);
8180
- }
8181
- return this.http
8182
- .get(url, { headers, observe: 'response' })
8183
- .pipe(map((response) => {
8184
- this.updateClientContextStorage(response.headers);
8185
- return FieldsUtils.handleNestedDynamicLists(response.body);
8186
- }), catchError(error => {
8187
- this.errorService.setError(error);
8188
- return throwError(error);
8189
- }), map((p) => plainToClass(CaseEventTrigger, p)), tap(eventTrigger => this.initialiseEventTrigger(eventTrigger)));
8190
- }
8191
- createEvent(caseDetails, eventData) {
8192
- const caseId = caseDetails.case_id;
8193
- const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/events`;
8194
- let headers = new HttpHeaders()
8195
- .set('experimental', 'true')
8196
- .set('Accept', CasesService.V2_MEDIATYPE_CREATE_EVENT)
8197
- .set('Content-Type', 'application/json');
8198
- headers = this.addClientContextHeader(headers);
8199
- return this.http
8200
- .post(url, eventData, { headers, observe: 'response' })
8201
- .pipe(map((response) => {
8202
- this.updateClientContextStorage(response.headers);
8203
- return response.body;
8204
- }), catchError(error => {
8205
- this.errorService.setError(error);
8206
- return throwError(error);
8207
- }));
8208
- }
8209
- validateCase(ctid, eventData, pageId) {
8210
- const pageIdString = pageId ? `?pageId=${pageId}` : '';
8211
- const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/validate${pageIdString}`;
8212
- let headers = new HttpHeaders()
8213
- .set('experimental', 'true')
8214
- .set('Accept', CasesService.V2_MEDIATYPE_CASE_DATA_VALIDATE)
8215
- .set('Content-Type', 'application/json');
8216
- headers = this.addClientContextHeader(headers);
8217
- return this.http
8218
- .post(url, eventData, { headers, observe: 'response' })
8219
- .pipe(map((response) => {
8220
- this.updateClientContextStorage(response.headers);
8221
- return response.body;
8222
- }), catchError(error => {
8223
- this.errorService.setError(error);
8224
- return throwError(error);
8225
- }));
8226
- }
8227
- createCase(ctid, eventData) {
8228
- let ignoreWarning = 'false';
8229
- if (eventData.ignore_warning) {
8230
- ignoreWarning = 'true';
8231
- }
8232
- const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/cases?ignore-warning=${ignoreWarning}`;
8233
- let headers = new HttpHeaders()
8234
- .set('experimental', 'true')
8235
- .set('Accept', CasesService.V2_MEDIATYPE_CREATE_CASE)
8236
- .set('Content-Type', 'application/json');
8237
- headers = this.addClientContextHeader(headers);
8238
- return this.http
8239
- .post(url, eventData, { headers, observe: 'response' })
8240
- .pipe(map((response) => {
8241
- this.updateClientContextStorage(response.headers);
8242
- return response.body;
8243
- }), catchError(error => {
8244
- this.errorService.setError(error);
8245
- return throwError(error);
8246
- }));
8247
- }
8248
- getPrintDocuments(caseId) {
8249
- const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/documents`;
8250
- let headers = new HttpHeaders()
8251
- .set('experimental', 'true')
8252
- .set('Accept', CasesService.V2_MEDIATYPE_CASE_DOCUMENTS)
8253
- .set('Content-Type', 'application/json');
8254
- headers = this.addClientContextHeader(headers);
8255
- return this.http
8256
- .get(url, { headers, observe: 'response' })
8257
- .pipe(map((response) => {
8258
- this.updateClientContextStorage(response.headers);
8259
- return response.body.documentResources;
8260
- }), catchError(error => {
8261
- this.errorService.setError(error);
8262
- return throwError(error);
8263
- }));
8264
- }
8265
- buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
8266
- let url = `${this.appConfig.getCaseDataUrl()}/internal`;
8267
- if (Draft.isDraft(caseId)) {
8268
- url += `/drafts/${caseId}`
8269
- + `/event-trigger`
8270
- + `?ignore-warning=${ignoreWarning}`;
8271
- }
8272
- else if (caseTypeId === undefined || caseTypeId === null) {
8273
- url += `/cases/${caseId}`
8274
- + `/event-triggers/${eventTriggerId}`
8275
- + `?ignore-warning=${ignoreWarning}`;
8276
- }
8277
- else {
8278
- url += `/case-types/${caseTypeId}`
8279
- + `/event-triggers/${eventTriggerId}`
8280
- + `?ignore-warning=${ignoreWarning}`;
8281
- }
8282
- return url;
8283
- }
8284
- initialiseEventTrigger(eventTrigger) {
8285
- if (!eventTrigger.wizard_pages) {
8286
- eventTrigger.wizard_pages = [];
8287
- }
8288
- eventTrigger.wizard_pages.forEach((wizardPage) => {
8289
- wizardPage.parsedShowCondition = ShowCondition.getInstance(wizardPage.show_condition);
8290
- wizardPage.case_fields = this.orderService.sort(this.wizardPageFieldToCaseFieldMapper.mapAll(wizardPage.wizard_page_fields, eventTrigger.case_fields));
8291
- });
8292
- }
8293
- getCourtOrHearingCentreName(locationId) {
8294
- return this.http.post(`/api/locations/getLocationsById`, { locations: [{ locationId }] });
8295
- }
8296
- createChallengedAccessRequest(caseId, request) {
8297
- // Assignment API endpoint
8298
- const userInfoStr = this.sessionStorageService.getItem('userDetails');
8299
- const camUtils = new CaseAccessUtils();
8300
- let userInfo;
8301
- if (userInfoStr) {
8302
- userInfo = JSON.parse(userInfoStr);
8303
- }
8304
- const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
8305
- const roleName = camUtils.getAMRoleName('challenged', roleCategory);
8306
- const beginTime = new Date();
8307
- const endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
8308
- const id = userInfo.id ? userInfo.id : userInfo.uid;
8309
- const isNew = true;
8310
- const payload = camUtils.getAMPayload(id, id, roleName, roleCategory, 'CHALLENGED', caseId, request, beginTime, endTime, isNew);
8311
- return this.http.post(`/api/challenged-access-request`, payload);
8312
- }
8313
- createSpecificAccessRequest(caseId, sar) {
8314
- // Assignment API endpoint
8315
- const userInfoStr = this.sessionStorageService.getItem('userDetails');
8316
- const camUtils = new CaseAccessUtils();
8317
- let userInfo;
8318
- if (userInfoStr) {
8319
- userInfo = JSON.parse(userInfoStr);
8320
- }
8321
- const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
8322
- const roleName = camUtils.getAMRoleName('specific', roleCategory);
8323
- const id = userInfo.id ? userInfo.id : userInfo.uid;
8324
- const payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);
8325
- payload.roleRequest = {
8326
- ...payload.roleRequest,
8327
- process: 'specific-access',
8328
- replaceExisting: true,
8329
- assignerId: payload.requestedRoles[0].actorId,
8330
- reference: `${caseId}/${roleName}/${payload.requestedRoles[0].actorId}`
8331
- };
8332
- payload.requestedRoles[0] = {
8333
- ...payload.requestedRoles[0],
8334
- roleName: 'specific-access-requested',
8335
- roleCategory,
8336
- classification: 'PRIVATE',
8337
- endTime: new Date(new Date().setDate(new Date().getDate() + 30)),
8338
- beginTime: null,
8339
- grantType: 'BASIC',
8340
- readOnly: true
8341
- };
8342
- payload.requestedRoles[0].attributes = {
8343
- ...payload.requestedRoles[0].attributes,
8344
- requestedRole: roleName,
8345
- specificAccessReason: sar.specificReason
8346
- };
8347
- payload.requestedRoles[0].notes[0] = {
8348
- ...payload.requestedRoles[0].notes[0],
8349
- userId: payload.requestedRoles[0].actorId
8350
- };
8351
- return this.http.post(`/api/specific-access-request`, payload);
8352
- }
8353
- getLinkedCases(caseId) {
8354
- const url = `${this.appConfig.getCaseDataStoreApiUrl()}/${caseId}`;
8355
- return this.http
8356
- .get(url)
8357
- .pipe(catchError(error => throwError(error)));
8358
- }
8359
- addClientContextHeader(headers) {
8360
- const clientContextDetails = this.sessionStorageService.getItem('clientContext');
8361
- if (clientContextDetails) {
8362
- const caseEditUtils = new CaseEditUtils();
8363
- // below changes non-ASCII characters
8364
- const editedClientContext = caseEditUtils.convertNonASCIICharacters(clientContextDetails);
8365
- const clientContext = window.btoa(editedClientContext);
8366
- if (clientContext) {
8367
- headers = headers.set('Client-Context', clientContext);
8368
- }
8369
- }
8370
- return headers;
8371
- }
8372
- updateClientContextStorage(headers) {
8373
- if (headers && headers.get('Client-Context')) {
8374
- const caseEditUtils = new CaseEditUtils();
8375
- const clientContextString = window.atob(headers.get('Client-Context'));
8376
- // below reverts non-ASCII characters
8377
- const editedClientContextString = caseEditUtils.convertHTMLEntities(clientContextString);
8378
- this.sessionStorageService.setItem('clientContext', editedClientContextString);
8379
- }
8380
- }
8381
- static ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(OrderService), i0.ɵɵinject(HttpErrorService), i0.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0.ɵɵinject(LoadingService), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(RetryUtil)); };
8382
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
8383
- }
8384
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CasesService, [{
8385
- type: Injectable
8386
- }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: LoadingService }, { type: SessionStorageService }, { type: RetryUtil }], null); })();
8387
-
8388
- class EventTriggerService {
8389
- eventTriggerSource = new Subject();
8390
- announceEventTrigger(eventTrigger) {
8391
- this.eventTriggerSource.next(eventTrigger);
8392
- }
8393
- static ɵfac = function EventTriggerService_Factory(t) { return new (t || EventTriggerService)(); };
8394
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventTriggerService, factory: EventTriggerService.ɵfac, providedIn: 'root' });
8395
- }
8396
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventTriggerService, [{
8397
- type: Injectable,
8398
- args: [{
8399
- providedIn: 'root',
8400
- }]
8401
- }], null, null); })();
8402
-
8403
- function CaseCreateComponent_div_0_Template(rf, ctx) { if (rf & 1) {
8404
- const _r1 = i0.ɵɵgetCurrentView();
8405
- i0.ɵɵelementStart(0, "div")(1, "ccd-case-edit", 1);
8406
- i0.ɵɵlistener("cancelled", function CaseCreateComponent_div_0_Template_ccd_case_edit_cancelled_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.emitCancelled($event)); })("submitted", function CaseCreateComponent_div_0_Template_ccd_case_edit_submitted_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.emitSubmitted($event)); });
8407
- i0.ɵɵelementEnd()();
8408
- } if (rf & 2) {
8409
- const ctx_r1 = i0.ɵɵnextContext();
8410
- i0.ɵɵadvance();
8411
- i0.ɵɵproperty("submit", ctx_r1.submit())("validate", ctx_r1.validate())("saveDraft", ctx_r1.saveDraft())("eventTrigger", ctx_r1.eventTrigger);
8412
- } }
8413
- class CaseCreateComponent {
8414
- casesService;
8415
- alertService;
8416
- draftService;
8417
- eventTriggerService;
8418
- jurisdiction;
8419
- caseType;
8420
- event;
8421
- cancelled = new EventEmitter();
8422
- submitted = new EventEmitter();
8423
- eventTrigger;
8424
- constructor(casesService, alertService, draftService, eventTriggerService) {
8425
- this.casesService = casesService;
8426
- this.alertService = alertService;
8427
- this.draftService = draftService;
8428
- this.eventTriggerService = eventTriggerService;
8429
- }
8430
- ngOnInit() {
8431
- this.casesService.getEventTrigger(this.caseType, this.event).toPromise()
8432
- .then(eventTrigger => {
8433
- this.eventTrigger = eventTrigger;
8434
- this.eventTriggerService.announceEventTrigger(eventTrigger);
8435
- })
8436
- .catch((error) => {
8437
- this.alertService.error({ phrase: error.message });
8438
- return throwError(error);
8439
- });
8440
- }
8441
- submit() {
8442
- return (sanitizedEditForm) => {
8443
- sanitizedEditForm.draft_id = this.eventTrigger.case_id;
8444
- return this.casesService.createCase(this.caseType, sanitizedEditForm);
8445
- };
8446
- }
8447
- validate() {
8448
- return (sanitizedEditForm, pageId) => this.casesService
8449
- .validateCase(this.caseType, sanitizedEditForm, pageId);
8450
- }
8451
- saveDraft() {
8452
- if (this.eventTrigger.can_save_draft) {
8453
- return (caseEventData) => this.draftService.createOrUpdateDraft(this.caseType, this.eventTrigger.case_id, caseEventData);
8454
- }
8455
- }
8456
- emitCancelled(event) {
8457
- this.cancelled.emit(event);
8458
- }
8459
- emitSubmitted(event) {
8460
- this.submitted.emit(event);
8461
- }
8462
- isDataLoaded() {
8463
- return this.eventTrigger ? true : false;
8464
- }
8465
- static ɵfac = function CaseCreateComponent_Factory(t) { return new (t || CaseCreateComponent)(i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(EventTriggerService)); };
8466
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseCreateComponent, selectors: [["ccd-case-create"]], inputs: { jurisdiction: "jurisdiction", caseType: "caseType", event: "event" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [3, "cancelled", "submitted", "submit", "validate", "saveDraft", "eventTrigger"]], template: function CaseCreateComponent_Template(rf, ctx) { if (rf & 1) {
8467
- i0.ɵɵtemplate(0, CaseCreateComponent_div_0_Template, 2, 4, "div", 0);
8468
- } if (rf & 2) {
8469
- i0.ɵɵproperty("ngIf", ctx.isDataLoaded());
8470
- } }, encapsulation: 2 });
8471
- }
8472
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseCreateComponent, [{
8473
- type: Component,
8474
- args: [{ selector: 'ccd-case-create', template: "<div *ngIf=\"isDataLoaded()\">\n <ccd-case-edit [submit]=\"submit()\"\n [validate]=\"validate()\"\n [saveDraft]=\"saveDraft()\"\n [eventTrigger]=\"eventTrigger\"\n (cancelled)=\"emitCancelled($event)\"\n (submitted)=\"emitSubmitted($event)\"></ccd-case-edit>\n</div>" }]
8475
- }], () => [{ type: CasesService }, { type: AlertService }, { type: DraftService }, { type: EventTriggerService }], { jurisdiction: [{
8476
- type: Input
8477
- }], caseType: [{
8478
- type: Input
8479
- }], event: [{
8480
- type: Input
8481
- }], cancelled: [{
8482
- type: Output
8483
- }], submitted: [{
8484
- type: Output
8485
- }] }); })();
8486
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseCreateComponent, { className: "CaseCreateComponent", filePath: "lib/shared/components/case-editor/case-create/case-create.component.ts", lineNumber: 17 }); })();
8487
-
8488
8056
  class Confirmation {
8489
8057
  caseId;
8490
8058
  status;
@@ -8622,6 +8190,21 @@ class ConvertHrefToRouterService {
8622
8190
  type: Injectable
8623
8191
  }], () => [{ type: i1$1.Router }], null); })();
8624
8192
 
8193
+ class EventTriggerService {
8194
+ eventTriggerSource = new Subject();
8195
+ announceEventTrigger(eventTrigger) {
8196
+ this.eventTriggerSource.next(eventTrigger);
8197
+ }
8198
+ static ɵfac = function EventTriggerService_Factory(t) { return new (t || EventTriggerService)(); };
8199
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventTriggerService, factory: EventTriggerService.ɵfac, providedIn: 'root' });
8200
+ }
8201
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventTriggerService, [{
8202
+ type: Injectable,
8203
+ args: [{
8204
+ providedIn: 'root',
8205
+ }]
8206
+ }], null, null); })();
8207
+
8625
8208
  class WizardFactoryService {
8626
8209
  create(eventTrigger) {
8627
8210
  return new Wizard(eventTrigger.wizard_pages);
@@ -8904,7 +8487,7 @@ class EventCompletionStateMachineService {
8904
8487
  entryActionForStateCompleteEventAndTask(state, context) {
8905
8488
  // Trigger final state to complete processing of state machine
8906
8489
  state.trigger(EventCompletionStates.Final);
8907
- const clientContextStr = context.sessionStorageService.getItem('clientContext');
8490
+ const clientContextStr = context.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
8908
8491
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8909
8492
  if (userTask?.task_data) {
8910
8493
  context.sessionStorageService.setItem('assignNeeded', 'false');
@@ -8927,7 +8510,7 @@ class EventCompletionStateMachineService {
8927
8510
  entryActionForStateTaskUnassigned(state, context) {
8928
8511
  // Trigger final state to complete processing of state machine
8929
8512
  state.trigger(EventCompletionStates.Final);
8930
- const clientContextStr = context.sessionStorageService.getItem('clientContext');
8513
+ const clientContextStr = context.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
8931
8514
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8932
8515
  if (userTask?.task_data) {
8933
8516
  context.sessionStorageService.setItem('assignNeeded', 'true');
@@ -8967,7 +8550,7 @@ class EventCompletionStateMachineService {
8967
8550
  this.stateTaskUnassigned.addTransition(EventCompletionStates.Final, this.stateFinal);
8968
8551
  }
8969
8552
  taskPresentInSessionStorage(context) {
8970
- const clientContextStr = context.sessionStorageService.getItem('clientContext');
8553
+ const clientContextStr = context.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
8971
8554
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8972
8555
  return !!userTask.task_data;
8973
8556
  }
@@ -9334,8 +8917,11 @@ class CaseEditComponent {
9334
8917
  workAllocationService;
9335
8918
  alertService;
9336
8919
  abstractConfig;
8920
+ cookieService;
9337
8921
  static ORIGIN_QUERY_PARAM = 'origin';
9338
8922
  static ALERT_MESSAGE = 'Page is being refreshed so you will be redirected to the first page of this event.';
8923
+ static CLIENT_CONTEXT = 'clientContext';
8924
+ static TASK_EVENT_COMPLETION_INFO = 'taskEventCompletionInfo';
9339
8925
  eventTrigger;
9340
8926
  submit;
9341
8927
  validate;
@@ -9359,7 +8945,7 @@ class CaseEditComponent {
9359
8945
  error;
9360
8946
  callbackErrorsSubject = new Subject();
9361
8947
  validPageList = [];
9362
- constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService, abstractConfig) {
8948
+ constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService, abstractConfig, cookieService) {
9363
8949
  this.fb = fb;
9364
8950
  this.caseNotifier = caseNotifier;
9365
8951
  this.router = router;
@@ -9377,6 +8963,7 @@ class CaseEditComponent {
9377
8963
  this.workAllocationService = workAllocationService;
9378
8964
  this.alertService = alertService;
9379
8965
  this.abstractConfig = abstractConfig;
8966
+ this.cookieService = cookieService;
9380
8967
  }
9381
8968
  ngOnInit() {
9382
8969
  this.wizard = this.wizardFactory.create(this.eventTrigger);
@@ -9483,12 +9070,12 @@ class CaseEditComponent {
9483
9070
  this.isSubmitting = true;
9484
9071
  // We have to run the event completion checks if task in session storage
9485
9072
  // and if the task is in session storage, then is it associated to the case
9486
- const clientContextStr = this.sessionStorageService.getItem('clientContext');
9073
+ const clientContextStr = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
9487
9074
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9488
9075
  const taskInSessionStorage = userTask ? userTask.task_data : null;
9489
9076
  let taskEventCompletionInfo;
9490
9077
  let userInfo;
9491
- const taskEventCompletionStr = this.sessionStorageService.getItem('taskEventCompletionInfo');
9078
+ const taskEventCompletionStr = this.sessionStorageService.getItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO);
9492
9079
  const userInfoStr = this.sessionStorageService.getItem('userDetails');
9493
9080
  const assignNeeded = this.sessionStorageService.getItem('assignNeeded');
9494
9081
  if (taskEventCompletionStr) {
@@ -9518,7 +9105,7 @@ class CaseEditComponent {
9518
9105
  taskId: taskInSessionStorage.id,
9519
9106
  createdTimestamp: Date.now()
9520
9107
  };
9521
- this.sessionStorageService.setItem('taskEventCompletionInfo', JSON.stringify(taskEventCompletionInfo));
9108
+ this.sessionStorageService.setItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO, JSON.stringify(taskEventCompletionInfo));
9522
9109
  this.isEventCompletionChecksRequired = true;
9523
9110
  }
9524
9111
  else {
@@ -9690,8 +9277,9 @@ class CaseEditComponent {
9690
9277
  }), finalize(() => {
9691
9278
  this.loadingService.unregister(loadingSpinnerToken);
9692
9279
  // on event completion ensure the previous event clientContext/taskEventCompletionInfo removed
9693
- this.sessionStorageService.removeItem('clientContext');
9694
- this.sessionStorageService.removeItem('taskEventCompletionInfo');
9280
+ // Note - Not removeTaskFromClientContext because could interfere with other logic
9281
+ this.sessionStorageService.removeItem(CaseEditComponent.CLIENT_CONTEXT);
9282
+ this.sessionStorageService.removeItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO);
9695
9283
  this.isSubmitting = false;
9696
9284
  }))
9697
9285
  .subscribe(() => {
@@ -9719,7 +9307,7 @@ class CaseEditComponent {
9719
9307
  });
9720
9308
  }
9721
9309
  postCompleteTaskIfRequired() {
9722
- const clientContextStr = this.sessionStorageService.getItem('clientContext');
9310
+ const clientContextStr = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
9723
9311
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9724
9312
  const [task, taskToBeCompleted] = userTask ? [userTask.task_data, userTask.complete_task] : [null, false];
9725
9313
  const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
@@ -9759,7 +9347,15 @@ class CaseEditComponent {
9759
9347
  }
9760
9348
  if (!taskEventCompletionInfo) {
9761
9349
  // if no task event present then there is no task to complete from previous event present
9762
- return true;
9350
+ // EXUI-2668 - Add additional logic to confirm the task is relevant to the event
9351
+ if (this.taskIsForEvent(taskInSessionStorage, eventDetails)) {
9352
+ return true;
9353
+ }
9354
+ else {
9355
+ // client context still needed for language
9356
+ removeTaskFromClientContext(this.sessionStorageService);
9357
+ return false;
9358
+ }
9763
9359
  }
9764
9360
  else {
9765
9361
  if (taskEventCompletionInfo.taskId !== taskInSessionStorage.id) {
@@ -9769,8 +9365,8 @@ class CaseEditComponent {
9769
9365
  this.eventDetailsDoNotMatch(taskEventCompletionInfo, eventDetails))
9770
9366
  || this.eventMoreThanDayAgo(taskEventCompletionInfo.createdTimestamp)) {
9771
9367
  // if the session storage not related to event, ignore it and remove
9772
- this.sessionStorageService.removeItem('clientContext');
9773
- this.sessionStorageService.removeItem('taskEventCompletionInfo');
9368
+ removeTaskFromClientContext(this.sessionStorageService);
9369
+ this.sessionStorageService.removeItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO);
9774
9370
  return false;
9775
9371
  }
9776
9372
  if (eventDetails.assignNeeded === 'false' && eventDetails.userId !== taskInSessionStorage.assignee) {
@@ -9812,7 +9408,15 @@ class CaseEditComponent {
9812
9408
  }
9813
9409
  return false;
9814
9410
  }
9815
- 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), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
9411
+ taskIsForEvent(task, eventDetails) {
9412
+ // EXUI-2668 - Ensure description for task includes event ID
9413
+ // Note - This is a failsafe for an edge case that may never occur again
9414
+ // Description may not include eventId in some cases which may mean task not completed (however this will be easy to check)
9415
+ // In instances of the above taskEventCompletionInfo will be created to block this check from occurring
9416
+ this.abstractConfig.logMessage(`checking taskIsForEvent: task ID ${task.id}, task description ${task.description}, event name ${eventDetails.eventId}`);
9417
+ return task.case_id === eventDetails.caseId && (task.description?.includes(eventDetails.eventId));
9418
+ }
9419
+ 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), i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(ReadCookieService)); };
9816
9420
  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) {
9817
9421
  i0.ɵɵelement(0, "router-outlet");
9818
9422
  } }, dependencies: [i1$1.RouterOutlet], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
@@ -9820,7 +9424,7 @@ class CaseEditComponent {
9820
9424
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditComponent, [{
9821
9425
  type: Component,
9822
9426
  args: [{ selector: 'ccd-case-edit', providers: [GreyBarService], template: "<router-outlet></router-outlet>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
9823
- }], () => [{ type: i4.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }, { type: AbstractAppConfig }], { eventTrigger: [{
9427
+ }], () => [{ type: i4.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }, { type: AbstractAppConfig }, { type: ReadCookieService }], { eventTrigger: [{
9824
9428
  type: Input
9825
9429
  }], submit: [{
9826
9430
  type: Input
@@ -9835,7 +9439,452 @@ class CaseEditComponent {
9835
9439
  }], submitted: [{
9836
9440
  type: Output
9837
9441
  }] }); })();
9838
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 35 }); })();
9442
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 37 }); })();
9443
+
9444
+ function convertNonASCIICharacter(character) {
9445
+ if (character === '£') {
9446
+ // pound sign will be frequently used and works for btoa despite being non-ASCII
9447
+ // note: this could be done for other characters provided they work for btoa()
9448
+ return character;
9449
+ }
9450
+ // Note: Will convert to HTML entity
9451
+ return CaseEditUtils.PREFIX + character.charCodeAt(0) + CaseEditUtils.SUFFIX;
9452
+ }
9453
+ class CaseEditUtils {
9454
+ static PREFIX = '&#';
9455
+ static SUFFIX = ';';
9456
+ convertNonASCIICharacters(rawString) {
9457
+ return rawString ? rawString.replace(/[^\x20-\x7E]/g, function (c) {
9458
+ return convertNonASCIICharacter(c);
9459
+ }) : '';
9460
+ }
9461
+ convertHTMLEntities(editedString) {
9462
+ const revertedCharacterList = editedString.split(CaseEditUtils.PREFIX);
9463
+ let rawString = revertedCharacterList[0];
9464
+ for (let index = 1; index < revertedCharacterList.length; index++) {
9465
+ const currentSection = revertedCharacterList[index];
9466
+ if (!currentSection.includes(CaseEditUtils.SUFFIX)) {
9467
+ return rawString.concat(currentSection);
9468
+ }
9469
+ else {
9470
+ const suffixSplitList = currentSection.split(CaseEditUtils.SUFFIX);
9471
+ const characterCode = Number(suffixSplitList[0]);
9472
+ rawString = rawString.concat(String.fromCharCode(characterCode), suffixSplitList[1]);
9473
+ }
9474
+ }
9475
+ return rawString;
9476
+ }
9477
+ }
9478
+ function removeTaskFromClientContext(sessionStorageService) {
9479
+ if (!sessionStorageService) {
9480
+ return;
9481
+ }
9482
+ const clientContextString = sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
9483
+ const clientContext = clientContextString ? JSON.parse(clientContextString) : null;
9484
+ if (clientContext?.client_context?.user_task) {
9485
+ delete clientContext.client_context.user_task;
9486
+ sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(clientContext));
9487
+ }
9488
+ }
9489
+
9490
+ class CasesService {
9491
+ http;
9492
+ appConfig;
9493
+ orderService;
9494
+ errorService;
9495
+ wizardPageFieldToCaseFieldMapper;
9496
+ loadingService;
9497
+ sessionStorageService;
9498
+ retryUtil;
9499
+ // Internal (UI) API
9500
+ static V2_MEDIATYPE_CASE_VIEW = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-case-view.v2+json';
9501
+ static V2_MEDIATYPE_START_CASE_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-case-trigger.v2+json;charset=UTF-8';
9502
+ static V2_MEDIATYPE_START_EVENT_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-event-trigger.v2+json;charset=UTF-8';
9503
+ static V2_MEDIATYPE_START_DRAFT_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-draft-trigger.v2+json;charset=UTF-8';
9504
+ // External (Data Store) API
9505
+ static V2_MEDIATYPE_CASE_DOCUMENTS = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.case-documents.v2+json;charset=UTF-8';
9506
+ static V2_MEDIATYPE_CASE_DATA_VALIDATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.case-data-validate.v2+json;charset=UTF-8';
9507
+ static V2_MEDIATYPE_CREATE_EVENT = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-event.v2+json;charset=UTF-8';
9508
+ static V2_MEDIATYPE_CREATE_CASE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-case.v2+json;charset=UTF-8';
9509
+ static PUI_CASE_MANAGER = 'pui-case-manager';
9510
+ get = this.getCaseView;
9511
+ static updateChallengedAccessRequestAttributes(httpClient, caseId, attributesToUpdate) {
9512
+ return httpClient.post(`/api/challenged-access-request/update-attributes`, {
9513
+ caseId,
9514
+ attributesToUpdate
9515
+ });
9516
+ }
9517
+ static updateSpecificAccessRequestAttributes(httpClient, caseId, attributesToUpdate) {
9518
+ return httpClient.post(`/api/specific-access-request/update-attributes`, {
9519
+ caseId,
9520
+ attributesToUpdate
9521
+ });
9522
+ }
9523
+ constructor(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, loadingService, sessionStorageService, retryUtil) {
9524
+ this.http = http;
9525
+ this.appConfig = appConfig;
9526
+ this.orderService = orderService;
9527
+ this.errorService = errorService;
9528
+ this.wizardPageFieldToCaseFieldMapper = wizardPageFieldToCaseFieldMapper;
9529
+ this.loadingService = loadingService;
9530
+ this.sessionStorageService = sessionStorageService;
9531
+ this.retryUtil = retryUtil;
9532
+ }
9533
+ getCaseView(jurisdictionId, caseTypeId, caseId) {
9534
+ const url = `${this.appConfig.getApiUrl()}/caseworkers/:uid/jurisdictions/${jurisdictionId}/case-types/${caseTypeId}/cases/${caseId}`;
9535
+ const loadingToken = this.loadingService.register();
9536
+ return this.http
9537
+ .get(url)
9538
+ .pipe(catchError(error => {
9539
+ this.errorService.setError(error);
9540
+ return throwError(error);
9541
+ }), finalize(() => this.loadingService.unregister(loadingToken)));
9542
+ }
9543
+ getCaseViewV2(caseId) {
9544
+ const url = `${this.appConfig.getCaseDataUrl()}/internal/cases/${caseId}`;
9545
+ const headers = new HttpHeaders()
9546
+ .set('experimental', 'true')
9547
+ .set('Accept', CasesService.V2_MEDIATYPE_CASE_VIEW)
9548
+ .set('Content-Type', 'application/json');
9549
+ const loadingToken = this.loadingService.register();
9550
+ let http$ = this.http.get(url, { headers, observe: 'body' });
9551
+ const artificialDelay = this.appConfig.getTimeoutsCaseRetrievalArtificialDelay();
9552
+ const timeoutPeriods = this.appConfig.getTimeoutsForCaseRetrieval();
9553
+ console.log(`Timeout periods: ${timeoutPeriods} seconds.`);
9554
+ if (timeoutPeriods && timeoutPeriods.length > 0 && timeoutPeriods[0] > 0) {
9555
+ http$ = this.retryUtil.pipeTimeoutMechanismOn(http$, artificialDelay, timeoutPeriods);
9556
+ }
9557
+ else {
9558
+ console.warn('Skipping to pipe a retry mechanism!');
9559
+ }
9560
+ http$ = this.pipeErrorProcessor(http$);
9561
+ http$ = http$.pipe(finalize(() => this.finalizeGetCaseViewWith(caseId, loadingToken)));
9562
+ return http$;
9563
+ }
9564
+ pipeErrorProcessor(in$) {
9565
+ const out$ = in$.pipe(catchError(error => {
9566
+ console.error(`Error while getting case view with getCaseViewV2! Error type: '${typeof error}, Error name: '${error?.name}'`);
9567
+ console.error(error);
9568
+ this.errorService.setError(error);
9569
+ return throwError(error);
9570
+ }));
9571
+ return out$;
9572
+ }
9573
+ finalizeGetCaseViewWith(caseId, loadingToken) {
9574
+ this.loadingService.unregister(loadingToken);
9575
+ }
9576
+ syncWait(seconds) {
9577
+ const end = Date.now() + seconds * 1000;
9578
+ while (Date.now() < end)
9579
+ continue;
9580
+ }
9581
+ getEventTrigger(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
9582
+ ignoreWarning = undefined !== ignoreWarning ? ignoreWarning : 'false';
9583
+ const url = this.buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning);
9584
+ let headers = new HttpHeaders();
9585
+ headers = headers.set('experimental', 'true');
9586
+ headers = headers.set('Content-Type', 'application/json');
9587
+ headers = this.addClientContextHeader(headers);
9588
+ if (Draft.isDraft(caseId)) {
9589
+ headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_DRAFT_TRIGGER);
9590
+ }
9591
+ else if (caseId !== undefined && caseId !== null) {
9592
+ headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_EVENT_TRIGGER);
9593
+ }
9594
+ else {
9595
+ headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_CASE_TRIGGER);
9596
+ }
9597
+ return this.http
9598
+ .get(url, { headers, observe: 'response' })
9599
+ .pipe(map((response) => {
9600
+ this.updateClientContextStorage(response.headers);
9601
+ return FieldsUtils.handleNestedDynamicLists(response.body);
9602
+ }), catchError(error => {
9603
+ this.errorService.setError(error);
9604
+ return throwError(error);
9605
+ }), map((p) => plainToClass(CaseEventTrigger, p)), tap(eventTrigger => this.initialiseEventTrigger(eventTrigger)));
9606
+ }
9607
+ createEvent(caseDetails, eventData) {
9608
+ const caseId = caseDetails.case_id;
9609
+ const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/events`;
9610
+ let headers = new HttpHeaders()
9611
+ .set('experimental', 'true')
9612
+ .set('Accept', CasesService.V2_MEDIATYPE_CREATE_EVENT)
9613
+ .set('Content-Type', 'application/json');
9614
+ headers = this.addClientContextHeader(headers);
9615
+ return this.http
9616
+ .post(url, eventData, { headers, observe: 'response' })
9617
+ .pipe(map((response) => {
9618
+ this.updateClientContextStorage(response.headers);
9619
+ return response.body;
9620
+ }), catchError(error => {
9621
+ this.errorService.setError(error);
9622
+ return throwError(error);
9623
+ }));
9624
+ }
9625
+ validateCase(ctid, eventData, pageId) {
9626
+ const pageIdString = pageId ? `?pageId=${pageId}` : '';
9627
+ const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/validate${pageIdString}`;
9628
+ let headers = new HttpHeaders()
9629
+ .set('experimental', 'true')
9630
+ .set('Accept', CasesService.V2_MEDIATYPE_CASE_DATA_VALIDATE)
9631
+ .set('Content-Type', 'application/json');
9632
+ headers = this.addClientContextHeader(headers);
9633
+ return this.http
9634
+ .post(url, eventData, { headers, observe: 'response' })
9635
+ .pipe(map((response) => {
9636
+ this.updateClientContextStorage(response.headers);
9637
+ return response.body;
9638
+ }), catchError(error => {
9639
+ this.errorService.setError(error);
9640
+ return throwError(error);
9641
+ }));
9642
+ }
9643
+ createCase(ctid, eventData) {
9644
+ let ignoreWarning = 'false';
9645
+ if (eventData.ignore_warning) {
9646
+ ignoreWarning = 'true';
9647
+ }
9648
+ const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/cases?ignore-warning=${ignoreWarning}`;
9649
+ let headers = new HttpHeaders()
9650
+ .set('experimental', 'true')
9651
+ .set('Accept', CasesService.V2_MEDIATYPE_CREATE_CASE)
9652
+ .set('Content-Type', 'application/json');
9653
+ headers = this.addClientContextHeader(headers);
9654
+ return this.http
9655
+ .post(url, eventData, { headers, observe: 'response' })
9656
+ .pipe(map((response) => {
9657
+ this.updateClientContextStorage(response.headers);
9658
+ return response.body;
9659
+ }), catchError(error => {
9660
+ this.errorService.setError(error);
9661
+ return throwError(error);
9662
+ }));
9663
+ }
9664
+ getPrintDocuments(caseId) {
9665
+ const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/documents`;
9666
+ let headers = new HttpHeaders()
9667
+ .set('experimental', 'true')
9668
+ .set('Accept', CasesService.V2_MEDIATYPE_CASE_DOCUMENTS)
9669
+ .set('Content-Type', 'application/json');
9670
+ headers = this.addClientContextHeader(headers);
9671
+ return this.http
9672
+ .get(url, { headers, observe: 'response' })
9673
+ .pipe(map((response) => {
9674
+ this.updateClientContextStorage(response.headers);
9675
+ return response.body.documentResources;
9676
+ }), catchError(error => {
9677
+ this.errorService.setError(error);
9678
+ return throwError(error);
9679
+ }));
9680
+ }
9681
+ buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
9682
+ let url = `${this.appConfig.getCaseDataUrl()}/internal`;
9683
+ if (Draft.isDraft(caseId)) {
9684
+ url += `/drafts/${caseId}`
9685
+ + `/event-trigger`
9686
+ + `?ignore-warning=${ignoreWarning}`;
9687
+ }
9688
+ else if (caseTypeId === undefined || caseTypeId === null) {
9689
+ url += `/cases/${caseId}`
9690
+ + `/event-triggers/${eventTriggerId}`
9691
+ + `?ignore-warning=${ignoreWarning}`;
9692
+ }
9693
+ else {
9694
+ url += `/case-types/${caseTypeId}`
9695
+ + `/event-triggers/${eventTriggerId}`
9696
+ + `?ignore-warning=${ignoreWarning}`;
9697
+ }
9698
+ return url;
9699
+ }
9700
+ initialiseEventTrigger(eventTrigger) {
9701
+ if (!eventTrigger.wizard_pages) {
9702
+ eventTrigger.wizard_pages = [];
9703
+ }
9704
+ eventTrigger.wizard_pages.forEach((wizardPage) => {
9705
+ wizardPage.parsedShowCondition = ShowCondition.getInstance(wizardPage.show_condition);
9706
+ wizardPage.case_fields = this.orderService.sort(this.wizardPageFieldToCaseFieldMapper.mapAll(wizardPage.wizard_page_fields, eventTrigger.case_fields));
9707
+ });
9708
+ }
9709
+ getCourtOrHearingCentreName(locationId) {
9710
+ return this.http.post(`/api/locations/getLocationsById`, { locations: [{ locationId }] });
9711
+ }
9712
+ createChallengedAccessRequest(caseId, request) {
9713
+ // Assignment API endpoint
9714
+ const userInfoStr = this.sessionStorageService.getItem('userDetails');
9715
+ const camUtils = new CaseAccessUtils();
9716
+ let userInfo;
9717
+ if (userInfoStr) {
9718
+ userInfo = JSON.parse(userInfoStr);
9719
+ }
9720
+ const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
9721
+ const roleName = camUtils.getAMRoleName('challenged', roleCategory);
9722
+ const beginTime = new Date();
9723
+ const endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
9724
+ const id = userInfo.id ? userInfo.id : userInfo.uid;
9725
+ const isNew = true;
9726
+ const payload = camUtils.getAMPayload(id, id, roleName, roleCategory, 'CHALLENGED', caseId, request, beginTime, endTime, isNew);
9727
+ return this.http.post(`/api/challenged-access-request`, payload);
9728
+ }
9729
+ createSpecificAccessRequest(caseId, sar) {
9730
+ // Assignment API endpoint
9731
+ const userInfoStr = this.sessionStorageService.getItem('userDetails');
9732
+ const camUtils = new CaseAccessUtils();
9733
+ let userInfo;
9734
+ if (userInfoStr) {
9735
+ userInfo = JSON.parse(userInfoStr);
9736
+ }
9737
+ const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
9738
+ const roleName = camUtils.getAMRoleName('specific', roleCategory);
9739
+ const id = userInfo.id ? userInfo.id : userInfo.uid;
9740
+ const payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);
9741
+ payload.roleRequest = {
9742
+ ...payload.roleRequest,
9743
+ process: 'specific-access',
9744
+ replaceExisting: true,
9745
+ assignerId: payload.requestedRoles[0].actorId,
9746
+ reference: `${caseId}/${roleName}/${payload.requestedRoles[0].actorId}`
9747
+ };
9748
+ payload.requestedRoles[0] = {
9749
+ ...payload.requestedRoles[0],
9750
+ roleName: 'specific-access-requested',
9751
+ roleCategory,
9752
+ classification: 'PRIVATE',
9753
+ endTime: new Date(new Date().setDate(new Date().getDate() + 30)),
9754
+ beginTime: null,
9755
+ grantType: 'BASIC',
9756
+ readOnly: true
9757
+ };
9758
+ payload.requestedRoles[0].attributes = {
9759
+ ...payload.requestedRoles[0].attributes,
9760
+ requestedRole: roleName,
9761
+ specificAccessReason: sar.specificReason
9762
+ };
9763
+ payload.requestedRoles[0].notes[0] = {
9764
+ ...payload.requestedRoles[0].notes[0],
9765
+ userId: payload.requestedRoles[0].actorId
9766
+ };
9767
+ return this.http.post(`/api/specific-access-request`, payload);
9768
+ }
9769
+ getLinkedCases(caseId) {
9770
+ const url = `${this.appConfig.getCaseDataStoreApiUrl()}/${caseId}`;
9771
+ return this.http
9772
+ .get(url)
9773
+ .pipe(catchError(error => throwError(error)));
9774
+ }
9775
+ addClientContextHeader(headers) {
9776
+ const clientContextDetails = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
9777
+ if (clientContextDetails) {
9778
+ const caseEditUtils = new CaseEditUtils();
9779
+ // below changes non-ASCII characters
9780
+ const editedClientContext = caseEditUtils.convertNonASCIICharacters(clientContextDetails);
9781
+ const clientContext = window.btoa(editedClientContext);
9782
+ if (clientContext) {
9783
+ headers = headers.set('Client-Context', clientContext);
9784
+ }
9785
+ }
9786
+ return headers;
9787
+ }
9788
+ updateClientContextStorage(headers) {
9789
+ if (headers && headers.get('Client-Context')) {
9790
+ const caseEditUtils = new CaseEditUtils();
9791
+ const clientContextString = window.atob(headers.get('Client-Context'));
9792
+ // below reverts non-ASCII characters
9793
+ const editedClientContextString = caseEditUtils.convertHTMLEntities(clientContextString);
9794
+ this.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, editedClientContextString);
9795
+ }
9796
+ }
9797
+ static ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(OrderService), i0.ɵɵinject(HttpErrorService), i0.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0.ɵɵinject(LoadingService), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(RetryUtil)); };
9798
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
9799
+ }
9800
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CasesService, [{
9801
+ type: Injectable
9802
+ }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: LoadingService }, { type: SessionStorageService }, { type: RetryUtil }], null); })();
9803
+
9804
+ function CaseCreateComponent_div_0_Template(rf, ctx) { if (rf & 1) {
9805
+ const _r1 = i0.ɵɵgetCurrentView();
9806
+ i0.ɵɵelementStart(0, "div")(1, "ccd-case-edit", 1);
9807
+ i0.ɵɵlistener("cancelled", function CaseCreateComponent_div_0_Template_ccd_case_edit_cancelled_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.emitCancelled($event)); })("submitted", function CaseCreateComponent_div_0_Template_ccd_case_edit_submitted_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.emitSubmitted($event)); });
9808
+ i0.ɵɵelementEnd()();
9809
+ } if (rf & 2) {
9810
+ const ctx_r1 = i0.ɵɵnextContext();
9811
+ i0.ɵɵadvance();
9812
+ i0.ɵɵproperty("submit", ctx_r1.submit())("validate", ctx_r1.validate())("saveDraft", ctx_r1.saveDraft())("eventTrigger", ctx_r1.eventTrigger);
9813
+ } }
9814
+ class CaseCreateComponent {
9815
+ casesService;
9816
+ alertService;
9817
+ draftService;
9818
+ eventTriggerService;
9819
+ jurisdiction;
9820
+ caseType;
9821
+ event;
9822
+ cancelled = new EventEmitter();
9823
+ submitted = new EventEmitter();
9824
+ eventTrigger;
9825
+ constructor(casesService, alertService, draftService, eventTriggerService) {
9826
+ this.casesService = casesService;
9827
+ this.alertService = alertService;
9828
+ this.draftService = draftService;
9829
+ this.eventTriggerService = eventTriggerService;
9830
+ }
9831
+ ngOnInit() {
9832
+ this.casesService.getEventTrigger(this.caseType, this.event).toPromise()
9833
+ .then(eventTrigger => {
9834
+ this.eventTrigger = eventTrigger;
9835
+ this.eventTriggerService.announceEventTrigger(eventTrigger);
9836
+ })
9837
+ .catch((error) => {
9838
+ this.alertService.error({ phrase: error.message });
9839
+ return throwError(error);
9840
+ });
9841
+ }
9842
+ submit() {
9843
+ return (sanitizedEditForm) => {
9844
+ sanitizedEditForm.draft_id = this.eventTrigger.case_id;
9845
+ return this.casesService.createCase(this.caseType, sanitizedEditForm);
9846
+ };
9847
+ }
9848
+ validate() {
9849
+ return (sanitizedEditForm, pageId) => this.casesService
9850
+ .validateCase(this.caseType, sanitizedEditForm, pageId);
9851
+ }
9852
+ saveDraft() {
9853
+ if (this.eventTrigger.can_save_draft) {
9854
+ return (caseEventData) => this.draftService.createOrUpdateDraft(this.caseType, this.eventTrigger.case_id, caseEventData);
9855
+ }
9856
+ }
9857
+ emitCancelled(event) {
9858
+ this.cancelled.emit(event);
9859
+ }
9860
+ emitSubmitted(event) {
9861
+ this.submitted.emit(event);
9862
+ }
9863
+ isDataLoaded() {
9864
+ return this.eventTrigger ? true : false;
9865
+ }
9866
+ static ɵfac = function CaseCreateComponent_Factory(t) { return new (t || CaseCreateComponent)(i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(EventTriggerService)); };
9867
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseCreateComponent, selectors: [["ccd-case-create"]], inputs: { jurisdiction: "jurisdiction", caseType: "caseType", event: "event" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [3, "cancelled", "submitted", "submit", "validate", "saveDraft", "eventTrigger"]], template: function CaseCreateComponent_Template(rf, ctx) { if (rf & 1) {
9868
+ i0.ɵɵtemplate(0, CaseCreateComponent_div_0_Template, 2, 4, "div", 0);
9869
+ } if (rf & 2) {
9870
+ i0.ɵɵproperty("ngIf", ctx.isDataLoaded());
9871
+ } }, encapsulation: 2 });
9872
+ }
9873
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseCreateComponent, [{
9874
+ type: Component,
9875
+ args: [{ selector: 'ccd-case-create', template: "<div *ngIf=\"isDataLoaded()\">\n <ccd-case-edit [submit]=\"submit()\"\n [validate]=\"validate()\"\n [saveDraft]=\"saveDraft()\"\n [eventTrigger]=\"eventTrigger\"\n (cancelled)=\"emitCancelled($event)\"\n (submitted)=\"emitSubmitted($event)\"></ccd-case-edit>\n</div>" }]
9876
+ }], () => [{ type: CasesService }, { type: AlertService }, { type: DraftService }, { type: EventTriggerService }], { jurisdiction: [{
9877
+ type: Input
9878
+ }], caseType: [{
9879
+ type: Input
9880
+ }], event: [{
9881
+ type: Input
9882
+ }], cancelled: [{
9883
+ type: Output
9884
+ }], submitted: [{
9885
+ type: Output
9886
+ }] }); })();
9887
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseCreateComponent, { className: "CaseCreateComponent", filePath: "lib/shared/components/case-editor/case-create/case-create.component.ts", lineNumber: 17 }); })();
9839
9888
 
9840
9889
  function CaseEditConfirmComponent_div_3_Template(rf, ctx) { if (rf & 1) {
9841
9890
  i0.ɵɵelement(0, "div");
@@ -11260,7 +11309,7 @@ class CaseEventCompletionTaskCancelledComponent {
11260
11309
  }
11261
11310
  onContinue() {
11262
11311
  // Removes task to complete so event completes without task
11263
- this.context.sessionStorageService.removeItem('clientContext');
11312
+ this.context.sessionStorageService.removeItem(CaseEditComponent.CLIENT_CONTEXT);
11264
11313
  // may be able to remove this call below since it is now unneccesary
11265
11314
  this.notifyEventCompletionCancelled.emit(true);
11266
11315
  }
@@ -11446,7 +11495,7 @@ class CaseEventCompletionTaskReassignedComponent {
11446
11495
  }
11447
11496
  onContinue() {
11448
11497
  // Get task details
11449
- const clientContextStr = this.sessionStorageService.getItem('clientContext');
11498
+ const clientContextStr = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
11450
11499
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
11451
11500
  const task = userTask ? userTask.task_data : null;
11452
11501
  // not complete_task not utilised here as related to event completion
@@ -11476,7 +11525,7 @@ class CaseEventCompletionTaskReassignedComponent {
11476
11525
  }], notifyEventCompletionReassigned: [{
11477
11526
  type: Output
11478
11527
  }] }); })();
11479
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskReassignedComponent, { className: "CaseEventCompletionTaskReassignedComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.ts", lineNumber: 15 }); })();
11528
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskReassignedComponent, { className: "CaseEventCompletionTaskReassignedComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.ts", lineNumber: 16 }); })();
11480
11529
 
11481
11530
  class AddressOption {
11482
11531
  description;
@@ -14223,28 +14272,18 @@ class FileUploadStateService {
14223
14272
 
14224
14273
  const _c0$R = ["fileInput"];
14225
14274
  const _c1$l = a0 => ({ "form-group-error bottom-30": a0 });
14226
- function WriteDocumentFieldComponent_span_6_Template(rf, ctx) { if (rf & 1) {
14227
- i0.ɵɵelementStart(0, "span", 12);
14228
- i0.ɵɵtext(1);
14229
- i0.ɵɵpipe(2, "rpxTranslate");
14230
- i0.ɵɵelementEnd();
14231
- } if (rf & 2) {
14232
- const ctx_r1 = i0.ɵɵnextContext();
14233
- i0.ɵɵadvance();
14234
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r1.caseField.hint_text));
14235
- } }
14236
- function WriteDocumentFieldComponent_span_7_Template(rf, ctx) { if (rf & 1) {
14237
- i0.ɵɵelementStart(0, "span", 13);
14275
+ function WriteDocumentFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
14276
+ i0.ɵɵelementStart(0, "span", 11);
14238
14277
  i0.ɵɵtext(1);
14239
14278
  i0.ɵɵpipe(2, "rpxTranslate");
14240
14279
  i0.ɵɵelementEnd();
14241
14280
  } if (rf & 2) {
14242
14281
  const ctx_r1 = i0.ɵɵnextContext();
14243
14282
  i0.ɵɵadvance();
14244
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r1.fileUploadMessages));
14283
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r1.caseField.hint_text), " ");
14245
14284
  } }
14246
14285
  function WriteDocumentFieldComponent_ccd_read_document_field_9_Template(rf, ctx) { if (rf & 1) {
14247
- i0.ɵɵelement(0, "ccd-read-document-field", 14);
14286
+ i0.ɵɵelement(0, "ccd-read-document-field", 12);
14248
14287
  } if (rf & 2) {
14249
14288
  const ctx_r1 = i0.ɵɵnextContext();
14250
14289
  i0.ɵɵproperty("caseField", ctx_r1.caseField);
@@ -14516,6 +14555,7 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
14516
14555
  case 502:
14517
14556
  return WriteDocumentFieldComponent.UPLOAD_ERROR_NOT_AVAILABLE;
14518
14557
  case 422:
14558
+ case 500:
14519
14559
  {
14520
14560
  let errorMsg = WriteDocumentFieldComponent.ERROR_UPLOADING_FILE;
14521
14561
  if (error?.error) {
@@ -14588,41 +14628,42 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
14588
14628
  } if (rf & 2) {
14589
14629
  let _t;
14590
14630
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fileInput = _t.first);
14591
- } }, features: [i0.ɵɵInheritDefinitionFeature], decls: 18, vars: 20, consts: [["fileInput", ""], [1, "form-group", 3, "ngClass"], [3, "for"], [1, "form-label"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], [3, "caseField", 4, "ngIf"], [2, "position", "relative"], [3, "click", "keyup", "id"], ["type", "file", 1, "form-control", "bottom-30", 3, "keydown.Tab", "change", "id", "accept"], [1, "form-group", "bottom-30"], ["type", "button", "aria-label", "Cancel upload", 1, "button", "button-secondary", 3, "click", "disabled"], [1, "form-hint"], [1, "error-message"], [3, "caseField"]], template: function WriteDocumentFieldComponent_Template(rf, ctx) { if (rf & 1) {
14631
+ } }, features: [i0.ɵɵInheritDefinitionFeature], decls: 18, vars: 19, consts: [["fileInput", ""], [1, "form-group", 3, "ngClass"], [1, "form-label"], ["class", "form-hint", 4, "ngIf"], ["role", "alert", "tabindex", "0", 1, "error-message", 3, "hidden"], [3, "caseField", 4, "ngIf"], [2, "position", "relative"], [3, "click", "keyup", "id"], ["type", "file", 1, "form-control", "bottom-30", 3, "keydown.Tab", "change", "id", "accept"], [1, "form-group", "bottom-30"], ["type", "button", "aria-label", "Cancel upload", 1, "button", "button-secondary", 3, "click", "disabled"], [1, "form-hint"], [3, "caseField"]], template: function WriteDocumentFieldComponent_Template(rf, ctx) { if (rf & 1) {
14592
14632
  const _r1 = i0.ɵɵgetCurrentView();
14593
- i0.ɵɵelementStart(0, "div", 1)(1, "label", 2)(2, "span", 3);
14633
+ i0.ɵɵelementStart(0, "div", 1)(1, "legend", 2);
14634
+ i0.ɵɵtext(2);
14594
14635
  i0.ɵɵpipe(3, "ccdFieldLabel");
14595
- i0.ɵɵtext(4);
14596
- i0.ɵɵpipe(5, "ccdFieldLabel");
14597
- i0.ɵɵelementEnd()();
14598
- i0.ɵɵtemplate(6, WriteDocumentFieldComponent_span_6_Template, 3, 3, "span", 4)(7, WriteDocumentFieldComponent_span_7_Template, 3, 3, "span", 5);
14636
+ i0.ɵɵelementEnd();
14637
+ i0.ɵɵtemplate(4, WriteDocumentFieldComponent_span_4_Template, 3, 3, "span", 3);
14638
+ i0.ɵɵelementStart(5, "span", 4);
14639
+ i0.ɵɵtext(6);
14640
+ i0.ɵɵpipe(7, "rpxTranslate");
14641
+ i0.ɵɵelementEnd();
14599
14642
  i0.ɵɵelementStart(8, "div");
14600
- i0.ɵɵtemplate(9, WriteDocumentFieldComponent_ccd_read_document_field_9_Template, 1, 1, "ccd-read-document-field", 6);
14643
+ i0.ɵɵtemplate(9, WriteDocumentFieldComponent_ccd_read_document_field_9_Template, 1, 1, "ccd-read-document-field", 5);
14601
14644
  i0.ɵɵelementEnd();
14602
- i0.ɵɵelementStart(10, "div", 7)(11, "div", 8);
14645
+ i0.ɵɵelementStart(10, "div", 6)(11, "div", 7);
14603
14646
  i0.ɵɵlistener("click", function WriteDocumentFieldComponent_Template_div_click_11_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.fileSelectEvent()); })("keyup", function WriteDocumentFieldComponent_Template_div_keyup_11_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.fileSelectEvent()); });
14604
14647
  i0.ɵɵelementEnd();
14605
- i0.ɵɵelementStart(12, "input", 9, 0);
14648
+ i0.ɵɵelementStart(12, "input", 8, 0);
14606
14649
  i0.ɵɵlistener("keydown.Tab", function WriteDocumentFieldComponent_Template_input_keydown_Tab_12_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.fileValidationsOnTab()); })("change", function WriteDocumentFieldComponent_Template_input_change_12_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.fileChangeEvent($event, ctx.caseField.field_type.regular_expression)); });
14607
14650
  i0.ɵɵelementEnd()()();
14608
- i0.ɵɵelementStart(14, "div", 10)(15, "button", 11);
14651
+ i0.ɵɵelementStart(14, "div", 9)(15, "button", 10);
14609
14652
  i0.ɵɵlistener("click", function WriteDocumentFieldComponent_Template_button_click_15_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.cancelUpload()); });
14610
14653
  i0.ɵɵtext(16);
14611
14654
  i0.ɵɵpipe(17, "rpxTranslate");
14612
14655
  i0.ɵɵelementEnd()();
14613
14656
  } if (rf & 2) {
14614
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(18, _c1$l, !ctx.valid));
14615
- i0.ɵɵadvance();
14616
- i0.ɵɵproperty("for", ctx.id());
14617
- i0.ɵɵadvance();
14618
- i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(3, 12, ctx.caseField));
14657
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(17, _c1$l, !ctx.valid));
14619
14658
  i0.ɵɵadvance(2);
14620
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 14, ctx.caseField));
14659
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 11, ctx.caseField), " ");
14621
14660
  i0.ɵɵadvance(2);
14622
14661
  i0.ɵɵproperty("ngIf", ctx.caseField.hint_text);
14623
14662
  i0.ɵɵadvance();
14624
- i0.ɵɵproperty("ngIf", ctx.fileUploadMessages && !ctx.valid);
14625
- i0.ɵɵadvance(2);
14663
+ i0.ɵɵproperty("hidden", !(ctx.fileUploadMessages && !ctx.valid));
14664
+ i0.ɵɵadvance();
14665
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 13, ctx.fileUploadMessages), " ");
14666
+ i0.ɵɵadvance(3);
14626
14667
  i0.ɵɵproperty("ngIf", ctx.caseField);
14627
14668
  i0.ɵɵadvance(2);
14628
14669
  i0.ɵɵproperty("id", ctx.createElementId("fileInputWrapper"));
@@ -14632,12 +14673,12 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
14632
14673
  i0.ɵɵadvance(3);
14633
14674
  i0.ɵɵproperty("disabled", !ctx.isUploadInProgress());
14634
14675
  i0.ɵɵadvance();
14635
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(17, 16, "Cancel upload"));
14676
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(17, 15, "Cancel upload"));
14636
14677
  } }, encapsulation: 2 });
14637
14678
  }
14638
14679
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteDocumentFieldComponent, [{
14639
14680
  type: Component,
14640
- args: [{ selector: 'ccd-write-document-field', template: "<div class=\"form-group\" [ngClass]=\"{'form-group-error bottom-30': !valid}\">\n <label [for]=\"id()\">\n <span class=\"form-label\" attr.aria-label=\"{{caseField | ccdFieldLabel}}\">{{(caseField | ccdFieldLabel)}}</span>\n </label>\n <span class=\"form-hint\" *ngIf=\"caseField.hint_text\">{{caseField.hint_text | rpxTranslate}}</span>\n <span class=\"error-message\" *ngIf=\"fileUploadMessages && !valid\">{{fileUploadMessages | rpxTranslate}}</span>\n\n <div>\n <!--<span *ngIf=\"getUploadedFileName()\" class=\"text-16\">File name: {{getUploadedFileName()}}</span>-->\n <ccd-read-document-field *ngIf=\"caseField\" [caseField]=\"caseField\"></ccd-read-document-field>\n </div>\n\n <div style='position:relative'>\n <div [id]=\"createElementId('fileInputWrapper')\" (click)=\"fileSelectEvent()\" (keyup)=\"fileSelectEvent()\"></div>\n <input class=\"form-control bottom-30\" [id]=\"id()\" type=\"file\" (keydown.Tab)=\"fileValidationsOnTab()\" (change)=\"fileChangeEvent($event, caseField.field_type.regular_expression)\"\n accept=\"{{caseField.field_type.regular_expression}}\" #fileInput/>\n </div>\n</div>\n<div class=\"form-group bottom-30\">\n <button class=\"button button-secondary\" type=\"button\" aria-label=\"Cancel upload\" (click)=\"cancelUpload()\" [disabled]=\"!isUploadInProgress()\">{{'Cancel upload' | rpxTranslate}}</button>\n</div>\n" }]
14681
+ args: [{ selector: 'ccd-write-document-field', template: "<div class=\"form-group\" [ngClass]=\"{'form-group-error bottom-30': !valid}\">\n <legend class=\"form-label\">\n {{ caseField | ccdFieldLabel }}\n </legend>\n <span class=\"form-hint\" *ngIf=\"caseField.hint_text\">\n {{ caseField.hint_text | rpxTranslate }}\n </span>\n <span class=\"error-message\"\n role=\"alert\"\n tabindex=\"0\"\n [hidden]=\"!(fileUploadMessages && !valid)\">\n {{ fileUploadMessages | rpxTranslate }}\n </span>\n <div>\n <!--<span *ngIf=\"getUploadedFileName()\" class=\"text-16\">File name: {{getUploadedFileName()}}</span>-->\n <ccd-read-document-field *ngIf=\"caseField\" [caseField]=\"caseField\"></ccd-read-document-field>\n </div>\n\n <div style='position:relative'>\n <div [id]=\"createElementId('fileInputWrapper')\" (click)=\"fileSelectEvent()\" (keyup)=\"fileSelectEvent()\"></div>\n <input class=\"form-control bottom-30\" [id]=\"id()\" type=\"file\" (keydown.Tab)=\"fileValidationsOnTab()\" (change)=\"fileChangeEvent($event, caseField.field_type.regular_expression)\"\n accept=\"{{caseField.field_type.regular_expression}}\" #fileInput/>\n </div>\n</div>\n<div class=\"form-group bottom-30\">\n <button class=\"button button-secondary\" type=\"button\" aria-label=\"Cancel upload\" (click)=\"cancelUpload()\" [disabled]=\"!isUploadInProgress()\">{{'Cancel upload' | rpxTranslate}}</button>\n</div>\n" }]
14641
14682
  }], () => [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1$3.MatLegacyDialog }, { type: FileUploadStateService }, { type: JurisdictionService }], { fileInput: [{
14642
14683
  type: ViewChild,
14643
14684
  args: ['fileInput', { static: false }]
@@ -27771,7 +27812,7 @@ class EventLogTableComponent {
27771
27812
  }
27772
27813
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventLogTableComponent, [{
27773
27814
  type: Component,
27774
- args: [{ selector: 'ccd-event-log-table', template: "<table class=\"EventLogTable\">\n <caption><h2 class=\"heading-h2\">{{'History' | rpxTranslate}}</h2></caption>\n <thead>\n <tr>\n <th><span class=\"text-16\">{{'Event' | rpxTranslate}}</span></th>\n <th><span class=\"text-16\">{{'Date' | rpxTranslate}}</span></th>\n <th><span class=\"text-16\">{{'Author' | rpxTranslate}}</span></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let event of events\" (click)=\"select(event)\" (keyup)=\"select(event)\" [ngClass]=\"{'EventLogTable-Selected': selected === event}\" tabindex=\"0\" attr.aria-label=\"{{getAriaLabelforRow(event)}}\">\n <td>\n <ng-container [ngSwitch]=\"isPartOfCaseTimeline\">\n <div id=\"case-timeline\" *ngSwitchCase=\"true\">\n <a (click)=\"caseHistoryClicked(event.id)\"\n *ngIf=\"event.state_id !== 'Draft'\" class=\"text-16 event-link\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">{{event.event_name | rpxTranslate}}</a>\n </div>\n <div *ngSwitchCase=\"false\">\n <a [routerLink]=\"['./', 'event', event.id, 'history']\"\n [target]=\"'_blank'\"\n *ngIf=\"event.state_id !== 'Draft'\" class=\"text-16 event-link\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">{{event.event_name | rpxTranslate}}</a>\n </div>\n </ng-container>\n <span *ngIf=\"event.state_id === 'Draft'\">{{event.event_name}}</span>\n <div class=\"tooltip\" *ngIf=\"significantItemExist(event)\">\n <a href=\"{{getSignificantItemUrl(event)}}\" target=\"_blank\" rel=\"noopener\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">\n <img class=\"doc-img\" alt=\"document image\" src=\"data:image/png;base64,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\"/>\n </a>\n <span class=\"tooltiptext doc-tooltip\">{{getSignificantItemDesc(event)}}</span>\n </div>\n </td>\n <td tabindex=\"0\" attr.aria-label=\"{{getAriaLabelforColumn(event)}}\" (keydown.enter)=\"select(event)\"><div class=\"tooltip text-16\">{{event.timestamp | ccdDate : 'local'}}\n <span class=\"tooltiptext\">{{'Local:' | rpxTranslate}} {{event.timestamp | ccdDate : 'local'}}</span>\n </div></td>\n <td tabindex=\"0\"><span class=\"text-16\">{{event.user_first_name | titlecase}} {{event.user_last_name | uppercase}}</span></td>\n </tr>\n </tbody>\n</table>\n", styles: ["#case-timeline a{cursor:pointer;text-decoration:underline;color:#005ea5}#case-timeline a:hover{color:#2b8cc4}#case-timeline a:visited{color:#4c2c92}.EventLogTable tbody>tr td:first-child{padding-left:10px}.EventLogTable tbody>tr.EventLogTable-Selected{border-left:8px solid #005ea5;background-color:#f8f8f8}.EventLogTable tbody>tr.EventLogTable-Selected td:first-child{padding-left:6px}.EventLogTable tbody>tr:not(.EventLogTable-Selected):hover{border-left:8px solid #2b8cc4;background-color:#f8f8f8;cursor:pointer;cursor:hand}.EventLogTable tbody>tr:not(.EventLogTable-Selected):hover td:first-child{padding-left:6px}.EventLogTable tbody>tr .event-link{float:left;padding-right:8px}.EventLogTable tbody>tr .doc-img{width:16px;float:left}.EventLogTable tbody>tr .doc-tooltip{left:35%;bottom:7px}.EventLogTable tbody>tr .doc-tooltip:after{border-color:transparent}\n"] }]
27815
+ args: [{ selector: 'ccd-event-log-table', template: "<table class=\"EventLogTable\">\n <caption><h2 class=\"heading-h2\">{{'History' | rpxTranslate}}</h2></caption>\n <thead>\n <tr>\n <th><span class=\"text-16\">{{'Event' | rpxTranslate}}</span></th>\n <th><span class=\"text-16\">{{'Date' | rpxTranslate}}</span></th>\n <th><span class=\"text-16\">{{'Author' | rpxTranslate}}</span></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let event of events\" (click)=\"select(event)\" (keyup)=\"select(event)\" [ngClass]=\"{'EventLogTable-Selected': selected === event}\" tabindex=\"0\" attr.aria-label=\"{{getAriaLabelforRow(event)}}\">\n <td>\n <ng-container [ngSwitch]=\"isPartOfCaseTimeline\">\n <div id=\"case-timeline\" *ngSwitchCase=\"true\">\n <a (click)=\"caseHistoryClicked(event.id)\"\n *ngIf=\"event.state_id !== 'Draft'\" class=\"text-16 event-link\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">{{event.event_name | rpxTranslate}}</a>\n </div>\n <div *ngSwitchCase=\"false\">\n <a [routerLink]=\"['./', 'event', event.id, 'history']\"\n [target]=\"'_blank'\"\n *ngIf=\"event.state_id !== 'Draft'\" class=\"text-16 event-link\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">{{event.event_name | rpxTranslate}}</a>\n </div>\n </ng-container>\n <span *ngIf=\"event.state_id === 'Draft'\">{{event.event_name}}</span>\n <div class=\"tooltip\" *ngIf=\"significantItemExist(event)\">\n <a href=\"{{getSignificantItemUrl(event)}}\" target=\"_blank\" rel=\"noopener\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">\n <img class=\"doc-img\" alt=\"document image\" src=\"data:image/png;base64,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\"/>\n </a>\n <span class=\"tooltiptext doc-tooltip\">{{getSignificantItemDesc(event)}}</span>\n </div>\n </td>\n <td tabindex=\"0\" attr.aria-label=\"{{getAriaLabelforColumn(event)}}\" (keydown.enter)=\"select(event)\"><div class=\"tooltip text-16\">{{event.timestamp | ccdDate : 'local'}}\n <span class=\"tooltiptext\">{{'Local:' | rpxTranslate}} {{event.timestamp | ccdDate : 'local'}}</span>\n </div></td>\n <td tabindex=\"0\"><span class=\"text-16\">{{event.user_first_name | titlecase}} {{event.user_last_name | uppercase}}</span></td>\n </tr>\n </tbody>\n</table>", styles: ["#case-timeline a{cursor:pointer;text-decoration:underline;color:#005ea5}#case-timeline a:hover{color:#2b8cc4}#case-timeline a:visited{color:#4c2c92}.EventLogTable tbody>tr td:first-child{padding-left:10px}.EventLogTable tbody>tr.EventLogTable-Selected{border-left:8px solid #005ea5;background-color:#f8f8f8}.EventLogTable tbody>tr.EventLogTable-Selected td:first-child{padding-left:6px}.EventLogTable tbody>tr:not(.EventLogTable-Selected):hover{border-left:8px solid #2b8cc4;background-color:#f8f8f8;cursor:pointer;cursor:hand}.EventLogTable tbody>tr:not(.EventLogTable-Selected):hover td:first-child{padding-left:6px}.EventLogTable tbody>tr .event-link{float:left;padding-right:8px}.EventLogTable tbody>tr .doc-img{width:16px;float:left}.EventLogTable tbody>tr .doc-tooltip{left:35%;bottom:7px}.EventLogTable tbody>tr .doc-tooltip:after{border-color:transparent}\n"] }]
27775
27816
  }], null, { events: [{
27776
27817
  type: Input
27777
27818
  }], selected: [{
@@ -32417,13 +32458,14 @@ class EventTriggerResolver {
32417
32458
  router;
32418
32459
  appConfig;
32419
32460
  errorNotifier;
32461
+ loadingService;
32420
32462
  static PARAM_CASE_ID = 'cid';
32421
32463
  static PARAM_EVENT_ID = 'eid';
32422
32464
  static IGNORE_WARNING = 'ignoreWarning';
32423
32465
  static IGNORE_WARNING_VALUES = ['true', 'false'];
32424
32466
  cachedEventTrigger;
32425
32467
  cachedProfile;
32426
- constructor(casesService, alertService, profileService, profileNotifier, router, appConfig, errorNotifier) {
32468
+ constructor(casesService, alertService, profileService, profileNotifier, router, appConfig, errorNotifier, loadingService) {
32427
32469
  this.casesService = casesService;
32428
32470
  this.alertService = alertService;
32429
32471
  this.profileService = profileService;
@@ -32431,6 +32473,7 @@ class EventTriggerResolver {
32431
32473
  this.router = router;
32432
32474
  this.appConfig = appConfig;
32433
32475
  this.errorNotifier = errorNotifier;
32476
+ this.loadingService = loadingService;
32434
32477
  }
32435
32478
  resolve(route) {
32436
32479
  return this.isRootTriggerEventRoute(route) ? this.getAndCacheEventTrigger(route)
@@ -32461,7 +32504,7 @@ class EventTriggerResolver {
32461
32504
  }
32462
32505
  return this.casesService
32463
32506
  .getEventTrigger(caseTypeId, eventTriggerId, cid, ignoreWarning)
32464
- .pipe(map(eventTrigger => this.cachedEventTrigger = eventTrigger), catchError(error => {
32507
+ .pipe(map((eventTrigger) => this.cachedEventTrigger = eventTrigger), catchError((error) => {
32465
32508
  error.details = { eventId: eventTriggerId, ...error.details };
32466
32509
  this.alertService.setPreserveAlerts(true);
32467
32510
  this.alertService.error(error.message);
@@ -32470,12 +32513,12 @@ class EventTriggerResolver {
32470
32513
  return throwError(error);
32471
32514
  })).toPromise();
32472
32515
  }
32473
- static ɵ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)); };
32516
+ static ɵ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), i0.ɵɵinject(LoadingService)); };
32474
32517
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventTriggerResolver, factory: EventTriggerResolver.ɵfac });
32475
32518
  }
32476
32519
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventTriggerResolver, [{
32477
32520
  type: Injectable
32478
- }], () => [{ type: CasesService }, { type: AlertService }, { type: ProfileService }, { type: ProfileNotifier }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: ErrorNotifierService }], null); })();
32521
+ }], () => [{ type: CasesService }, { type: AlertService }, { type: ProfileService }, { type: ProfileNotifier }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: ErrorNotifierService }, { type: LoadingService }], null); })();
32479
32522
 
32480
32523
  function CaseEventTriggerComponent_div_0_Template(rf, ctx) { if (rf & 1) {
32481
32524
  const _r1 = i0.ɵɵgetCurrentView();
@@ -32501,6 +32544,7 @@ class CaseEventTriggerComponent {
32501
32544
  caseReferencePipe;
32502
32545
  activityPollingService;
32503
32546
  sessionStorageService;
32547
+ loadingService;
32504
32548
  static EVENT_COMPLETION_MESSAGE = `Case #%CASEREFERENCE% has been updated with event: %NAME%`;
32505
32549
  static CALLBACK_FAILED_MESSAGE = ' but the callback service cannot be completed';
32506
32550
  BANNER = DisplayMode.BANNER;
@@ -32509,7 +32553,7 @@ class CaseEventTriggerComponent {
32509
32553
  activitySubscription;
32510
32554
  caseSubscription;
32511
32555
  parentUrl;
32512
- constructor(ngZone, casesService, caseNotifier, router, alertService, route, caseReferencePipe, activityPollingService, sessionStorageService) {
32556
+ constructor(ngZone, casesService, caseNotifier, router, alertService, route, caseReferencePipe, activityPollingService, sessionStorageService, loadingService) {
32513
32557
  this.ngZone = ngZone;
32514
32558
  this.casesService = casesService;
32515
32559
  this.caseNotifier = caseNotifier;
@@ -32519,8 +32563,12 @@ class CaseEventTriggerComponent {
32519
32563
  this.caseReferencePipe = caseReferencePipe;
32520
32564
  this.activityPollingService = activityPollingService;
32521
32565
  this.sessionStorageService = sessionStorageService;
32566
+ this.loadingService = loadingService;
32522
32567
  }
32523
32568
  ngOnInit() {
32569
+ if (this.loadingService.hasSharedSpinner()) {
32570
+ this.loadingService.unregisterSharedSpinner();
32571
+ }
32524
32572
  if (this.route.snapshot.data.case) {
32525
32573
  this.caseDetails = this.route.snapshot.data.case;
32526
32574
  }
@@ -32607,7 +32655,7 @@ class CaseEventTriggerComponent {
32607
32655
  isDataLoaded() {
32608
32656
  return !!(this.eventTrigger && this.caseDetails);
32609
32657
  }
32610
- static ɵfac = function CaseEventTriggerComponent_Factory(t) { return new (t || CaseEventTriggerComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseReferencePipe), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(SessionStorageService)); };
32658
+ static ɵfac = function CaseEventTriggerComponent_Factory(t) { return new (t || CaseEventTriggerComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseReferencePipe), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(LoadingService)); };
32611
32659
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventTriggerComponent, selectors: [["ccd-case-event-trigger"]], decls: 1, vars: 1, consts: [["class", "screen-990", 4, "ngIf"], [1, "screen-990"], [3, "caseId", "displayMode"], [3, "cancelled", "submitted", "caseDetails", "submit", "validate", "eventTrigger"]], template: function CaseEventTriggerComponent_Template(rf, ctx) { if (rf & 1) {
32612
32660
  i0.ɵɵtemplate(0, CaseEventTriggerComponent_div_0_Template, 3, 6, "div", 0);
32613
32661
  } if (rf & 2) {
@@ -32617,7 +32665,7 @@ class CaseEventTriggerComponent {
32617
32665
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEventTriggerComponent, [{
32618
32666
  type: Component,
32619
32667
  args: [{ selector: 'ccd-case-event-trigger', template: "<div *ngIf=\"isDataLoaded()\" class=\"screen-990\">\n <ccd-activity [caseId]=\"caseDetails.case_id\" [displayMode]=\"BANNER\"></ccd-activity>\n <ccd-case-edit [caseDetails]=\"caseDetails\"\n [submit]=\"submit()\"\n [validate]=\"validate()\"\n [eventTrigger]=\"eventTrigger\"\n (cancelled)=\"cancel()\"\n (submitted)=\"submitted($event)\"></ccd-case-edit>\n</div>\n" }]
32620
- }], () => [{ type: i0.NgZone }, { type: CasesService }, { type: CaseNotifier }, { type: i1$1.Router }, { type: AlertService }, { type: i1$1.ActivatedRoute }, { type: CaseReferencePipe }, { type: ActivityPollingService }, { type: SessionStorageService }], null); })();
32668
+ }], () => [{ type: i0.NgZone }, { type: CasesService }, { type: CaseNotifier }, { type: i1$1.Router }, { type: AlertService }, { type: i1$1.ActivatedRoute }, { type: CaseReferencePipe }, { type: ActivityPollingService }, { type: SessionStorageService }, { type: LoadingService }], null); })();
32621
32669
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventTriggerComponent, { className: "CaseEventTriggerComponent", filePath: "lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.ts", lineNumber: 14 }); })();
32622
32670
 
32623
32671
  function CaseViewComponent_div_0_Template(rf, ctx) { if (rf & 1) {
@@ -33281,6 +33329,7 @@ class CaseFullAccessViewComponent {
33281
33329
  crf;
33282
33330
  sessionStorageService;
33283
33331
  rpxTranslationPipe;
33332
+ loadingService;
33284
33333
  static ORIGIN_QUERY_PARAM = 'origin';
33285
33334
  static TRIGGER_TEXT_START = 'Go';
33286
33335
  static TRIGGER_TEXT_CONTINUE = 'Ignore Warning and Go';
@@ -33315,9 +33364,10 @@ class CaseFullAccessViewComponent {
33315
33364
  caseFlagsReadExternalMode = '#ARGUMENT(READ,EXTERNAL)';
33316
33365
  subs = [];
33317
33366
  eventId;
33367
+ isEventButtonClicked = false;
33318
33368
  callbackErrorsSubject;
33319
33369
  tabGroup;
33320
- constructor(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location, crf, sessionStorageService, rpxTranslationPipe) {
33370
+ constructor(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location, crf, sessionStorageService, rpxTranslationPipe, loadingService) {
33321
33371
  this.ngZone = ngZone;
33322
33372
  this.route = route;
33323
33373
  this.router = router;
@@ -33333,6 +33383,7 @@ class CaseFullAccessViewComponent {
33333
33383
  this.crf = crf;
33334
33384
  this.sessionStorageService = sessionStorageService;
33335
33385
  this.rpxTranslationPipe = rpxTranslationPipe;
33386
+ this.loadingService = loadingService;
33336
33387
  }
33337
33388
  ngOnInit() {
33338
33389
  this.callbackErrorsSubject = this.errorNotifierService.errorSource.pipe(filter((x) => {
@@ -33412,8 +33463,15 @@ class CaseFullAccessViewComponent {
33412
33463
  this.resetErrors();
33413
33464
  this.ignoreWarning = false;
33414
33465
  this.triggerText = CaseFullAccessViewComponent.TRIGGER_TEXT_START;
33466
+ this.isEventButtonClicked = false;
33415
33467
  }
33416
33468
  async applyTrigger(trigger) {
33469
+ if (this.isEventButtonClicked) {
33470
+ return;
33471
+ }
33472
+ this.isEventButtonClicked = true;
33473
+ const spinner = this.loadingService.register();
33474
+ this.loadingService.addSharedSpinner(spinner);
33417
33475
  this.errorNotifierService.announceError(null);
33418
33476
  const theQueryParams = {};
33419
33477
  if (this.ignoreWarning) {
@@ -33664,7 +33722,7 @@ class CaseFullAccessViewComponent {
33664
33722
  this.errorNotifierService.announceError(null);
33665
33723
  this.alertService.clear();
33666
33724
  }
33667
- static ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(NavigationNotifierService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(ConvertHrefToRouterService), i0.ɵɵdirectiveInject(i5.Location), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1.RpxTranslatePipe)); };
33725
+ static ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(NavigationNotifierService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(ConvertHrefToRouterService), i0.ɵɵdirectiveInject(i5.Location), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1.RpxTranslatePipe), i0.ɵɵdirectiveInject(LoadingService)); };
33668
33726
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFullAccessViewComponent, selectors: [["ccd-case-full-access-view"]], viewQuery: function CaseFullAccessViewComponent_Query(rf, ctx) { if (rf & 1) {
33669
33727
  i0.ɵɵviewQuery(_c0$b, 5);
33670
33728
  } if (rf & 2) {
@@ -33709,7 +33767,7 @@ class CaseFullAccessViewComponent {
33709
33767
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFullAccessViewComponent, [{
33710
33768
  type: Component,
33711
33769
  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}.hide-table-capion{position:absolute;visibility:hidden}\n"] }]
33712
- }], () => [{ 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: i5.Location }, { type: i0.ChangeDetectorRef }, { type: SessionStorageService }, { type: i1.RpxTranslatePipe }], { hasPrint: [{
33770
+ }], () => [{ 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: i5.Location }, { type: i0.ChangeDetectorRef }, { type: SessionStorageService }, { type: i1.RpxTranslatePipe }, { type: LoadingService }], { hasPrint: [{
33713
33771
  type: Input
33714
33772
  }], hasEventSelector: [{
33715
33773
  type: Input
@@ -33723,7 +33781,7 @@ class CaseFullAccessViewComponent {
33723
33781
  type: ViewChild,
33724
33782
  args: ['tabGroup', { static: false }]
33725
33783
  }] }); })();
33726
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFullAccessViewComponent, { className: "CaseFullAccessViewComponent", filePath: "lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.ts", lineNumber: 43 }); })();
33784
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFullAccessViewComponent, { className: "CaseFullAccessViewComponent", filePath: "lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.ts", lineNumber: 44 }); })();
33727
33785
 
33728
33786
  class PrintUrlPipe {
33729
33787
  appConfig;
@@ -34473,7 +34531,6 @@ class EventStartGuard {
34473
34531
  sessionStorageService;
34474
34532
  abstractConfig;
34475
34533
  cookieService;
34476
- static CLIENT_CONTEXT = 'clientContext';
34477
34534
  constructor(workAllocationService, router, sessionStorageService, abstractConfig, cookieService) {
34478
34535
  this.workAllocationService = workAllocationService;
34479
34536
  this.router = router;
@@ -34494,7 +34551,7 @@ class EventStartGuard {
34494
34551
  const caseInfoStr = this.sessionStorageService.getItem('caseInfo');
34495
34552
  const languageCookie = this.cookieService.getCookie('exui-preferred-language');
34496
34553
  const currentLanguage = !!languageCookie && languageCookie !== '' ? languageCookie : 'en';
34497
- const preClientContext = this.sessionStorageService.getItem(EventStartGuard.CLIENT_CONTEXT);
34554
+ const preClientContext = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
34498
34555
  if (!preClientContext) {
34499
34556
  // creates client context for language if not already existing
34500
34557
  const storeClientContext = {
@@ -34504,7 +34561,7 @@ class EventStartGuard {
34504
34561
  }
34505
34562
  }
34506
34563
  };
34507
- this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34564
+ this.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34508
34565
  }
34509
34566
  else {
34510
34567
  const clientContextObj = JSON.parse(preClientContext);
@@ -34518,7 +34575,7 @@ class EventStartGuard {
34518
34575
  }
34519
34576
  }
34520
34577
  };
34521
- this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(clientContextAddLanguage));
34578
+ this.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(clientContextAddLanguage));
34522
34579
  }
34523
34580
  }
34524
34581
  if (caseInfoStr) {
@@ -34536,7 +34593,7 @@ class EventStartGuard {
34536
34593
  }
34537
34594
  return of(false);
34538
34595
  }
34539
- checkTaskInEventNotRequired(payload, caseId, taskId) {
34596
+ checkTaskInEventNotRequired(payload, caseId, taskId, eventId, userId) {
34540
34597
  if (!payload || !payload.tasks) {
34541
34598
  return true;
34542
34599
  }
@@ -34566,55 +34623,18 @@ class EventStartGuard {
34566
34623
  else {
34567
34624
  task = tasksAssignedToUser[0];
34568
34625
  }
34569
- const currentLanguage = this.cookieService.getCookie('exui-preferred-language');
34570
- // if one task assigned to user, allow user to complete event
34571
- const storeClientContext = {
34572
- client_context: {
34573
- user_task: {
34574
- task_data: task,
34575
- complete_task: true
34576
- },
34577
- user_language: {
34578
- language: currentLanguage
34579
- }
34580
- }
34581
- };
34582
- this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34626
+ this.setClientContextStorage(task, caseId, eventId, userId);
34583
34627
  return true;
34584
34628
  }
34585
34629
  }
34586
- removeTaskFromSessionStorage() {
34587
- this.sessionStorageService.removeItem(EventStartGuard.CLIENT_CONTEXT);
34588
- }
34589
34630
  checkForTasks(payload, caseId, eventId, taskId, userId) {
34590
34631
  if (taskId && payload?.tasks?.length > 0) {
34591
34632
  const task = payload.tasks.find((t) => t.id == taskId);
34592
34633
  if (task) {
34593
- // Store task to session
34594
- const taskEventCompletionInfo = {
34595
- caseId: caseId,
34596
- eventId: eventId,
34597
- userId: userId,
34598
- taskId: task.id,
34599
- createdTimestamp: Date.now()
34600
- };
34601
- const currentLanguage = this.cookieService.getCookie('exui-preferred-language');
34602
- const storeClientContext = {
34603
- client_context: {
34604
- user_task: {
34605
- task_data: task,
34606
- complete_task: true
34607
- },
34608
- user_language: {
34609
- language: currentLanguage
34610
- }
34611
- }
34612
- };
34613
- this.sessionStorageService.setItem('taskEventCompletionInfo', JSON.stringify(taskEventCompletionInfo));
34614
- this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34634
+ this.setClientContextStorage(task, caseId, eventId, userId);
34615
34635
  }
34616
34636
  else {
34617
- this.removeTaskFromSessionStorage();
34637
+ removeTaskFromClientContext(this.sessionStorageService);
34618
34638
  }
34619
34639
  }
34620
34640
  if (payload.task_required_for_event) {
@@ -34629,9 +34649,34 @@ class EventStartGuard {
34629
34649
  return of(false);
34630
34650
  }
34631
34651
  else {
34632
- return of(this.checkTaskInEventNotRequired(payload, caseId, taskId));
34652
+ return of(this.checkTaskInEventNotRequired(payload, caseId, taskId, eventId, userId));
34633
34653
  }
34634
34654
  }
34655
+ // EXUI-2743 - Make taskEventCompletionInfo always available in session storage with client context
34656
+ setClientContextStorage(task, caseId, eventId, userId) {
34657
+ // Store task to session
34658
+ const taskEventCompletionInfo = {
34659
+ caseId: caseId,
34660
+ eventId: eventId,
34661
+ userId: userId,
34662
+ taskId: task.id,
34663
+ createdTimestamp: Date.now()
34664
+ };
34665
+ const currentLanguage = this.cookieService.getCookie('exui-preferred-language');
34666
+ const storeClientContext = {
34667
+ client_context: {
34668
+ user_task: {
34669
+ task_data: task,
34670
+ complete_task: true
34671
+ },
34672
+ user_language: {
34673
+ language: currentLanguage
34674
+ }
34675
+ }
34676
+ };
34677
+ this.sessionStorageService.setItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO, JSON.stringify(taskEventCompletionInfo));
34678
+ this.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34679
+ }
34635
34680
  static ɵfac = function EventStartGuard_Factory(t) { return new (t || EventStartGuard)(i0.ɵɵinject(WorkAllocationService), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(ReadCookieService)); };
34636
34681
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventStartGuard, factory: EventStartGuard.ɵfac });
34637
34682
  }
@@ -34793,7 +34838,6 @@ class EventStartStateMachineService {
34793
34838
  }
34794
34839
  }
34795
34840
  };
34796
- context.sessionStorageService.setItem('clientContext', JSON.stringify(clientContext));
34797
34841
  let userInfo;
34798
34842
  const userInfoStr = context.sessionStorageService.getItem('userDetails');
34799
34843
  if (userInfoStr) {
@@ -34807,7 +34851,9 @@ class EventStartStateMachineService {
34807
34851
  taskId: task.id,
34808
34852
  createdTimestamp: Date.now()
34809
34853
  };
34810
- context.sessionStorageService.setItem('taskEventCompletionInfo', JSON.stringify(taskEventCompletionInfo));
34854
+ context.sessionStorageService.setItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO, JSON.stringify(taskEventCompletionInfo));
34855
+ // EXUI-2668 - Only add client context when taskEventCompletionInfo is set - stops auto completing incorrect tasks
34856
+ context.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(clientContext));
34811
34857
  // Allow user to perform the event
34812
34858
  context.router.navigate([`/cases/case-details/${context.caseId}/trigger/${context.eventId}`], { relativeTo: context.route });
34813
34859
  }