@hmcts/ccd-case-ui-toolkit 7.3.68-pofcc-srt → 7.3.68-pofcc-156

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.
@@ -12,11 +12,11 @@ import { BehaviorSubject, throwError, Subject, EMPTY, concat, defer, timer, Obse
12
12
  import { distinctUntilChanged, catchError, map, switchMap, repeat, retry, publish, refCount, debounceTime, delay, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
13
13
  import * as i1$2 from '@angular/common/http';
14
14
  import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
15
- import { Type, Exclude, Expose, plainToClassFromExist, plainToClass } from 'class-transformer';
16
- import moment from 'moment';
17
15
  import { __decorate, __metadata } from 'tslib';
16
+ import { Type, Exclude, Expose, plainToClassFromExist, plainToClass } from 'class-transformer';
18
17
  import * as _ from 'underscore';
19
18
  import 'reflect-metadata';
19
+ import moment from 'moment';
20
20
  import { generate } from 'pegjs';
21
21
  import { StateMachine } from '@edium/fsm';
22
22
  import * as i1$3 from '@angular/material/legacy-dialog';
@@ -1263,12 +1263,6 @@ class AbstractAppConfig {
1263
1263
  return 'ithc';
1264
1264
  return 'prod';
1265
1265
  }
1266
- getWASupportedRoleCategories() {
1267
- return [];
1268
- }
1269
- getWASupportedRoleTypes() {
1270
- return [];
1271
- }
1272
1266
  getCamRoleAssignmentsApiUrl() {
1273
1267
  return undefined;
1274
1268
  }
@@ -1325,8 +1319,6 @@ class CaseEditorConfig {
1325
1319
  icp_jurisdictions;
1326
1320
  events_to_hide;
1327
1321
  enable_service_specific_multi_followups;
1328
- wa_supported_role_categories;
1329
- wa_supported_role_types;
1330
1322
  }
1331
1323
 
1332
1324
  class StructuredLoggerService {
@@ -1855,2326 +1847,2428 @@ class SessionStorageGuard {
1855
1847
  args: [SessionJsonErrorLogger]
1856
1848
  }] }], null); })();
1857
1849
 
1858
- const USER_DETAILS = 'userDetails';
1859
- const PUI_CASE_MANAGER = 'pui-case-manager';
1860
- const JUDGE = 'judge';
1861
- function getUserDetails(sessionStorageService) {
1862
- const item = sessionStorageService?.getItem(USER_DETAILS);
1863
- return safeJsonParse(item, null);
1850
+ // tslint:disable:variable-name
1851
+ class AddressModel {
1852
+ AddressLine1 = '';
1853
+ AddressLine2 = '';
1854
+ AddressLine3 = '';
1855
+ PostTown = '';
1856
+ County = '';
1857
+ PostCode = '';
1858
+ Country = '';
1864
1859
  }
1865
- function isInternalUser(sessionStorageService) {
1866
- const userDetails = getUserDetails(sessionStorageService);
1867
- return userDetails && userDetails?.roles
1868
- && !(userDetails.roles.includes(PUI_CASE_MANAGER)
1869
- || userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
1860
+
1861
+ class Alert {
1862
+ level;
1863
+ message;
1870
1864
  }
1871
- function isJudiciaryUser(sessionStorageService) {
1872
- const userDetails = getUserDetails(sessionStorageService);
1873
- return userDetails && userDetails?.roles
1874
- && (userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
1865
+
1866
+ // tslint:disable:variable-name
1867
+ class CaseDetails {
1868
+ id;
1869
+ jurisdiction;
1870
+ case_type_id;
1871
+ state;
1872
+ created_date;
1873
+ last_modified;
1874
+ locked_by_user_id;
1875
+ security_level;
1876
+ case_data;
1877
+ }
1878
+
1879
+ // tslint:disable:variable-name
1880
+ class CaseEventData {
1881
+ event;
1882
+ data;
1883
+ event_data; // full event data
1884
+ event_token;
1885
+ ignore_warning;
1886
+ draft_id;
1887
+ case_reference;
1888
+ }
1889
+
1890
+ class WizardPageField {
1891
+ case_field_id;
1892
+ order;
1893
+ page_column_no;
1894
+ complex_field_overrides;
1895
+ }
1896
+
1897
+ class FixedListItem {
1898
+ code;
1899
+ label;
1900
+ order;
1875
1901
  }
1876
1902
 
1877
1903
  // @dynamic
1878
- class ActivityService {
1879
- http;
1880
- appConfig;
1881
- sessionStorageService;
1882
- static get ACTIVITY_VIEW() { return 'view'; }
1883
- static get ACTIVITY_EDIT() { return 'edit'; }
1884
- logger = new StructuredLoggerService();
1885
- constructor(http, appConfig, sessionStorageService) {
1886
- this.http = http;
1887
- this.appConfig = appConfig;
1888
- this.sessionStorageService = sessionStorageService;
1889
- }
1890
- get isEnabled() {
1891
- return this.activityUrl() && this.userAuthorised;
1892
- }
1893
- static DUMMY_CASE_REFERENCE = '0';
1894
- userAuthorised = undefined;
1895
- static handleHttpError(response) {
1896
- const error = HttpErrorService.convertToHttpError(response);
1897
- if (response?.status !== error.status) {
1898
- error.status = response.status;
1899
- }
1900
- return error;
1901
- }
1902
- getOptions() {
1903
- const userDetails = safeJsonParse(this.sessionStorageService.getItem(USER_DETAILS));
1904
- let headers = new HttpHeaders().set('Content-Type', 'application/json');
1905
- if (userDetails?.token) {
1906
- headers = headers.set('Authorization', userDetails.token);
1907
- }
1908
- return {
1909
- headers,
1910
- withCredentials: true,
1911
- observe: 'body',
1912
- };
1913
- }
1914
- getActivities(...caseId) {
1915
- try {
1916
- const options = this.getOptions();
1917
- const url = `${this.activityUrl()}/cases/${caseId.join(',')}/activity`;
1918
- return this.http
1919
- .get(url, options, false, ActivityService.handleHttpError)
1920
- .pipe(map(response => response));
1921
- }
1922
- catch (error) {
1923
- this.logUserMayNotBeAuthenticated(error);
1924
- }
1925
- }
1926
- postActivity(caseId, activity) {
1927
- try {
1928
- const options = this.getOptions();
1929
- const url = `${this.activityUrl()}/cases/${caseId}/activity`;
1930
- const body = { activity };
1931
- return this.http
1932
- .post(url, body, options, false)
1933
- .pipe(map(response => response));
1934
- }
1935
- catch (error) {
1936
- this.logUserMayNotBeAuthenticated(error);
1937
- }
1938
- }
1939
- verifyUserIsAuthorized() {
1940
- if (this.sessionStorageService.getItem(USER_DETAILS) && this.activityUrl() && this.userAuthorised === undefined) {
1941
- this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(() => this.userAuthorised = true, error => {
1942
- this.userAuthorised = [401, 403].indexOf(error.status) <= -1;
1943
- });
1944
- }
1945
- }
1946
- activityUrl() {
1947
- return this.appConfig.getActivityUrl();
1948
- }
1949
- logUserMayNotBeAuthenticated(error) {
1950
- this.logger.error('User may not be authenticated. Activity request was not sent.', { error });
1951
- }
1952
- static ɵfac = function ActivityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(SessionStorageService)); };
1953
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac });
1904
+ class FieldType {
1905
+ id;
1906
+ type;
1907
+ min;
1908
+ max;
1909
+ regular_expression;
1910
+ fixed_list_items;
1911
+ complex_fields;
1912
+ collection_field_type;
1954
1913
  }
1955
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
1956
- type: Injectable
1957
- }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: SessionStorageService }], null); })();
1914
+ __decorate([
1915
+ Type(() => FixedListItem),
1916
+ __metadata("design:type", Array)
1917
+ ], FieldType.prototype, "fixed_list_items", void 0);
1918
+ __decorate([
1919
+ Type(() => CaseField),
1920
+ __metadata("design:type", Array)
1921
+ ], FieldType.prototype, "complex_fields", void 0);
1922
+ __decorate([
1923
+ Type(() => FieldType),
1924
+ __metadata("design:type", FieldType)
1925
+ ], FieldType.prototype, "collection_field_type", void 0);
1958
1926
 
1959
1927
  // @dynamic
1960
- class ActivityPollingService {
1961
- activityService;
1962
- ngZone;
1963
- config;
1964
- logger = new StructuredLoggerService();
1965
- pendingRequests = new Map();
1966
- currentTimeoutHandle;
1967
- pollActivitiesSubscription;
1968
- pollConfig;
1969
- batchCollectionDelayMs;
1970
- maxRequestsPerBatch;
1971
- constructor(activityService, ngZone, config) {
1972
- this.activityService = activityService;
1973
- this.ngZone = ngZone;
1974
- this.config = config;
1975
- this.pollConfig = {
1976
- interval: config.getActivityNexPollRequestMs(),
1977
- attempts: config.getActivityRetry()
1978
- };
1979
- this.batchCollectionDelayMs = config.getActivityBatchCollectionDelayMs();
1980
- this.maxRequestsPerBatch = config.getActivityMaxRequestPerBatch();
1981
- }
1982
- get isEnabled() {
1983
- return this.activityService.isEnabled;
1984
- }
1985
- subscribeToActivity(caseId, done) {
1986
- if (!this.isEnabled) {
1987
- return new Subject();
1928
+ class CaseField {
1929
+ static logger = new StructuredLoggerService();
1930
+ id;
1931
+ hidden;
1932
+ hiddenCannotChange;
1933
+ label;
1934
+ originalLabel;
1935
+ noCacheLabel;
1936
+ order;
1937
+ parent;
1938
+ field_type;
1939
+ hint_text;
1940
+ security_label;
1941
+ display_context;
1942
+ display_context_parameter;
1943
+ month_format;
1944
+ show_condition;
1945
+ show_summary_change_option;
1946
+ show_summary_content_option;
1947
+ acls;
1948
+ metadata;
1949
+ formatted_value;
1950
+ retain_hidden_value;
1951
+ wizardProps;
1952
+ _value;
1953
+ _list_items = [];
1954
+ isTranslatedFlag = false;
1955
+ get value() {
1956
+ if (this.field_type && (this.field_type.type === 'DynamicList' || this.field_type.type === 'DynamicRadioList')) {
1957
+ return this._value && this._value.value ? this._value.value.code : this._value;
1988
1958
  }
1989
- let subject = this.pendingRequests.get(caseId);
1990
- if (subject) {
1991
- subject.subscribe(done);
1959
+ else if (this.field_type && this.field_type.type === 'DynamicMultiSelectList') {
1960
+ return this._value && this._value.value ? this._value.value : this._value;
1992
1961
  }
1993
1962
  else {
1994
- // Only the first pending request should start the batch collection timer.
1995
- const wasEmpty = this.pendingRequests.size === 0;
1996
- subject = new Subject();
1997
- subject.subscribe(done);
1998
- this.addPendingRequest(caseId, subject);
1999
- if (wasEmpty) {
2000
- this.ngZone.runOutsideAngular(() => {
2001
- this.currentTimeoutHandle = setTimeout(() => this.ngZone.run(() => {
2002
- this.flushRequests();
2003
- }), this.batchCollectionDelayMs);
2004
- });
2005
- }
2006
- }
2007
- if (this.pendingRequests.size >= this.maxRequestsPerBatch) {
2008
- this.flushRequests();
1963
+ return this._value;
2009
1964
  }
2010
- return subject;
2011
1965
  }
2012
- stopPolling() {
2013
- if (this.pollActivitiesSubscription) {
2014
- this.pollActivitiesSubscription.unsubscribe();
1966
+ set value(value) {
1967
+ if (this.isDynamic()) {
1968
+ if (value && value instanceof Object && value.list_items) {
1969
+ this._list_items = value.list_items;
1970
+ }
1971
+ else if (!this._list_items || this._list_items.length === 0) {
1972
+ // Extract the list items from the current value if that's the only place they exist.
1973
+ this._list_items = this.list_items;
1974
+ if (!value || !value.value) {
1975
+ value = null;
1976
+ }
1977
+ }
2015
1978
  }
1979
+ this._value = value;
2016
1980
  }
2017
- flushRequests() {
2018
- if (this.currentTimeoutHandle) {
2019
- clearTimeout(this.currentTimeoutHandle);
2020
- this.currentTimeoutHandle = undefined;
1981
+ get list_items() {
1982
+ if (this.isDynamic()) {
1983
+ return this._value && this._value.list_items ? this._value.list_items : this._list_items;
2021
1984
  }
2022
- if (!this.pendingRequests.size) {
2023
- return;
1985
+ else {
1986
+ return this.field_type.fixed_list_items;
2024
1987
  }
2025
- const requests = new Map(this.pendingRequests);
2026
- this.pendingRequests.clear();
2027
- this.performBatchRequest(requests);
2028
1988
  }
2029
- pollActivities(...caseIds) {
2030
- if (!this.isEnabled) {
2031
- return EMPTY;
1989
+ set list_items(items) {
1990
+ if ((items && !this._list_items) || (items?.length > this._list_items?.length)) {
1991
+ this._list_items = items;
2032
1992
  }
2033
- return this.polling(this.activityService.getActivities(...caseIds), this.pollConfig);
2034
- }
2035
- postViewActivity(caseId) {
2036
- return this.postActivity(caseId, ActivityService.ACTIVITY_VIEW);
2037
1993
  }
2038
- postEditActivity(caseId) {
2039
- return this.postActivity(caseId, ActivityService.ACTIVITY_EDIT);
2040
- }
2041
- performBatchRequest(requests) {
2042
- const caseIds = Array.from(requests.keys()).join();
2043
- this.ngZone.runOutsideAngular(() => {
2044
- // run polling outside angular zone so it does not trigger change detection
2045
- this.pollActivitiesSubscription = this.pollActivities(caseIds).subscribe({
2046
- // process activity inside zone so it triggers change detection for activity.component.ts
2047
- next: (activities) => this.ngZone.run(() => {
2048
- activities.forEach((activity) => {
2049
- // Ignore activities returned for cases outside this local batch.
2050
- requests.get(activity.caseId)?.next(activity);
2051
- });
2052
- }),
2053
- error: (err) => this.ngZone.run(() => {
2054
- this.logger.error('Error while polling activities.', { error: err });
2055
- Array.from(requests.values()).forEach((subject) => subject.error(err));
2056
- })
2057
- });
2058
- });
2059
- }
2060
- postActivity(caseId, activityType) {
2061
- if (!this.isEnabled) {
2062
- return EMPTY;
1994
+ get dateTimeEntryFormat() {
1995
+ if (this.isComplexDisplay()) {
1996
+ return null;
2063
1997
  }
2064
- const pollingConfig = {
2065
- ...this.pollConfig,
2066
- interval: 5000 // inline with CCD Backend
2067
- };
2068
- return this.polling(this.activityService.postActivity(caseId, activityType), pollingConfig);
2069
- }
2070
- addPendingRequest(caseId, subject) {
2071
- this.pendingRequests.set(caseId, subject);
2072
- // Components complete their returned Subject on destroy; remove it so a later same-case subscription gets a fresh Subject.
2073
- subject.subscribe({
2074
- complete: () => this.removePendingRequest(caseId, subject),
2075
- error: () => this.removePendingRequest(caseId, subject)
2076
- });
1998
+ if (this.display_context_parameter) {
1999
+ return this.extractBracketValue(this.display_context_parameter, '#DATETIMEENTRY');
2000
+ }
2001
+ return null;
2077
2002
  }
2078
- removePendingRequest(caseId, subject) {
2079
- if (this.pendingRequests.get(caseId) !== subject) {
2080
- return;
2003
+ get dateTimeDisplayFormat() {
2004
+ if (this.isComplexEntry()) {
2005
+ return null;
2081
2006
  }
2082
- this.pendingRequests.delete(caseId);
2083
- if (!this.pendingRequests.size && this.currentTimeoutHandle) {
2084
- clearTimeout(this.currentTimeoutHandle);
2085
- this.currentTimeoutHandle = undefined;
2007
+ if (this.display_context_parameter) {
2008
+ return this.extractBracketValue(this.display_context_parameter, '#DATETIMEDISPLAY');
2086
2009
  }
2010
+ return null;
2087
2011
  }
2088
- polling(request$, options) {
2089
- const pollingOptions = {
2090
- interval: options.interval,
2091
- attempts: options.attempts ?? 9,
2092
- exponentialUnit: options.exponentialUnit ?? 1000
2093
- };
2094
- return concat(request$, defer(() => timer(pollingOptions.interval).pipe(switchMap(() => request$))).pipe(repeat())).pipe(
2095
- // Preserve consecutive-failure retry behaviour using the current RxJS retry config.
2096
- retry({
2097
- count: pollingOptions.attempts,
2098
- delay: (_error, retryCount) => timer(this.getExponentialRetryDelay(retryCount, pollingOptions.exponentialUnit)),
2099
- resetOnSuccess: true
2100
- }));
2012
+ isComplexDisplay() {
2013
+ return (this.isComplex() || this.isCollection()) && this.isReadonly();
2101
2014
  }
2102
- getExponentialRetryDelay(consecutiveErrorsCount, exponentialUnit) {
2103
- return Math.pow(2, consecutiveErrorsCount - 1) * exponentialUnit;
2015
+ isComplexEntry() {
2016
+ return (this.isComplex() || this.isCollection()) && (this.isOptional() || this.isMandatory());
2104
2017
  }
2105
- static ɵfac = function ActivityPollingService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityPollingService)(i0.ɵɵinject(ActivityService), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(AbstractAppConfig)); };
2106
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityPollingService, factory: ActivityPollingService.ɵfac });
2107
- }
2108
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityPollingService, [{
2109
- type: Injectable
2110
- }], () => [{ type: ActivityService }, { type: i0.NgZone }, { type: AbstractAppConfig }], null); })();
2111
-
2112
- function ActivityComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2113
- i0.ɵɵelementStart(0, "div");
2114
- i0.ɵɵelement(1, "ccd-activity-icon", 5);
2115
- i0.ɵɵpipe(2, "rpxTranslate");
2116
- i0.ɵɵelementEnd();
2117
- } if (rf & 2) {
2118
- const ctx_r0 = i0.ɵɵnextContext(2);
2119
- i0.ɵɵclassProp("activityEditorsAndViewersIcons", ctx_r0.viewersPresent())("activityEditorsIcon", !ctx_r0.viewersPresent());
2120
- i0.ɵɵadvance();
2121
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 5, ctx_r0.editorsText));
2122
- } }
2123
- function ActivityComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
2124
- i0.ɵɵelementStart(0, "div", 6);
2125
- i0.ɵɵelement(1, "ccd-activity-icon", 7);
2126
- i0.ɵɵpipe(2, "rpxTranslate");
2127
- i0.ɵɵelementEnd();
2128
- } if (rf & 2) {
2129
- const ctx_r0 = i0.ɵɵnextContext(2);
2130
- i0.ɵɵadvance();
2131
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2132
- } }
2133
- function ActivityComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
2134
- i0.ɵɵelementStart(0, "div");
2135
- i0.ɵɵelement(1, "ccd-activity-banner", 8);
2136
- i0.ɵɵpipe(2, "rpxTranslate");
2137
- i0.ɵɵelementEnd();
2138
- } if (rf & 2) {
2139
- const ctx_r0 = i0.ɵɵnextContext(2);
2140
- i0.ɵɵadvance();
2141
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.editorsText));
2142
- } }
2143
- function ActivityComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
2144
- i0.ɵɵelementStart(0, "div");
2145
- i0.ɵɵelement(1, "ccd-activity-banner", 9);
2146
- i0.ɵɵpipe(2, "rpxTranslate");
2147
- i0.ɵɵelementEnd();
2148
- } if (rf & 2) {
2149
- const ctx_r0 = i0.ɵɵnextContext(2);
2150
- i0.ɵɵadvance();
2151
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2152
- } }
2153
- function ActivityComponent_div_0_Template(rf, ctx) { if (rf & 1) {
2154
- i0.ɵɵelementStart(0, "div", 1);
2155
- i0.ɵɵtemplate(1, ActivityComponent_div_0_div_1_Template, 3, 7, "div", 2)(2, ActivityComponent_div_0_div_2_Template, 3, 3, "div", 3)(3, ActivityComponent_div_0_div_3_Template, 3, 3, "div", 4)(4, ActivityComponent_div_0_div_4_Template, 3, 3, "div", 4);
2156
- i0.ɵɵelementEnd();
2157
- } if (rf & 2) {
2158
- const ctx_r0 = i0.ɵɵnextContext();
2159
- i0.ɵɵadvance();
2160
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.editorsPresent());
2161
- i0.ɵɵadvance();
2162
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.viewersPresent());
2163
- i0.ɵɵadvance();
2164
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.editorsPresent());
2165
- i0.ɵɵadvance();
2166
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.viewersPresent());
2167
- } }
2168
- class ActivityComponent {
2169
- activityPollingService;
2170
- activity;
2171
- dspMode = DisplayMode;
2172
- viewersText;
2173
- editorsText;
2174
- subscription;
2175
- caseId;
2176
- displayMode;
2177
- VIEWERS_PREFIX = '';
2178
- VIEWERS_SUFFIX = 'viewing this case';
2179
- EDITORS_PREFIX = 'This case is being updated by ';
2180
- EDITORS_SUFFIX = '';
2181
- constructor(activityPollingService) {
2182
- this.activityPollingService = activityPollingService;
2018
+ isReadonly() {
2019
+ return !_.isEmpty(this.display_context)
2020
+ && this.display_context.toUpperCase() === 'READONLY';
2183
2021
  }
2184
- ngOnInit() {
2185
- this.activity = new Activity();
2186
- this.activity.caseId = this.caseId;
2187
- this.activity.editors = [];
2188
- this.activity.unknownEditors = 0;
2189
- this.activity.viewers = [];
2190
- this.activity.unknownViewers = 0;
2191
- this.viewersText = '';
2192
- this.editorsText = '';
2193
- this.subscription = this.activityPollingService.subscribeToActivity(this.caseId, newActivity => this.onActivityChange(newActivity));
2022
+ isOptional() {
2023
+ return !_.isEmpty(this.display_context)
2024
+ && this.display_context.toUpperCase() === 'OPTIONAL';
2194
2025
  }
2195
- onActivityChange(newActivity) {
2196
- this.activity = newActivity;
2197
- this.viewersText = this.generateDescription(this.VIEWERS_PREFIX, this.VIEWERS_SUFFIX, this.activity.viewers, this.activity.unknownViewers);
2198
- this.editorsText = this.generateDescription(this.EDITORS_PREFIX, this.EDITORS_SUFFIX, this.activity.editors, this.activity.unknownEditors);
2026
+ isMandatory() {
2027
+ return !_.isEmpty(this.display_context)
2028
+ && this.display_context.toUpperCase() === 'MANDATORY';
2199
2029
  }
2200
- isActivityEnabled() {
2201
- return this.activityPollingService.isEnabled;
2030
+ isCollection() {
2031
+ return this.field_type && this.field_type.type === 'Collection';
2202
2032
  }
2203
- isActiveCase() {
2204
- return this.activity.editors.length || this.activity.viewers.length || this.activity.unknownEditors || this.activity.unknownViewers;
2033
+ isComplex() {
2034
+ return this.field_type && this.field_type.type === 'Complex';
2205
2035
  }
2206
- viewersPresent() {
2207
- return (this.activity.viewers.length > 0 || this.activity.unknownViewers > 0);
2036
+ isDynamic() {
2037
+ const dynamicFieldTypes = ['DynamicList', 'DynamicRadioList', 'DynamicMultiSelectList'];
2038
+ if (!this.field_type) {
2039
+ return false;
2040
+ }
2041
+ return dynamicFieldTypes.some(t => t === this.field_type.type);
2208
2042
  }
2209
- editorsPresent() {
2210
- return (this.activity.editors.length > 0 || this.activity.unknownEditors > 0);
2043
+ isCaseLink() {
2044
+ return this.isComplex()
2045
+ && this.field_type.id === 'CaseLink'
2046
+ && this.field_type.complex_fields.some(cf => cf.id === 'CaseReference');
2211
2047
  }
2212
- ngOnDestroy() {
2213
- if (this.subscription) {
2214
- this.subscription.complete();
2048
+ extractBracketValue(fmt, paramName, leftBracket = '(', rightBracket = ')') {
2049
+ fmt = fmt.split(',')
2050
+ .find(a => a.trim().startsWith(paramName));
2051
+ if (fmt) {
2052
+ const s = fmt.indexOf(leftBracket) + 1;
2053
+ const e = fmt.indexOf(rightBracket, s);
2054
+ if (e > s && s >= 0) {
2055
+ return fmt.substr(s, (e - s));
2056
+ }
2215
2057
  }
2216
- this.activityPollingService.stopPolling();
2058
+ return null;
2217
2059
  }
2218
- generateDescription(prefix, suffix, namesArray, unknownCount) {
2219
- let resultText = prefix;
2220
- resultText += namesArray.map(activityInfo => `${activityInfo.forename} ${activityInfo.surname}`).join(', ');
2221
- if (unknownCount > 0) {
2222
- resultText += (namesArray.length > 0 ? ` and ${unknownCount} other` : `${unknownCount} user`);
2223
- resultText += (unknownCount > 1 ? 's' : '');
2224
- }
2225
- else {
2226
- resultText = this.replaceLastCommaWithAnd(resultText);
2227
- }
2228
- if (suffix.length > 0) {
2229
- if (namesArray.length + unknownCount > 1) {
2230
- resultText += ` are ${suffix}`;
2060
+ // Ascend the hierarchy to get the full path of the field
2061
+ getHierachicalId(curr) {
2062
+ const prefix = curr ? curr + "_" : "";
2063
+ if (prefix.length < 1024) {
2064
+ if (this.parent) {
2065
+ return this.parent.getHierachicalId(prefix + this.id);
2231
2066
  }
2232
2067
  else {
2233
- resultText += ` is ${suffix}`;
2234
- }
2235
- }
2236
- return resultText;
2237
- }
2238
- replaceLastCommaWithAnd(str) {
2239
- return str.trim().replace(/,([^,]*)$/, ' and $1').split(' ').join(' ');
2240
- }
2241
- static ɵfac = function ActivityComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityComponent)(i0.ɵɵdirectiveInject(ActivityPollingService)); };
2242
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ActivityComponent, selectors: [["ccd-activity"]], inputs: { caseId: "caseId", displayMode: "displayMode" }, standalone: false, decls: 1, vars: 1, consts: [["class", "activityComponent", 4, "ngIf"], [1, "activityComponent"], [3, "activityEditorsAndViewersIcons", "activityEditorsIcon", 4, "ngIf"], ["class", "activityViewersIcon", 4, "ngIf"], [4, "ngIf"], ["imageLink", "assets/img/editor.png", 3, "description"], [1, "activityViewersIcon"], ["imageLink", "assets/img/viewer.png", 3, "description"], ["imageLink", "assets/img/editorBanner.png", "bannerType", "editor", 3, "description"], ["imageLink", "assets/img/viewerBanner.png", "bannerType", "viewer", 3, "description"]], template: function ActivityComponent_Template(rf, ctx) { if (rf & 1) {
2243
- i0.ɵɵtemplate(0, ActivityComponent_div_0_Template, 5, 4, "div", 0);
2244
- } if (rf & 2) {
2245
- i0.ɵɵproperty("ngIf", ctx.isActivityEnabled());
2246
- } }, dependencies: [i5.NgIf, ActivityBannerComponent, ActivityIconComponent, i1.RpxTranslatePipe], styles: [".activityEditorsIcon[_ngcontent-%COMP%]{margin-left:14px}.activityEditorsAndViewersIcons[_ngcontent-%COMP%], .activityViewersIcon[_ngcontent-%COMP%]{float:left;margin-left:14px}"] });
2247
- }
2248
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityComponent, [{
2249
- type: Component,
2250
- args: [{ selector: 'ccd-activity', standalone: false, template: "<div class=\"activityComponent\" *ngIf=\"isActivityEnabled()\">\n <div *ngIf=\"displayMode === dspMode.ICON && editorsPresent()\" [class.activityEditorsAndViewersIcons]=\"viewersPresent()\" [class.activityEditorsIcon]=\"!viewersPresent()\">\n <ccd-activity-icon imageLink=\"assets/img/editor.png\" [description]=\"editorsText | rpxTranslate\"></ccd-activity-icon>\n </div>\n <div *ngIf=\"displayMode === dspMode.ICON && viewersPresent()\" class=\"activityViewersIcon\">\n <ccd-activity-icon imageLink=\"assets/img/viewer.png\" [description]=\"viewersText | rpxTranslate\"></ccd-activity-icon>\n </div>\n <div *ngIf=\"displayMode === dspMode.BANNER && editorsPresent()\">\n <ccd-activity-banner imageLink=\"assets/img/editorBanner.png\" [description]=\"editorsText | rpxTranslate\" bannerType=\"editor\">\n </ccd-activity-banner>\n </div>\n <div *ngIf=\"displayMode === dspMode.BANNER && viewersPresent()\">\n <ccd-activity-banner imageLink=\"assets/img/viewerBanner.png\" [description]=\"viewersText | rpxTranslate\" bannerType=\"viewer\">\n </ccd-activity-banner>\n </div>\n</div>\n", styles: [".activityEditorsIcon{margin-left:14px}.activityEditorsAndViewersIcons,.activityViewersIcon{float:left;margin-left:14px}\n"] }]
2251
- }], () => [{ type: ActivityPollingService }], { caseId: [{
2252
- type: Input
2253
- }], displayMode: [{
2254
- type: Input
2255
- }] }); })();
2256
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ActivityComponent, { className: "ActivityComponent", filePath: "lib/shared/components/activity/activity.component.ts", lineNumber: 12 }); })();
2257
-
2258
- class ActivityModule {
2259
- static ɵfac = function ActivityModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityModule)(); };
2260
- static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ActivityModule });
2261
- static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
2262
- ActivityService,
2263
- ActivityPollingService,
2264
- SessionStorageService,
2265
- ], imports: [CommonModule,
2266
- RouterModule,
2267
- RpxTranslationModule.forChild()] });
2268
- }
2269
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityModule, [{
2270
- type: NgModule,
2271
- args: [{
2272
- imports: [
2273
- CommonModule,
2274
- RouterModule,
2275
- RpxTranslationModule.forChild()
2276
- ],
2277
- declarations: [
2278
- ActivityComponent,
2279
- ActivityBannerComponent,
2280
- ActivityIconComponent,
2281
- ],
2282
- exports: [
2283
- ActivityComponent,
2284
- ActivityBannerComponent,
2285
- ActivityIconComponent,
2286
- ],
2287
- providers: [
2288
- ActivityService,
2289
- ActivityPollingService,
2290
- SessionStorageService,
2291
- ]
2292
- }]
2293
- }], null, null); })();
2294
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ActivityModule, { declarations: [ActivityComponent,
2295
- ActivityBannerComponent,
2296
- ActivityIconComponent], imports: [CommonModule,
2297
- RouterModule, i1.RpxTranslationModule], exports: [ActivityComponent,
2298
- ActivityBannerComponent,
2299
- ActivityIconComponent] }); })();
2300
-
2301
- class AlertService {
2302
- router;
2303
- rpxTranslationService;
2304
- // the preserved messages
2305
- preservedError = '';
2306
- preservedWarning = '';
2307
- preservedSuccess = '';
2308
- // TODO: Remove
2309
- message;
2310
- level;
2311
- successes;
2312
- errors;
2313
- warnings;
2314
- // TODO: Remove
2315
- alerts;
2316
- successObserver;
2317
- errorObserver;
2318
- warningObserver;
2319
- // TODO: Remove
2320
- alertObserver;
2321
- preserveAlerts = false;
2322
- constructor(router, rpxTranslationService) {
2323
- this.router = router;
2324
- this.rpxTranslationService = rpxTranslationService;
2325
- this.successes = Observable
2326
- .create(observer => this.successObserver = observer).pipe(publish(), refCount());
2327
- this.successes.subscribe();
2328
- this.errors = Observable
2329
- .create(observer => this.errorObserver = observer).pipe(publish(), refCount());
2330
- this.errors.subscribe();
2331
- this.warnings = Observable
2332
- .create(observer => this.warningObserver = observer).pipe(publish(), refCount());
2333
- this.warnings.subscribe();
2334
- // TODO: Remove
2335
- this.alerts = Observable
2336
- .create(observer => this.alertObserver = observer).pipe(publish(), refCount());
2337
- this.alerts.subscribe();
2338
- this.router
2339
- .events
2340
- .subscribe(event => {
2341
- if (event instanceof NavigationStart) {
2342
- // if there is no longer a preserve alerts setting for the page then clear all observers and preserved messages
2343
- if (!this.preserveAlerts) {
2344
- this.clear();
2345
- }
2346
- // if not, then set the preserving of alerts to false so rendering to a new page
2347
- this.preserveAlerts = false;
2068
+ return prefix + this.id;
2348
2069
  }
2349
- });
2350
- }
2351
- clear() {
2352
- this.successObserver.next(null);
2353
- this.errorObserver.next(null);
2354
- this.warningObserver.next(null);
2355
- this.preservedError = '';
2356
- this.preservedWarning = '';
2357
- this.preservedSuccess = '';
2358
- // EUI-3381.
2359
- this.alertObserver.next(null);
2360
- this.message = '';
2361
- }
2362
- error({ phrase, replacements }) {
2363
- const message = this.getTranslationWithReplacements(phrase, replacements);
2364
- this.preservedError = this.preserveMessages(message);
2365
- const alert = { level: 'error', message };
2366
- this.errorObserver.next(alert);
2367
- // EUI-3381.
2368
- this.push(alert);
2369
- }
2370
- warning({ phrase, replacements }) {
2371
- const message = this.getTranslationWithReplacements(phrase, replacements);
2372
- this.preservedWarning = this.preserveMessages(message);
2373
- const alert = { level: 'warning', message };
2374
- this.warningObserver.next(alert);
2375
- // EUI-3381.
2376
- this.push(alert);
2377
- }
2378
- success({ preserve, phrase, replacements }) {
2379
- const message = this.getTranslationWithReplacements(phrase, replacements);
2380
- this.preserveAlerts = preserve || this.preserveAlerts;
2381
- const alert = { level: 'success', message };
2382
- this.preservedSuccess = this.preserveMessages(message);
2383
- this.successObserver.next(alert);
2384
- // EUI-3381.
2385
- this.push(alert);
2386
- }
2387
- getTranslationWithReplacements(phrase, replacements) {
2388
- let message;
2389
- if (replacements) {
2390
- this.rpxTranslationService.getTranslationWithReplacements$(phrase, replacements).subscribe(translation => {
2391
- message = translation;
2392
- });
2393
2070
  }
2394
2071
  else {
2395
- this.rpxTranslationService.getTranslation$(phrase).subscribe(translation => {
2396
- message = translation;
2397
- });
2072
+ CaseField.logger.error('Path too long, possible circular reference in case field hierarchy.');
2073
+ return this.id;
2398
2074
  }
2399
- return message;
2400
2075
  }
2401
- setPreserveAlerts(preserve, urlInfo) {
2402
- // if there is no url setting then just preserve the messages
2403
- if (!urlInfo) {
2404
- this.preserveAlerts = preserve;
2405
- }
2406
- else {
2407
- // check if the url includes the sting given
2408
- this.preserveAlerts = this.currentUrlIncludesInfo(preserve, urlInfo);
2409
- }
2076
+ set isTranslated(val) {
2077
+ this.isTranslatedFlag = val;
2410
2078
  }
2411
- currentUrlIncludesInfo(preserve, urlInfo) {
2412
- // loop through the list of strings and check the router includes all of them
2413
- for (const urlSnip of urlInfo) {
2414
- if (!this.router.url.includes(urlSnip)) {
2415
- // return the opposite boolean value if the router does not include one of the strings
2416
- return !preserve;
2417
- }
2418
- }
2419
- // return the boolean value if all strings are in the url
2420
- return preserve;
2079
+ get isTranslated() {
2080
+ return this.isTranslatedFlag;
2421
2081
  }
2422
- isPreserveAlerts() {
2423
- return this.preserveAlerts;
2082
+ }
2083
+ __decorate([
2084
+ Exclude(),
2085
+ __metadata("design:type", CaseField)
2086
+ ], CaseField.prototype, "parent", void 0);
2087
+ __decorate([
2088
+ Type(() => FieldType),
2089
+ __metadata("design:type", FieldType)
2090
+ ], CaseField.prototype, "field_type", void 0);
2091
+ __decorate([
2092
+ Type(() => WizardPageField),
2093
+ __metadata("design:type", WizardPageField)
2094
+ ], CaseField.prototype, "wizardProps", void 0);
2095
+ __decorate([
2096
+ Expose(),
2097
+ __metadata("design:type", Object),
2098
+ __metadata("design:paramtypes", [Object])
2099
+ ], CaseField.prototype, "value", null);
2100
+ __decorate([
2101
+ Expose(),
2102
+ __metadata("design:type", Object),
2103
+ __metadata("design:paramtypes", [Object])
2104
+ ], CaseField.prototype, "list_items", null);
2105
+ __decorate([
2106
+ Expose(),
2107
+ __metadata("design:type", String),
2108
+ __metadata("design:paramtypes", [])
2109
+ ], CaseField.prototype, "dateTimeEntryFormat", null);
2110
+ __decorate([
2111
+ Expose(),
2112
+ __metadata("design:type", String),
2113
+ __metadata("design:paramtypes", [])
2114
+ ], CaseField.prototype, "dateTimeDisplayFormat", null);
2115
+ __decorate([
2116
+ Expose(),
2117
+ __metadata("design:type", Function),
2118
+ __metadata("design:paramtypes", []),
2119
+ __metadata("design:returntype", void 0)
2120
+ ], CaseField.prototype, "isComplexDisplay", null);
2121
+ __decorate([
2122
+ Expose(),
2123
+ __metadata("design:type", Function),
2124
+ __metadata("design:paramtypes", []),
2125
+ __metadata("design:returntype", void 0)
2126
+ ], CaseField.prototype, "isComplexEntry", null);
2127
+ __decorate([
2128
+ Expose(),
2129
+ __metadata("design:type", Function),
2130
+ __metadata("design:paramtypes", []),
2131
+ __metadata("design:returntype", void 0)
2132
+ ], CaseField.prototype, "isReadonly", null);
2133
+ __decorate([
2134
+ Expose(),
2135
+ __metadata("design:type", Function),
2136
+ __metadata("design:paramtypes", []),
2137
+ __metadata("design:returntype", void 0)
2138
+ ], CaseField.prototype, "isOptional", null);
2139
+ __decorate([
2140
+ Expose(),
2141
+ __metadata("design:type", Function),
2142
+ __metadata("design:paramtypes", []),
2143
+ __metadata("design:returntype", void 0)
2144
+ ], CaseField.prototype, "isMandatory", null);
2145
+ __decorate([
2146
+ Expose(),
2147
+ __metadata("design:type", Function),
2148
+ __metadata("design:paramtypes", []),
2149
+ __metadata("design:returntype", Boolean)
2150
+ ], CaseField.prototype, "isCollection", null);
2151
+ __decorate([
2152
+ Expose(),
2153
+ __metadata("design:type", Function),
2154
+ __metadata("design:paramtypes", []),
2155
+ __metadata("design:returntype", Boolean)
2156
+ ], CaseField.prototype, "isComplex", null);
2157
+ __decorate([
2158
+ Expose(),
2159
+ __metadata("design:type", Function),
2160
+ __metadata("design:paramtypes", []),
2161
+ __metadata("design:returntype", Boolean)
2162
+ ], CaseField.prototype, "isDynamic", null);
2163
+ __decorate([
2164
+ Expose(),
2165
+ __metadata("design:type", Function),
2166
+ __metadata("design:paramtypes", []),
2167
+ __metadata("design:returntype", Boolean)
2168
+ ], CaseField.prototype, "isCaseLink", null);
2169
+ __decorate([
2170
+ Expose(),
2171
+ __metadata("design:type", Function),
2172
+ __metadata("design:paramtypes", [String]),
2173
+ __metadata("design:returntype", String)
2174
+ ], CaseField.prototype, "getHierachicalId", null);
2175
+
2176
+ // @dynamic
2177
+ class WizardPage {
2178
+ id;
2179
+ label;
2180
+ order;
2181
+ wizard_page_fields;
2182
+ case_fields;
2183
+ show_condition;
2184
+ parsedShowCondition;
2185
+ getCol1Fields() {
2186
+ return this.case_fields?.filter(f => !f.wizardProps.page_column_no || f.wizardProps.page_column_no === 1);
2424
2187
  }
2425
- preserveMessages(message) {
2426
- // preserve the messages if set to preserve them
2427
- if (this.isPreserveAlerts()) {
2428
- return message;
2429
- }
2430
- else {
2431
- return '';
2432
- }
2188
+ getCol2Fields() {
2189
+ return this.case_fields?.filter(f => f.wizardProps.page_column_no === 2);
2433
2190
  }
2434
- // TODO: Remove
2435
- push(msgObject) {
2436
- this.message = msgObject.message;
2437
- this.level = msgObject.level;
2438
- this.alertObserver.next({
2439
- level: this.level,
2440
- message: this.message
2441
- });
2191
+ isMultiColumn() {
2192
+ return this.getCol2Fields()?.length > 0;
2442
2193
  }
2443
- static ɵfac = function AlertService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AlertService)(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(i1.RpxTranslationService)); };
2444
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AlertService, factory: AlertService.ɵfac });
2445
2194
  }
2446
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AlertService, [{
2447
- type: Injectable
2448
- }], () => [{ type: i1$1.Router }, { type: i1.RpxTranslationService }], null); })();
2195
+ __decorate([
2196
+ Type(() => WizardPageField),
2197
+ __metadata("design:type", Array)
2198
+ ], WizardPage.prototype, "wizard_page_fields", void 0);
2199
+ __decorate([
2200
+ Type(() => CaseField),
2201
+ __metadata("design:type", Array)
2202
+ ], WizardPage.prototype, "case_fields", void 0);
2449
2203
 
2450
- const DRAFT_PREFIX = 'DRAFT';
2451
- const DRAFT_QUERY_PARAM = 'draft';
2452
- class Draft {
2204
+ // @dynamic
2205
+ class CaseEventTrigger {
2453
2206
  id;
2454
- document;
2455
- type;
2456
- created;
2457
- updated;
2458
- static stripDraftId(draftId) {
2459
- return draftId.slice(DRAFT_PREFIX.length);
2207
+ name;
2208
+ description;
2209
+ case_id;
2210
+ case_fields;
2211
+ event_token;
2212
+ wizard_pages;
2213
+ show_summary;
2214
+ show_event_notes;
2215
+ end_button_label;
2216
+ can_save_draft;
2217
+ hasFields() {
2218
+ return this.case_fields && this.case_fields.length !== 0;
2460
2219
  }
2461
- static isDraft(id) {
2462
- return String(id).startsWith(DRAFT_PREFIX);
2220
+ hasPages() {
2221
+ return this.wizard_pages && this.wizard_pages.length !== 0;
2463
2222
  }
2464
2223
  }
2224
+ __decorate([
2225
+ Type(() => CaseField),
2226
+ __metadata("design:type", Array)
2227
+ ], CaseEventTrigger.prototype, "case_fields", void 0);
2228
+ __decorate([
2229
+ Type(() => WizardPage),
2230
+ __metadata("design:type", Array)
2231
+ ], CaseEventTrigger.prototype, "wizard_pages", void 0);
2465
2232
 
2466
- class DraftService {
2467
- http;
2468
- appConfig;
2469
- errorService;
2470
- static V2_MEDIATYPE_DRAFT_CREATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-create.v2+json;charset=UTF-8';
2471
- static V2_MEDIATYPE_DRAFT_UPDATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-update.v2+json;charset=UTF-8';
2472
- static V2_MEDIATYPE_DRAFT_READ = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-read.v2+json;charset=UTF-8';
2473
- static V2_MEDIATYPE_DRAFT_DELETE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-delete.v2+json;charset=UTF-8';
2474
- constructor(http, appConfig, errorService) {
2475
- this.http = http;
2476
- this.appConfig = appConfig;
2477
- this.errorService = errorService;
2478
- }
2479
- createDraft(ctid, eventData) {
2480
- const saveDraftEndpoint = this.appConfig.getCreateOrUpdateDraftsUrl(ctid);
2481
- const headers = new HttpHeaders()
2482
- .set('experimental', 'true')
2483
- .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_CREATE)
2484
- .set('Content-Type', 'application/json');
2485
- return this.http
2486
- .post(saveDraftEndpoint, eventData, { headers, observe: 'body' })
2487
- .pipe(catchError((error) => {
2488
- this.errorService.setError(error);
2489
- return throwError(error);
2490
- }));
2491
- }
2492
- updateDraft(ctid, draftId, eventData) {
2493
- const saveDraftEndpoint = `${this.appConfig.getCreateOrUpdateDraftsUrl(ctid)}/${draftId}`;
2494
- const headers = new HttpHeaders()
2495
- .set('experimental', 'true')
2496
- .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_UPDATE)
2497
- .set('Content-Type', 'application/json');
2498
- return this.http
2499
- .put(saveDraftEndpoint, eventData, { headers, observe: 'body' })
2500
- .pipe(catchError((error) => {
2501
- this.errorService.setError(error);
2502
- return throwError(error);
2503
- }));
2504
- }
2505
- getDraft(draftId) {
2506
- const url = this.appConfig.getViewOrDeleteDraftsUrl(draftId.slice(DRAFT_PREFIX.length));
2507
- const headers = new HttpHeaders()
2508
- .set('experimental', 'true')
2509
- .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_READ)
2510
- .set('Content-Type', 'application/json');
2511
- return this.http
2512
- .get(url, { headers, observe: 'body' })
2513
- .pipe(catchError((error) => {
2514
- this.errorService.setError(error);
2515
- return throwError(error);
2516
- }));
2517
- }
2518
- deleteDraft(draftId) {
2519
- const url = this.appConfig.getViewOrDeleteDraftsUrl(draftId.slice(DRAFT_PREFIX.length));
2520
- const headers = new HttpHeaders()
2521
- .set('experimental', 'true')
2522
- .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_DELETE)
2523
- .set('Content-Type', 'application/json');
2524
- return this.http
2525
- .delete(url, { headers, observe: 'body' }).pipe(catchError((error) => {
2526
- this.errorService.setError(error);
2527
- return throwError(error);
2528
- }));
2529
- }
2530
- createOrUpdateDraft(caseTypeId, draftId, caseEventData) {
2531
- if (!draftId) {
2532
- return this.createDraft(caseTypeId, caseEventData);
2533
- }
2534
- else {
2535
- return this.updateDraft(caseTypeId, Draft.stripDraftId(draftId), caseEventData);
2536
- }
2537
- }
2538
- static ɵfac = function DraftService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DraftService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(HttpErrorService)); };
2539
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DraftService, factory: DraftService.ɵfac });
2233
+ // tslint:disable:variable-name
2234
+ class CaseViewEvent {
2235
+ id;
2236
+ timestamp;
2237
+ summary;
2238
+ comment;
2239
+ event_id;
2240
+ event_name;
2241
+ state_id;
2242
+ state_name;
2243
+ user_id;
2244
+ user_last_name;
2245
+ user_first_name;
2246
+ significant_item;
2540
2247
  }
2541
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DraftService, [{
2542
- type: Injectable
2543
- }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }], null); })();
2544
2248
 
2545
- class ConditionalShowRegistrarService {
2546
- registeredDirectives = [];
2547
- register(newDirective) {
2548
- this.registeredDirectives.push(newDirective);
2549
- }
2550
- reset() {
2551
- this.registeredDirectives = [];
2552
- }
2553
- static ɵfac = function ConditionalShowRegistrarService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConditionalShowRegistrarService)(); };
2554
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConditionalShowRegistrarService, factory: ConditionalShowRegistrarService.ɵfac });
2249
+ class CaseViewTrigger {
2250
+ id;
2251
+ name;
2252
+ description;
2253
+ order;
2555
2254
  }
2556
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConditionalShowRegistrarService, [{
2557
- type: Injectable
2558
- }], null, null); })();
2559
2255
 
2560
- /** Keeps track of initially hidden fields that toggle to show on the page (parent page).
2561
- * Used to decide whether to redisplay the grey bar when returning to the page during
2562
- * navigation between pages.
2563
- */
2564
- class GreyBarService {
2565
- fieldsToggledToShow = [];
2566
- renderer;
2567
- constructor(rendererFactory) {
2568
- this.renderer = rendererFactory.createRenderer(null, null);
2569
- }
2570
- showGreyBar(field, el) {
2571
- if (!field.isCollection()) {
2572
- this.addGreyBar(el);
2573
- }
2574
- }
2575
- removeGreyBar(el) {
2576
- const divSelector = el.nativeElement.querySelector('div');
2577
- if (divSelector) {
2578
- this.renderer.removeClass(divSelector, 'show-condition-grey-bar');
2579
- }
2580
- }
2581
- addToggledToShow(fieldId) {
2582
- this.fieldsToggledToShow.push(fieldId);
2583
- }
2584
- removeToggledToShow(fieldId) {
2585
- this.fieldsToggledToShow = this.fieldsToggledToShow.filter(id => id !== fieldId);
2586
- }
2587
- wasToggledToShow(fieldId) {
2588
- return this.fieldsToggledToShow.find(id => id === fieldId) !== undefined;
2589
- }
2590
- reset() {
2591
- this.fieldsToggledToShow = [];
2592
- }
2593
- addGreyBar(el) {
2594
- const divSelector = el.nativeElement.querySelector('div');
2595
- if (divSelector) {
2596
- this.renderer.addClass(divSelector, 'show-condition-grey-bar');
2597
- }
2598
- }
2599
- static ɵfac = function GreyBarService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GreyBarService)(i0.ɵɵinject(i0.RendererFactory2)); };
2600
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GreyBarService, factory: GreyBarService.ɵfac });
2256
+ class CaseEvent {
2257
+ id;
2258
+ name;
2259
+ post_state;
2260
+ pre_states;
2261
+ case_fields;
2262
+ description;
2263
+ order;
2264
+ acls;
2601
2265
  }
2602
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GreyBarService, [{
2603
- type: Injectable
2604
- }], () => [{ type: i0.RendererFactory2 }], null); })();
2605
-
2606
- var AddCommentsErrorMessage;
2607
- (function (AddCommentsErrorMessage) {
2608
- AddCommentsErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
2609
- AddCommentsErrorMessage["FLAG_COMMENTS_NOT_ENTERED_EXTERNAL"] = "Please enter comments for this support request";
2610
- AddCommentsErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
2611
- })(AddCommentsErrorMessage || (AddCommentsErrorMessage = {}));
2612
-
2613
- var AddCommentsStep;
2614
- (function (AddCommentsStep) {
2615
- AddCommentsStep["HINT_TEXT"] = "Explain why you are creating this flag. Do not include any sensitive information such as personal details.";
2616
- AddCommentsStep["HINT_TEXT_EXTERNAL"] = "Explain why you are creating this support request. Do not include any sensitive information such as personal details.";
2617
- AddCommentsStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2618
- AddCommentsStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
2619
- })(AddCommentsStep || (AddCommentsStep = {}));
2620
2266
 
2621
- var CaseFlagCheckYourAnswersPageStep;
2622
- (function (CaseFlagCheckYourAnswersPageStep) {
2623
- CaseFlagCheckYourAnswersPageStep["CASE_LEVEL_LOCATION"] = "Case level";
2624
- CaseFlagCheckYourAnswersPageStep["ADD_FLAG_HEADER_TEXT"] = "Add flag to";
2625
- CaseFlagCheckYourAnswersPageStep["ADD_FLAG_HEADER_TEXT_EXTERNAL"] = "Add support to";
2626
- CaseFlagCheckYourAnswersPageStep["UPDATE_FLAG_HEADER_TEXT"] = "Update flag for";
2627
- CaseFlagCheckYourAnswersPageStep["UPDATE_FLAG_HEADER_TEXT_EXTERNAL"] = "Update support for";
2628
- CaseFlagCheckYourAnswersPageStep["FLAG_TYPE_HEADER_TEXT"] = "Flag type";
2629
- CaseFlagCheckYourAnswersPageStep["FLAG_TYPE_HEADER_TEXT_EXTERNAL"] = "Support type";
2630
- CaseFlagCheckYourAnswersPageStep["NONE"] = "";
2631
- })(CaseFlagCheckYourAnswersPageStep || (CaseFlagCheckYourAnswersPageStep = {}));
2267
+ class CaseState {
2268
+ id;
2269
+ name;
2270
+ description;
2271
+ order;
2272
+ }
2632
2273
 
2633
- /**
2634
- * Create and update contexts for external users are, by definition, part of Case Flags 2.1 - thus there is no enum
2635
- * value for these.
2636
- */
2637
- var CaseFlagDisplayContextParameter;
2638
- (function (CaseFlagDisplayContextParameter) {
2639
- CaseFlagDisplayContextParameter["CREATE"] = "#ARGUMENT(CREATE)";
2640
- CaseFlagDisplayContextParameter["CREATE_EXTERNAL"] = "#ARGUMENT(CREATE,EXTERNAL)";
2641
- CaseFlagDisplayContextParameter["CREATE_2_POINT_1"] = "#ARGUMENT(CREATE,VERSION2.1)";
2642
- CaseFlagDisplayContextParameter["READ_EXTERNAL"] = "#ARGUMENT(READ,EXTERNAL)";
2643
- CaseFlagDisplayContextParameter["UPDATE"] = "#ARGUMENT(UPDATE)";
2644
- CaseFlagDisplayContextParameter["UPDATE_EXTERNAL"] = "#ARGUMENT(UPDATE,EXTERNAL)";
2645
- CaseFlagDisplayContextParameter["UPDATE_2_POINT_1"] = "#ARGUMENT(UPDATE,VERSION2.1)";
2646
- })(CaseFlagDisplayContextParameter || (CaseFlagDisplayContextParameter = {}));
2274
+ // Light clone of CaseType to be used in Jurisdiction class
2275
+ // to avoid cyclic dependency
2276
+ class CaseTypeLite {
2277
+ id;
2278
+ name;
2279
+ events;
2280
+ states;
2281
+ description;
2282
+ }
2647
2283
 
2648
- var CaseFlagFormFields;
2649
- (function (CaseFlagFormFields) {
2650
- CaseFlagFormFields["FLAG_TYPE"] = "flagType";
2651
- CaseFlagFormFields["COMMENTS"] = "flagComment";
2652
- CaseFlagFormFields["COMMENTS_WELSH"] = "flagComment_cy";
2653
- CaseFlagFormFields["OTHER_FLAG_DESCRIPTION"] = "otherDescription";
2654
- CaseFlagFormFields["OTHER_FLAG_DESCRIPTION_WELSH"] = "otherDescription_cy";
2655
- CaseFlagFormFields["STATUS"] = "status";
2656
- CaseFlagFormFields["STATUS_CHANGE_REASON"] = "flagStatusReasonChange";
2657
- CaseFlagFormFields["IS_WELSH_TRANSLATION_NEEDED"] = "flagIsWelshTranslationNeeded";
2658
- CaseFlagFormFields["IS_VISIBLE_INTERNALLY_ONLY"] = "flagIsVisibleInternallyOnly";
2659
- })(CaseFlagFormFields || (CaseFlagFormFields = {}));
2284
+ // @dynamics
2285
+ class CaseType {
2286
+ id;
2287
+ name;
2288
+ events;
2289
+ states;
2290
+ case_fields;
2291
+ description;
2292
+ jurisdiction;
2293
+ printEnabled;
2294
+ }
2295
+ __decorate([
2296
+ Type(() => CaseField),
2297
+ __metadata("design:type", Array)
2298
+ ], CaseType.prototype, "case_fields", void 0);
2660
2299
 
2661
- var CaseFlagStatus;
2662
- (function (CaseFlagStatus) {
2663
- CaseFlagStatus["REQUESTED"] = "Requested";
2664
- CaseFlagStatus["ACTIVE"] = "Active";
2665
- CaseFlagStatus["INACTIVE"] = "Inactive";
2666
- CaseFlagStatus["NOT_APPROVED"] = "Not approved";
2667
- })(CaseFlagStatus || (CaseFlagStatus = {}));
2300
+ // tslint:disable:variable-name
2301
+ class EventCaseField {
2302
+ case_field_id;
2303
+ showCondition;
2304
+ }
2668
2305
 
2669
- var CaseFlagSummaryListDisplayMode;
2670
- (function (CaseFlagSummaryListDisplayMode) {
2671
- CaseFlagSummaryListDisplayMode[CaseFlagSummaryListDisplayMode["CREATE"] = 0] = "CREATE";
2672
- CaseFlagSummaryListDisplayMode[CaseFlagSummaryListDisplayMode["MANAGE"] = 1] = "MANAGE";
2673
- })(CaseFlagSummaryListDisplayMode || (CaseFlagSummaryListDisplayMode = {}));
2306
+ class Jurisdiction {
2307
+ id;
2308
+ name;
2309
+ description;
2310
+ caseTypes;
2311
+ currentCaseType;
2312
+ }
2674
2313
 
2675
- var CaseFlagWizardStepTitle;
2676
- (function (CaseFlagWizardStepTitle) {
2677
- CaseFlagWizardStepTitle["SELECT_FLAG_LOCATION"] = "Where should this flag be added?";
2678
- CaseFlagWizardStepTitle["SELECT_FLAG_LOCATION_EXTERNAL"] = "Who is the support for?";
2679
- CaseFlagWizardStepTitle["SELECT_CASE_FLAG"] = "Select flag type";
2680
- CaseFlagWizardStepTitle["SELECT_CASE_FLAG_EXTERNAL"] = "Select support type";
2681
- CaseFlagWizardStepTitle["OTHER_FLAG_TYPE_DESCRIPTION"] = "Enter a flag type";
2682
- CaseFlagWizardStepTitle["OTHER_FLAG_TYPE_DESCRIPTION_EXTERNAL"] = "Enter a support type";
2683
- CaseFlagWizardStepTitle["ADD_FLAG_COMMENTS"] = "Add comments for this flag";
2684
- CaseFlagWizardStepTitle["ADD_FLAG_COMMENTS_EXTERNAL_MODE"] = "Tell us more about the request";
2685
- CaseFlagWizardStepTitle["CONFIRM_FLAG_STATUS"] = "Confirm the status of the flag";
2686
- CaseFlagWizardStepTitle["FLAG_STATUS"] = "Flag status";
2687
- CaseFlagWizardStepTitle["MANAGE_CASE_FLAGS"] = "Manage case flags";
2688
- CaseFlagWizardStepTitle["MANAGE_SUPPORT"] = "Which support is no longer needed?";
2689
- CaseFlagWizardStepTitle["UPDATE_FLAG_TITLE"] = "Update flag";
2690
- CaseFlagWizardStepTitle["UPDATE_FLAG_TITLE_EXTERNAL"] = "Tell us why the support is no longer needed";
2691
- CaseFlagWizardStepTitle["UPDATE_FLAG_ADD_TRANSLATION"] = "Add translations to flag";
2692
- CaseFlagWizardStepTitle["NONE"] = "";
2693
- })(CaseFlagWizardStepTitle || (CaseFlagWizardStepTitle = {}));
2314
+ class Banner {
2315
+ bannerDescription;
2316
+ bannerUrlText;
2317
+ bannerUrl;
2318
+ bannerViewed;
2319
+ bannerEnabled;
2320
+ }
2694
2321
 
2695
- var ConfirmStatusErrorMessage;
2696
- (function (ConfirmStatusErrorMessage) {
2697
- ConfirmStatusErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
2698
- ConfirmStatusErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
2699
- })(ConfirmStatusErrorMessage || (ConfirmStatusErrorMessage = {}));
2322
+ // @dynamic
2323
+ class CaseTab {
2324
+ id;
2325
+ label;
2326
+ order;
2327
+ fields;
2328
+ show_condition;
2329
+ }
2330
+ __decorate([
2331
+ Type(() => CaseField),
2332
+ __metadata("design:type", Array)
2333
+ ], CaseTab.prototype, "fields", void 0);
2700
2334
 
2701
- var ConfirmStatusStep;
2702
- (function (ConfirmStatusStep) {
2703
- ConfirmStatusStep["HINT_TEXT"] = "Describe reason for status; if choosing 'Not approved' provide name of person approving decision.";
2704
- ConfirmStatusStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2705
- })(ConfirmStatusStep || (ConfirmStatusStep = {}));
2335
+ // @dynamic
2336
+ class CaseView {
2337
+ case_id;
2338
+ case_type;
2339
+ state;
2340
+ channels;
2341
+ tabs;
2342
+ triggers;
2343
+ events;
2344
+ metadataFields;
2345
+ basicFields;
2346
+ case_flag;
2347
+ }
2348
+ __decorate([
2349
+ Type(() => CaseTab),
2350
+ __metadata("design:type", Array)
2351
+ ], CaseView.prototype, "tabs", void 0);
2352
+ __decorate([
2353
+ Type(() => CaseField),
2354
+ __metadata("design:type", Array)
2355
+ ], CaseView.prototype, "metadataFields", void 0);
2706
2356
 
2707
- var SearchLanguageInterpreterErrorMessage;
2708
- (function (SearchLanguageInterpreterErrorMessage) {
2709
- SearchLanguageInterpreterErrorMessage["LANGUAGE_NOT_ENTERED"] = "Enter the language that will need to be interpreted";
2710
- SearchLanguageInterpreterErrorMessage["LANGUAGE_CHAR_LIMIT_EXCEEDED"] = "You can enter up to 80 characters for the required language";
2711
- SearchLanguageInterpreterErrorMessage["LANGUAGE_ENTERED_IN_BOTH_FIELDS"] = "The language can only be entered in one of the fields";
2712
- })(SearchLanguageInterpreterErrorMessage || (SearchLanguageInterpreterErrorMessage = {}));
2357
+ class CasePrintDocument {
2358
+ name;
2359
+ type;
2360
+ url;
2361
+ }
2713
2362
 
2714
- var SearchLanguageInterpreterStep;
2715
- (function (SearchLanguageInterpreterStep) {
2716
- SearchLanguageInterpreterStep["HINT_TEXT"] = "Enter the language that will need to be interpreted. If this language is not listed, you can enter it manually.";
2717
- SearchLanguageInterpreterStep["SIGN_HINT_TEXT"] = "Enter the sign language that will need to be interpreted. If this language is not listed, you can enter it manually.";
2718
- SearchLanguageInterpreterStep["CHECKBOX_LABEL"] = "Enter the language manually";
2719
- SearchLanguageInterpreterStep["INPUT_LABEL"] = "Enter the language";
2720
- })(SearchLanguageInterpreterStep || (SearchLanguageInterpreterStep = {}));
2363
+ var RoleCategory;
2364
+ (function (RoleCategory) {
2365
+ RoleCategory["JUDICIAL"] = "JUDICIAL";
2366
+ RoleCategory["LEGAL_OPERATIONS"] = "LEGAL_OPERATIONS";
2367
+ RoleCategory["ADMIN"] = "ADMIN";
2368
+ RoleCategory["CTSC"] = "CTSC";
2369
+ RoleCategory["PROFESSIONAL"] = "PROFESSIONAL";
2370
+ RoleCategory["CITIZEN"] = "CITIZEN";
2371
+ RoleCategory["ENFORCEMENT"] = "ENFORCEMENT";
2372
+ })(RoleCategory || (RoleCategory = {}));
2373
+ var AMRoleSuffix;
2374
+ (function (AMRoleSuffix) {
2375
+ AMRoleSuffix["JUDICIARY"] = "judiciary";
2376
+ AMRoleSuffix["ADMIN"] = "admin";
2377
+ AMRoleSuffix["PROFESSIONAL"] = "professional";
2378
+ AMRoleSuffix["LEGAL_OPERATIONS"] = "legal-ops";
2379
+ AMRoleSuffix["CITIZEN"] = "citizen";
2380
+ AMRoleSuffix["CTSC"] = "ctsc";
2381
+ AMRoleSuffix["ENFORCEMENT"] = "enforcement";
2382
+ })(AMRoleSuffix || (AMRoleSuffix = {}));
2383
+ var RoleKeyword;
2384
+ (function (RoleKeyword) {
2385
+ RoleKeyword["JUDGE"] = "judge";
2386
+ RoleKeyword["ADMIN"] = "admin";
2387
+ RoleKeyword["SOLICITOR"] = "solicitor";
2388
+ RoleKeyword["CITIZEN"] = "citizen";
2389
+ RoleKeyword["CTSC"] = "ctsc";
2390
+ RoleKeyword["ENFORCEMENT"] = "enforcement";
2391
+ })(RoleKeyword || (RoleKeyword = {}));
2721
2392
 
2722
- var SelectFlagErrorMessage;
2723
- (function (SelectFlagErrorMessage) {
2724
- SelectFlagErrorMessage["MANAGE_CASE_FLAGS_FLAG_NOT_SELECTED"] = "Please make a selection";
2725
- SelectFlagErrorMessage["MANAGE_SUPPORT_FLAG_NOT_SELECTED"] = "Select which support is no longer needed";
2726
- SelectFlagErrorMessage["NO_FLAGS"] = "This case has no flags";
2727
- })(SelectFlagErrorMessage || (SelectFlagErrorMessage = {}));
2393
+ // tslint:disable:variable-name
2394
+ class HRef {
2395
+ href;
2396
+ }
2397
+ class DocumentLinks {
2398
+ self;
2399
+ binary;
2400
+ }
2401
+ class Document {
2402
+ _links;
2403
+ originalDocumentName;
2404
+ hashToken;
2405
+ }
2406
+ class Embedded {
2407
+ documents;
2408
+ }
2409
+ class DocumentData {
2410
+ _embedded;
2411
+ documents;
2412
+ }
2413
+ class FormDocument {
2414
+ document_url;
2415
+ document_binary_url;
2416
+ document_filename;
2417
+ document_hash;
2418
+ upload_timestamp;
2419
+ }
2728
2420
 
2729
- var SelectFlagLocationErrorMessage;
2730
- (function (SelectFlagLocationErrorMessage) {
2731
- SelectFlagLocationErrorMessage["FLAG_LOCATION_NOT_SELECTED"] = "Please make a selection";
2732
- SelectFlagLocationErrorMessage["FLAGS_NOT_CONFIGURED"] = "Flags have not been configured for this case type";
2733
- })(SelectFlagLocationErrorMessage || (SelectFlagLocationErrorMessage = {}));
2421
+ const DRAFT_PREFIX = 'DRAFT';
2422
+ const DRAFT_QUERY_PARAM = 'draft';
2423
+ class Draft {
2424
+ id;
2425
+ document;
2426
+ type;
2427
+ created;
2428
+ updated;
2429
+ static stripDraftId(draftId) {
2430
+ return draftId.slice(DRAFT_PREFIX.length);
2431
+ }
2432
+ static isDraft(id) {
2433
+ return String(id).startsWith(DRAFT_PREFIX);
2434
+ }
2435
+ }
2734
2436
 
2735
- var SelectFlagTypeErrorMessage;
2736
- (function (SelectFlagTypeErrorMessage) {
2737
- SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_SELECTED"] = "Please select a flag type";
2738
- SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_SELECTED_EXTERNAL"] = "Please select a support type";
2739
- SelectFlagTypeErrorMessage["FLAG_TYPE_OPTION_NOT_SELECTED"] = "Select an option";
2740
- SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_ENTERED"] = "Please enter a flag type";
2741
- SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_ENTERED_EXTERNAL"] = "Please enter a support type";
2742
- SelectFlagTypeErrorMessage["FLAG_TYPE_LIMIT_EXCEEDED"] = "You can enter up to 80 characters only";
2743
- })(SelectFlagTypeErrorMessage || (SelectFlagTypeErrorMessage = {}));
2437
+ class OrganisationConverter {
2438
+ static toSimpleAddress(organisationModel) {
2439
+ let simpleAddress = '';
2440
+ if (organisationModel.addressLine1) {
2441
+ simpleAddress += `${organisationModel.addressLine1}<br>`;
2442
+ }
2443
+ if (organisationModel.addressLine2) {
2444
+ simpleAddress += `${organisationModel.addressLine2}<br>`;
2445
+ }
2446
+ if (organisationModel.addressLine3) {
2447
+ simpleAddress += `${organisationModel.addressLine3}<br>`;
2448
+ }
2449
+ if (organisationModel.townCity) {
2450
+ simpleAddress += `${organisationModel.townCity}<br>`;
2451
+ }
2452
+ if (organisationModel.county) {
2453
+ simpleAddress += `${organisationModel.county}<br>`;
2454
+ }
2455
+ if (organisationModel.country) {
2456
+ simpleAddress += `${organisationModel.country}<br>`;
2457
+ }
2458
+ if (organisationModel.postCode) {
2459
+ simpleAddress += `${organisationModel.postCode}<br>`;
2460
+ }
2461
+ return simpleAddress;
2462
+ }
2463
+ toSimpleOrganisationModel(organisationModel) {
2464
+ return {
2465
+ organisationIdentifier: organisationModel.organisationIdentifier,
2466
+ name: organisationModel.name,
2467
+ address: OrganisationConverter.toSimpleAddress(organisationModel)
2468
+ };
2469
+ }
2470
+ static ɵfac = function OrganisationConverter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OrganisationConverter)(); };
2471
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: OrganisationConverter, factory: OrganisationConverter.ɵfac });
2472
+ }
2473
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OrganisationConverter, [{
2474
+ type: Injectable
2475
+ }], null, null); })();
2744
2476
 
2745
- var UpdateFlagAddTranslationErrorMessage;
2746
- (function (UpdateFlagAddTranslationErrorMessage) {
2747
- UpdateFlagAddTranslationErrorMessage["DESCRIPTION_CHAR_LIMIT_EXCEEDED"] = "Original description or translation must be 200 characters or fewer";
2748
- UpdateFlagAddTranslationErrorMessage["COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Original comments or translation must be 200 characters or fewer";
2749
- })(UpdateFlagAddTranslationErrorMessage || (UpdateFlagAddTranslationErrorMessage = {}));
2477
+ class PaginationMetadata {
2478
+ totalResultsCount;
2479
+ totalPagesCount;
2480
+ }
2750
2481
 
2751
- var UpdateFlagAddTranslationStep;
2752
- (function (UpdateFlagAddTranslationStep) {
2753
- UpdateFlagAddTranslationStep["HINT_TEXT"] = "Write translation for flag description or comments in the boxes provided.";
2754
- UpdateFlagAddTranslationStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2755
- })(UpdateFlagAddTranslationStep || (UpdateFlagAddTranslationStep = {}));
2482
+ function hasRoles(profile) {
2483
+ if (profile.user && profile.user.idam && Array.isArray(profile.user.idam.roles)) {
2484
+ return profile.user.idam.roles.length > 0;
2485
+ }
2486
+ return false;
2487
+ }
2488
+ // @dynamic
2489
+ class Profile {
2490
+ user;
2491
+ channels;
2492
+ jurisdictions;
2493
+ default;
2494
+ isSolicitor() {
2495
+ if (hasRoles(this)) {
2496
+ return this.user.idam.roles.find(r => r.endsWith('-solicitor')) !== undefined;
2497
+ }
2498
+ return false;
2499
+ }
2500
+ isCourtAdmin() {
2501
+ if (hasRoles(this)) {
2502
+ return this.user.idam.roles.find(r => r.endsWith('-courtadmin')) !== undefined;
2503
+ }
2504
+ return false;
2505
+ }
2506
+ }
2507
+ __decorate([
2508
+ Type(() => Jurisdiction),
2509
+ __metadata("design:type", Array)
2510
+ ], Profile.prototype, "jurisdictions", void 0);
2756
2511
 
2757
- var UpdateFlagErrorMessage;
2758
- (function (UpdateFlagErrorMessage) {
2759
- UpdateFlagErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
2760
- UpdateFlagErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
2761
- UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
2762
- UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED_EXTERNAL"] = "You must explain why the support is no longer needed";
2763
- UpdateFlagErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
2764
- UpdateFlagErrorMessage["NONE"] = "";
2765
- })(UpdateFlagErrorMessage || (UpdateFlagErrorMessage = {}));
2512
+ class Field {
2513
+ id;
2514
+ field_type;
2515
+ elementPath;
2516
+ value;
2517
+ label;
2518
+ metadata;
2519
+ constructor(id, field_type, elementPath, value, label, metadata) {
2520
+ this.id = id;
2521
+ this.field_type = field_type;
2522
+ this.elementPath = elementPath;
2523
+ this.value = value;
2524
+ this.label = label;
2525
+ this.metadata = metadata;
2526
+ }
2527
+ }
2766
2528
 
2767
- var UpdateFlagStep;
2768
- (function (UpdateFlagStep) {
2769
- UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL"] = "Explain why you are updating this flag. Do not include any sensitive information such as personal details.";
2770
- UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL_2_POINT_1"] = "Update the comments describing the user's support needs or flag description. Do not include any sensitive information such as personal details.";
2771
- UpdateFlagStep["COMMENT_HINT_TEXT_EXTERNAL"] = "Do not include any sensitive information such as personal details.";
2772
- UpdateFlagStep["COMMENT_FIELD_LABEL_EXTERNAL"] = "Please provide your comments below";
2773
- UpdateFlagStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2774
- UpdateFlagStep["STATUS_HINT_TEXT"] = "Describe reason for status change.";
2775
- UpdateFlagStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
2776
- })(UpdateFlagStep || (UpdateFlagStep = {}));
2529
+ class SearchResultViewColumn {
2530
+ case_field_id;
2531
+ case_field_type;
2532
+ display_context;
2533
+ display_context_parameter;
2534
+ label;
2535
+ order;
2536
+ }
2777
2537
 
2778
- var CaseFlagFieldState;
2779
- (function (CaseFlagFieldState) {
2780
- CaseFlagFieldState[CaseFlagFieldState["FLAG_LOCATION"] = 0] = "FLAG_LOCATION";
2781
- CaseFlagFieldState[CaseFlagFieldState["FLAG_TYPE"] = 1] = "FLAG_TYPE";
2782
- CaseFlagFieldState[CaseFlagFieldState["FLAG_LANGUAGE_INTERPRETER"] = 2] = "FLAG_LANGUAGE_INTERPRETER";
2783
- CaseFlagFieldState[CaseFlagFieldState["FLAG_COMMENTS"] = 3] = "FLAG_COMMENTS";
2784
- CaseFlagFieldState[CaseFlagFieldState["FLAG_STATUS"] = 4] = "FLAG_STATUS";
2785
- CaseFlagFieldState[CaseFlagFieldState["FLAG_MANAGE_CASE_FLAGS"] = 5] = "FLAG_MANAGE_CASE_FLAGS";
2786
- CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE"] = 6] = "FLAG_UPDATE";
2787
- CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE_WELSH_TRANSLATION"] = 7] = "FLAG_UPDATE_WELSH_TRANSLATION";
2788
- })(CaseFlagFieldState || (CaseFlagFieldState = {}));
2789
- var CaseFlagErrorMessage;
2790
- (function (CaseFlagErrorMessage) {
2791
- CaseFlagErrorMessage["NO_EXTERNAL_FLAGS_COLLECTION"] = "External collection for storing this case flag has not been configured for this case type";
2792
- CaseFlagErrorMessage["NO_INTERNAL_FLAGS_COLLECTION"] = "Internal collection for storing this case flag has not been configured for this case type";
2793
- })(CaseFlagErrorMessage || (CaseFlagErrorMessage = {}));
2538
+ // @dynamic
2539
+ class SearchResultViewItem {
2540
+ case_id;
2541
+ case_fields;
2542
+ hydrated_case_fields;
2543
+ columns;
2544
+ supplementary_data;
2545
+ display_context_parameter;
2546
+ }
2547
+ __decorate([
2548
+ Type(() => CaseField),
2549
+ __metadata("design:type", Array)
2550
+ ], SearchResultViewItem.prototype, "hydrated_case_fields", void 0);
2794
2551
 
2795
- class DashPipe {
2796
- transform(value) {
2797
- return value ? value : '-';
2552
+ // @dynamic
2553
+ class SearchResultView {
2554
+ columns;
2555
+ results;
2556
+ result_error;
2557
+ hasDrafts() {
2558
+ return this.results[0]
2559
+ && this.results[0].case_id
2560
+ && Draft.isDraft(this.results[0].case_id);
2798
2561
  }
2799
- static ɵfac = function DashPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DashPipe)(); };
2800
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDash", type: DashPipe, pure: true, standalone: false });
2801
2562
  }
2802
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DashPipe, [{
2803
- type: Pipe,
2804
- args: [{
2805
- name: 'ccdDash',
2806
- standalone: false
2807
- }]
2808
- }], null, null); })();
2809
-
2810
- /*
2811
- Translate a date time format string from the Java format provided by CCD to the format supported by Angular formatDate()
2812
- Very simple translator that maps unsupported chars to the nearest equivalent.
2813
- If there is no equivalent puts ***x*** into the output where x is the unsupported character
2563
+ __decorate([
2564
+ Type(() => SearchResultViewColumn),
2565
+ __metadata("design:type", Array)
2566
+ ], SearchResultView.prototype, "columns", void 0);
2567
+ __decorate([
2568
+ Type(() => SearchResultViewItem),
2569
+ __metadata("design:type", Array)
2570
+ ], SearchResultView.prototype, "results", void 0);
2814
2571
 
2815
- Java format
2816
- G era text AD; Anno Domini; A
2817
- u year year 2004; 04
2818
- y year-of-era year 2004; 04
2819
- D day-of-year number 189
2820
- M/L month-of-year number/text 7; 07; Jul; July; J
2821
- d day-of-month number 10
2572
+ class SortParameters {
2573
+ comparator;
2574
+ sortOrder;
2575
+ constructor(comparator, sortOrder) {
2576
+ this.comparator = comparator;
2577
+ this.sortOrder = sortOrder;
2578
+ }
2579
+ }
2822
2580
 
2823
- Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter
2824
- Y week-based-year year 1996; 96
2825
- w week-of-week-based-year number 27
2826
- W week-of-month number 4
2827
- E day-of-week text Tue; Tuesday; T
2828
- e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T
2829
- F week-of-month number 3
2581
+ var SortOrder$1;
2582
+ (function (SortOrder) {
2583
+ SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
2584
+ SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
2585
+ SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
2586
+ })(SortOrder$1 || (SortOrder$1 = {}));
2830
2587
 
2831
- a am-pm-of-day text PM
2832
- h clock-hour-of-am-pm (1-12) number 12
2833
- K hour-of-am-pm (0-11) number 0
2834
- k clock-hour-of-am-pm (1-24) number 0
2588
+ class WorkbasketInputModel {
2589
+ label;
2590
+ order;
2591
+ field;
2592
+ metadata;
2593
+ display_context_parameter;
2594
+ }
2595
+ class WorkbasketInput {
2596
+ workbasketInputs;
2597
+ }
2835
2598
 
2836
- H hour-of-day (0-23) number 0
2837
- m minute-of-hour number 30
2838
- s second-of-minute number 55
2839
- S fraction-of-second fraction 978
2840
- A milli-of-day number 1234
2841
- n nano-of-second number 987654321
2842
- N nano-of-day number 1234000000
2843
-
2844
- V time-zone ID zone-id America/Los_Angeles; Z; -08:30
2845
- z time-zone name zone-name Pacific Standard Time; PST
2846
- O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00;
2847
- X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15;
2848
- x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15;
2849
- Z zone-offset offset-Z +0000; -0800; -08:00;
2850
-
2851
- p pad next pad modifier 1
2852
-
2853
- ' escape for text delimiter
2854
- '' single quote literal '
2855
- [ optional section start
2856
- ] optional section end
2857
- # reserved for future use
2858
- { reserved for future use
2859
- } reserved for future use
2599
+ const USER_DETAILS = 'userDetails';
2600
+ const PUI_CASE_MANAGER = 'pui-case-manager';
2601
+ function getUserDetails(sessionStorageService) {
2602
+ const item = sessionStorageService?.getItem(USER_DETAILS);
2603
+ return safeJsonParse(item, null);
2604
+ }
2605
+ function isInternalUser(sessionStorageService) {
2606
+ const userDetails = getUserDetails(sessionStorageService);
2607
+ if (!userDetails?.roles) {
2608
+ return false;
2609
+ }
2610
+ else if (userDetails?.roleCategories?.includes(RoleCategory.ENFORCEMENT)) {
2611
+ return true;
2612
+ }
2613
+ else {
2614
+ return !(userDetails.roles.includes(PUI_CASE_MANAGER) ||
2615
+ userDetails.roles.some((role) => role.toLowerCase().includes(RoleKeyword.JUDGE)));
2616
+ }
2617
+ }
2618
+ function isJudiciaryUser(sessionStorageService) {
2619
+ const userDetails = getUserDetails(sessionStorageService);
2620
+ return userDetails && userDetails?.roles
2621
+ && (userDetails.roles.some((role) => role.toLowerCase().includes(RoleKeyword.JUDGE)));
2622
+ }
2623
+ function isWorkAllocationUser(sessionStorageService) {
2624
+ const userDetails = getUserDetails(sessionStorageService);
2625
+ return userDetails?.roles
2626
+ && !userDetails.roles.includes(PUI_CASE_MANAGER)
2627
+ &&
2628
+ (userDetails.roles.includes('caseworker-ia-iacjudge')
2629
+ || userDetails.roles.includes('caseworker-ia-caseofficer')
2630
+ || userDetails.roles.includes('caseworker-ia-admofficer')
2631
+ || userDetails.roles.includes('caseworker-civil')
2632
+ || userDetails.roles.includes('caseworker-privatelaw')
2633
+ || userDetails?.roleCategories?.includes(RoleCategory.ENFORCEMENT));
2634
+ }
2635
+ function roleOrCategoryExists(roleKeyword, roleCategory, roleKeywords, roleCategories) {
2636
+ return roleCategories.includes(roleCategory) || roleKeywords.includes(roleKeyword);
2637
+ }
2638
+ function getMappedRoleCategory(roles = [], roleCategories = []) {
2639
+ const roleKeywords = roles.join().split('-').join().split(',');
2640
+ if (roleOrCategoryExists(RoleKeyword.JUDGE, RoleCategory.JUDICIAL, roleKeywords, roleCategories)) {
2641
+ return RoleCategory.JUDICIAL;
2642
+ }
2643
+ else if (roleOrCategoryExists(RoleKeyword.SOLICITOR, RoleCategory.PROFESSIONAL, roleKeywords, roleCategories)) {
2644
+ return RoleCategory.PROFESSIONAL;
2645
+ }
2646
+ else if (roleOrCategoryExists(RoleKeyword.CITIZEN, RoleCategory.CITIZEN, roleKeywords, roleCategories)) {
2647
+ return RoleCategory.CITIZEN;
2648
+ }
2649
+ else if (roleOrCategoryExists(RoleKeyword.ADMIN, RoleCategory.ADMIN, roleKeywords, roleCategories)) {
2650
+ return RoleCategory.ADMIN;
2651
+ }
2652
+ else if (roleOrCategoryExists(RoleKeyword.CTSC, RoleCategory.CTSC, roleKeywords, roleCategories)) {
2653
+ return RoleCategory.CTSC;
2654
+ }
2655
+ else if (roleOrCategoryExists(RoleKeyword.ENFORCEMENT, RoleCategory.ENFORCEMENT, roleKeywords, roleCategories)) {
2656
+ return RoleCategory.ENFORCEMENT;
2657
+ }
2658
+ else {
2659
+ return RoleCategory.LEGAL_OPERATIONS;
2660
+ }
2661
+ }
2662
+ function getAMRoleName(accessType, aMRole) {
2663
+ let roleName = '';
2664
+ switch (aMRole) {
2665
+ case RoleCategory.JUDICIAL:
2666
+ roleName = `${accessType}-access-${AMRoleSuffix.JUDICIARY}`;
2667
+ break;
2668
+ case RoleCategory.PROFESSIONAL:
2669
+ roleName = `${accessType}-access-${AMRoleSuffix.PROFESSIONAL}`;
2670
+ break;
2671
+ case RoleCategory.CITIZEN:
2672
+ roleName = `${accessType}-access-${AMRoleSuffix.CITIZEN}`;
2673
+ break;
2674
+ case RoleCategory.ADMIN:
2675
+ roleName = `${accessType}-access-${AMRoleSuffix.ADMIN}`;
2676
+ break;
2677
+ case RoleCategory.CTSC:
2678
+ roleName = `${accessType}-access-${AMRoleSuffix.CTSC}`;
2679
+ break;
2680
+ case RoleCategory.ENFORCEMENT:
2681
+ roleName = `${accessType}-access-${AMRoleSuffix.ENFORCEMENT}`;
2682
+ break;
2683
+ default:
2684
+ roleName = `${accessType}-access-${AMRoleSuffix.LEGAL_OPERATIONS}`;
2685
+ break;
2686
+ }
2687
+ return roleName;
2688
+ }
2860
2689
 
2861
- Angular dateFormat characters
2862
- Era G, GG & GGG Abbreviated AD
2863
- GGGG Wide Anno Domini
2864
- GGGGG Narrow A
2865
- Year y Numeric: minimum digits 2, 20, 201, 2017, 20173
2866
- yy Numeric: 2 digits + zero padded 02, 20, 01, 17, 73
2867
- yyy Numeric: 3 digits + zero padded 002, 020, 201, 2017, 20173
2868
- yyyy Numeric: 4 digits or more + zero padded 0002, 0020, 0201, 2017, 20173
2869
- Month M Numeric: 1 digit 9, 12
2870
- MM Numeric: 2 digits + zero padded 09, 12
2871
- MMM Abbreviated Sep
2872
- MMMM Wide September
2873
- MMMMM Narrow S
2874
- Month standalone L Numeric: 1 digit 9, 12
2875
- LL Numeric: 2 digits + zero padded 09, 12
2876
- LLL Abbreviated Sep
2877
- LLLL Wide September
2878
- LLLLL Narrow S
2879
- Week of year w Numeric: minimum digits 1... 53
2880
- ww Numeric: 2 digits + zero padded 01... 53
2881
- Week of month W Numeric: 1 digit 1... 5
2882
- Day of month d Numeric: minimum digits 1
2883
- dd Numeric: 2 digits + zero padded 01
2884
- Week day E, EE & EEE Abbreviated Tue
2885
- EEEE Wide Tuesday
2886
- EEEEE Narrow T
2887
- EEEEEE Short Tu
2888
- Period a, aa & aaa Abbreviated am/pm or AM/PM
2889
- aaaa Wide (fallback to a when missing) ante meridiem/post meridiem
2890
- aaaaa Narrow a/p
2891
- Period* B, BB & BBB Abbreviated mid.
2892
- BBBB Wide am, pm, midnight, noon, morning, afternoon, evening, night
2893
- BBBBB Narrow md
2894
- Period standalone* b, bb & bbb Abbreviated mid.
2895
- bbbb Wide am, pm, midnight, noon, morning, afternoon, evening, night
2896
- bbbbb Narrow md
2897
- Hour 1-12 h Numeric: minimum digits 1, 12
2898
- hh Numeric: 2 digits + zero padded 01, 12
2899
- Hour 0-23 H Numeric: minimum digits 0, 23
2900
- HH Numeric: 2 digits + zero padded 00, 23
2901
- Minute m Numeric: minimum digits 8, 59
2902
- mm Numeric: 2 digits + zero padded 08, 59
2903
- Second s Numeric: minimum digits 0... 59
2904
- ss Numeric: 2 digits + zero padded 00... 59
2905
- Fractional seconds S Numeric: 1 digit 0... 9
2906
- SS Numeric: 2 digits + zero padded 00... 99
2907
- SSS Numeric: 3 digits + zero padded (= milliseconds) 000... 999
2908
- Zone z, zz & zzz Short specific non location format (fallback to O) GMT-8
2909
- zzzz Long specific non location format (fallback to OOOO) GMT-08:00
2910
- Z, ZZ & ZZZ ISO8601 basic format -0800
2911
- ZZZZ Long localized GMT format GMT-8:00
2912
- ZZZZZ ISO8601 extended format + Z indicator for offset 0 (= XXXXX) -08:00
2913
- O, OO & OOO Short localized GMT format GMT-8
2914
- OOOO Long localized GMT format GMT-08:00
2915
- */
2916
- class FormatTranslatorService {
2917
- translate(javaFormat) {
2918
- const result = [];
2919
- let prev = '\0';
2920
- let inQuote = false;
2921
- const maybePush = (target, obj, flag) => {
2922
- if (!flag) {
2923
- target.push(obj);
2924
- }
2925
- };
2926
- for (const c of javaFormat) {
2927
- switch (c) {
2928
- case '\'':
2929
- if (prev === '\'') {
2930
- // literal single quote - ignore
2931
- inQuote = false;
2932
- }
2933
- else {
2934
- inQuote = !inQuote;
2935
- }
2936
- break;
2937
- // Due to formatting constraints on the webapp, all 'd' characters should be replaced with 'D' (for Moment library)
2938
- // This is because we want the date, not the day (this format will need to be converted back)
2939
- case 'd':
2940
- maybePush(result, 'D', inQuote);
2941
- break;
2942
- // moment library defines year as capital y
2943
- case 'y':
2944
- maybePush(result, 'Y', inQuote);
2945
- break;
2946
- case 'e':
2947
- case 'c':
2948
- maybePush(result, 'E', inQuote); // no lower case E
2949
- break;
2950
- case 'F':
2951
- maybePush(result, 'W', inQuote);
2952
- break;
2953
- case 'K':
2954
- maybePush(result, 'H', inQuote);
2955
- break;
2956
- case 'k':
2957
- maybePush(result, 'h', inQuote);
2958
- break;
2959
- // commented out A change to '***' due to use in moment library for AM/PM
2960
- // added 'a' specification to stop discrepancy in am/AM pm/PM formatting
2961
- case 'a':
2962
- maybePush(result, 'A', inQuote);
2963
- break;
2964
- case 'n':
2965
- case 'N':
2966
- maybePush(result, `***${c}***`, inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
2967
- break;
2968
- case 'V':
2969
- case 'O':
2970
- maybePush(result, 'z', inQuote);
2971
- break;
2972
- case 'x':
2973
- case 'X':
2974
- maybePush(result, 'Z', inQuote);
2975
- break;
2976
- default:
2977
- maybePush(result, c, inQuote);
2978
- }
2979
- prev = c;
2980
- }
2981
- return result.join('');
2690
+ // @dynamic
2691
+ class ActivityService {
2692
+ http;
2693
+ appConfig;
2694
+ sessionStorageService;
2695
+ static get ACTIVITY_VIEW() { return 'view'; }
2696
+ static get ACTIVITY_EDIT() { return 'edit'; }
2697
+ logger = new StructuredLoggerService();
2698
+ constructor(http, appConfig, sessionStorageService) {
2699
+ this.http = http;
2700
+ this.appConfig = appConfig;
2701
+ this.sessionStorageService = sessionStorageService;
2982
2702
  }
2983
- showOnlyDates(dateFormat) {
2984
- // replace 'd' character with 'D' for the moment library
2985
- // This ensures only dates allowed
2986
- while (dateFormat.includes('d')) {
2987
- dateFormat = dateFormat.replace('d', 'D');
2703
+ get isEnabled() {
2704
+ return this.activityUrl() && this.userAuthorised;
2705
+ }
2706
+ static DUMMY_CASE_REFERENCE = '0';
2707
+ userAuthorised = undefined;
2708
+ static handleHttpError(response) {
2709
+ const error = HttpErrorService.convertToHttpError(response);
2710
+ if (response?.status !== error.status) {
2711
+ error.status = response.status;
2988
2712
  }
2989
- while (dateFormat.includes('y')) {
2990
- dateFormat = dateFormat.replace('y', 'Y');
2713
+ return error;
2714
+ }
2715
+ getOptions() {
2716
+ const userDetails = safeJsonParse(this.sessionStorageService.getItem(USER_DETAILS));
2717
+ let headers = new HttpHeaders().set('Content-Type', 'application/json');
2718
+ if (userDetails?.token) {
2719
+ headers = headers.set('Authorization', userDetails.token);
2991
2720
  }
2992
- return dateFormat;
2721
+ return {
2722
+ headers,
2723
+ withCredentials: true,
2724
+ observe: 'body',
2725
+ };
2993
2726
  }
2994
- removeTime(dateFormat) {
2995
- // remove hours irrelevant of whether 12 or 24 hour clock
2996
- while (dateFormat.includes('H') || dateFormat.includes('h')) {
2997
- dateFormat = dateFormat.replace('H', '');
2998
- dateFormat = dateFormat.replace('h', '');
2727
+ getActivities(...caseId) {
2728
+ try {
2729
+ const options = this.getOptions();
2730
+ const url = `${this.activityUrl()}/cases/${caseId.join(',')}/activity`;
2731
+ return this.http
2732
+ .get(url, options, false, ActivityService.handleHttpError)
2733
+ .pipe(map(response => response));
2999
2734
  }
3000
- // remove minutes
3001
- while (dateFormat.includes('m')) {
3002
- dateFormat = dateFormat.replace('m', '');
2735
+ catch (error) {
2736
+ this.logUserMayNotBeAuthenticated(error);
3003
2737
  }
3004
- // remove seconds (s) and micro seconds (S)
3005
- while (dateFormat.includes('S') || dateFormat.includes('s')) {
3006
- dateFormat = dateFormat.replace('S', '');
3007
- dateFormat = dateFormat.replace('s', '');
2738
+ }
2739
+ postActivity(caseId, activity) {
2740
+ try {
2741
+ const options = this.getOptions();
2742
+ const url = `${this.activityUrl()}/cases/${caseId}/activity`;
2743
+ const body = { activity };
2744
+ return this.http
2745
+ .post(url, body, options, false)
2746
+ .pipe(map(response => response));
3008
2747
  }
3009
- // because there is time removal algorithm can make reasonable assumption to remove colons
3010
- while (dateFormat.includes(':')) {
3011
- dateFormat = dateFormat.replace(':', '');
2748
+ catch (error) {
2749
+ this.logUserMayNotBeAuthenticated(error);
3012
2750
  }
3013
- return dateFormat.trim();
3014
- }
3015
- hasDate(value) {
3016
- return this.translate(value).length &&
3017
- value.toLowerCase().indexOf('d') >= 0 &&
3018
- value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3019
- }
3020
- is24Hour(value) {
3021
- return this.translate(value).length &&
3022
- value.indexOf('H') >= 0;
3023
- }
3024
- hasNoDay(value) {
3025
- return this.translate(value).length && value.toLowerCase().indexOf('d') === -1 &&
3026
- value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3027
- }
3028
- hasNoDayAndMonth(value) {
3029
- return this.translate(value).length &&
3030
- value.toLowerCase().indexOf('d') === -1 &&
3031
- value.indexOf('M') === -1 &&
3032
- value.toLowerCase().indexOf('y') >= 0;
3033
2751
  }
3034
- hasHours(value) {
3035
- return this.translate(value).length && value.toLowerCase().indexOf('h') >= 0 && value.indexOf('m') === -1;
2752
+ verifyUserIsAuthorized() {
2753
+ if (this.sessionStorageService.getItem(USER_DETAILS) && this.activityUrl() && this.userAuthorised === undefined) {
2754
+ this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(() => this.userAuthorised = true, error => {
2755
+ this.userAuthorised = [401, 403].indexOf(error.status) <= -1;
2756
+ });
2757
+ }
3036
2758
  }
3037
- hasMinutes(value) {
3038
- return this.translate(value).length && value.indexOf('m') >= 0 && value.toLowerCase().indexOf('h') >= 0;
2759
+ activityUrl() {
2760
+ return this.appConfig.getActivityUrl();
3039
2761
  }
3040
- hasSeconds(value) {
3041
- return this.translate(value).length && value.toLowerCase().indexOf('s') >= 0;
2762
+ logUserMayNotBeAuthenticated(error) {
2763
+ this.logger.error('User may not be authenticated. Activity request was not sent.', { error });
3042
2764
  }
3043
- static ɵfac = function FormatTranslatorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormatTranslatorService)(); };
3044
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormatTranslatorService, factory: FormatTranslatorService.ɵfac });
2765
+ static ɵfac = function ActivityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(SessionStorageService)); };
2766
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac });
3045
2767
  }
3046
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormatTranslatorService, [{
2768
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
3047
2769
  type: Injectable
3048
- }], null, null); })();
2770
+ }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: SessionStorageService }], null); })();
3049
2771
 
3050
- class DatePipe {
3051
- formatTrans;
3052
- static DATE_FORMAT_REGEXP = new RegExp('^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?|Z)?$');
3053
- // 1 2 3 4 5 6 7 8 9 10 11
3054
- static MONTHS = [
3055
- ['Jan'], ['Feb'], ['Mar'], ['Apr'], ['May'], ['Jun'], ['Jul'], ['Aug'], ['Sep'], ['Oct'], ['Nov'], ['Dec'],
3056
- ];
3057
- /**
3058
- * constructor to allow format translator to be injected
3059
- * @param formatTrans format translator
3060
- */
3061
- constructor(formatTrans) {
3062
- this.formatTrans = formatTrans;
2772
+ // @dynamic
2773
+ class ActivityPollingService {
2774
+ activityService;
2775
+ ngZone;
2776
+ config;
2777
+ logger = new StructuredLoggerService();
2778
+ pendingRequests = new Map();
2779
+ currentTimeoutHandle;
2780
+ pollActivitiesSubscription;
2781
+ pollConfig;
2782
+ batchCollectionDelayMs;
2783
+ maxRequestsPerBatch;
2784
+ constructor(activityService, ngZone, config) {
2785
+ this.activityService = activityService;
2786
+ this.ngZone = ngZone;
2787
+ this.config = config;
2788
+ this.pollConfig = {
2789
+ interval: config.getActivityNexPollRequestMs(),
2790
+ attempts: config.getActivityRetry()
2791
+ };
2792
+ this.batchCollectionDelayMs = config.getActivityBatchCollectionDelayMs();
2793
+ this.maxRequestsPerBatch = config.getActivityMaxRequestPerBatch();
3063
2794
  }
3064
- transform(value, zone, format) {
3065
- let resultDate = null;
3066
- const ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
3067
- if (value) {
3068
- // included to avoid editing the hour twice on second pass through
3069
- // this occurs on case details when datepipe is applied twice
3070
- if (!value.includes('T')) {
3071
- zone = 'utc';
3072
- }
3073
- const match = value.match(DatePipe.DATE_FORMAT_REGEXP);
3074
- // Make sure we actually have a match.
3075
- if (match) {
3076
- let offsetDate = null;
3077
- const date = this.getDate(match);
3078
- if (zone === 'local') {
3079
- offsetDate = this.getOffsetDate(date);
3080
- }
3081
- else {
3082
- offsetDate = this.getDate(match);
3083
- }
3084
- // 'short' format is meaningful to formatDate, but not the same meaning as in the unit tests
3085
- if (this.formatTrans && format && format !== 'short') {
3086
- // support for java style formatting strings for dates
3087
- format = this.translateDateFormat(format);
3088
- resultDate = moment(offsetDate).format(format);
3089
- }
3090
- else {
3091
- // RDM-1149 changed the pipe logic so that it doesn't add an hour to 'Summer Time' dates on DateTime field type
3092
- resultDate = `${offsetDate.getDate()} ${DatePipe.MONTHS[offsetDate.getMonth()]} ${offsetDate.getFullYear()}`;
3093
- if (match[4] && match[5] && match[6] && format !== 'short') {
3094
- resultDate += ', ';
3095
- resultDate += `${this.getHour(offsetDate.getHours().toString())}:`;
3096
- resultDate += `${this.pad(offsetDate.getMinutes())}:`;
3097
- resultDate += `${this.pad(offsetDate.getSeconds())} `;
3098
- resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
3099
- }
3100
- }
3101
- }
3102
- else {
3103
- // EUI-2667. See if what we've been given is actually a formatted date that
3104
- // we could attempt to do something with.
3105
- const parsedDate = Date.parse(value);
3106
- // We successfully parsed it so let's use it.
3107
- if (!isNaN(parsedDate)) {
3108
- const d = new Date(parsedDate);
3109
- // If what we received didn't include time, don't include it here either.
3110
- if (value.indexOf(':') < 0) {
3111
- const shortDate = d.toLocaleDateString('en-GB');
3112
- const shortISO = shortDate.split('/').reverse().join('-');
3113
- return this.transform(shortISO, zone, format);
3114
- }
3115
- // If it did include time, we want a full ISO string.
3116
- const thisMoment = moment(d).format(ISO_FORMAT);
3117
- return this.transform(thisMoment, zone, format);
3118
- }
3119
- }
3120
- }
3121
- return resultDate;
2795
+ get isEnabled() {
2796
+ return this.activityService.isEnabled;
3122
2797
  }
3123
- translateDateFormat(format) {
3124
- if (this.formatTrans) {
3125
- return this.formatTrans.translate(format);
2798
+ subscribeToActivity(caseId, done) {
2799
+ if (!this.isEnabled) {
2800
+ return new Subject();
2801
+ }
2802
+ let subject = this.pendingRequests.get(caseId);
2803
+ if (subject) {
2804
+ subject.subscribe(done);
3126
2805
  }
3127
2806
  else {
3128
- return format;
2807
+ // Only the first pending request should start the batch collection timer.
2808
+ const wasEmpty = this.pendingRequests.size === 0;
2809
+ subject = new Subject();
2810
+ subject.subscribe(done);
2811
+ this.addPendingRequest(caseId, subject);
2812
+ if (wasEmpty) {
2813
+ this.ngZone.runOutsideAngular(() => {
2814
+ this.currentTimeoutHandle = setTimeout(() => this.ngZone.run(() => {
2815
+ this.flushRequests();
2816
+ }), this.batchCollectionDelayMs);
2817
+ });
2818
+ }
3129
2819
  }
3130
- }
3131
- getOffsetDate(date) {
3132
- const localOffset = -date.getTimezoneOffset() / 60;
3133
- return new Date(date.getTime() + localOffset * 3600 * 1000);
3134
- }
3135
- getDate(match) {
3136
- const year = this.toInt(match[1]);
3137
- const month = this.toInt(match[2]) - 1;
3138
- const day = this.toInt(match[3]);
3139
- let resultDate;
3140
- if (match[4] && match[5] && match[6]) {
3141
- const hour = this.toInt(match[4]);
3142
- const minutes = this.toInt(match[5]);
3143
- const seconds = this.toInt(match[6]);
3144
- resultDate = new Date(year, month, day, hour, minutes, seconds, 0);
2820
+ if (this.pendingRequests.size >= this.maxRequestsPerBatch) {
2821
+ this.flushRequests();
3145
2822
  }
3146
- else {
3147
- resultDate = new Date(year, month, day);
2823
+ return subject;
2824
+ }
2825
+ stopPolling() {
2826
+ if (this.pollActivitiesSubscription) {
2827
+ this.pollActivitiesSubscription.unsubscribe();
3148
2828
  }
3149
- return resultDate;
3150
2829
  }
3151
- getHour(hourStr) {
3152
- let hourNum = this.toInt(hourStr);
3153
- if (hourNum > 12) {
3154
- hourNum = hourNum - 12;
2830
+ flushRequests() {
2831
+ if (this.currentTimeoutHandle) {
2832
+ clearTimeout(this.currentTimeoutHandle);
2833
+ this.currentTimeoutHandle = undefined;
3155
2834
  }
3156
- else if (hourNum === 0) {
3157
- hourNum = 12;
2835
+ if (!this.pendingRequests.size) {
2836
+ return;
3158
2837
  }
3159
- return hourNum;
2838
+ const requests = new Map(this.pendingRequests);
2839
+ this.pendingRequests.clear();
2840
+ this.performBatchRequest(requests);
3160
2841
  }
3161
- toInt(str) {
3162
- return parseInt(str, 10);
2842
+ pollActivities(...caseIds) {
2843
+ if (!this.isEnabled) {
2844
+ return EMPTY;
2845
+ }
2846
+ return this.polling(this.activityService.getActivities(...caseIds), this.pollConfig);
3163
2847
  }
3164
- pad(num, padNum = 2) {
3165
- const val = num !== undefined ? num.toString() : '';
3166
- return val.length >= padNum ? val : new Array(padNum - val.length + 1).join('0') + val;
2848
+ postViewActivity(caseId) {
2849
+ return this.postActivity(caseId, ActivityService.ACTIVITY_VIEW);
3167
2850
  }
3168
- static ɵfac = function DatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(FormatTranslatorService, 16)); };
3169
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDate", type: DatePipe, pure: true, standalone: false });
3170
- }
3171
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{
3172
- type: Pipe,
3173
- args: [{
3174
- name: 'ccdDate',
3175
- standalone: false
3176
- }]
3177
- }], () => [{ type: FormatTranslatorService }], null); })();
3178
-
3179
- class FieldLabelPipe {
3180
- rpxTranslationPipe;
3181
- constructor(rpxTranslationPipe) {
3182
- this.rpxTranslationPipe = rpxTranslationPipe;
2851
+ postEditActivity(caseId) {
2852
+ return this.postActivity(caseId, ActivityService.ACTIVITY_EDIT);
3183
2853
  }
3184
- transform(field) {
3185
- if (!field || !field.label) {
3186
- return '';
3187
- }
3188
- else if (!field.display_context) {
3189
- return this.getTranslatedLabel(field);
3190
- }
3191
- return this.getTranslatedLabel(field) + (field.display_context.toUpperCase() === 'OPTIONAL' ?
3192
- ' (' + this.rpxTranslationPipe.transform('Optional') + ')' : '');
2854
+ performBatchRequest(requests) {
2855
+ const caseIds = Array.from(requests.keys()).join();
2856
+ this.ngZone.runOutsideAngular(() => {
2857
+ // run polling outside angular zone so it does not trigger change detection
2858
+ this.pollActivitiesSubscription = this.pollActivities(caseIds).subscribe({
2859
+ // process activity inside zone so it triggers change detection for activity.component.ts
2860
+ next: (activities) => this.ngZone.run(() => {
2861
+ activities.forEach((activity) => {
2862
+ // Ignore activities returned for cases outside this local batch.
2863
+ requests.get(activity.caseId)?.next(activity);
2864
+ });
2865
+ }),
2866
+ error: (err) => this.ngZone.run(() => {
2867
+ this.logger.error('Error while polling activities.', { error: err });
2868
+ Array.from(requests.values()).forEach((subject) => subject.error(err));
2869
+ })
2870
+ });
2871
+ });
3193
2872
  }
3194
- getTranslatedLabel(field) {
3195
- if (!field.isTranslated) {
3196
- return this.rpxTranslationPipe.transform(field.label);
3197
- }
3198
- else {
3199
- return field.label;
2873
+ postActivity(caseId, activityType) {
2874
+ if (!this.isEnabled) {
2875
+ return EMPTY;
3200
2876
  }
2877
+ const pollingConfig = {
2878
+ ...this.pollConfig,
2879
+ interval: 5000 // inline with CCD Backend
2880
+ };
2881
+ return this.polling(this.activityService.postActivity(caseId, activityType), pollingConfig);
3201
2882
  }
3202
- getOriginalLabelForYesNoTranslation(field) {
3203
- return field.originalLabel || field.label;
3204
- }
3205
- static ɵfac = function FieldLabelPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FieldLabelPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslatePipe, 16)); };
3206
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFieldLabel", type: FieldLabelPipe, pure: false, standalone: false });
3207
- }
3208
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldLabelPipe, [{
3209
- type: Pipe,
3210
- args: [{
3211
- name: 'ccdFieldLabel',
3212
- pure: false,
3213
- standalone: false
3214
- }]
3215
- }], () => [{ type: i1.RpxTranslatePipe }], null); })();
3216
-
3217
- class FirstErrorPipe {
3218
- rpxTranslationService;
3219
- injector;
3220
- asyncPipe;
3221
- constructor(rpxTranslationService, injector) {
3222
- this.rpxTranslationService = rpxTranslationService;
3223
- this.injector = injector;
3224
- this.asyncPipe = new AsyncPipe(this.injector.get(ChangeDetectorRef));
2883
+ addPendingRequest(caseId, subject) {
2884
+ this.pendingRequests.set(caseId, subject);
2885
+ // Components complete their returned Subject on destroy; remove it so a later same-case subscription gets a fresh Subject.
2886
+ subject.subscribe({
2887
+ complete: () => this.removePendingRequest(caseId, subject),
2888
+ error: () => this.removePendingRequest(caseId, subject)
2889
+ });
3225
2890
  }
3226
- transform(value, args) {
3227
- if (!value) {
3228
- return '';
3229
- }
3230
- if (!args) {
3231
- args = 'Field';
3232
- }
3233
- const keys = Object.keys(value);
3234
- if (!keys.length) {
3235
- return '';
3236
- }
3237
- let errorMessage;
3238
- if (keys[0] === 'required') {
3239
- errorMessage = '%FIELDLABEL% is required';
3240
- }
3241
- else if (keys[0] === 'pattern') {
3242
- errorMessage = 'The data entered is not valid for %FIELDLABEL%';
3243
- }
3244
- else if (keys[0] === 'markDownPattern') {
3245
- errorMessage = 'The data entered is not valid for %FIELDLABEL%. Link mark up characters are not allowed in this field';
3246
- }
3247
- else if (keys[0] === 'minlength') {
3248
- errorMessage = '%FIELDLABEL% is below the minimum length';
3249
- }
3250
- else if (keys[0] === 'maxlength') {
3251
- errorMessage = '%FIELDLABEL% exceeds the maximum length';
3252
- }
3253
- else if (value.hasOwnProperty('matDatetimePickerParse')) {
3254
- errorMessage = 'The date entered is not valid. Please provide a valid date';
2891
+ removePendingRequest(caseId, subject) {
2892
+ if (this.pendingRequests.get(caseId) !== subject) {
2893
+ return;
3255
2894
  }
3256
- else {
3257
- errorMessage = value[keys[0]];
2895
+ this.pendingRequests.delete(caseId);
2896
+ if (!this.pendingRequests.size && this.currentTimeoutHandle) {
2897
+ clearTimeout(this.currentTimeoutHandle);
2898
+ this.currentTimeoutHandle = undefined;
3258
2899
  }
3259
- const o = this.rpxTranslationService.getTranslation$(args).pipe(switchMap(fieldLabel => this.rpxTranslationService.getTranslationWithReplacements$(errorMessage, { FIELDLABEL: fieldLabel })));
3260
- return this.asyncPipe.transform(o);
3261
2900
  }
3262
- ngOnDestroy() {
3263
- this.asyncPipe.ngOnDestroy();
2901
+ polling(request$, options) {
2902
+ const pollingOptions = {
2903
+ interval: options.interval,
2904
+ attempts: options.attempts ?? 9,
2905
+ exponentialUnit: options.exponentialUnit ?? 1000
2906
+ };
2907
+ return concat(request$, defer(() => timer(pollingOptions.interval).pipe(switchMap(() => request$))).pipe(repeat())).pipe(
2908
+ // Preserve consecutive-failure retry behaviour using the current RxJS retry config.
2909
+ retry({
2910
+ count: pollingOptions.attempts,
2911
+ delay: (_error, retryCount) => timer(this.getExponentialRetryDelay(retryCount, pollingOptions.exponentialUnit)),
2912
+ resetOnSuccess: true
2913
+ }));
3264
2914
  }
3265
- static ɵfac = function FirstErrorPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FirstErrorPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslationService, 16), i0.ɵɵdirectiveInject(i0.Injector, 16)); };
3266
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFirstError", type: FirstErrorPipe, pure: false, standalone: false });
3267
- }
3268
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FirstErrorPipe, [{
3269
- type: Pipe,
3270
- args: [{
3271
- name: 'ccdFirstError',
3272
- pure: false,
3273
- standalone: false
3274
- }]
3275
- }], () => [{ type: i1.RpxTranslationService }, { type: i0.Injector }], null); })();
3276
-
3277
- class IsCompoundPipe {
3278
- static COMPOUND_TYPES = [
3279
- 'Complex',
3280
- 'Label',
3281
- 'AddressGlobal',
3282
- 'AddressUK',
3283
- 'AddressGlobalUK',
3284
- 'CasePaymentHistoryViewer',
3285
- 'CaseHistoryViewer',
3286
- 'Organisation',
3287
- 'WaysToPay',
3288
- 'ComponentLauncher',
3289
- 'FlagLauncher',
3290
- 'CaseFlag'
3291
- ];
3292
- static EXCLUDE = [
3293
- 'CaseLink',
3294
- 'JudicialUser'
3295
- ];
3296
- transform(field) {
3297
- if (!field || !field.field_type || !field.field_type.type) {
3298
- return false;
3299
- }
3300
- if (IsCompoundPipe.COMPOUND_TYPES.indexOf(field.field_type.type) !== -1) {
3301
- if (IsCompoundPipe.EXCLUDE.indexOf(field.field_type.id) !== -1) {
3302
- return false;
3303
- }
3304
- return true;
3305
- }
3306
- return false;
2915
+ getExponentialRetryDelay(consecutiveErrorsCount, exponentialUnit) {
2916
+ return Math.pow(2, consecutiveErrorsCount - 1) * exponentialUnit;
3307
2917
  }
3308
- static ɵfac = function IsCompoundPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsCompoundPipe)(); };
3309
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsCompound", type: IsCompoundPipe, pure: true, standalone: false });
2918
+ static ɵfac = function ActivityPollingService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityPollingService)(i0.ɵɵinject(ActivityService), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(AbstractAppConfig)); };
2919
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityPollingService, factory: ActivityPollingService.ɵfac });
3310
2920
  }
3311
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsCompoundPipe, [{
3312
- type: Pipe,
3313
- args: [{
3314
- name: 'ccdIsCompound',
3315
- standalone: false
3316
- }]
3317
- }], null, null); })();
2921
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityPollingService, [{
2922
+ type: Injectable
2923
+ }], () => [{ type: ActivityService }, { type: i0.NgZone }, { type: AbstractAppConfig }], null); })();
3318
2924
 
3319
- class CaseFieldService {
3320
- isOptional(field) {
3321
- if (!field || !field.display_context) {
3322
- return false;
3323
- }
3324
- return field.display_context.toUpperCase() === 'OPTIONAL';
3325
- }
3326
- isReadOnly(field) {
3327
- if (!field || !field.display_context) {
3328
- return false;
3329
- }
3330
- return field.display_context.toUpperCase() === 'READONLY';
2925
+ function ActivityComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2926
+ i0.ɵɵelementStart(0, "div");
2927
+ i0.ɵɵelement(1, "ccd-activity-icon", 5);
2928
+ i0.ɵɵpipe(2, "rpxTranslate");
2929
+ i0.ɵɵelementEnd();
2930
+ } if (rf & 2) {
2931
+ const ctx_r0 = i0.ɵɵnextContext(2);
2932
+ i0.ɵɵclassProp("activityEditorsAndViewersIcons", ctx_r0.viewersPresent())("activityEditorsIcon", !ctx_r0.viewersPresent());
2933
+ i0.ɵɵadvance();
2934
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 5, ctx_r0.editorsText));
2935
+ } }
2936
+ function ActivityComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
2937
+ i0.ɵɵelementStart(0, "div", 6);
2938
+ i0.ɵɵelement(1, "ccd-activity-icon", 7);
2939
+ i0.ɵɵpipe(2, "rpxTranslate");
2940
+ i0.ɵɵelementEnd();
2941
+ } if (rf & 2) {
2942
+ const ctx_r0 = i0.ɵɵnextContext(2);
2943
+ i0.ɵɵadvance();
2944
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2945
+ } }
2946
+ function ActivityComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
2947
+ i0.ɵɵelementStart(0, "div");
2948
+ i0.ɵɵelement(1, "ccd-activity-banner", 8);
2949
+ i0.ɵɵpipe(2, "rpxTranslate");
2950
+ i0.ɵɵelementEnd();
2951
+ } if (rf & 2) {
2952
+ const ctx_r0 = i0.ɵɵnextContext(2);
2953
+ i0.ɵɵadvance();
2954
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.editorsText));
2955
+ } }
2956
+ function ActivityComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
2957
+ i0.ɵɵelementStart(0, "div");
2958
+ i0.ɵɵelement(1, "ccd-activity-banner", 9);
2959
+ i0.ɵɵpipe(2, "rpxTranslate");
2960
+ i0.ɵɵelementEnd();
2961
+ } if (rf & 2) {
2962
+ const ctx_r0 = i0.ɵɵnextContext(2);
2963
+ i0.ɵɵadvance();
2964
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2965
+ } }
2966
+ function ActivityComponent_div_0_Template(rf, ctx) { if (rf & 1) {
2967
+ i0.ɵɵelementStart(0, "div", 1);
2968
+ i0.ɵɵtemplate(1, ActivityComponent_div_0_div_1_Template, 3, 7, "div", 2)(2, ActivityComponent_div_0_div_2_Template, 3, 3, "div", 3)(3, ActivityComponent_div_0_div_3_Template, 3, 3, "div", 4)(4, ActivityComponent_div_0_div_4_Template, 3, 3, "div", 4);
2969
+ i0.ɵɵelementEnd();
2970
+ } if (rf & 2) {
2971
+ const ctx_r0 = i0.ɵɵnextContext();
2972
+ i0.ɵɵadvance();
2973
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.editorsPresent());
2974
+ i0.ɵɵadvance();
2975
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.viewersPresent());
2976
+ i0.ɵɵadvance();
2977
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.editorsPresent());
2978
+ i0.ɵɵadvance();
2979
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.viewersPresent());
2980
+ } }
2981
+ class ActivityComponent {
2982
+ activityPollingService;
2983
+ activity;
2984
+ dspMode = DisplayMode;
2985
+ viewersText;
2986
+ editorsText;
2987
+ subscription;
2988
+ caseId;
2989
+ displayMode;
2990
+ VIEWERS_PREFIX = '';
2991
+ VIEWERS_SUFFIX = 'viewing this case';
2992
+ EDITORS_PREFIX = 'This case is being updated by ';
2993
+ EDITORS_SUFFIX = '';
2994
+ constructor(activityPollingService) {
2995
+ this.activityPollingService = activityPollingService;
3331
2996
  }
3332
- isMandatory(field) {
3333
- if (!field || !field.display_context) {
3334
- return false;
3335
- }
3336
- return field.display_context.toUpperCase() === 'MANDATORY';
2997
+ ngOnInit() {
2998
+ this.activity = new Activity();
2999
+ this.activity.caseId = this.caseId;
3000
+ this.activity.editors = [];
3001
+ this.activity.unknownEditors = 0;
3002
+ this.activity.viewers = [];
3003
+ this.activity.unknownViewers = 0;
3004
+ this.viewersText = '';
3005
+ this.editorsText = '';
3006
+ this.subscription = this.activityPollingService.subscribeToActivity(this.caseId, newActivity => this.onActivityChange(newActivity));
3337
3007
  }
3338
- isLabel(field) {
3339
- if (!field || !field.field_type) {
3340
- return false;
3341
- }
3342
- return field.field_type.type === 'Label';
3008
+ onActivityChange(newActivity) {
3009
+ this.activity = newActivity;
3010
+ this.viewersText = this.generateDescription(this.VIEWERS_PREFIX, this.VIEWERS_SUFFIX, this.activity.viewers, this.activity.unknownViewers);
3011
+ this.editorsText = this.generateDescription(this.EDITORS_PREFIX, this.EDITORS_SUFFIX, this.activity.editors, this.activity.unknownEditors);
3343
3012
  }
3344
- static ɵfac = function CaseFieldService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFieldService)(); };
3345
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFieldService, factory: CaseFieldService.ɵfac });
3346
- }
3347
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFieldService, [{
3348
- type: Injectable
3349
- }], null, null); })();
3350
-
3351
- class IsMandatoryPipe {
3352
- caseFieldService;
3353
- constructor(caseFieldService) {
3354
- this.caseFieldService = caseFieldService;
3013
+ isActivityEnabled() {
3014
+ return this.activityPollingService.isEnabled;
3355
3015
  }
3356
- transform(field) {
3357
- return this.caseFieldService.isMandatory(field);
3016
+ isActiveCase() {
3017
+ return this.activity.editors.length || this.activity.viewers.length || this.activity.unknownEditors || this.activity.unknownViewers;
3358
3018
  }
3359
- static ɵfac = function IsMandatoryPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsMandatoryPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3360
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsMandatory", type: IsMandatoryPipe, pure: true, standalone: false });
3361
- }
3362
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsMandatoryPipe, [{
3363
- type: Pipe,
3364
- args: [{
3365
- name: 'ccdIsMandatory',
3366
- standalone: false
3367
- }]
3368
- }], () => [{ type: CaseFieldService }], null); })();
3369
-
3370
- class IsReadOnlyPipe {
3371
- caseFieldService;
3372
- constructor(caseFieldService) {
3373
- this.caseFieldService = caseFieldService;
3019
+ viewersPresent() {
3020
+ return (this.activity.viewers.length > 0 || this.activity.unknownViewers > 0);
3374
3021
  }
3375
- transform(field) {
3376
- return this.caseFieldService.isReadOnly(field);
3022
+ editorsPresent() {
3023
+ return (this.activity.editors.length > 0 || this.activity.unknownEditors > 0);
3377
3024
  }
3378
- static ɵfac = function IsReadOnlyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3379
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnly", type: IsReadOnlyPipe, pure: true, standalone: false });
3380
- }
3381
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyPipe, [{
3382
- type: Pipe,
3383
- args: [{
3384
- name: 'ccdIsReadOnly',
3385
- standalone: false
3386
- }]
3387
- }], () => [{ type: CaseFieldService }], null); })();
3388
-
3389
- class IsReadOnlyAndNotCollectionPipe {
3390
- caseFieldService;
3391
- constructor(caseFieldService) {
3392
- this.caseFieldService = caseFieldService;
3025
+ ngOnDestroy() {
3026
+ if (this.subscription) {
3027
+ this.subscription.complete();
3028
+ }
3029
+ this.activityPollingService.stopPolling();
3393
3030
  }
3394
- transform(field) {
3395
- if (!field || !field.field_type || !field.field_type.type) {
3396
- return false;
3031
+ generateDescription(prefix, suffix, namesArray, unknownCount) {
3032
+ let resultText = prefix;
3033
+ resultText += namesArray.map(activityInfo => `${activityInfo.forename} ${activityInfo.surname}`).join(', ');
3034
+ if (unknownCount > 0) {
3035
+ resultText += (namesArray.length > 0 ? ` and ${unknownCount} other` : `${unknownCount} user`);
3036
+ resultText += (unknownCount > 1 ? 's' : '');
3397
3037
  }
3398
- if (this.isCollection(field)) {
3399
- return false;
3038
+ else {
3039
+ resultText = this.replaceLastCommaWithAnd(resultText);
3400
3040
  }
3401
- return this.caseFieldService.isReadOnly(field);
3041
+ if (suffix.length > 0) {
3042
+ if (namesArray.length + unknownCount > 1) {
3043
+ resultText += ` are ${suffix}`;
3044
+ }
3045
+ else {
3046
+ resultText += ` is ${suffix}`;
3047
+ }
3048
+ }
3049
+ return resultText;
3402
3050
  }
3403
- // CaseField @Expose() doesn't work with the pipe in here, so leaving the manual check
3404
- isCollection(field) {
3405
- return field.field_type && field.field_type.type === 'Collection';
3051
+ replaceLastCommaWithAnd(str) {
3052
+ return str.trim().replace(/,([^,]*)$/, ' and $1').split(' ').join(' ');
3406
3053
  }
3407
- static ɵfac = function IsReadOnlyAndNotCollectionPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyAndNotCollectionPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3408
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnlyAndNotCollection", type: IsReadOnlyAndNotCollectionPipe, pure: true, standalone: false });
3054
+ static ɵfac = function ActivityComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityComponent)(i0.ɵɵdirectiveInject(ActivityPollingService)); };
3055
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ActivityComponent, selectors: [["ccd-activity"]], inputs: { caseId: "caseId", displayMode: "displayMode" }, standalone: false, decls: 1, vars: 1, consts: [["class", "activityComponent", 4, "ngIf"], [1, "activityComponent"], [3, "activityEditorsAndViewersIcons", "activityEditorsIcon", 4, "ngIf"], ["class", "activityViewersIcon", 4, "ngIf"], [4, "ngIf"], ["imageLink", "assets/img/editor.png", 3, "description"], [1, "activityViewersIcon"], ["imageLink", "assets/img/viewer.png", 3, "description"], ["imageLink", "assets/img/editorBanner.png", "bannerType", "editor", 3, "description"], ["imageLink", "assets/img/viewerBanner.png", "bannerType", "viewer", 3, "description"]], template: function ActivityComponent_Template(rf, ctx) { if (rf & 1) {
3056
+ i0.ɵɵtemplate(0, ActivityComponent_div_0_Template, 5, 4, "div", 0);
3057
+ } if (rf & 2) {
3058
+ i0.ɵɵproperty("ngIf", ctx.isActivityEnabled());
3059
+ } }, dependencies: [i5.NgIf, ActivityBannerComponent, ActivityIconComponent, i1.RpxTranslatePipe], styles: [".activityEditorsIcon[_ngcontent-%COMP%]{margin-left:14px}.activityEditorsAndViewersIcons[_ngcontent-%COMP%], .activityViewersIcon[_ngcontent-%COMP%]{float:left;margin-left:14px}"] });
3409
3060
  }
3410
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyAndNotCollectionPipe, [{
3411
- type: Pipe,
3412
- args: [{
3413
- name: 'ccdIsReadOnlyAndNotCollection',
3414
- standalone: false
3415
- }]
3416
- }], () => [{ type: CaseFieldService }], null); })();
3061
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityComponent, [{
3062
+ type: Component,
3063
+ args: [{ selector: 'ccd-activity', standalone: false, template: "<div class=\"activityComponent\" *ngIf=\"isActivityEnabled()\">\n <div *ngIf=\"displayMode === dspMode.ICON && editorsPresent()\" [class.activityEditorsAndViewersIcons]=\"viewersPresent()\" [class.activityEditorsIcon]=\"!viewersPresent()\">\n <ccd-activity-icon imageLink=\"assets/img/editor.png\" [description]=\"editorsText | rpxTranslate\"></ccd-activity-icon>\n </div>\n <div *ngIf=\"displayMode === dspMode.ICON && viewersPresent()\" class=\"activityViewersIcon\">\n <ccd-activity-icon imageLink=\"assets/img/viewer.png\" [description]=\"viewersText | rpxTranslate\"></ccd-activity-icon>\n </div>\n <div *ngIf=\"displayMode === dspMode.BANNER && editorsPresent()\">\n <ccd-activity-banner imageLink=\"assets/img/editorBanner.png\" [description]=\"editorsText | rpxTranslate\" bannerType=\"editor\">\n </ccd-activity-banner>\n </div>\n <div *ngIf=\"displayMode === dspMode.BANNER && viewersPresent()\">\n <ccd-activity-banner imageLink=\"assets/img/viewerBanner.png\" [description]=\"viewersText | rpxTranslate\" bannerType=\"viewer\">\n </ccd-activity-banner>\n </div>\n</div>\n", styles: [".activityEditorsIcon{margin-left:14px}.activityEditorsAndViewersIcons,.activityViewersIcon{float:left;margin-left:14px}\n"] }]
3064
+ }], () => [{ type: ActivityPollingService }], { caseId: [{
3065
+ type: Input
3066
+ }], displayMode: [{
3067
+ type: Input
3068
+ }] }); })();
3069
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ActivityComponent, { className: "ActivityComponent", filePath: "lib/shared/components/activity/activity.component.ts", lineNumber: 12 }); })();
3417
3070
 
3418
- class PaletteUtilsModule {
3419
- static ɵfac = function PaletteUtilsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PaletteUtilsModule)(); };
3420
- static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaletteUtilsModule });
3071
+ class ActivityModule {
3072
+ static ɵfac = function ActivityModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityModule)(); };
3073
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ActivityModule });
3421
3074
  static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
3422
- IsCompoundPipe,
3423
- RpxTranslatePipe
3075
+ ActivityService,
3076
+ ActivityPollingService,
3077
+ SessionStorageService,
3424
3078
  ], imports: [CommonModule,
3079
+ RouterModule,
3425
3080
  RpxTranslationModule.forChild()] });
3426
3081
  }
3427
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaletteUtilsModule, [{
3082
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityModule, [{
3428
3083
  type: NgModule,
3429
3084
  args: [{
3430
3085
  imports: [
3431
3086
  CommonModule,
3087
+ RouterModule,
3432
3088
  RpxTranslationModule.forChild()
3433
3089
  ],
3434
3090
  declarations: [
3435
- DatePipe,
3436
- FieldLabelPipe,
3437
- FirstErrorPipe,
3438
- IsCompoundPipe,
3439
- IsMandatoryPipe,
3440
- IsReadOnlyPipe,
3441
- IsReadOnlyAndNotCollectionPipe,
3442
- DashPipe
3091
+ ActivityComponent,
3092
+ ActivityBannerComponent,
3093
+ ActivityIconComponent,
3443
3094
  ],
3444
3095
  exports: [
3445
- DatePipe,
3446
- FieldLabelPipe,
3447
- FirstErrorPipe,
3448
- IsCompoundPipe,
3449
- IsMandatoryPipe,
3450
- IsReadOnlyPipe,
3451
- IsReadOnlyAndNotCollectionPipe,
3452
- DashPipe
3096
+ ActivityComponent,
3097
+ ActivityBannerComponent,
3098
+ ActivityIconComponent,
3453
3099
  ],
3454
3100
  providers: [
3455
- IsCompoundPipe,
3456
- RpxTranslatePipe
3101
+ ActivityService,
3102
+ ActivityPollingService,
3103
+ SessionStorageService,
3457
3104
  ]
3458
3105
  }]
3459
3106
  }], null, null); })();
3460
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaletteUtilsModule, { declarations: [DatePipe,
3461
- FieldLabelPipe,
3462
- FirstErrorPipe,
3463
- IsCompoundPipe,
3464
- IsMandatoryPipe,
3465
- IsReadOnlyPipe,
3466
- IsReadOnlyAndNotCollectionPipe,
3467
- DashPipe], imports: [CommonModule, i1.RpxTranslationModule], exports: [DatePipe,
3468
- FieldLabelPipe,
3469
- FirstErrorPipe,
3470
- IsCompoundPipe,
3471
- IsMandatoryPipe,
3472
- IsReadOnlyPipe,
3473
- IsReadOnlyAndNotCollectionPipe,
3474
- DashPipe] }); })();
3475
-
3476
- // tslint:disable:variable-name
3477
- class AddressModel {
3478
- AddressLine1 = '';
3479
- AddressLine2 = '';
3480
- AddressLine3 = '';
3481
- PostTown = '';
3482
- County = '';
3483
- PostCode = '';
3484
- Country = '';
3485
- }
3107
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ActivityModule, { declarations: [ActivityComponent,
3108
+ ActivityBannerComponent,
3109
+ ActivityIconComponent], imports: [CommonModule,
3110
+ RouterModule, i1.RpxTranslationModule], exports: [ActivityComponent,
3111
+ ActivityBannerComponent,
3112
+ ActivityIconComponent] }); })();
3486
3113
 
3487
- class Alert {
3488
- level;
3114
+ class AlertService {
3115
+ router;
3116
+ rpxTranslationService;
3117
+ // the preserved messages
3118
+ preservedError = '';
3119
+ preservedWarning = '';
3120
+ preservedSuccess = '';
3121
+ // TODO: Remove
3489
3122
  message;
3490
- }
3491
-
3492
- // tslint:disable:variable-name
3493
- class CaseDetails {
3494
- id;
3495
- jurisdiction;
3496
- case_type_id;
3497
- state;
3498
- created_date;
3499
- last_modified;
3500
- locked_by_user_id;
3501
- security_level;
3502
- case_data;
3503
- }
3504
-
3505
- // tslint:disable:variable-name
3506
- class CaseEventData {
3507
- event;
3508
- data;
3509
- event_data; // full event data
3510
- event_token;
3511
- ignore_warning;
3512
- draft_id;
3513
- case_reference;
3514
- }
3515
-
3516
- class WizardPageField {
3517
- case_field_id;
3518
- order;
3519
- page_column_no;
3520
- complex_field_overrides;
3521
- }
3522
-
3523
- class FixedListItem {
3524
- code;
3525
- label;
3526
- order;
3527
- }
3528
-
3529
- // @dynamic
3530
- class FieldType {
3531
- id;
3532
- type;
3533
- min;
3534
- max;
3535
- regular_expression;
3536
- fixed_list_items;
3537
- complex_fields;
3538
- collection_field_type;
3539
- }
3540
- __decorate([
3541
- Type(() => FixedListItem),
3542
- __metadata("design:type", Array)
3543
- ], FieldType.prototype, "fixed_list_items", void 0);
3544
- __decorate([
3545
- Type(() => CaseField),
3546
- __metadata("design:type", Array)
3547
- ], FieldType.prototype, "complex_fields", void 0);
3548
- __decorate([
3549
- Type(() => FieldType),
3550
- __metadata("design:type", FieldType)
3551
- ], FieldType.prototype, "collection_field_type", void 0);
3552
-
3553
- // @dynamic
3554
- class CaseField {
3555
- static logger = new StructuredLoggerService();
3556
- id;
3557
- hidden;
3558
- hiddenCannotChange;
3559
- label;
3560
- originalLabel;
3561
- noCacheLabel;
3562
- order;
3563
- parent;
3564
- field_type;
3565
- hint_text;
3566
- security_label;
3567
- display_context;
3568
- display_context_parameter;
3569
- month_format;
3570
- show_condition;
3571
- show_summary_change_option;
3572
- show_summary_content_option;
3573
- acls;
3574
- metadata;
3575
- formatted_value;
3576
- retain_hidden_value;
3577
- wizardProps;
3578
- _value;
3579
- _list_items = [];
3580
- isTranslatedFlag = false;
3581
- get value() {
3582
- if (this.field_type && (this.field_type.type === 'DynamicList' || this.field_type.type === 'DynamicRadioList')) {
3583
- return this._value && this._value.value ? this._value.value.code : this._value;
3584
- }
3585
- else if (this.field_type && this.field_type.type === 'DynamicMultiSelectList') {
3586
- return this._value && this._value.value ? this._value.value : this._value;
3587
- }
3588
- else {
3589
- return this._value;
3590
- }
3591
- }
3592
- set value(value) {
3593
- if (this.isDynamic()) {
3594
- if (value && value instanceof Object && value.list_items) {
3595
- this._list_items = value.list_items;
3596
- }
3597
- else if (!this._list_items || this._list_items.length === 0) {
3598
- // Extract the list items from the current value if that's the only place they exist.
3599
- this._list_items = this.list_items;
3600
- if (!value || !value.value) {
3601
- value = null;
3123
+ level;
3124
+ successes;
3125
+ errors;
3126
+ warnings;
3127
+ // TODO: Remove
3128
+ alerts;
3129
+ successObserver;
3130
+ errorObserver;
3131
+ warningObserver;
3132
+ // TODO: Remove
3133
+ alertObserver;
3134
+ preserveAlerts = false;
3135
+ constructor(router, rpxTranslationService) {
3136
+ this.router = router;
3137
+ this.rpxTranslationService = rpxTranslationService;
3138
+ this.successes = Observable
3139
+ .create(observer => this.successObserver = observer).pipe(publish(), refCount());
3140
+ this.successes.subscribe();
3141
+ this.errors = Observable
3142
+ .create(observer => this.errorObserver = observer).pipe(publish(), refCount());
3143
+ this.errors.subscribe();
3144
+ this.warnings = Observable
3145
+ .create(observer => this.warningObserver = observer).pipe(publish(), refCount());
3146
+ this.warnings.subscribe();
3147
+ // TODO: Remove
3148
+ this.alerts = Observable
3149
+ .create(observer => this.alertObserver = observer).pipe(publish(), refCount());
3150
+ this.alerts.subscribe();
3151
+ this.router
3152
+ .events
3153
+ .subscribe(event => {
3154
+ if (event instanceof NavigationStart) {
3155
+ // if there is no longer a preserve alerts setting for the page then clear all observers and preserved messages
3156
+ if (!this.preserveAlerts) {
3157
+ this.clear();
3602
3158
  }
3159
+ // if not, then set the preserving of alerts to false so rendering to a new page
3160
+ this.preserveAlerts = false;
3603
3161
  }
3604
- }
3605
- this._value = value;
3162
+ });
3606
3163
  }
3607
- get list_items() {
3608
- if (this.isDynamic()) {
3609
- return this._value && this._value.list_items ? this._value.list_items : this._list_items;
3610
- }
3611
- else {
3612
- return this.field_type.fixed_list_items;
3613
- }
3164
+ clear() {
3165
+ this.successObserver.next(null);
3166
+ this.errorObserver.next(null);
3167
+ this.warningObserver.next(null);
3168
+ this.preservedError = '';
3169
+ this.preservedWarning = '';
3170
+ this.preservedSuccess = '';
3171
+ // EUI-3381.
3172
+ this.alertObserver.next(null);
3173
+ this.message = '';
3614
3174
  }
3615
- set list_items(items) {
3616
- if ((items && !this._list_items) || (items?.length > this._list_items?.length)) {
3617
- this._list_items = items;
3618
- }
3175
+ error({ phrase, replacements }) {
3176
+ const message = this.getTranslationWithReplacements(phrase, replacements);
3177
+ this.preservedError = this.preserveMessages(message);
3178
+ const alert = { level: 'error', message };
3179
+ this.errorObserver.next(alert);
3180
+ // EUI-3381.
3181
+ this.push(alert);
3619
3182
  }
3620
- get dateTimeEntryFormat() {
3621
- if (this.isComplexDisplay()) {
3622
- return null;
3183
+ warning({ phrase, replacements }) {
3184
+ const message = this.getTranslationWithReplacements(phrase, replacements);
3185
+ this.preservedWarning = this.preserveMessages(message);
3186
+ const alert = { level: 'warning', message };
3187
+ this.warningObserver.next(alert);
3188
+ // EUI-3381.
3189
+ this.push(alert);
3190
+ }
3191
+ success({ preserve, phrase, replacements }) {
3192
+ const message = this.getTranslationWithReplacements(phrase, replacements);
3193
+ this.preserveAlerts = preserve || this.preserveAlerts;
3194
+ const alert = { level: 'success', message };
3195
+ this.preservedSuccess = this.preserveMessages(message);
3196
+ this.successObserver.next(alert);
3197
+ // EUI-3381.
3198
+ this.push(alert);
3199
+ }
3200
+ getTranslationWithReplacements(phrase, replacements) {
3201
+ let message;
3202
+ if (replacements) {
3203
+ this.rpxTranslationService.getTranslationWithReplacements$(phrase, replacements).subscribe(translation => {
3204
+ message = translation;
3205
+ });
3623
3206
  }
3624
- if (this.display_context_parameter) {
3625
- return this.extractBracketValue(this.display_context_parameter, '#DATETIMEENTRY');
3207
+ else {
3208
+ this.rpxTranslationService.getTranslation$(phrase).subscribe(translation => {
3209
+ message = translation;
3210
+ });
3626
3211
  }
3627
- return null;
3212
+ return message;
3628
3213
  }
3629
- get dateTimeDisplayFormat() {
3630
- if (this.isComplexEntry()) {
3631
- return null;
3214
+ setPreserveAlerts(preserve, urlInfo) {
3215
+ // if there is no url setting then just preserve the messages
3216
+ if (!urlInfo) {
3217
+ this.preserveAlerts = preserve;
3632
3218
  }
3633
- if (this.display_context_parameter) {
3634
- return this.extractBracketValue(this.display_context_parameter, '#DATETIMEDISPLAY');
3219
+ else {
3220
+ // check if the url includes the sting given
3221
+ this.preserveAlerts = this.currentUrlIncludesInfo(preserve, urlInfo);
3635
3222
  }
3636
- return null;
3637
- }
3638
- isComplexDisplay() {
3639
- return (this.isComplex() || this.isCollection()) && this.isReadonly();
3640
3223
  }
3641
- isComplexEntry() {
3642
- return (this.isComplex() || this.isCollection()) && (this.isOptional() || this.isMandatory());
3224
+ currentUrlIncludesInfo(preserve, urlInfo) {
3225
+ // loop through the list of strings and check the router includes all of them
3226
+ for (const urlSnip of urlInfo) {
3227
+ if (!this.router.url.includes(urlSnip)) {
3228
+ // return the opposite boolean value if the router does not include one of the strings
3229
+ return !preserve;
3230
+ }
3231
+ }
3232
+ // return the boolean value if all strings are in the url
3233
+ return preserve;
3643
3234
  }
3644
- isReadonly() {
3645
- return !_.isEmpty(this.display_context)
3646
- && this.display_context.toUpperCase() === 'READONLY';
3235
+ isPreserveAlerts() {
3236
+ return this.preserveAlerts;
3647
3237
  }
3648
- isOptional() {
3649
- return !_.isEmpty(this.display_context)
3650
- && this.display_context.toUpperCase() === 'OPTIONAL';
3238
+ preserveMessages(message) {
3239
+ // preserve the messages if set to preserve them
3240
+ if (this.isPreserveAlerts()) {
3241
+ return message;
3242
+ }
3243
+ else {
3244
+ return '';
3245
+ }
3651
3246
  }
3652
- isMandatory() {
3653
- return !_.isEmpty(this.display_context)
3654
- && this.display_context.toUpperCase() === 'MANDATORY';
3247
+ // TODO: Remove
3248
+ push(msgObject) {
3249
+ this.message = msgObject.message;
3250
+ this.level = msgObject.level;
3251
+ this.alertObserver.next({
3252
+ level: this.level,
3253
+ message: this.message
3254
+ });
3655
3255
  }
3656
- isCollection() {
3657
- return this.field_type && this.field_type.type === 'Collection';
3256
+ static ɵfac = function AlertService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AlertService)(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(i1.RpxTranslationService)); };
3257
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AlertService, factory: AlertService.ɵfac });
3258
+ }
3259
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AlertService, [{
3260
+ type: Injectable
3261
+ }], () => [{ type: i1$1.Router }, { type: i1.RpxTranslationService }], null); })();
3262
+
3263
+ class DraftService {
3264
+ http;
3265
+ appConfig;
3266
+ errorService;
3267
+ static V2_MEDIATYPE_DRAFT_CREATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-create.v2+json;charset=UTF-8';
3268
+ static V2_MEDIATYPE_DRAFT_UPDATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-update.v2+json;charset=UTF-8';
3269
+ static V2_MEDIATYPE_DRAFT_READ = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-read.v2+json;charset=UTF-8';
3270
+ static V2_MEDIATYPE_DRAFT_DELETE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-delete.v2+json;charset=UTF-8';
3271
+ constructor(http, appConfig, errorService) {
3272
+ this.http = http;
3273
+ this.appConfig = appConfig;
3274
+ this.errorService = errorService;
3658
3275
  }
3659
- isComplex() {
3660
- return this.field_type && this.field_type.type === 'Complex';
3276
+ createDraft(ctid, eventData) {
3277
+ const saveDraftEndpoint = this.appConfig.getCreateOrUpdateDraftsUrl(ctid);
3278
+ const headers = new HttpHeaders()
3279
+ .set('experimental', 'true')
3280
+ .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_CREATE)
3281
+ .set('Content-Type', 'application/json');
3282
+ return this.http
3283
+ .post(saveDraftEndpoint, eventData, { headers, observe: 'body' })
3284
+ .pipe(catchError((error) => {
3285
+ this.errorService.setError(error);
3286
+ return throwError(error);
3287
+ }));
3661
3288
  }
3662
- isDynamic() {
3663
- const dynamicFieldTypes = ['DynamicList', 'DynamicRadioList', 'DynamicMultiSelectList'];
3664
- if (!this.field_type) {
3665
- return false;
3666
- }
3667
- return dynamicFieldTypes.some(t => t === this.field_type.type);
3289
+ updateDraft(ctid, draftId, eventData) {
3290
+ const saveDraftEndpoint = `${this.appConfig.getCreateOrUpdateDraftsUrl(ctid)}/${draftId}`;
3291
+ const headers = new HttpHeaders()
3292
+ .set('experimental', 'true')
3293
+ .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_UPDATE)
3294
+ .set('Content-Type', 'application/json');
3295
+ return this.http
3296
+ .put(saveDraftEndpoint, eventData, { headers, observe: 'body' })
3297
+ .pipe(catchError((error) => {
3298
+ this.errorService.setError(error);
3299
+ return throwError(error);
3300
+ }));
3668
3301
  }
3669
- isCaseLink() {
3670
- return this.isComplex()
3671
- && this.field_type.id === 'CaseLink'
3672
- && this.field_type.complex_fields.some(cf => cf.id === 'CaseReference');
3302
+ getDraft(draftId) {
3303
+ const url = this.appConfig.getViewOrDeleteDraftsUrl(draftId.slice(DRAFT_PREFIX.length));
3304
+ const headers = new HttpHeaders()
3305
+ .set('experimental', 'true')
3306
+ .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_READ)
3307
+ .set('Content-Type', 'application/json');
3308
+ return this.http
3309
+ .get(url, { headers, observe: 'body' })
3310
+ .pipe(catchError((error) => {
3311
+ this.errorService.setError(error);
3312
+ return throwError(error);
3313
+ }));
3673
3314
  }
3674
- extractBracketValue(fmt, paramName, leftBracket = '(', rightBracket = ')') {
3675
- fmt = fmt.split(',')
3676
- .find(a => a.trim().startsWith(paramName));
3677
- if (fmt) {
3678
- const s = fmt.indexOf(leftBracket) + 1;
3679
- const e = fmt.indexOf(rightBracket, s);
3680
- if (e > s && s >= 0) {
3681
- return fmt.substr(s, (e - s));
3682
- }
3683
- }
3684
- return null;
3315
+ deleteDraft(draftId) {
3316
+ const url = this.appConfig.getViewOrDeleteDraftsUrl(draftId.slice(DRAFT_PREFIX.length));
3317
+ const headers = new HttpHeaders()
3318
+ .set('experimental', 'true')
3319
+ .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_DELETE)
3320
+ .set('Content-Type', 'application/json');
3321
+ return this.http
3322
+ .delete(url, { headers, observe: 'body' }).pipe(catchError((error) => {
3323
+ this.errorService.setError(error);
3324
+ return throwError(error);
3325
+ }));
3685
3326
  }
3686
- // Ascend the hierarchy to get the full path of the field
3687
- getHierachicalId(curr) {
3688
- const prefix = curr ? curr + "_" : "";
3689
- if (prefix.length < 1024) {
3690
- if (this.parent) {
3691
- return this.parent.getHierachicalId(prefix + this.id);
3692
- }
3693
- else {
3694
- return prefix + this.id;
3695
- }
3327
+ createOrUpdateDraft(caseTypeId, draftId, caseEventData) {
3328
+ if (!draftId) {
3329
+ return this.createDraft(caseTypeId, caseEventData);
3696
3330
  }
3697
3331
  else {
3698
- CaseField.logger.error('Path too long, possible circular reference in case field hierarchy.');
3699
- return this.id;
3332
+ return this.updateDraft(caseTypeId, Draft.stripDraftId(draftId), caseEventData);
3700
3333
  }
3701
3334
  }
3702
- set isTranslated(val) {
3703
- this.isTranslatedFlag = val;
3335
+ static ɵfac = function DraftService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DraftService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(HttpErrorService)); };
3336
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DraftService, factory: DraftService.ɵfac });
3337
+ }
3338
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DraftService, [{
3339
+ type: Injectable
3340
+ }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }], null); })();
3341
+
3342
+ class ConditionalShowRegistrarService {
3343
+ registeredDirectives = [];
3344
+ register(newDirective) {
3345
+ this.registeredDirectives.push(newDirective);
3704
3346
  }
3705
- get isTranslated() {
3706
- return this.isTranslatedFlag;
3347
+ reset() {
3348
+ this.registeredDirectives = [];
3707
3349
  }
3350
+ static ɵfac = function ConditionalShowRegistrarService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConditionalShowRegistrarService)(); };
3351
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConditionalShowRegistrarService, factory: ConditionalShowRegistrarService.ɵfac });
3708
3352
  }
3709
- __decorate([
3710
- Exclude(),
3711
- __metadata("design:type", CaseField)
3712
- ], CaseField.prototype, "parent", void 0);
3713
- __decorate([
3714
- Type(() => FieldType),
3715
- __metadata("design:type", FieldType)
3716
- ], CaseField.prototype, "field_type", void 0);
3717
- __decorate([
3718
- Type(() => WizardPageField),
3719
- __metadata("design:type", WizardPageField)
3720
- ], CaseField.prototype, "wizardProps", void 0);
3721
- __decorate([
3722
- Expose(),
3723
- __metadata("design:type", Object),
3724
- __metadata("design:paramtypes", [Object])
3725
- ], CaseField.prototype, "value", null);
3726
- __decorate([
3727
- Expose(),
3728
- __metadata("design:type", Object),
3729
- __metadata("design:paramtypes", [Object])
3730
- ], CaseField.prototype, "list_items", null);
3731
- __decorate([
3732
- Expose(),
3733
- __metadata("design:type", String),
3734
- __metadata("design:paramtypes", [])
3735
- ], CaseField.prototype, "dateTimeEntryFormat", null);
3736
- __decorate([
3737
- Expose(),
3738
- __metadata("design:type", String),
3739
- __metadata("design:paramtypes", [])
3740
- ], CaseField.prototype, "dateTimeDisplayFormat", null);
3741
- __decorate([
3742
- Expose(),
3743
- __metadata("design:type", Function),
3744
- __metadata("design:paramtypes", []),
3745
- __metadata("design:returntype", void 0)
3746
- ], CaseField.prototype, "isComplexDisplay", null);
3747
- __decorate([
3748
- Expose(),
3749
- __metadata("design:type", Function),
3750
- __metadata("design:paramtypes", []),
3751
- __metadata("design:returntype", void 0)
3752
- ], CaseField.prototype, "isComplexEntry", null);
3753
- __decorate([
3754
- Expose(),
3755
- __metadata("design:type", Function),
3756
- __metadata("design:paramtypes", []),
3757
- __metadata("design:returntype", void 0)
3758
- ], CaseField.prototype, "isReadonly", null);
3759
- __decorate([
3760
- Expose(),
3761
- __metadata("design:type", Function),
3762
- __metadata("design:paramtypes", []),
3763
- __metadata("design:returntype", void 0)
3764
- ], CaseField.prototype, "isOptional", null);
3765
- __decorate([
3766
- Expose(),
3767
- __metadata("design:type", Function),
3768
- __metadata("design:paramtypes", []),
3769
- __metadata("design:returntype", void 0)
3770
- ], CaseField.prototype, "isMandatory", null);
3771
- __decorate([
3772
- Expose(),
3773
- __metadata("design:type", Function),
3774
- __metadata("design:paramtypes", []),
3775
- __metadata("design:returntype", Boolean)
3776
- ], CaseField.prototype, "isCollection", null);
3777
- __decorate([
3778
- Expose(),
3779
- __metadata("design:type", Function),
3780
- __metadata("design:paramtypes", []),
3781
- __metadata("design:returntype", Boolean)
3782
- ], CaseField.prototype, "isComplex", null);
3783
- __decorate([
3784
- Expose(),
3785
- __metadata("design:type", Function),
3786
- __metadata("design:paramtypes", []),
3787
- __metadata("design:returntype", Boolean)
3788
- ], CaseField.prototype, "isDynamic", null);
3789
- __decorate([
3790
- Expose(),
3791
- __metadata("design:type", Function),
3792
- __metadata("design:paramtypes", []),
3793
- __metadata("design:returntype", Boolean)
3794
- ], CaseField.prototype, "isCaseLink", null);
3795
- __decorate([
3796
- Expose(),
3797
- __metadata("design:type", Function),
3798
- __metadata("design:paramtypes", [String]),
3799
- __metadata("design:returntype", String)
3800
- ], CaseField.prototype, "getHierachicalId", null);
3353
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConditionalShowRegistrarService, [{
3354
+ type: Injectable
3355
+ }], null, null); })();
3801
3356
 
3802
- // @dynamic
3803
- class WizardPage {
3804
- id;
3805
- label;
3806
- order;
3807
- wizard_page_fields;
3808
- case_fields;
3809
- show_condition;
3810
- parsedShowCondition;
3811
- getCol1Fields() {
3812
- return this.case_fields?.filter(f => !f.wizardProps.page_column_no || f.wizardProps.page_column_no === 1);
3357
+ /** Keeps track of initially hidden fields that toggle to show on the page (parent page).
3358
+ * Used to decide whether to redisplay the grey bar when returning to the page during
3359
+ * navigation between pages.
3360
+ */
3361
+ class GreyBarService {
3362
+ fieldsToggledToShow = [];
3363
+ renderer;
3364
+ constructor(rendererFactory) {
3365
+ this.renderer = rendererFactory.createRenderer(null, null);
3813
3366
  }
3814
- getCol2Fields() {
3815
- return this.case_fields?.filter(f => f.wizardProps.page_column_no === 2);
3367
+ showGreyBar(field, el) {
3368
+ if (!field.isCollection()) {
3369
+ this.addGreyBar(el);
3370
+ }
3816
3371
  }
3817
- isMultiColumn() {
3818
- return this.getCol2Fields()?.length > 0;
3372
+ removeGreyBar(el) {
3373
+ const divSelector = el.nativeElement.querySelector('div');
3374
+ if (divSelector) {
3375
+ this.renderer.removeClass(divSelector, 'show-condition-grey-bar');
3376
+ }
3819
3377
  }
3820
- }
3821
- __decorate([
3822
- Type(() => WizardPageField),
3823
- __metadata("design:type", Array)
3824
- ], WizardPage.prototype, "wizard_page_fields", void 0);
3825
- __decorate([
3826
- Type(() => CaseField),
3827
- __metadata("design:type", Array)
3828
- ], WizardPage.prototype, "case_fields", void 0);
3829
-
3830
- // @dynamic
3831
- class CaseEventTrigger {
3832
- id;
3833
- name;
3834
- description;
3835
- case_id;
3836
- case_fields;
3837
- event_token;
3838
- wizard_pages;
3839
- show_summary;
3840
- show_event_notes;
3841
- end_button_label;
3842
- can_save_draft;
3843
- hasFields() {
3844
- return this.case_fields && this.case_fields.length !== 0;
3378
+ addToggledToShow(fieldId) {
3379
+ this.fieldsToggledToShow.push(fieldId);
3845
3380
  }
3846
- hasPages() {
3847
- return this.wizard_pages && this.wizard_pages.length !== 0;
3381
+ removeToggledToShow(fieldId) {
3382
+ this.fieldsToggledToShow = this.fieldsToggledToShow.filter(id => id !== fieldId);
3383
+ }
3384
+ wasToggledToShow(fieldId) {
3385
+ return this.fieldsToggledToShow.find(id => id === fieldId) !== undefined;
3386
+ }
3387
+ reset() {
3388
+ this.fieldsToggledToShow = [];
3389
+ }
3390
+ addGreyBar(el) {
3391
+ const divSelector = el.nativeElement.querySelector('div');
3392
+ if (divSelector) {
3393
+ this.renderer.addClass(divSelector, 'show-condition-grey-bar');
3394
+ }
3848
3395
  }
3396
+ static ɵfac = function GreyBarService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GreyBarService)(i0.ɵɵinject(i0.RendererFactory2)); };
3397
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GreyBarService, factory: GreyBarService.ɵfac });
3849
3398
  }
3850
- __decorate([
3851
- Type(() => CaseField),
3852
- __metadata("design:type", Array)
3853
- ], CaseEventTrigger.prototype, "case_fields", void 0);
3854
- __decorate([
3855
- Type(() => WizardPage),
3856
- __metadata("design:type", Array)
3857
- ], CaseEventTrigger.prototype, "wizard_pages", void 0);
3399
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GreyBarService, [{
3400
+ type: Injectable
3401
+ }], () => [{ type: i0.RendererFactory2 }], null); })();
3858
3402
 
3859
- // tslint:disable:variable-name
3860
- class CaseViewEvent {
3861
- id;
3862
- timestamp;
3863
- summary;
3864
- comment;
3865
- event_id;
3866
- event_name;
3867
- state_id;
3868
- state_name;
3869
- user_id;
3870
- user_last_name;
3871
- user_first_name;
3872
- significant_item;
3873
- }
3403
+ var AddCommentsErrorMessage;
3404
+ (function (AddCommentsErrorMessage) {
3405
+ AddCommentsErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
3406
+ AddCommentsErrorMessage["FLAG_COMMENTS_NOT_ENTERED_EXTERNAL"] = "Please enter comments for this support request";
3407
+ AddCommentsErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
3408
+ })(AddCommentsErrorMessage || (AddCommentsErrorMessage = {}));
3874
3409
 
3875
- class CaseViewTrigger {
3876
- id;
3877
- name;
3878
- description;
3879
- order;
3880
- }
3410
+ var AddCommentsStep;
3411
+ (function (AddCommentsStep) {
3412
+ AddCommentsStep["HINT_TEXT"] = "Explain why you are creating this flag. Do not include any sensitive information such as personal details.";
3413
+ AddCommentsStep["HINT_TEXT_EXTERNAL"] = "Explain why you are creating this support request. Do not include any sensitive information such as personal details.";
3414
+ AddCommentsStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3415
+ AddCommentsStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
3416
+ })(AddCommentsStep || (AddCommentsStep = {}));
3881
3417
 
3882
- class CaseEvent {
3883
- id;
3884
- name;
3885
- post_state;
3886
- pre_states;
3887
- case_fields;
3888
- description;
3889
- order;
3890
- acls;
3891
- }
3418
+ var CaseFlagCheckYourAnswersPageStep;
3419
+ (function (CaseFlagCheckYourAnswersPageStep) {
3420
+ CaseFlagCheckYourAnswersPageStep["CASE_LEVEL_LOCATION"] = "Case level";
3421
+ CaseFlagCheckYourAnswersPageStep["ADD_FLAG_HEADER_TEXT"] = "Add flag to";
3422
+ CaseFlagCheckYourAnswersPageStep["ADD_FLAG_HEADER_TEXT_EXTERNAL"] = "Add support to";
3423
+ CaseFlagCheckYourAnswersPageStep["UPDATE_FLAG_HEADER_TEXT"] = "Update flag for";
3424
+ CaseFlagCheckYourAnswersPageStep["UPDATE_FLAG_HEADER_TEXT_EXTERNAL"] = "Update support for";
3425
+ CaseFlagCheckYourAnswersPageStep["FLAG_TYPE_HEADER_TEXT"] = "Flag type";
3426
+ CaseFlagCheckYourAnswersPageStep["FLAG_TYPE_HEADER_TEXT_EXTERNAL"] = "Support type";
3427
+ CaseFlagCheckYourAnswersPageStep["NONE"] = "";
3428
+ })(CaseFlagCheckYourAnswersPageStep || (CaseFlagCheckYourAnswersPageStep = {}));
3892
3429
 
3893
- class CaseState {
3894
- id;
3895
- name;
3896
- description;
3897
- order;
3898
- }
3430
+ /**
3431
+ * Create and update contexts for external users are, by definition, part of Case Flags 2.1 - thus there is no enum
3432
+ * value for these.
3433
+ */
3434
+ var CaseFlagDisplayContextParameter;
3435
+ (function (CaseFlagDisplayContextParameter) {
3436
+ CaseFlagDisplayContextParameter["CREATE"] = "#ARGUMENT(CREATE)";
3437
+ CaseFlagDisplayContextParameter["CREATE_EXTERNAL"] = "#ARGUMENT(CREATE,EXTERNAL)";
3438
+ CaseFlagDisplayContextParameter["CREATE_2_POINT_1"] = "#ARGUMENT(CREATE,VERSION2.1)";
3439
+ CaseFlagDisplayContextParameter["READ_EXTERNAL"] = "#ARGUMENT(READ,EXTERNAL)";
3440
+ CaseFlagDisplayContextParameter["UPDATE"] = "#ARGUMENT(UPDATE)";
3441
+ CaseFlagDisplayContextParameter["UPDATE_EXTERNAL"] = "#ARGUMENT(UPDATE,EXTERNAL)";
3442
+ CaseFlagDisplayContextParameter["UPDATE_2_POINT_1"] = "#ARGUMENT(UPDATE,VERSION2.1)";
3443
+ })(CaseFlagDisplayContextParameter || (CaseFlagDisplayContextParameter = {}));
3899
3444
 
3900
- // Light clone of CaseType to be used in Jurisdiction class
3901
- // to avoid cyclic dependency
3902
- class CaseTypeLite {
3903
- id;
3904
- name;
3905
- events;
3906
- states;
3907
- description;
3908
- }
3445
+ var CaseFlagFormFields;
3446
+ (function (CaseFlagFormFields) {
3447
+ CaseFlagFormFields["FLAG_TYPE"] = "flagType";
3448
+ CaseFlagFormFields["COMMENTS"] = "flagComment";
3449
+ CaseFlagFormFields["COMMENTS_WELSH"] = "flagComment_cy";
3450
+ CaseFlagFormFields["OTHER_FLAG_DESCRIPTION"] = "otherDescription";
3451
+ CaseFlagFormFields["OTHER_FLAG_DESCRIPTION_WELSH"] = "otherDescription_cy";
3452
+ CaseFlagFormFields["STATUS"] = "status";
3453
+ CaseFlagFormFields["STATUS_CHANGE_REASON"] = "flagStatusReasonChange";
3454
+ CaseFlagFormFields["IS_WELSH_TRANSLATION_NEEDED"] = "flagIsWelshTranslationNeeded";
3455
+ CaseFlagFormFields["IS_VISIBLE_INTERNALLY_ONLY"] = "flagIsVisibleInternallyOnly";
3456
+ })(CaseFlagFormFields || (CaseFlagFormFields = {}));
3909
3457
 
3910
- // @dynamics
3911
- class CaseType {
3912
- id;
3913
- name;
3914
- events;
3915
- states;
3916
- case_fields;
3917
- description;
3918
- jurisdiction;
3919
- printEnabled;
3920
- }
3921
- __decorate([
3922
- Type(() => CaseField),
3923
- __metadata("design:type", Array)
3924
- ], CaseType.prototype, "case_fields", void 0);
3458
+ var CaseFlagStatus;
3459
+ (function (CaseFlagStatus) {
3460
+ CaseFlagStatus["REQUESTED"] = "Requested";
3461
+ CaseFlagStatus["ACTIVE"] = "Active";
3462
+ CaseFlagStatus["INACTIVE"] = "Inactive";
3463
+ CaseFlagStatus["NOT_APPROVED"] = "Not approved";
3464
+ })(CaseFlagStatus || (CaseFlagStatus = {}));
3925
3465
 
3926
- // tslint:disable:variable-name
3927
- class EventCaseField {
3928
- case_field_id;
3929
- showCondition;
3930
- }
3466
+ var CaseFlagSummaryListDisplayMode;
3467
+ (function (CaseFlagSummaryListDisplayMode) {
3468
+ CaseFlagSummaryListDisplayMode[CaseFlagSummaryListDisplayMode["CREATE"] = 0] = "CREATE";
3469
+ CaseFlagSummaryListDisplayMode[CaseFlagSummaryListDisplayMode["MANAGE"] = 1] = "MANAGE";
3470
+ })(CaseFlagSummaryListDisplayMode || (CaseFlagSummaryListDisplayMode = {}));
3931
3471
 
3932
- class Jurisdiction {
3933
- id;
3934
- name;
3935
- description;
3936
- caseTypes;
3937
- currentCaseType;
3938
- }
3472
+ var CaseFlagWizardStepTitle;
3473
+ (function (CaseFlagWizardStepTitle) {
3474
+ CaseFlagWizardStepTitle["SELECT_FLAG_LOCATION"] = "Where should this flag be added?";
3475
+ CaseFlagWizardStepTitle["SELECT_FLAG_LOCATION_EXTERNAL"] = "Who is the support for?";
3476
+ CaseFlagWizardStepTitle["SELECT_CASE_FLAG"] = "Select flag type";
3477
+ CaseFlagWizardStepTitle["SELECT_CASE_FLAG_EXTERNAL"] = "Select support type";
3478
+ CaseFlagWizardStepTitle["OTHER_FLAG_TYPE_DESCRIPTION"] = "Enter a flag type";
3479
+ CaseFlagWizardStepTitle["OTHER_FLAG_TYPE_DESCRIPTION_EXTERNAL"] = "Enter a support type";
3480
+ CaseFlagWizardStepTitle["ADD_FLAG_COMMENTS"] = "Add comments for this flag";
3481
+ CaseFlagWizardStepTitle["ADD_FLAG_COMMENTS_EXTERNAL_MODE"] = "Tell us more about the request";
3482
+ CaseFlagWizardStepTitle["CONFIRM_FLAG_STATUS"] = "Confirm the status of the flag";
3483
+ CaseFlagWizardStepTitle["FLAG_STATUS"] = "Flag status";
3484
+ CaseFlagWizardStepTitle["MANAGE_CASE_FLAGS"] = "Manage case flags";
3485
+ CaseFlagWizardStepTitle["MANAGE_SUPPORT"] = "Which support is no longer needed?";
3486
+ CaseFlagWizardStepTitle["UPDATE_FLAG_TITLE"] = "Update flag";
3487
+ CaseFlagWizardStepTitle["UPDATE_FLAG_TITLE_EXTERNAL"] = "Tell us why the support is no longer needed";
3488
+ CaseFlagWizardStepTitle["UPDATE_FLAG_ADD_TRANSLATION"] = "Add translations to flag";
3489
+ CaseFlagWizardStepTitle["NONE"] = "";
3490
+ })(CaseFlagWizardStepTitle || (CaseFlagWizardStepTitle = {}));
3939
3491
 
3940
- class Banner {
3941
- bannerDescription;
3942
- bannerUrlText;
3943
- bannerUrl;
3944
- bannerViewed;
3945
- bannerEnabled;
3946
- }
3492
+ var ConfirmStatusErrorMessage;
3493
+ (function (ConfirmStatusErrorMessage) {
3494
+ ConfirmStatusErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
3495
+ ConfirmStatusErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
3496
+ })(ConfirmStatusErrorMessage || (ConfirmStatusErrorMessage = {}));
3947
3497
 
3948
- // @dynamic
3949
- class CaseTab {
3950
- id;
3951
- label;
3952
- order;
3953
- fields;
3954
- show_condition;
3498
+ var ConfirmStatusStep;
3499
+ (function (ConfirmStatusStep) {
3500
+ ConfirmStatusStep["HINT_TEXT"] = "Describe reason for status; if choosing 'Not approved' provide name of person approving decision.";
3501
+ ConfirmStatusStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3502
+ })(ConfirmStatusStep || (ConfirmStatusStep = {}));
3503
+
3504
+ var SearchLanguageInterpreterErrorMessage;
3505
+ (function (SearchLanguageInterpreterErrorMessage) {
3506
+ SearchLanguageInterpreterErrorMessage["LANGUAGE_NOT_ENTERED"] = "Enter the language that will need to be interpreted";
3507
+ SearchLanguageInterpreterErrorMessage["LANGUAGE_CHAR_LIMIT_EXCEEDED"] = "You can enter up to 80 characters for the required language";
3508
+ SearchLanguageInterpreterErrorMessage["LANGUAGE_ENTERED_IN_BOTH_FIELDS"] = "The language can only be entered in one of the fields";
3509
+ })(SearchLanguageInterpreterErrorMessage || (SearchLanguageInterpreterErrorMessage = {}));
3510
+
3511
+ var SearchLanguageInterpreterStep;
3512
+ (function (SearchLanguageInterpreterStep) {
3513
+ SearchLanguageInterpreterStep["HINT_TEXT"] = "Enter the language that will need to be interpreted. If this language is not listed, you can enter it manually.";
3514
+ SearchLanguageInterpreterStep["SIGN_HINT_TEXT"] = "Enter the sign language that will need to be interpreted. If this language is not listed, you can enter it manually.";
3515
+ SearchLanguageInterpreterStep["CHECKBOX_LABEL"] = "Enter the language manually";
3516
+ SearchLanguageInterpreterStep["INPUT_LABEL"] = "Enter the language";
3517
+ })(SearchLanguageInterpreterStep || (SearchLanguageInterpreterStep = {}));
3518
+
3519
+ var SelectFlagErrorMessage;
3520
+ (function (SelectFlagErrorMessage) {
3521
+ SelectFlagErrorMessage["MANAGE_CASE_FLAGS_FLAG_NOT_SELECTED"] = "Please make a selection";
3522
+ SelectFlagErrorMessage["MANAGE_SUPPORT_FLAG_NOT_SELECTED"] = "Select which support is no longer needed";
3523
+ SelectFlagErrorMessage["NO_FLAGS"] = "This case has no flags";
3524
+ })(SelectFlagErrorMessage || (SelectFlagErrorMessage = {}));
3525
+
3526
+ var SelectFlagLocationErrorMessage;
3527
+ (function (SelectFlagLocationErrorMessage) {
3528
+ SelectFlagLocationErrorMessage["FLAG_LOCATION_NOT_SELECTED"] = "Please make a selection";
3529
+ SelectFlagLocationErrorMessage["FLAGS_NOT_CONFIGURED"] = "Flags have not been configured for this case type";
3530
+ })(SelectFlagLocationErrorMessage || (SelectFlagLocationErrorMessage = {}));
3531
+
3532
+ var SelectFlagTypeErrorMessage;
3533
+ (function (SelectFlagTypeErrorMessage) {
3534
+ SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_SELECTED"] = "Please select a flag type";
3535
+ SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_SELECTED_EXTERNAL"] = "Please select a support type";
3536
+ SelectFlagTypeErrorMessage["FLAG_TYPE_OPTION_NOT_SELECTED"] = "Select an option";
3537
+ SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_ENTERED"] = "Please enter a flag type";
3538
+ SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_ENTERED_EXTERNAL"] = "Please enter a support type";
3539
+ SelectFlagTypeErrorMessage["FLAG_TYPE_LIMIT_EXCEEDED"] = "You can enter up to 80 characters only";
3540
+ })(SelectFlagTypeErrorMessage || (SelectFlagTypeErrorMessage = {}));
3541
+
3542
+ var UpdateFlagAddTranslationErrorMessage;
3543
+ (function (UpdateFlagAddTranslationErrorMessage) {
3544
+ UpdateFlagAddTranslationErrorMessage["DESCRIPTION_CHAR_LIMIT_EXCEEDED"] = "Original description or translation must be 200 characters or fewer";
3545
+ UpdateFlagAddTranslationErrorMessage["COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Original comments or translation must be 200 characters or fewer";
3546
+ })(UpdateFlagAddTranslationErrorMessage || (UpdateFlagAddTranslationErrorMessage = {}));
3547
+
3548
+ var UpdateFlagAddTranslationStep;
3549
+ (function (UpdateFlagAddTranslationStep) {
3550
+ UpdateFlagAddTranslationStep["HINT_TEXT"] = "Write translation for flag description or comments in the boxes provided.";
3551
+ UpdateFlagAddTranslationStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3552
+ })(UpdateFlagAddTranslationStep || (UpdateFlagAddTranslationStep = {}));
3553
+
3554
+ var UpdateFlagErrorMessage;
3555
+ (function (UpdateFlagErrorMessage) {
3556
+ UpdateFlagErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
3557
+ UpdateFlagErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
3558
+ UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
3559
+ UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED_EXTERNAL"] = "You must explain why the support is no longer needed";
3560
+ UpdateFlagErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
3561
+ UpdateFlagErrorMessage["NONE"] = "";
3562
+ })(UpdateFlagErrorMessage || (UpdateFlagErrorMessage = {}));
3563
+
3564
+ var UpdateFlagStep;
3565
+ (function (UpdateFlagStep) {
3566
+ UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL"] = "Explain why you are updating this flag. Do not include any sensitive information such as personal details.";
3567
+ UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL_2_POINT_1"] = "Update the comments describing the user's support needs or flag description. Do not include any sensitive information such as personal details.";
3568
+ UpdateFlagStep["COMMENT_HINT_TEXT_EXTERNAL"] = "Do not include any sensitive information such as personal details.";
3569
+ UpdateFlagStep["COMMENT_FIELD_LABEL_EXTERNAL"] = "Please provide your comments below";
3570
+ UpdateFlagStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3571
+ UpdateFlagStep["STATUS_HINT_TEXT"] = "Describe reason for status change.";
3572
+ UpdateFlagStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
3573
+ })(UpdateFlagStep || (UpdateFlagStep = {}));
3574
+
3575
+ var CaseFlagFieldState;
3576
+ (function (CaseFlagFieldState) {
3577
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_LOCATION"] = 0] = "FLAG_LOCATION";
3578
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_TYPE"] = 1] = "FLAG_TYPE";
3579
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_LANGUAGE_INTERPRETER"] = 2] = "FLAG_LANGUAGE_INTERPRETER";
3580
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_COMMENTS"] = 3] = "FLAG_COMMENTS";
3581
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_STATUS"] = 4] = "FLAG_STATUS";
3582
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_MANAGE_CASE_FLAGS"] = 5] = "FLAG_MANAGE_CASE_FLAGS";
3583
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE"] = 6] = "FLAG_UPDATE";
3584
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE_WELSH_TRANSLATION"] = 7] = "FLAG_UPDATE_WELSH_TRANSLATION";
3585
+ })(CaseFlagFieldState || (CaseFlagFieldState = {}));
3586
+ var CaseFlagErrorMessage;
3587
+ (function (CaseFlagErrorMessage) {
3588
+ CaseFlagErrorMessage["NO_EXTERNAL_FLAGS_COLLECTION"] = "External collection for storing this case flag has not been configured for this case type";
3589
+ CaseFlagErrorMessage["NO_INTERNAL_FLAGS_COLLECTION"] = "Internal collection for storing this case flag has not been configured for this case type";
3590
+ })(CaseFlagErrorMessage || (CaseFlagErrorMessage = {}));
3591
+
3592
+ class DashPipe {
3593
+ transform(value) {
3594
+ return value ? value : '-';
3595
+ }
3596
+ static ɵfac = function DashPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DashPipe)(); };
3597
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDash", type: DashPipe, pure: true, standalone: false });
3955
3598
  }
3956
- __decorate([
3957
- Type(() => CaseField),
3958
- __metadata("design:type", Array)
3959
- ], CaseTab.prototype, "fields", void 0);
3599
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DashPipe, [{
3600
+ type: Pipe,
3601
+ args: [{
3602
+ name: 'ccdDash',
3603
+ standalone: false
3604
+ }]
3605
+ }], null, null); })();
3960
3606
 
3961
- // @dynamic
3962
- class CaseView {
3963
- case_id;
3964
- case_type;
3965
- state;
3966
- channels;
3967
- tabs;
3968
- triggers;
3969
- events;
3970
- metadataFields;
3971
- basicFields;
3972
- case_flag;
3607
+ /*
3608
+ Translate a date time format string from the Java format provided by CCD to the format supported by Angular formatDate()
3609
+ Very simple translator that maps unsupported chars to the nearest equivalent.
3610
+ If there is no equivalent puts ***x*** into the output where x is the unsupported character
3611
+
3612
+ Java format
3613
+ G era text AD; Anno Domini; A
3614
+ u year year 2004; 04
3615
+ y year-of-era year 2004; 04
3616
+ D day-of-year number 189
3617
+ M/L month-of-year number/text 7; 07; Jul; July; J
3618
+ d day-of-month number 10
3619
+
3620
+ Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter
3621
+ Y week-based-year year 1996; 96
3622
+ w week-of-week-based-year number 27
3623
+ W week-of-month number 4
3624
+ E day-of-week text Tue; Tuesday; T
3625
+ e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T
3626
+ F week-of-month number 3
3627
+
3628
+ a am-pm-of-day text PM
3629
+ h clock-hour-of-am-pm (1-12) number 12
3630
+ K hour-of-am-pm (0-11) number 0
3631
+ k clock-hour-of-am-pm (1-24) number 0
3632
+
3633
+ H hour-of-day (0-23) number 0
3634
+ m minute-of-hour number 30
3635
+ s second-of-minute number 55
3636
+ S fraction-of-second fraction 978
3637
+ A milli-of-day number 1234
3638
+ n nano-of-second number 987654321
3639
+ N nano-of-day number 1234000000
3640
+
3641
+ V time-zone ID zone-id America/Los_Angeles; Z; -08:30
3642
+ z time-zone name zone-name Pacific Standard Time; PST
3643
+ O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00;
3644
+ X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15;
3645
+ x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15;
3646
+ Z zone-offset offset-Z +0000; -0800; -08:00;
3647
+
3648
+ p pad next pad modifier 1
3649
+
3650
+ ' escape for text delimiter
3651
+ '' single quote literal '
3652
+ [ optional section start
3653
+ ] optional section end
3654
+ # reserved for future use
3655
+ { reserved for future use
3656
+ } reserved for future use
3657
+
3658
+ Angular dateFormat characters
3659
+ Era G, GG & GGG Abbreviated AD
3660
+ GGGG Wide Anno Domini
3661
+ GGGGG Narrow A
3662
+ Year y Numeric: minimum digits 2, 20, 201, 2017, 20173
3663
+ yy Numeric: 2 digits + zero padded 02, 20, 01, 17, 73
3664
+ yyy Numeric: 3 digits + zero padded 002, 020, 201, 2017, 20173
3665
+ yyyy Numeric: 4 digits or more + zero padded 0002, 0020, 0201, 2017, 20173
3666
+ Month M Numeric: 1 digit 9, 12
3667
+ MM Numeric: 2 digits + zero padded 09, 12
3668
+ MMM Abbreviated Sep
3669
+ MMMM Wide September
3670
+ MMMMM Narrow S
3671
+ Month standalone L Numeric: 1 digit 9, 12
3672
+ LL Numeric: 2 digits + zero padded 09, 12
3673
+ LLL Abbreviated Sep
3674
+ LLLL Wide September
3675
+ LLLLL Narrow S
3676
+ Week of year w Numeric: minimum digits 1... 53
3677
+ ww Numeric: 2 digits + zero padded 01... 53
3678
+ Week of month W Numeric: 1 digit 1... 5
3679
+ Day of month d Numeric: minimum digits 1
3680
+ dd Numeric: 2 digits + zero padded 01
3681
+ Week day E, EE & EEE Abbreviated Tue
3682
+ EEEE Wide Tuesday
3683
+ EEEEE Narrow T
3684
+ EEEEEE Short Tu
3685
+ Period a, aa & aaa Abbreviated am/pm or AM/PM
3686
+ aaaa Wide (fallback to a when missing) ante meridiem/post meridiem
3687
+ aaaaa Narrow a/p
3688
+ Period* B, BB & BBB Abbreviated mid.
3689
+ BBBB Wide am, pm, midnight, noon, morning, afternoon, evening, night
3690
+ BBBBB Narrow md
3691
+ Period standalone* b, bb & bbb Abbreviated mid.
3692
+ bbbb Wide am, pm, midnight, noon, morning, afternoon, evening, night
3693
+ bbbbb Narrow md
3694
+ Hour 1-12 h Numeric: minimum digits 1, 12
3695
+ hh Numeric: 2 digits + zero padded 01, 12
3696
+ Hour 0-23 H Numeric: minimum digits 0, 23
3697
+ HH Numeric: 2 digits + zero padded 00, 23
3698
+ Minute m Numeric: minimum digits 8, 59
3699
+ mm Numeric: 2 digits + zero padded 08, 59
3700
+ Second s Numeric: minimum digits 0... 59
3701
+ ss Numeric: 2 digits + zero padded 00... 59
3702
+ Fractional seconds S Numeric: 1 digit 0... 9
3703
+ SS Numeric: 2 digits + zero padded 00... 99
3704
+ SSS Numeric: 3 digits + zero padded (= milliseconds) 000... 999
3705
+ Zone z, zz & zzz Short specific non location format (fallback to O) GMT-8
3706
+ zzzz Long specific non location format (fallback to OOOO) GMT-08:00
3707
+ Z, ZZ & ZZZ ISO8601 basic format -0800
3708
+ ZZZZ Long localized GMT format GMT-8:00
3709
+ ZZZZZ ISO8601 extended format + Z indicator for offset 0 (= XXXXX) -08:00
3710
+ O, OO & OOO Short localized GMT format GMT-8
3711
+ OOOO Long localized GMT format GMT-08:00
3712
+ */
3713
+ class FormatTranslatorService {
3714
+ translate(javaFormat) {
3715
+ const result = [];
3716
+ let prev = '\0';
3717
+ let inQuote = false;
3718
+ const maybePush = (target, obj, flag) => {
3719
+ if (!flag) {
3720
+ target.push(obj);
3721
+ }
3722
+ };
3723
+ for (const c of javaFormat) {
3724
+ switch (c) {
3725
+ case '\'':
3726
+ if (prev === '\'') {
3727
+ // literal single quote - ignore
3728
+ inQuote = false;
3729
+ }
3730
+ else {
3731
+ inQuote = !inQuote;
3732
+ }
3733
+ break;
3734
+ // Due to formatting constraints on the webapp, all 'd' characters should be replaced with 'D' (for Moment library)
3735
+ // This is because we want the date, not the day (this format will need to be converted back)
3736
+ case 'd':
3737
+ maybePush(result, 'D', inQuote);
3738
+ break;
3739
+ // moment library defines year as capital y
3740
+ case 'y':
3741
+ maybePush(result, 'Y', inQuote);
3742
+ break;
3743
+ case 'e':
3744
+ case 'c':
3745
+ maybePush(result, 'E', inQuote); // no lower case E
3746
+ break;
3747
+ case 'F':
3748
+ maybePush(result, 'W', inQuote);
3749
+ break;
3750
+ case 'K':
3751
+ maybePush(result, 'H', inQuote);
3752
+ break;
3753
+ case 'k':
3754
+ maybePush(result, 'h', inQuote);
3755
+ break;
3756
+ // commented out A change to '***' due to use in moment library for AM/PM
3757
+ // added 'a' specification to stop discrepancy in am/AM pm/PM formatting
3758
+ case 'a':
3759
+ maybePush(result, 'A', inQuote);
3760
+ break;
3761
+ case 'n':
3762
+ case 'N':
3763
+ maybePush(result, `***${c}***`, inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
3764
+ break;
3765
+ case 'V':
3766
+ case 'O':
3767
+ maybePush(result, 'z', inQuote);
3768
+ break;
3769
+ case 'x':
3770
+ case 'X':
3771
+ maybePush(result, 'Z', inQuote);
3772
+ break;
3773
+ default:
3774
+ maybePush(result, c, inQuote);
3775
+ }
3776
+ prev = c;
3777
+ }
3778
+ return result.join('');
3779
+ }
3780
+ showOnlyDates(dateFormat) {
3781
+ // replace 'd' character with 'D' for the moment library
3782
+ // This ensures only dates allowed
3783
+ while (dateFormat.includes('d')) {
3784
+ dateFormat = dateFormat.replace('d', 'D');
3785
+ }
3786
+ while (dateFormat.includes('y')) {
3787
+ dateFormat = dateFormat.replace('y', 'Y');
3788
+ }
3789
+ return dateFormat;
3790
+ }
3791
+ removeTime(dateFormat) {
3792
+ // remove hours irrelevant of whether 12 or 24 hour clock
3793
+ while (dateFormat.includes('H') || dateFormat.includes('h')) {
3794
+ dateFormat = dateFormat.replace('H', '');
3795
+ dateFormat = dateFormat.replace('h', '');
3796
+ }
3797
+ // remove minutes
3798
+ while (dateFormat.includes('m')) {
3799
+ dateFormat = dateFormat.replace('m', '');
3800
+ }
3801
+ // remove seconds (s) and micro seconds (S)
3802
+ while (dateFormat.includes('S') || dateFormat.includes('s')) {
3803
+ dateFormat = dateFormat.replace('S', '');
3804
+ dateFormat = dateFormat.replace('s', '');
3805
+ }
3806
+ // because there is time removal algorithm can make reasonable assumption to remove colons
3807
+ while (dateFormat.includes(':')) {
3808
+ dateFormat = dateFormat.replace(':', '');
3809
+ }
3810
+ return dateFormat.trim();
3811
+ }
3812
+ hasDate(value) {
3813
+ return this.translate(value).length &&
3814
+ value.toLowerCase().indexOf('d') >= 0 &&
3815
+ value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3816
+ }
3817
+ is24Hour(value) {
3818
+ return this.translate(value).length &&
3819
+ value.indexOf('H') >= 0;
3820
+ }
3821
+ hasNoDay(value) {
3822
+ return this.translate(value).length && value.toLowerCase().indexOf('d') === -1 &&
3823
+ value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3824
+ }
3825
+ hasNoDayAndMonth(value) {
3826
+ return this.translate(value).length &&
3827
+ value.toLowerCase().indexOf('d') === -1 &&
3828
+ value.indexOf('M') === -1 &&
3829
+ value.toLowerCase().indexOf('y') >= 0;
3830
+ }
3831
+ hasHours(value) {
3832
+ return this.translate(value).length && value.toLowerCase().indexOf('h') >= 0 && value.indexOf('m') === -1;
3833
+ }
3834
+ hasMinutes(value) {
3835
+ return this.translate(value).length && value.indexOf('m') >= 0 && value.toLowerCase().indexOf('h') >= 0;
3836
+ }
3837
+ hasSeconds(value) {
3838
+ return this.translate(value).length && value.toLowerCase().indexOf('s') >= 0;
3839
+ }
3840
+ static ɵfac = function FormatTranslatorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormatTranslatorService)(); };
3841
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormatTranslatorService, factory: FormatTranslatorService.ɵfac });
3973
3842
  }
3974
- __decorate([
3975
- Type(() => CaseTab),
3976
- __metadata("design:type", Array)
3977
- ], CaseView.prototype, "tabs", void 0);
3978
- __decorate([
3979
- Type(() => CaseField),
3980
- __metadata("design:type", Array)
3981
- ], CaseView.prototype, "metadataFields", void 0);
3843
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormatTranslatorService, [{
3844
+ type: Injectable
3845
+ }], null, null); })();
3982
3846
 
3983
- class CasePrintDocument {
3984
- name;
3985
- type;
3986
- url;
3847
+ class DatePipe {
3848
+ formatTrans;
3849
+ static DATE_FORMAT_REGEXP = new RegExp('^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?|Z)?$');
3850
+ // 1 2 3 4 5 6 7 8 9 10 11
3851
+ static MONTHS = [
3852
+ ['Jan'], ['Feb'], ['Mar'], ['Apr'], ['May'], ['Jun'], ['Jul'], ['Aug'], ['Sep'], ['Oct'], ['Nov'], ['Dec'],
3853
+ ];
3854
+ /**
3855
+ * constructor to allow format translator to be injected
3856
+ * @param formatTrans format translator
3857
+ */
3858
+ constructor(formatTrans) {
3859
+ this.formatTrans = formatTrans;
3860
+ }
3861
+ transform(value, zone, format) {
3862
+ let resultDate = null;
3863
+ const ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
3864
+ if (value) {
3865
+ // included to avoid editing the hour twice on second pass through
3866
+ // this occurs on case details when datepipe is applied twice
3867
+ if (!value.includes('T')) {
3868
+ zone = 'utc';
3869
+ }
3870
+ const match = value.match(DatePipe.DATE_FORMAT_REGEXP);
3871
+ // Make sure we actually have a match.
3872
+ if (match) {
3873
+ let offsetDate = null;
3874
+ const date = this.getDate(match);
3875
+ if (zone === 'local') {
3876
+ offsetDate = this.getOffsetDate(date);
3877
+ }
3878
+ else {
3879
+ offsetDate = this.getDate(match);
3880
+ }
3881
+ // 'short' format is meaningful to formatDate, but not the same meaning as in the unit tests
3882
+ if (this.formatTrans && format && format !== 'short') {
3883
+ // support for java style formatting strings for dates
3884
+ format = this.translateDateFormat(format);
3885
+ resultDate = moment(offsetDate).format(format);
3886
+ }
3887
+ else {
3888
+ // RDM-1149 changed the pipe logic so that it doesn't add an hour to 'Summer Time' dates on DateTime field type
3889
+ resultDate = `${offsetDate.getDate()} ${DatePipe.MONTHS[offsetDate.getMonth()]} ${offsetDate.getFullYear()}`;
3890
+ if (match[4] && match[5] && match[6] && format !== 'short') {
3891
+ resultDate += ', ';
3892
+ resultDate += `${this.getHour(offsetDate.getHours().toString())}:`;
3893
+ resultDate += `${this.pad(offsetDate.getMinutes())}:`;
3894
+ resultDate += `${this.pad(offsetDate.getSeconds())} `;
3895
+ resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
3896
+ }
3897
+ }
3898
+ }
3899
+ else {
3900
+ // EUI-2667. See if what we've been given is actually a formatted date that
3901
+ // we could attempt to do something with.
3902
+ const parsedDate = Date.parse(value);
3903
+ // We successfully parsed it so let's use it.
3904
+ if (!isNaN(parsedDate)) {
3905
+ const d = new Date(parsedDate);
3906
+ // If what we received didn't include time, don't include it here either.
3907
+ if (value.indexOf(':') < 0) {
3908
+ const shortDate = d.toLocaleDateString('en-GB');
3909
+ const shortISO = shortDate.split('/').reverse().join('-');
3910
+ return this.transform(shortISO, zone, format);
3911
+ }
3912
+ // If it did include time, we want a full ISO string.
3913
+ const thisMoment = moment(d).format(ISO_FORMAT);
3914
+ return this.transform(thisMoment, zone, format);
3915
+ }
3916
+ }
3917
+ }
3918
+ return resultDate;
3919
+ }
3920
+ translateDateFormat(format) {
3921
+ if (this.formatTrans) {
3922
+ return this.formatTrans.translate(format);
3923
+ }
3924
+ else {
3925
+ return format;
3926
+ }
3927
+ }
3928
+ getOffsetDate(date) {
3929
+ const localOffset = -date.getTimezoneOffset() / 60;
3930
+ return new Date(date.getTime() + localOffset * 3600 * 1000);
3931
+ }
3932
+ getDate(match) {
3933
+ const year = this.toInt(match[1]);
3934
+ const month = this.toInt(match[2]) - 1;
3935
+ const day = this.toInt(match[3]);
3936
+ let resultDate;
3937
+ if (match[4] && match[5] && match[6]) {
3938
+ const hour = this.toInt(match[4]);
3939
+ const minutes = this.toInt(match[5]);
3940
+ const seconds = this.toInt(match[6]);
3941
+ resultDate = new Date(year, month, day, hour, minutes, seconds, 0);
3942
+ }
3943
+ else {
3944
+ resultDate = new Date(year, month, day);
3945
+ }
3946
+ return resultDate;
3947
+ }
3948
+ getHour(hourStr) {
3949
+ let hourNum = this.toInt(hourStr);
3950
+ if (hourNum > 12) {
3951
+ hourNum = hourNum - 12;
3952
+ }
3953
+ else if (hourNum === 0) {
3954
+ hourNum = 12;
3955
+ }
3956
+ return hourNum;
3957
+ }
3958
+ toInt(str) {
3959
+ return parseInt(str, 10);
3960
+ }
3961
+ pad(num, padNum = 2) {
3962
+ const val = num !== undefined ? num.toString() : '';
3963
+ return val.length >= padNum ? val : new Array(padNum - val.length + 1).join('0') + val;
3964
+ }
3965
+ static ɵfac = function DatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(FormatTranslatorService, 16)); };
3966
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDate", type: DatePipe, pure: true, standalone: false });
3987
3967
  }
3968
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{
3969
+ type: Pipe,
3970
+ args: [{
3971
+ name: 'ccdDate',
3972
+ standalone: false
3973
+ }]
3974
+ }], () => [{ type: FormatTranslatorService }], null); })();
3988
3975
 
3989
- // tslint:disable:variable-name
3990
- class HRef {
3991
- href;
3992
- }
3993
- class DocumentLinks {
3994
- self;
3995
- binary;
3996
- }
3997
- class Document {
3998
- _links;
3999
- originalDocumentName;
4000
- hashToken;
4001
- }
4002
- class Embedded {
4003
- documents;
4004
- }
4005
- class DocumentData {
4006
- _embedded;
4007
- documents;
4008
- }
4009
- class FormDocument {
4010
- document_url;
4011
- document_binary_url;
4012
- document_filename;
4013
- document_hash;
4014
- upload_timestamp;
3976
+ class FieldLabelPipe {
3977
+ rpxTranslationPipe;
3978
+ constructor(rpxTranslationPipe) {
3979
+ this.rpxTranslationPipe = rpxTranslationPipe;
3980
+ }
3981
+ transform(field) {
3982
+ if (!field || !field.label) {
3983
+ return '';
3984
+ }
3985
+ else if (!field.display_context) {
3986
+ return this.getTranslatedLabel(field);
3987
+ }
3988
+ return this.getTranslatedLabel(field) + (field.display_context.toUpperCase() === 'OPTIONAL' ?
3989
+ ' (' + this.rpxTranslationPipe.transform('Optional') + ')' : '');
3990
+ }
3991
+ getTranslatedLabel(field) {
3992
+ if (!field.isTranslated) {
3993
+ return this.rpxTranslationPipe.transform(field.label);
3994
+ }
3995
+ else {
3996
+ return field.label;
3997
+ }
3998
+ }
3999
+ getOriginalLabelForYesNoTranslation(field) {
4000
+ return field.originalLabel || field.label;
4001
+ }
4002
+ static ɵfac = function FieldLabelPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FieldLabelPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslatePipe, 16)); };
4003
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFieldLabel", type: FieldLabelPipe, pure: false, standalone: false });
4015
4004
  }
4005
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldLabelPipe, [{
4006
+ type: Pipe,
4007
+ args: [{
4008
+ name: 'ccdFieldLabel',
4009
+ pure: false,
4010
+ standalone: false
4011
+ }]
4012
+ }], () => [{ type: i1.RpxTranslatePipe }], null); })();
4016
4013
 
4017
- class OrganisationConverter {
4018
- static toSimpleAddress(organisationModel) {
4019
- let simpleAddress = '';
4020
- if (organisationModel.addressLine1) {
4021
- simpleAddress += `${organisationModel.addressLine1}<br>`;
4014
+ class FirstErrorPipe {
4015
+ rpxTranslationService;
4016
+ injector;
4017
+ asyncPipe;
4018
+ constructor(rpxTranslationService, injector) {
4019
+ this.rpxTranslationService = rpxTranslationService;
4020
+ this.injector = injector;
4021
+ this.asyncPipe = new AsyncPipe(this.injector.get(ChangeDetectorRef));
4022
+ }
4023
+ transform(value, args) {
4024
+ if (!value) {
4025
+ return '';
4022
4026
  }
4023
- if (organisationModel.addressLine2) {
4024
- simpleAddress += `${organisationModel.addressLine2}<br>`;
4027
+ if (!args) {
4028
+ args = 'Field';
4025
4029
  }
4026
- if (organisationModel.addressLine3) {
4027
- simpleAddress += `${organisationModel.addressLine3}<br>`;
4030
+ const keys = Object.keys(value);
4031
+ if (!keys.length) {
4032
+ return '';
4028
4033
  }
4029
- if (organisationModel.townCity) {
4030
- simpleAddress += `${organisationModel.townCity}<br>`;
4034
+ let errorMessage;
4035
+ if (keys[0] === 'required') {
4036
+ errorMessage = '%FIELDLABEL% is required';
4031
4037
  }
4032
- if (organisationModel.county) {
4033
- simpleAddress += `${organisationModel.county}<br>`;
4038
+ else if (keys[0] === 'pattern') {
4039
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%';
4034
4040
  }
4035
- if (organisationModel.country) {
4036
- simpleAddress += `${organisationModel.country}<br>`;
4041
+ else if (keys[0] === 'markDownPattern') {
4042
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%. Link mark up characters are not allowed in this field';
4037
4043
  }
4038
- if (organisationModel.postCode) {
4039
- simpleAddress += `${organisationModel.postCode}<br>`;
4044
+ else if (keys[0] === 'minlength') {
4045
+ errorMessage = '%FIELDLABEL% is below the minimum length';
4040
4046
  }
4041
- return simpleAddress;
4047
+ else if (keys[0] === 'maxlength') {
4048
+ errorMessage = '%FIELDLABEL% exceeds the maximum length';
4049
+ }
4050
+ else if (value.hasOwnProperty('matDatetimePickerParse')) {
4051
+ errorMessage = 'The date entered is not valid. Please provide a valid date';
4052
+ }
4053
+ else {
4054
+ errorMessage = value[keys[0]];
4055
+ }
4056
+ const o = this.rpxTranslationService.getTranslation$(args).pipe(switchMap(fieldLabel => this.rpxTranslationService.getTranslationWithReplacements$(errorMessage, { FIELDLABEL: fieldLabel })));
4057
+ return this.asyncPipe.transform(o);
4042
4058
  }
4043
- toSimpleOrganisationModel(organisationModel) {
4044
- return {
4045
- organisationIdentifier: organisationModel.organisationIdentifier,
4046
- name: organisationModel.name,
4047
- address: OrganisationConverter.toSimpleAddress(organisationModel)
4048
- };
4059
+ ngOnDestroy() {
4060
+ this.asyncPipe.ngOnDestroy();
4049
4061
  }
4050
- static ɵfac = function OrganisationConverter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OrganisationConverter)(); };
4051
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: OrganisationConverter, factory: OrganisationConverter.ɵfac });
4062
+ static ɵfac = function FirstErrorPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FirstErrorPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslationService, 16), i0.ɵɵdirectiveInject(i0.Injector, 16)); };
4063
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFirstError", type: FirstErrorPipe, pure: false, standalone: false });
4052
4064
  }
4053
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OrganisationConverter, [{
4054
- type: Injectable
4055
- }], null, null); })();
4065
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FirstErrorPipe, [{
4066
+ type: Pipe,
4067
+ args: [{
4068
+ name: 'ccdFirstError',
4069
+ pure: false,
4070
+ standalone: false
4071
+ }]
4072
+ }], () => [{ type: i1.RpxTranslationService }, { type: i0.Injector }], null); })();
4056
4073
 
4057
- class PaginationMetadata {
4058
- totalResultsCount;
4059
- totalPagesCount;
4074
+ class IsCompoundPipe {
4075
+ static COMPOUND_TYPES = [
4076
+ 'Complex',
4077
+ 'Label',
4078
+ 'AddressGlobal',
4079
+ 'AddressUK',
4080
+ 'AddressGlobalUK',
4081
+ 'CasePaymentHistoryViewer',
4082
+ 'CaseHistoryViewer',
4083
+ 'Organisation',
4084
+ 'WaysToPay',
4085
+ 'ComponentLauncher',
4086
+ 'FlagLauncher',
4087
+ 'CaseFlag'
4088
+ ];
4089
+ static EXCLUDE = [
4090
+ 'CaseLink',
4091
+ 'JudicialUser'
4092
+ ];
4093
+ transform(field) {
4094
+ if (!field || !field.field_type || !field.field_type.type) {
4095
+ return false;
4096
+ }
4097
+ if (IsCompoundPipe.COMPOUND_TYPES.indexOf(field.field_type.type) !== -1) {
4098
+ if (IsCompoundPipe.EXCLUDE.indexOf(field.field_type.id) !== -1) {
4099
+ return false;
4100
+ }
4101
+ return true;
4102
+ }
4103
+ return false;
4104
+ }
4105
+ static ɵfac = function IsCompoundPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsCompoundPipe)(); };
4106
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsCompound", type: IsCompoundPipe, pure: true, standalone: false });
4060
4107
  }
4108
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsCompoundPipe, [{
4109
+ type: Pipe,
4110
+ args: [{
4111
+ name: 'ccdIsCompound',
4112
+ standalone: false
4113
+ }]
4114
+ }], null, null); })();
4061
4115
 
4062
- function hasRoles(profile) {
4063
- if (profile.user && profile.user.idam && Array.isArray(profile.user.idam.roles)) {
4064
- return profile.user.idam.roles.length > 0;
4116
+ class CaseFieldService {
4117
+ isOptional(field) {
4118
+ if (!field || !field.display_context) {
4119
+ return false;
4120
+ }
4121
+ return field.display_context.toUpperCase() === 'OPTIONAL';
4065
4122
  }
4066
- return false;
4067
- }
4068
- // @dynamic
4069
- class Profile {
4070
- user;
4071
- channels;
4072
- jurisdictions;
4073
- default;
4074
- isSolicitor() {
4075
- if (hasRoles(this)) {
4076
- return this.user.idam.roles.find(r => r.endsWith('-solicitor')) !== undefined;
4123
+ isReadOnly(field) {
4124
+ if (!field || !field.display_context) {
4125
+ return false;
4077
4126
  }
4078
- return false;
4127
+ return field.display_context.toUpperCase() === 'READONLY';
4079
4128
  }
4080
- isCourtAdmin() {
4081
- if (hasRoles(this)) {
4082
- return this.user.idam.roles.find(r => r.endsWith('-courtadmin')) !== undefined;
4129
+ isMandatory(field) {
4130
+ if (!field || !field.display_context) {
4131
+ return false;
4083
4132
  }
4084
- return false;
4133
+ return field.display_context.toUpperCase() === 'MANDATORY';
4085
4134
  }
4086
- }
4087
- __decorate([
4088
- Type(() => Jurisdiction),
4089
- __metadata("design:type", Array)
4090
- ], Profile.prototype, "jurisdictions", void 0);
4091
-
4092
- class Field {
4093
- id;
4094
- field_type;
4095
- elementPath;
4096
- value;
4097
- label;
4098
- metadata;
4099
- constructor(id, field_type, elementPath, value, label, metadata) {
4100
- this.id = id;
4101
- this.field_type = field_type;
4102
- this.elementPath = elementPath;
4103
- this.value = value;
4104
- this.label = label;
4105
- this.metadata = metadata;
4135
+ isLabel(field) {
4136
+ if (!field || !field.field_type) {
4137
+ return false;
4138
+ }
4139
+ return field.field_type.type === 'Label';
4106
4140
  }
4141
+ static ɵfac = function CaseFieldService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFieldService)(); };
4142
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFieldService, factory: CaseFieldService.ɵfac });
4107
4143
  }
4144
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFieldService, [{
4145
+ type: Injectable
4146
+ }], null, null); })();
4108
4147
 
4109
- class SearchResultViewColumn {
4110
- case_field_id;
4111
- case_field_type;
4112
- display_context;
4113
- display_context_parameter;
4114
- label;
4115
- order;
4116
- }
4117
-
4118
- // @dynamic
4119
- class SearchResultViewItem {
4120
- case_id;
4121
- case_fields;
4122
- hydrated_case_fields;
4123
- columns;
4124
- supplementary_data;
4125
- display_context_parameter;
4148
+ class IsMandatoryPipe {
4149
+ caseFieldService;
4150
+ constructor(caseFieldService) {
4151
+ this.caseFieldService = caseFieldService;
4152
+ }
4153
+ transform(field) {
4154
+ return this.caseFieldService.isMandatory(field);
4155
+ }
4156
+ static ɵfac = function IsMandatoryPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsMandatoryPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4157
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsMandatory", type: IsMandatoryPipe, pure: true, standalone: false });
4126
4158
  }
4127
- __decorate([
4128
- Type(() => CaseField),
4129
- __metadata("design:type", Array)
4130
- ], SearchResultViewItem.prototype, "hydrated_case_fields", void 0);
4159
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsMandatoryPipe, [{
4160
+ type: Pipe,
4161
+ args: [{
4162
+ name: 'ccdIsMandatory',
4163
+ standalone: false
4164
+ }]
4165
+ }], () => [{ type: CaseFieldService }], null); })();
4131
4166
 
4132
- // @dynamic
4133
- class SearchResultView {
4134
- columns;
4135
- results;
4136
- result_error;
4137
- hasDrafts() {
4138
- return this.results[0]
4139
- && this.results[0].case_id
4140
- && Draft.isDraft(this.results[0].case_id);
4167
+ class IsReadOnlyPipe {
4168
+ caseFieldService;
4169
+ constructor(caseFieldService) {
4170
+ this.caseFieldService = caseFieldService;
4171
+ }
4172
+ transform(field) {
4173
+ return this.caseFieldService.isReadOnly(field);
4141
4174
  }
4175
+ static ɵfac = function IsReadOnlyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4176
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnly", type: IsReadOnlyPipe, pure: true, standalone: false });
4142
4177
  }
4143
- __decorate([
4144
- Type(() => SearchResultViewColumn),
4145
- __metadata("design:type", Array)
4146
- ], SearchResultView.prototype, "columns", void 0);
4147
- __decorate([
4148
- Type(() => SearchResultViewItem),
4149
- __metadata("design:type", Array)
4150
- ], SearchResultView.prototype, "results", void 0);
4178
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyPipe, [{
4179
+ type: Pipe,
4180
+ args: [{
4181
+ name: 'ccdIsReadOnly',
4182
+ standalone: false
4183
+ }]
4184
+ }], () => [{ type: CaseFieldService }], null); })();
4151
4185
 
4152
- class SortParameters {
4153
- comparator;
4154
- sortOrder;
4155
- constructor(comparator, sortOrder) {
4156
- this.comparator = comparator;
4157
- this.sortOrder = sortOrder;
4186
+ class IsReadOnlyAndNotCollectionPipe {
4187
+ caseFieldService;
4188
+ constructor(caseFieldService) {
4189
+ this.caseFieldService = caseFieldService;
4190
+ }
4191
+ transform(field) {
4192
+ if (!field || !field.field_type || !field.field_type.type) {
4193
+ return false;
4194
+ }
4195
+ if (this.isCollection(field)) {
4196
+ return false;
4197
+ }
4198
+ return this.caseFieldService.isReadOnly(field);
4199
+ }
4200
+ // CaseField @Expose() doesn't work with the pipe in here, so leaving the manual check
4201
+ isCollection(field) {
4202
+ return field.field_type && field.field_type.type === 'Collection';
4158
4203
  }
4204
+ static ɵfac = function IsReadOnlyAndNotCollectionPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyAndNotCollectionPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4205
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnlyAndNotCollection", type: IsReadOnlyAndNotCollectionPipe, pure: true, standalone: false });
4159
4206
  }
4207
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyAndNotCollectionPipe, [{
4208
+ type: Pipe,
4209
+ args: [{
4210
+ name: 'ccdIsReadOnlyAndNotCollection',
4211
+ standalone: false
4212
+ }]
4213
+ }], () => [{ type: CaseFieldService }], null); })();
4160
4214
 
4161
- var SortOrder$1;
4162
- (function (SortOrder) {
4163
- SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
4164
- SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
4165
- SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
4166
- })(SortOrder$1 || (SortOrder$1 = {}));
4167
-
4168
- class WorkbasketInputModel {
4169
- label;
4170
- order;
4171
- field;
4172
- metadata;
4173
- display_context_parameter;
4174
- }
4175
- class WorkbasketInput {
4176
- workbasketInputs;
4215
+ class PaletteUtilsModule {
4216
+ static ɵfac = function PaletteUtilsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PaletteUtilsModule)(); };
4217
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaletteUtilsModule });
4218
+ static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
4219
+ IsCompoundPipe,
4220
+ RpxTranslatePipe
4221
+ ], imports: [CommonModule,
4222
+ RpxTranslationModule.forChild()] });
4177
4223
  }
4224
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaletteUtilsModule, [{
4225
+ type: NgModule,
4226
+ args: [{
4227
+ imports: [
4228
+ CommonModule,
4229
+ RpxTranslationModule.forChild()
4230
+ ],
4231
+ declarations: [
4232
+ DatePipe,
4233
+ FieldLabelPipe,
4234
+ FirstErrorPipe,
4235
+ IsCompoundPipe,
4236
+ IsMandatoryPipe,
4237
+ IsReadOnlyPipe,
4238
+ IsReadOnlyAndNotCollectionPipe,
4239
+ DashPipe
4240
+ ],
4241
+ exports: [
4242
+ DatePipe,
4243
+ FieldLabelPipe,
4244
+ FirstErrorPipe,
4245
+ IsCompoundPipe,
4246
+ IsMandatoryPipe,
4247
+ IsReadOnlyPipe,
4248
+ IsReadOnlyAndNotCollectionPipe,
4249
+ DashPipe
4250
+ ],
4251
+ providers: [
4252
+ IsCompoundPipe,
4253
+ RpxTranslatePipe
4254
+ ]
4255
+ }]
4256
+ }], null, null); })();
4257
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaletteUtilsModule, { declarations: [DatePipe,
4258
+ FieldLabelPipe,
4259
+ FirstErrorPipe,
4260
+ IsCompoundPipe,
4261
+ IsMandatoryPipe,
4262
+ IsReadOnlyPipe,
4263
+ IsReadOnlyAndNotCollectionPipe,
4264
+ DashPipe], imports: [CommonModule, i1.RpxTranslationModule], exports: [DatePipe,
4265
+ FieldLabelPipe,
4266
+ FirstErrorPipe,
4267
+ IsCompoundPipe,
4268
+ IsMandatoryPipe,
4269
+ IsReadOnlyPipe,
4270
+ IsReadOnlyAndNotCollectionPipe,
4271
+ DashPipe] }); })();
4178
4272
 
4179
4273
  // @dynamic
4180
4274
  class FieldsUtils {
@@ -8409,26 +8503,6 @@ class WindowService {
8409
8503
  type: Injectable
8410
8504
  }], null, null); })();
8411
8505
 
8412
- class FocusService {
8413
- /** unique ID of DOM element this service will focus on */
8414
- elementIdToFocus = 'focusService-elementIdToFocus';
8415
- /**
8416
- * Focus on a specific element with the elementIdToFocus.
8417
- * If there is no element in the DOM, no action is taken.
8418
- */
8419
- focus() {
8420
- const elementToFocus = document.getElementById(this.elementIdToFocus);
8421
- if (elementToFocus) {
8422
- elementToFocus.focus();
8423
- }
8424
- }
8425
- static ɵfac = function FocusService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FocusService)(); };
8426
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FocusService, factory: FocusService.ɵfac });
8427
- }
8428
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FocusService, [{
8429
- type: Injectable
8430
- }], null, null); })();
8431
-
8432
8506
  class WorkbasketInputFilterService {
8433
8507
  httpService;
8434
8508
  appConfig;
@@ -8660,75 +8734,6 @@ class BrowserService {
8660
8734
  }], null, null); })();
8661
8735
 
8662
8736
  class CaseAccessUtils {
8663
- // User role mapping
8664
- static JUDGE_ROLE = 'judge';
8665
- static JUDGE_ROLE_CATEGORY = 'JUDICIAL';
8666
- static JUDGE_ROLE_NAME = 'judiciary';
8667
- static ADMIN_ROLE = 'admin';
8668
- static ADMIN_ROLE_CATEGORY = 'ADMIN';
8669
- static ADMIN_ROLE_NAME = 'admin';
8670
- static PROFESSIONAL_ROLE = 'solicitor';
8671
- static PROFESSIONAL_ROLE_CATEGORY = 'PROFESSIONAL';
8672
- static PROFESSIONAL_ROLE_NAME = 'professional';
8673
- static LEGAL_OPERATIONS_ROLE = 'caseworker';
8674
- static LEGAL_OPERATIONS_ROLE_CATEGORY = 'LEGAL_OPERATIONS';
8675
- static LEGAL_OPERATIONS_ROLE_NAME = 'legal-ops';
8676
- static CITIZEN_ROLE = 'citizen';
8677
- static CITIZEN_ROLE_CATEGORY = 'CITIZEN';
8678
- static CITIZEN_ROLE_NAME = 'citizen';
8679
- static CTSC_ROLE = 'ctsc';
8680
- static CTSC_ROLE_CATEGORY = 'CTSC';
8681
- static CTSC_ROLE_NAME = 'ctsc';
8682
- getMappedRoleCategory(roles = [], roleCategories = []) {
8683
- const roleKeywords = roles.join().split('-').join().split(',');
8684
- if (this.roleOrCategoryExists(CaseAccessUtils.JUDGE_ROLE, CaseAccessUtils.JUDGE_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8685
- return CaseAccessUtils.JUDGE_ROLE_CATEGORY;
8686
- }
8687
- else if (this.roleOrCategoryExists(CaseAccessUtils.PROFESSIONAL_ROLE, CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8688
- return CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY;
8689
- }
8690
- else if (this.roleOrCategoryExists(CaseAccessUtils.CITIZEN_ROLE, CaseAccessUtils.CITIZEN_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8691
- return CaseAccessUtils.CITIZEN_ROLE_CATEGORY;
8692
- }
8693
- else if (this.roleOrCategoryExists(CaseAccessUtils.ADMIN_ROLE, CaseAccessUtils.ADMIN_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8694
- return CaseAccessUtils.ADMIN_ROLE_CATEGORY;
8695
- }
8696
- else if (this.roleOrCategoryExists(CaseAccessUtils.CTSC_ROLE, CaseAccessUtils.CTSC_ROLE_CATEGORY, roleKeywords, roleCategories)) {
8697
- return CaseAccessUtils.CTSC_ROLE_CATEGORY;
8698
- }
8699
- else {
8700
- return CaseAccessUtils.LEGAL_OPERATIONS_ROLE_CATEGORY;
8701
- }
8702
- }
8703
- roleOrCategoryExists(roleKeyword, roleCategory, roleKeywords, roleCategories) {
8704
- const categoryExists = roleCategories.indexOf(roleCategory) > -1;
8705
- const keywordExists = roleKeywords.indexOf(roleKeyword) > -1;
8706
- return categoryExists ? categoryExists : keywordExists;
8707
- }
8708
- getAMRoleName(accessType, aMRole) {
8709
- let roleName = '';
8710
- switch (aMRole) {
8711
- case CaseAccessUtils.JUDGE_ROLE_CATEGORY:
8712
- roleName = `${accessType}-access-${CaseAccessUtils.JUDGE_ROLE_NAME}`;
8713
- break;
8714
- case CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY:
8715
- roleName = `${accessType}-access-${CaseAccessUtils.PROFESSIONAL_ROLE_NAME}`;
8716
- break;
8717
- case CaseAccessUtils.CITIZEN_ROLE_CATEGORY:
8718
- roleName = `${accessType}-access-${CaseAccessUtils.CITIZEN_ROLE_NAME}`;
8719
- break;
8720
- case CaseAccessUtils.ADMIN_ROLE_CATEGORY:
8721
- roleName = `${accessType}-access-${CaseAccessUtils.ADMIN_ROLE_NAME}`;
8722
- break;
8723
- case CaseAccessUtils.CTSC_ROLE_CATEGORY:
8724
- roleName = `${accessType}-access-${CaseAccessUtils.CTSC_ROLE_NAME}`;
8725
- break;
8726
- default:
8727
- roleName = `${accessType}-access-${CaseAccessUtils.LEGAL_OPERATIONS_ROLE_NAME}`;
8728
- break;
8729
- }
8730
- return roleName;
8731
- }
8732
8737
  getAMPayload(assignerId, actorId, roleName, roleCategory, grantType, caseId, details, beginTime = null, endTime = null, isNew = false) {
8733
8738
  const process = details.caseReference !== undefined ? 'challenged-access' : 'specific-access';
8734
8739
  const payload = {
@@ -10191,7 +10196,7 @@ class CaseEditComponent {
10191
10196
  return of(true);
10192
10197
  }
10193
10198
  finishEventCompletionLogic(eventResponse) {
10194
- this.caseNotifier.removeCachedCase();
10199
+ this.caseNotifier.cachedCaseView = null;
10195
10200
  this.sessionStorageService.removeItem('eventUrl');
10196
10201
  const confirmation = this.buildConfirmation(eventResponse);
10197
10202
  if (confirmation && (confirmation.getHeader() || confirmation.getBody())) {
@@ -10594,8 +10599,8 @@ class CasesService {
10594
10599
  if (userInfoStr) {
10595
10600
  userInfo = JSON.parse(userInfoStr);
10596
10601
  }
10597
- const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
10598
- const roleName = camUtils.getAMRoleName('challenged', roleCategory);
10602
+ const roleCategory = userInfo.roleCategory || getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
10603
+ const roleName = getAMRoleName('challenged', roleCategory);
10599
10604
  const beginTime = new Date();
10600
10605
  const endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
10601
10606
  const id = userInfo.id ? userInfo.id : userInfo.uid;
@@ -10611,8 +10616,8 @@ class CasesService {
10611
10616
  if (userInfoStr) {
10612
10617
  userInfo = JSON.parse(userInfoStr);
10613
10618
  }
10614
- const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
10615
- const roleName = camUtils.getAMRoleName('specific', roleCategory);
10619
+ const roleCategory = userInfo.roleCategory || getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
10620
+ const roleName = getAMRoleName('specific', roleCategory);
10616
10621
  const id = userInfo.id ? userInfo.id : userInfo.uid;
10617
10622
  const payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);
10618
10623
  payload.roleRequest = {
@@ -11522,7 +11527,6 @@ class CaseEditPageComponent {
11522
11527
  addressService;
11523
11528
  linkedCasesService;
11524
11529
  caseFlagStateService;
11525
- focusService;
11526
11530
  static RESUMED_FORM_DISCARD = 'RESUMED_FORM_DISCARD';
11527
11531
  static NEW_FORM_DISCARD = 'NEW_FORM_DISCARD';
11528
11532
  static NEW_FORM_SAVE = 'NEW_FORM_CHANGED_SAVE';
@@ -11558,7 +11562,13 @@ class CaseEditPageComponent {
11558
11562
  static scrollToTop() {
11559
11563
  window.scrollTo(0, 0);
11560
11564
  }
11561
- constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService, validPageListCaseFieldsService, multipageComponentStateService, addressService, linkedCasesService, caseFlagStateService, focusService) {
11565
+ static setFocusToTop() {
11566
+ const topContainer = document.getElementById('top');
11567
+ if (topContainer) {
11568
+ topContainer.focus();
11569
+ }
11570
+ }
11571
+ constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService, validPageListCaseFieldsService, multipageComponentStateService, addressService, linkedCasesService, caseFlagStateService) {
11562
11572
  this.caseEdit = caseEdit;
11563
11573
  this.route = route;
11564
11574
  this.formValueService = formValueService;
@@ -11574,7 +11584,6 @@ class CaseEditPageComponent {
11574
11584
  this.addressService = addressService;
11575
11585
  this.linkedCasesService = linkedCasesService;
11576
11586
  this.caseFlagStateService = caseFlagStateService;
11577
- this.focusService = focusService;
11578
11587
  this.multipageComponentStateService.setInstigator(this);
11579
11588
  }
11580
11589
  onFinalNext() {
@@ -11639,7 +11648,7 @@ class CaseEditPageComponent {
11639
11648
  }
11640
11649
  this.triggerText = this.getTriggerText();
11641
11650
  });
11642
- this.focusService.focus();
11651
+ CaseEditPageComponent.setFocusToTop();
11643
11652
  this.caseEditFormSub = this.caseEditDataService.caseEditForm$.subscribe({
11644
11653
  next: editForm => this.editForm = editForm
11645
11654
  });
@@ -11700,7 +11709,7 @@ class CaseEditPageComponent {
11700
11709
  if (this.getPageNumber() !== undefined) {
11701
11710
  this.previousStep();
11702
11711
  }
11703
- this.focusService.focus();
11712
+ CaseEditPageComponent.setFocusToTop();
11704
11713
  }
11705
11714
  // Adding validation message to show it as Error Summary
11706
11715
  generateErrorMessage(fields, container, path, sourceFromComplexField) {
@@ -11909,7 +11918,7 @@ class CaseEditPageComponent {
11909
11918
  // purposes)
11910
11919
  this.removeAllJudicialUserFormControls(this.currentPage, this.editForm);
11911
11920
  }
11912
- this.focusService.focus();
11921
+ CaseEditPageComponent.setFocusToTop();
11913
11922
  }
11914
11923
  updateFormData(jsonData) {
11915
11924
  for (const caseFieldId of Object.keys(jsonData.data)) {
@@ -12028,8 +12037,6 @@ class CaseEditPageComponent {
12028
12037
  else {
12029
12038
  this.caseEdit.cancelled.emit();
12030
12039
  }
12031
- // clear CaseView cache to allow any incidental changes to get picked up once the edit has cancelled
12032
- this.caseEdit.caseNotifier.removeCachedCase();
12033
12040
  this.clearValidationErrors();
12034
12041
  this.multipageComponentStateService.reset();
12035
12042
  }
@@ -12203,7 +12210,7 @@ class CaseEditPageComponent {
12203
12210
  }
12204
12211
  });
12205
12212
  }
12206
- static ɵfac = function CaseEditPageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(AddressesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(CaseFlagStateService), i0.ɵɵdirectiveInject(FocusService)); };
12213
+ static ɵfac = function CaseEditPageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(AddressesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(CaseFlagStateService)); };
12207
12214
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditPageComponent, selectors: [["ccd-case-edit-page"]], standalone: false, decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["tabindex", "0", 1, "validation-error", 3, "click", "keyup.enter"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], [2, "display", "none"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["type", "button", 1, "govuk-js-link", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
12208
12215
  const _r1 = i0.ɵɵgetCurrentView();
12209
12216
  i0.ɵɵtemplate(0, CaseEditPageComponent_ng_container_0_Template, 3, 2, "ng-container", 2)(1, CaseEditPageComponent_div_1_Template, 1, 0, "div", 3)(2, CaseEditPageComponent_ng_template_2_Template, 3, 7, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(4, CaseEditPageComponent_ng_template_4_Template, 1, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(6, CaseEditPageComponent_div_6_Template, 5, 4, "div", 4);
@@ -12236,8 +12243,8 @@ class CaseEditPageComponent {
12236
12243
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditPageComponent, [{
12237
12244
  type: Component,
12238
12245
  args: [{ selector: 'ccd-case-edit-page', standalone: false, template: "<ng-container *ngIf=\"currentPage\">\n <h1 *ngIf=\"!currentPage.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" (keyup.enter)=\"navigateToErrorElement(validationError.id)\" tabindex=\"0\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"nextStep()\">\n <fieldset id=\"fieldset-case-data\">\n <legend style=\"display: none;\"></legend>\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </fieldset>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isDisabled()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><button type=\"button\" (click)=\"cancel()\" class=\"govuk-js-link\">{{getCancelText() | rpxTranslate}}</button></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
12239
- }], () => [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }, { type: CaseFlagStateService }, { type: FocusService }], null); })();
12240
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 36 }); })();
12246
+ }], () => [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }, { type: CaseFlagStateService }], null); })();
12247
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 35 }); })();
12241
12248
 
12242
12249
  class CallbackErrorsContext {
12243
12250
  triggerText;
@@ -33572,8 +33579,7 @@ class CaseEditorModule {
33572
33579
  EventCompletionStateMachineService,
33573
33580
  CaseFlagStateService,
33574
33581
  ValidPageListCaseFieldsService,
33575
- MultipageComponentStateService,
33576
- FocusService
33582
+ MultipageComponentStateService
33577
33583
  ], imports: [CommonModule,
33578
33584
  RouterModule,
33579
33585
  FormsModule,
@@ -33656,8 +33662,7 @@ class CaseEditorModule {
33656
33662
  EventCompletionStateMachineService,
33657
33663
  CaseFlagStateService,
33658
33664
  ValidPageListCaseFieldsService,
33659
- MultipageComponentStateService,
33660
- FocusService
33665
+ MultipageComponentStateService
33661
33666
  ]
33662
33667
  }]
33663
33668
  }], null, null); })();
@@ -35780,16 +35785,8 @@ class CaseResolver {
35780
35785
  }
35781
35786
  // as discussed for EUI-5456, need functionality to go to default page
35782
35787
  goToDefaultPage() {
35783
- const userDetails = safeJsonParse(this.sessionStorage.getItem(USER_DETAILS));
35784
- userDetails && userDetails.roles
35785
- && !userDetails.roles.includes(PUI_CASE_MANAGER)
35786
- &&
35787
- (userDetails.roles.includes('caseworker-ia-iacjudge')
35788
- || userDetails.roles.includes('caseworker-ia-caseofficer')
35789
- || userDetails.roles.includes('caseworker-ia-admofficer')
35790
- || userDetails.roles.includes('caseworker-civil')
35791
- || userDetails.roles.includes('caseworker-privatelaw'))
35792
- ? this.router.navigate([CaseResolver.defaultWAPage]) : this.router.navigate([CaseResolver.defaultPage]);
35788
+ isWorkAllocationUser(this.sessionStorage) ?
35789
+ this.router.navigate([CaseResolver.defaultWAPage]) : this.router.navigate([CaseResolver.defaultPage]);
35793
35790
  }
35794
35791
  static ɵfac = function CaseResolver_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseResolver)(i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(DraftService), i0.ɵɵinject(NavigationNotifierService), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(SessionStorageService)); };
35795
35792
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseResolver, factory: CaseResolver.ɵfac });
@@ -40040,6 +40037,9 @@ class CreateCaseFiltersComponent {
40040
40037
  this.jurisdictions = jurisdictions;
40041
40038
  this.selectJurisdiction(this.jurisdictions, this.filterJurisdictionControl);
40042
40039
  });
40040
+ if (document.getElementById('cc-jurisdiction')) {
40041
+ document.getElementById('cc-jurisdiction').focus();
40042
+ }
40043
40043
  }
40044
40044
  onJurisdictionIdChange() {
40045
40045
  this.resetCaseType();
@@ -41865,5 +41865,5 @@ class TestRouteSnapshotBuilder {
41865
41865
  * Generated bundle index. Do not edit.
41866
41866
  */
41867
41867
 
41868
- export { AbstractAppConfig, AbstractFieldReadComponent, AbstractFieldWriteComponent, AbstractFieldWriteJourneyComponent, AbstractJourneyComponent, Activity, ActivityBannerComponent, ActivityComponent, ActivityIconComponent, ActivityInfo, ActivityModule, ActivityPollingService, ActivityService, AddCommentsComponent, AddCommentsErrorMessage, AddCommentsStep, AddressModel, AddressOption, AddressesService, Alert, AlertComponent, AlertIconClassPipe, AlertMessageType, AlertModule, AlertService, AuthService, Banner, BannersService, BeforeYouStartComponent, BodyComponent, BrowserService, CCDCaseLinkType, COMPONENT_PORTAL_INJECTION_TOKEN, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditDataModule, CaseEditDataService, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventCompletionComponent, CaseEventCompletionTaskCancelledComponent, CaseEventCompletionTaskReassignedComponent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFileViewFieldComponent, CaseFileViewFolderComponent, CaseFileViewFolderDocumentActionsComponent, CaseFileViewFolderSelectorComponent, CaseFileViewFolderSortComponent, CaseFileViewFolderToggleComponent, CaseFileViewOverlayMenuComponent, CaseFileViewService, CaseFlagCheckYourAnswersPageStep, CaseFlagDisplayContextParameter, CaseFlagErrorMessage, CaseFlagFieldState, CaseFlagFormFields, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagWizardStepTitle, CaseFullAccessViewComponent, CaseHeaderComponent, CaseHeaderModule, CaseHistoryViewerFieldComponent, CaseLink, CaseLinkResponse, CaseListComponent, CaseListFiltersComponent, CaseListFiltersModule, CaseListModule, CaseNotifier, CasePaymentHistoryViewerFieldComponent, CasePrintDocument, CasePrinterComponent, CaseProgressComponent, CaseReferencePipe, CaseResolver, CaseSpecificAccessRequestComponent, CaseSpecificAccessSuccessComponent, CaseState, CaseTab, CaseTimelineComponent, CaseTimelineDisplayMode, CaseTimelineModule, CaseType, CaseTypeLite, CaseView, CaseViewComponent, CaseViewEvent, CaseViewTrigger, CaseViewerComponent, CaseViewerModule, CasesService, CaseworkerService, CcdCYAPageLabelFilterPipe, CcdCaseTitlePipe, CcdCollectionTableCaseFieldsFilterPipe, CcdPageFieldsPipe, CcdTabFieldsPipe, CheckYourAnswersComponent, CloseQueryComponent, ConditionalShowFormDirective, ConditionalShowModule, ConditionalShowRegistrarService, ConfirmFlagStatusComponent, ConfirmStatusErrorMessage, ConfirmStatusStep, Confirmation, ConvertHrefToRouterService, CreateCaseFiltersComponent, CreateCaseFiltersModule, CreateCaseFiltersSelection, DRAFT_PREFIX, DRAFT_QUERY_PARAM, DashPipe, DateInputComponent, DatePipe, DateTimeFormatUtils, DatetimePickerComponent, DefinitionsModule, DefinitionsService, DeleteOrCancelDialogComponent, DialogsModule, DisplayMode, Document, DocumentData, DocumentDialogComponent, DocumentLinks, DocumentManagementService, DocumentUrlPipe, Draft, DraftService, DynamicListPipe, DynamicRadioListPipe, ESQueryType, Embedded, EnumDisplayDescriptionPipe, ErrorMessageComponent, ErrorNotifierService, EventCaseField, EventCompletionReturnStates, EventCompletionStateMachineService, EventCompletionStates, EventLogComponent, EventLogDetailsComponent, EventLogTableComponent, EventMessageModule, EventStartComponent, EventStartModule, EventStartStateMachineService, EventStatusService, EventTriggerResolver, EventTriggerService, Fee, FeeValue, Field, FieldLabelPipe, FieldReadComponent, FieldReadLabelComponent, FieldType, FieldTypeSanitiser, FieldWriteComponent, FieldsFilterPipe, FieldsPurger, FieldsUtils, FirstErrorPipe, FixedListItem, FixedListPipe, FixedRadioListPipe, FlagFieldDisplayPipe, FocusElementDirective, FocusElementModule, FocusService, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LanguageInterpreterDisplayPipe, LinkCaseReason, LinkCasesComponent, LinkCasesFromReasonValuePipe, LinkCasesReasonValuePipe, LinkDetails, LinkFromReason, LinkReason, LinkedCasesErrorMessages, LinkedCasesEventTriggers, LinkedCasesFromTableComponent, LinkedCasesPages, LinkedCasesResponse, LinkedCasesToTableComponent, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MEDIA_VIEWER_LOCALSTORAGE_KEY, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, ManageCaseFlagsLabelDisplayPipe, MarkdownComponent, MarkdownComponentModule, MoneyGbpInputComponent, MultipageComponentStateService, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoLinkedCasesComponent, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, Patterns, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, QualifyingQuestionDetailComponent, QualifyingQuestionOptionsComponent, QualifyingQuestionService, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryConfirmationComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryManagementService, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadCookieService, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RespondToQueryErrorMessages, RetryUtil, RouterHelperService, RouterLinkComponent, SaveOrDiscardDialogComponent, SearchFiltersComponent, SearchFiltersModule, SearchFiltersWrapperComponent, SearchInput, SearchLanguageInterpreterComponent, SearchLanguageInterpreterErrorMessage, SearchLanguageInterpreterStep, SearchResultComponent, SearchResultModule, SearchResultView, SearchResultViewColumn, SearchResultViewItem, SearchResultViewItemComparatorFactory, SearchService, SelectFlagErrorMessage, SelectFlagLocationComponent, SelectFlagLocationErrorMessage, SelectFlagTypeComponent, SelectFlagTypeErrorMessage, SessionErrorPageComponent, SessionErrorRoute, SessionJsonErrorLogger, SessionStorageGuard, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, StructuredLoggerService, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, TranslatedMarkdownDirective, TranslatedMarkdownModule, UnLinkCasesComponent, UnsupportedFieldComponent, UpdateFlagAddTranslationErrorMessage, UpdateFlagAddTranslationFormComponent, UpdateFlagAddTranslationStep, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, UpdateFlagTitleDisplayPipe, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicMultiSelectListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteLinkedCasesFieldComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, safeJsonParse, textFieldType, viewerRouting };
41868
+ export { AMRoleSuffix, AbstractAppConfig, AbstractFieldReadComponent, AbstractFieldWriteComponent, AbstractFieldWriteJourneyComponent, AbstractJourneyComponent, Activity, ActivityBannerComponent, ActivityComponent, ActivityIconComponent, ActivityInfo, ActivityModule, ActivityPollingService, ActivityService, AddCommentsComponent, AddCommentsErrorMessage, AddCommentsStep, AddressModel, AddressOption, AddressesService, Alert, AlertComponent, AlertIconClassPipe, AlertMessageType, AlertModule, AlertService, AuthService, Banner, BannersService, BeforeYouStartComponent, BodyComponent, BrowserService, CCDCaseLinkType, COMPONENT_PORTAL_INJECTION_TOKEN, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditDataModule, CaseEditDataService, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventCompletionComponent, CaseEventCompletionTaskCancelledComponent, CaseEventCompletionTaskReassignedComponent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFileViewFieldComponent, CaseFileViewFolderComponent, CaseFileViewFolderDocumentActionsComponent, CaseFileViewFolderSelectorComponent, CaseFileViewFolderSortComponent, CaseFileViewFolderToggleComponent, CaseFileViewOverlayMenuComponent, CaseFileViewService, CaseFlagCheckYourAnswersPageStep, CaseFlagDisplayContextParameter, CaseFlagErrorMessage, CaseFlagFieldState, CaseFlagFormFields, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagWizardStepTitle, CaseFullAccessViewComponent, CaseHeaderComponent, CaseHeaderModule, CaseHistoryViewerFieldComponent, CaseLink, CaseLinkResponse, CaseListComponent, CaseListFiltersComponent, CaseListFiltersModule, CaseListModule, CaseNotifier, CasePaymentHistoryViewerFieldComponent, CasePrintDocument, CasePrinterComponent, CaseProgressComponent, CaseReferencePipe, CaseResolver, CaseSpecificAccessRequestComponent, CaseSpecificAccessSuccessComponent, CaseState, CaseTab, CaseTimelineComponent, CaseTimelineDisplayMode, CaseTimelineModule, CaseType, CaseTypeLite, CaseView, CaseViewComponent, CaseViewEvent, CaseViewTrigger, CaseViewerComponent, CaseViewerModule, CasesService, CaseworkerService, CcdCYAPageLabelFilterPipe, CcdCaseTitlePipe, CcdCollectionTableCaseFieldsFilterPipe, CcdPageFieldsPipe, CcdTabFieldsPipe, CheckYourAnswersComponent, CloseQueryComponent, ConditionalShowFormDirective, ConditionalShowModule, ConditionalShowRegistrarService, ConfirmFlagStatusComponent, ConfirmStatusErrorMessage, ConfirmStatusStep, Confirmation, ConvertHrefToRouterService, CreateCaseFiltersComponent, CreateCaseFiltersModule, CreateCaseFiltersSelection, DRAFT_PREFIX, DRAFT_QUERY_PARAM, DashPipe, DateInputComponent, DatePipe, DateTimeFormatUtils, DatetimePickerComponent, DefinitionsModule, DefinitionsService, DeleteOrCancelDialogComponent, DialogsModule, DisplayMode, Document, DocumentData, DocumentDialogComponent, DocumentLinks, DocumentManagementService, DocumentUrlPipe, Draft, DraftService, DynamicListPipe, DynamicRadioListPipe, ESQueryType, Embedded, EnumDisplayDescriptionPipe, ErrorMessageComponent, ErrorNotifierService, EventCaseField, EventCompletionReturnStates, EventCompletionStateMachineService, EventCompletionStates, EventLogComponent, EventLogDetailsComponent, EventLogTableComponent, EventMessageModule, EventStartComponent, EventStartModule, EventStartStateMachineService, EventStatusService, EventTriggerResolver, EventTriggerService, Fee, FeeValue, Field, FieldLabelPipe, FieldReadComponent, FieldReadLabelComponent, FieldType, FieldTypeSanitiser, FieldWriteComponent, FieldsFilterPipe, FieldsPurger, FieldsUtils, FirstErrorPipe, FixedListItem, FixedListPipe, FixedRadioListPipe, FlagFieldDisplayPipe, FocusElementDirective, FocusElementModule, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LanguageInterpreterDisplayPipe, LinkCaseReason, LinkCasesComponent, LinkCasesFromReasonValuePipe, LinkCasesReasonValuePipe, LinkDetails, LinkFromReason, LinkReason, LinkedCasesErrorMessages, LinkedCasesEventTriggers, LinkedCasesFromTableComponent, LinkedCasesPages, LinkedCasesResponse, LinkedCasesToTableComponent, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MEDIA_VIEWER_LOCALSTORAGE_KEY, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, ManageCaseFlagsLabelDisplayPipe, MarkdownComponent, MarkdownComponentModule, MoneyGbpInputComponent, MultipageComponentStateService, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoLinkedCasesComponent, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, Patterns, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, QualifyingQuestionDetailComponent, QualifyingQuestionOptionsComponent, QualifyingQuestionService, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryConfirmationComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryManagementService, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadCookieService, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RespondToQueryErrorMessages, RetryUtil, RoleCategory, RoleKeyword, RouterHelperService, RouterLinkComponent, SaveOrDiscardDialogComponent, SearchFiltersComponent, SearchFiltersModule, SearchFiltersWrapperComponent, SearchInput, SearchLanguageInterpreterComponent, SearchLanguageInterpreterErrorMessage, SearchLanguageInterpreterStep, SearchResultComponent, SearchResultModule, SearchResultView, SearchResultViewColumn, SearchResultViewItem, SearchResultViewItemComparatorFactory, SearchService, SelectFlagErrorMessage, SelectFlagLocationComponent, SelectFlagLocationErrorMessage, SelectFlagTypeComponent, SelectFlagTypeErrorMessage, SessionErrorPageComponent, SessionErrorRoute, SessionJsonErrorLogger, SessionStorageGuard, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, StructuredLoggerService, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, TranslatedMarkdownDirective, TranslatedMarkdownModule, UnLinkCasesComponent, UnsupportedFieldComponent, UpdateFlagAddTranslationErrorMessage, UpdateFlagAddTranslationFormComponent, UpdateFlagAddTranslationStep, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, UpdateFlagTitleDisplayPipe, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicMultiSelectListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteLinkedCasesFieldComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, safeJsonParse, textFieldType, viewerRouting };
41869
41869
  //# sourceMappingURL=hmcts-ccd-case-ui-toolkit.mjs.map