@hmcts/ccd-case-ui-toolkit 7.3.86 → 7.3.87-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, HttpStatusCode } 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 { StateMachine } from '@edium/fsm';
21
21
  import * as i1$3 from '@angular/material/legacy-dialog';
22
22
  import { MAT_LEGACY_DIALOG_DATA, MatLegacyDialogModule } from '@angular/material/legacy-dialog';
@@ -1852,2326 +1852,2432 @@ class SessionStorageGuard {
1852
1852
  args: [SessionJsonErrorLogger]
1853
1853
  }] }], null); })();
1854
1854
 
1855
- const USER_DETAILS = 'userDetails';
1856
- const PUI_CASE_MANAGER = 'pui-case-manager';
1857
- const JUDGE = 'judge';
1858
- function getUserDetails(sessionStorageService) {
1859
- const item = sessionStorageService?.getItem(USER_DETAILS);
1860
- return safeJsonParse(item, null);
1855
+ // tslint:disable:variable-name
1856
+ class AddressModel {
1857
+ AddressLine1 = '';
1858
+ AddressLine2 = '';
1859
+ AddressLine3 = '';
1860
+ PostTown = '';
1861
+ County = '';
1862
+ PostCode = '';
1863
+ Country = '';
1861
1864
  }
1862
- function isInternalUser(sessionStorageService) {
1863
- const userDetails = getUserDetails(sessionStorageService);
1864
- return !!userDetails?.roles
1865
- && !(userDetails.roles.includes(PUI_CASE_MANAGER)
1866
- || userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
1865
+
1866
+ class Alert {
1867
+ level;
1868
+ message;
1867
1869
  }
1868
- function isJudiciaryUser(sessionStorageService) {
1869
- const userDetails = getUserDetails(sessionStorageService);
1870
- return !!userDetails?.roles
1871
- && (userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
1870
+
1871
+ // tslint:disable:variable-name
1872
+ class CaseDetails {
1873
+ id;
1874
+ jurisdiction;
1875
+ case_type_id;
1876
+ state;
1877
+ created_date;
1878
+ last_modified;
1879
+ locked_by_user_id;
1880
+ security_level;
1881
+ case_data;
1882
+ }
1883
+
1884
+ // tslint:disable:variable-name
1885
+ class CaseEventData {
1886
+ event;
1887
+ data;
1888
+ event_data; // full event data
1889
+ event_token;
1890
+ ignore_warning;
1891
+ draft_id;
1892
+ case_reference;
1893
+ }
1894
+
1895
+ class WizardPageField {
1896
+ case_field_id;
1897
+ order;
1898
+ page_column_no;
1899
+ complex_field_overrides;
1900
+ }
1901
+
1902
+ class FixedListItem {
1903
+ code;
1904
+ label;
1905
+ order;
1872
1906
  }
1873
1907
 
1874
1908
  // @dynamic
1875
- class ActivityService {
1876
- http;
1877
- appConfig;
1878
- sessionStorageService;
1879
- static get ACTIVITY_VIEW() { return 'view'; }
1880
- static get ACTIVITY_EDIT() { return 'edit'; }
1881
- logger = new StructuredLoggerService();
1882
- constructor(http, appConfig, sessionStorageService) {
1883
- this.http = http;
1884
- this.appConfig = appConfig;
1885
- this.sessionStorageService = sessionStorageService;
1886
- }
1887
- get isEnabled() {
1888
- return this.activityUrl() && this.userAuthorised;
1889
- }
1890
- static DUMMY_CASE_REFERENCE = '0';
1891
- userAuthorised = undefined;
1892
- static handleHttpError(response) {
1893
- const error = HttpErrorService.convertToHttpError(response);
1894
- if (response?.status !== error.status) {
1895
- error.status = response.status;
1896
- }
1897
- return error;
1898
- }
1899
- getOptions() {
1900
- const userDetails = safeJsonParse(this.sessionStorageService.getItem(USER_DETAILS));
1901
- let headers = new HttpHeaders().set('Content-Type', 'application/json');
1902
- if (userDetails?.token) {
1903
- headers = headers.set('Authorization', userDetails.token);
1904
- }
1905
- return {
1906
- headers,
1907
- withCredentials: true,
1908
- observe: 'body',
1909
- };
1910
- }
1911
- getActivities(...caseId) {
1912
- try {
1913
- const options = this.getOptions();
1914
- const url = `${this.activityUrl()}/cases/${caseId.join(',')}/activity`;
1915
- return this.http
1916
- .get(url, options, false, ActivityService.handleHttpError)
1917
- .pipe(map(response => response));
1918
- }
1919
- catch (error) {
1920
- this.logUserMayNotBeAuthenticated(error);
1921
- }
1922
- }
1923
- postActivity(caseId, activity) {
1924
- try {
1925
- const options = this.getOptions();
1926
- const url = `${this.activityUrl()}/cases/${caseId}/activity`;
1927
- const body = { activity };
1928
- return this.http
1929
- .post(url, body, options, false)
1930
- .pipe(map(response => response));
1931
- }
1932
- catch (error) {
1933
- this.logUserMayNotBeAuthenticated(error);
1934
- }
1935
- }
1936
- verifyUserIsAuthorized() {
1937
- if (this.sessionStorageService.getItem(USER_DETAILS) && this.activityUrl() && this.userAuthorised === undefined) {
1938
- this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(() => this.userAuthorised = true, error => {
1939
- this.userAuthorised = [401, 403].indexOf(error.status) <= -1;
1940
- });
1941
- }
1942
- }
1943
- activityUrl() {
1944
- return this.appConfig.getActivityUrl();
1945
- }
1946
- logUserMayNotBeAuthenticated(error) {
1947
- this.logger.error('User may not be authenticated. Activity request was not sent.', { error });
1948
- }
1949
- static ɵfac = function ActivityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(SessionStorageService)); };
1950
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac });
1909
+ class FieldType {
1910
+ id;
1911
+ type;
1912
+ min;
1913
+ max;
1914
+ regular_expression;
1915
+ fixed_list_items;
1916
+ complex_fields;
1917
+ collection_field_type;
1951
1918
  }
1952
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
1953
- type: Injectable
1954
- }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: SessionStorageService }], null); })();
1919
+ __decorate([
1920
+ Type(() => FixedListItem),
1921
+ __metadata("design:type", Array)
1922
+ ], FieldType.prototype, "fixed_list_items", void 0);
1923
+ __decorate([
1924
+ Type(() => CaseField),
1925
+ __metadata("design:type", Array)
1926
+ ], FieldType.prototype, "complex_fields", void 0);
1927
+ __decorate([
1928
+ Type(() => FieldType),
1929
+ __metadata("design:type", FieldType)
1930
+ ], FieldType.prototype, "collection_field_type", void 0);
1955
1931
 
1956
1932
  // @dynamic
1957
- class ActivityPollingService {
1958
- activityService;
1959
- ngZone;
1960
- config;
1961
- logger = new StructuredLoggerService();
1962
- pendingRequests = new Map();
1963
- currentTimeoutHandle;
1964
- pollActivitiesSubscription;
1965
- pollConfig;
1966
- batchCollectionDelayMs;
1967
- maxRequestsPerBatch;
1968
- constructor(activityService, ngZone, config) {
1969
- this.activityService = activityService;
1970
- this.ngZone = ngZone;
1971
- this.config = config;
1972
- this.pollConfig = {
1973
- interval: config.getActivityNexPollRequestMs(),
1974
- attempts: config.getActivityRetry()
1975
- };
1976
- this.batchCollectionDelayMs = config.getActivityBatchCollectionDelayMs();
1977
- this.maxRequestsPerBatch = config.getActivityMaxRequestPerBatch();
1978
- }
1979
- get isEnabled() {
1980
- return this.activityService.isEnabled;
1981
- }
1982
- subscribeToActivity(caseId, done) {
1983
- if (!this.isEnabled) {
1984
- return new Subject();
1933
+ class CaseField {
1934
+ static logger = new StructuredLoggerService();
1935
+ id;
1936
+ hidden;
1937
+ hiddenCannotChange;
1938
+ label;
1939
+ originalLabel;
1940
+ noCacheLabel;
1941
+ order;
1942
+ parent;
1943
+ field_type;
1944
+ hint_text;
1945
+ security_label;
1946
+ display_context;
1947
+ display_context_parameter;
1948
+ month_format;
1949
+ show_condition;
1950
+ show_summary_change_option;
1951
+ show_summary_content_option;
1952
+ acls;
1953
+ metadata;
1954
+ formatted_value;
1955
+ retain_hidden_value;
1956
+ wizardProps;
1957
+ _value;
1958
+ _list_items = [];
1959
+ isTranslatedFlag = false;
1960
+ get value() {
1961
+ if (this.field_type && (this.field_type.type === 'DynamicList' || this.field_type.type === 'DynamicRadioList')) {
1962
+ return this._value && this._value.value ? this._value.value.code : this._value;
1985
1963
  }
1986
- let subject = this.pendingRequests.get(caseId);
1987
- if (subject) {
1988
- subject.subscribe(done);
1964
+ else if (this.field_type && this.field_type.type === 'DynamicMultiSelectList') {
1965
+ return this._value && this._value.value ? this._value.value : this._value;
1989
1966
  }
1990
1967
  else {
1991
- // Only the first pending request should start the batch collection timer.
1992
- const wasEmpty = this.pendingRequests.size === 0;
1993
- subject = new Subject();
1994
- subject.subscribe(done);
1995
- this.addPendingRequest(caseId, subject);
1996
- if (wasEmpty) {
1997
- this.ngZone.runOutsideAngular(() => {
1998
- this.currentTimeoutHandle = setTimeout(() => this.ngZone.run(() => {
1999
- this.flushRequests();
2000
- }), this.batchCollectionDelayMs);
2001
- });
2002
- }
2003
- }
2004
- if (this.pendingRequests.size >= this.maxRequestsPerBatch) {
2005
- this.flushRequests();
1968
+ return this._value;
2006
1969
  }
2007
- return subject;
2008
1970
  }
2009
- stopPolling() {
2010
- if (this.pollActivitiesSubscription) {
2011
- this.pollActivitiesSubscription.unsubscribe();
1971
+ set value(value) {
1972
+ if (this.isDynamic()) {
1973
+ if (value && value instanceof Object && value.list_items) {
1974
+ this._list_items = value.list_items;
1975
+ }
1976
+ else if (!this._list_items || this._list_items.length === 0) {
1977
+ // Extract the list items from the current value if that's the only place they exist.
1978
+ this._list_items = this.list_items;
1979
+ if (!value || !value.value) {
1980
+ value = null;
1981
+ }
1982
+ }
2012
1983
  }
1984
+ this._value = value;
2013
1985
  }
2014
- flushRequests() {
2015
- if (this.currentTimeoutHandle) {
2016
- clearTimeout(this.currentTimeoutHandle);
2017
- this.currentTimeoutHandle = undefined;
1986
+ get list_items() {
1987
+ if (this.isDynamic()) {
1988
+ return this._value && this._value.list_items ? this._value.list_items : this._list_items;
2018
1989
  }
2019
- if (!this.pendingRequests.size) {
2020
- return;
1990
+ else {
1991
+ return this.field_type.fixed_list_items;
2021
1992
  }
2022
- const requests = new Map(this.pendingRequests);
2023
- this.pendingRequests.clear();
2024
- this.performBatchRequest(requests);
2025
1993
  }
2026
- pollActivities(...caseIds) {
2027
- if (!this.isEnabled) {
2028
- return EMPTY;
1994
+ set list_items(items) {
1995
+ if ((items && !this._list_items) || (items?.length > this._list_items?.length)) {
1996
+ this._list_items = items;
2029
1997
  }
2030
- return this.polling(this.activityService.getActivities(...caseIds), this.pollConfig);
2031
- }
2032
- postViewActivity(caseId) {
2033
- return this.postActivity(caseId, ActivityService.ACTIVITY_VIEW);
2034
- }
2035
- postEditActivity(caseId) {
2036
- return this.postActivity(caseId, ActivityService.ACTIVITY_EDIT);
2037
- }
2038
- performBatchRequest(requests) {
2039
- const caseIds = Array.from(requests.keys()).join();
2040
- this.ngZone.runOutsideAngular(() => {
2041
- // run polling outside angular zone so it does not trigger change detection
2042
- this.pollActivitiesSubscription = this.pollActivities(caseIds).subscribe({
2043
- // process activity inside zone so it triggers change detection for activity.component.ts
2044
- next: (activities) => this.ngZone.run(() => {
2045
- activities.forEach((activity) => {
2046
- // Ignore activities returned for cases outside this local batch.
2047
- requests.get(activity.caseId)?.next(activity);
2048
- });
2049
- }),
2050
- error: (err) => this.ngZone.run(() => {
2051
- this.logger.error('Error while polling activities.', { error: err });
2052
- Array.from(requests.values()).forEach((subject) => subject.error(err));
2053
- })
2054
- });
2055
- });
2056
1998
  }
2057
- postActivity(caseId, activityType) {
2058
- if (!this.isEnabled) {
2059
- return EMPTY;
1999
+ get dateTimeEntryFormat() {
2000
+ if (this.isComplexDisplay()) {
2001
+ return null;
2060
2002
  }
2061
- const pollingConfig = {
2062
- ...this.pollConfig,
2063
- interval: 5000 // inline with CCD Backend
2064
- };
2065
- return this.polling(this.activityService.postActivity(caseId, activityType), pollingConfig);
2066
- }
2067
- addPendingRequest(caseId, subject) {
2068
- this.pendingRequests.set(caseId, subject);
2069
- // Components complete their returned Subject on destroy; remove it so a later same-case subscription gets a fresh Subject.
2070
- subject.subscribe({
2071
- complete: () => this.removePendingRequest(caseId, subject),
2072
- error: () => this.removePendingRequest(caseId, subject)
2073
- });
2003
+ if (this.display_context_parameter) {
2004
+ return this.extractBracketValue(this.display_context_parameter, '#DATETIMEENTRY');
2005
+ }
2006
+ return null;
2074
2007
  }
2075
- removePendingRequest(caseId, subject) {
2076
- if (this.pendingRequests.get(caseId) !== subject) {
2077
- return;
2008
+ get dateTimeDisplayFormat() {
2009
+ if (this.isComplexEntry()) {
2010
+ return null;
2078
2011
  }
2079
- this.pendingRequests.delete(caseId);
2080
- if (!this.pendingRequests.size && this.currentTimeoutHandle) {
2081
- clearTimeout(this.currentTimeoutHandle);
2082
- this.currentTimeoutHandle = undefined;
2012
+ if (this.display_context_parameter) {
2013
+ return this.extractBracketValue(this.display_context_parameter, '#DATETIMEDISPLAY');
2083
2014
  }
2015
+ return null;
2084
2016
  }
2085
- polling(request$, options) {
2086
- const pollingOptions = {
2087
- interval: options.interval,
2088
- attempts: options.attempts ?? 9,
2089
- exponentialUnit: options.exponentialUnit ?? 1000
2090
- };
2091
- return concat(request$, defer(() => timer(pollingOptions.interval).pipe(switchMap(() => request$))).pipe(repeat())).pipe(
2092
- // Preserve consecutive-failure retry behaviour using the current RxJS retry config.
2093
- retry({
2094
- count: pollingOptions.attempts,
2095
- delay: (_error, retryCount) => timer(this.getExponentialRetryDelay(retryCount, pollingOptions.exponentialUnit)),
2096
- resetOnSuccess: true
2097
- }));
2017
+ isComplexDisplay() {
2018
+ return (this.isComplex() || this.isCollection()) && this.isReadonly();
2098
2019
  }
2099
- getExponentialRetryDelay(consecutiveErrorsCount, exponentialUnit) {
2100
- return Math.pow(2, consecutiveErrorsCount - 1) * exponentialUnit;
2020
+ isComplexEntry() {
2021
+ return (this.isComplex() || this.isCollection()) && (this.isOptional() || this.isMandatory());
2101
2022
  }
2102
- static ɵfac = function ActivityPollingService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityPollingService)(i0.ɵɵinject(ActivityService), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(AbstractAppConfig)); };
2103
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityPollingService, factory: ActivityPollingService.ɵfac });
2104
- }
2105
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityPollingService, [{
2106
- type: Injectable
2107
- }], () => [{ type: ActivityService }, { type: i0.NgZone }, { type: AbstractAppConfig }], null); })();
2108
-
2109
- function ActivityComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2110
- i0.ɵɵelementStart(0, "div");
2111
- i0.ɵɵelement(1, "ccd-activity-icon", 5);
2112
- i0.ɵɵpipe(2, "rpxTranslate");
2113
- i0.ɵɵelementEnd();
2114
- } if (rf & 2) {
2115
- const ctx_r0 = i0.ɵɵnextContext(2);
2116
- i0.ɵɵclassProp("activityEditorsAndViewersIcons", ctx_r0.viewersPresent())("activityEditorsIcon", !ctx_r0.viewersPresent());
2117
- i0.ɵɵadvance();
2118
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 5, ctx_r0.editorsText));
2119
- } }
2120
- function ActivityComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
2121
- i0.ɵɵelementStart(0, "div", 6);
2122
- i0.ɵɵelement(1, "ccd-activity-icon", 7);
2123
- i0.ɵɵpipe(2, "rpxTranslate");
2124
- i0.ɵɵelementEnd();
2125
- } if (rf & 2) {
2126
- const ctx_r0 = i0.ɵɵnextContext(2);
2127
- i0.ɵɵadvance();
2128
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2129
- } }
2130
- function ActivityComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
2131
- i0.ɵɵelementStart(0, "div");
2132
- i0.ɵɵelement(1, "ccd-activity-banner", 8);
2133
- i0.ɵɵpipe(2, "rpxTranslate");
2134
- i0.ɵɵelementEnd();
2135
- } if (rf & 2) {
2136
- const ctx_r0 = i0.ɵɵnextContext(2);
2137
- i0.ɵɵadvance();
2138
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.editorsText));
2139
- } }
2140
- function ActivityComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
2141
- i0.ɵɵelementStart(0, "div");
2142
- i0.ɵɵelement(1, "ccd-activity-banner", 9);
2143
- i0.ɵɵpipe(2, "rpxTranslate");
2144
- i0.ɵɵelementEnd();
2145
- } if (rf & 2) {
2146
- const ctx_r0 = i0.ɵɵnextContext(2);
2147
- i0.ɵɵadvance();
2148
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2149
- } }
2150
- function ActivityComponent_div_0_Template(rf, ctx) { if (rf & 1) {
2151
- i0.ɵɵelementStart(0, "div", 1);
2152
- 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);
2153
- i0.ɵɵelementEnd();
2154
- } if (rf & 2) {
2155
- const ctx_r0 = i0.ɵɵnextContext();
2156
- i0.ɵɵadvance();
2157
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.editorsPresent());
2158
- i0.ɵɵadvance();
2159
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.viewersPresent());
2160
- i0.ɵɵadvance();
2161
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.editorsPresent());
2162
- i0.ɵɵadvance();
2163
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.viewersPresent());
2164
- } }
2165
- class ActivityComponent {
2166
- activityPollingService;
2167
- activity;
2168
- dspMode = DisplayMode;
2169
- viewersText;
2170
- editorsText;
2171
- subscription;
2172
- caseId;
2173
- displayMode;
2174
- VIEWERS_PREFIX = '';
2175
- VIEWERS_SUFFIX = 'viewing this case';
2176
- EDITORS_PREFIX = 'This case is being updated by ';
2177
- EDITORS_SUFFIX = '';
2178
- constructor(activityPollingService) {
2179
- this.activityPollingService = activityPollingService;
2023
+ isReadonly() {
2024
+ return !_.isEmpty(this.display_context)
2025
+ && this.display_context.toUpperCase() === 'READONLY';
2180
2026
  }
2181
- ngOnInit() {
2182
- this.activity = new Activity();
2183
- this.activity.caseId = this.caseId;
2184
- this.activity.editors = [];
2185
- this.activity.unknownEditors = 0;
2186
- this.activity.viewers = [];
2187
- this.activity.unknownViewers = 0;
2188
- this.viewersText = '';
2189
- this.editorsText = '';
2190
- this.subscription = this.activityPollingService.subscribeToActivity(this.caseId, newActivity => this.onActivityChange(newActivity));
2027
+ isOptional() {
2028
+ return !_.isEmpty(this.display_context)
2029
+ && this.display_context.toUpperCase() === 'OPTIONAL';
2191
2030
  }
2192
- onActivityChange(newActivity) {
2193
- this.activity = newActivity;
2194
- this.viewersText = this.generateDescription(this.VIEWERS_PREFIX, this.VIEWERS_SUFFIX, this.activity.viewers, this.activity.unknownViewers);
2195
- this.editorsText = this.generateDescription(this.EDITORS_PREFIX, this.EDITORS_SUFFIX, this.activity.editors, this.activity.unknownEditors);
2031
+ isMandatory() {
2032
+ return !_.isEmpty(this.display_context)
2033
+ && this.display_context.toUpperCase() === 'MANDATORY';
2196
2034
  }
2197
- isActivityEnabled() {
2198
- return this.activityPollingService.isEnabled;
2035
+ isCollection() {
2036
+ return this.field_type && this.field_type.type === 'Collection';
2199
2037
  }
2200
- isActiveCase() {
2201
- return this.activity.editors.length || this.activity.viewers.length || this.activity.unknownEditors || this.activity.unknownViewers;
2038
+ isComplex() {
2039
+ return this.field_type && this.field_type.type === 'Complex';
2202
2040
  }
2203
- viewersPresent() {
2204
- return (this.activity.viewers.length > 0 || this.activity.unknownViewers > 0);
2041
+ isDynamic() {
2042
+ const dynamicFieldTypes = ['DynamicList', 'DynamicRadioList', 'DynamicMultiSelectList'];
2043
+ if (!this.field_type) {
2044
+ return false;
2045
+ }
2046
+ return dynamicFieldTypes.some(t => t === this.field_type.type);
2205
2047
  }
2206
- editorsPresent() {
2207
- return (this.activity.editors.length > 0 || this.activity.unknownEditors > 0);
2048
+ isCaseLink() {
2049
+ return this.isComplex()
2050
+ && this.field_type.id === 'CaseLink'
2051
+ && this.field_type.complex_fields.some(cf => cf.id === 'CaseReference');
2208
2052
  }
2209
- ngOnDestroy() {
2210
- if (this.subscription) {
2211
- this.subscription.complete();
2053
+ extractBracketValue(fmt, paramName, leftBracket = '(', rightBracket = ')') {
2054
+ fmt = fmt.split(',')
2055
+ .find(a => a.trim().startsWith(paramName));
2056
+ if (fmt) {
2057
+ const s = fmt.indexOf(leftBracket) + 1;
2058
+ const e = fmt.indexOf(rightBracket, s);
2059
+ if (e > s && s >= 0) {
2060
+ return fmt.substr(s, (e - s));
2061
+ }
2212
2062
  }
2213
- this.activityPollingService.stopPolling();
2063
+ return null;
2214
2064
  }
2215
- generateDescription(prefix, suffix, namesArray, unknownCount) {
2216
- let resultText = prefix;
2217
- resultText += namesArray.map(activityInfo => `${activityInfo.forename} ${activityInfo.surname}`).join(', ');
2218
- if (unknownCount > 0) {
2219
- resultText += (namesArray.length > 0 ? ` and ${unknownCount} other` : `${unknownCount} user`);
2220
- resultText += (unknownCount > 1 ? 's' : '');
2221
- }
2222
- else {
2223
- resultText = this.replaceLastCommaWithAnd(resultText);
2224
- }
2225
- if (suffix.length > 0) {
2226
- if (namesArray.length + unknownCount > 1) {
2227
- resultText += ` are ${suffix}`;
2228
- }
2229
- else {
2230
- resultText += ` is ${suffix}`;
2065
+ // Ascend the hierarchy to get the full path of the field
2066
+ getHierachicalId(curr) {
2067
+ const prefix = curr ? curr + "_" : "";
2068
+ if (prefix.length < 1024) {
2069
+ if (this.parent) {
2070
+ return this.parent.getHierachicalId(prefix + this.id);
2231
2071
  }
2232
- }
2233
- return resultText;
2234
- }
2235
- replaceLastCommaWithAnd(str) {
2236
- return str.trim().replace(/,([^,]*)$/, ' and $1').split(' ').join(' ');
2237
- }
2238
- static ɵfac = function ActivityComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityComponent)(i0.ɵɵdirectiveInject(ActivityPollingService)); };
2239
- 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) {
2240
- i0.ɵɵtemplate(0, ActivityComponent_div_0_Template, 5, 4, "div", 0);
2241
- } if (rf & 2) {
2242
- i0.ɵɵproperty("ngIf", ctx.isActivityEnabled());
2243
- } }, dependencies: [i4.NgIf, ActivityBannerComponent, ActivityIconComponent, i1.RpxTranslatePipe], styles: [".activityEditorsIcon[_ngcontent-%COMP%]{margin-left:14px}.activityEditorsAndViewersIcons[_ngcontent-%COMP%], .activityViewersIcon[_ngcontent-%COMP%]{float:left;margin-left:14px}"] });
2244
- }
2245
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityComponent, [{
2246
- type: Component,
2247
- 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"] }]
2248
- }], () => [{ type: ActivityPollingService }], { caseId: [{
2249
- type: Input
2250
- }], displayMode: [{
2251
- type: Input
2252
- }] }); })();
2253
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ActivityComponent, { className: "ActivityComponent", filePath: "lib/shared/components/activity/activity.component.ts", lineNumber: 12 }); })();
2254
-
2255
- class ActivityModule {
2256
- static ɵfac = function ActivityModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityModule)(); };
2257
- static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ActivityModule });
2258
- static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
2259
- ActivityService,
2260
- ActivityPollingService,
2261
- SessionStorageService,
2262
- ], imports: [CommonModule,
2263
- RouterModule,
2264
- RpxTranslationModule.forChild()] });
2265
- }
2266
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityModule, [{
2267
- type: NgModule,
2268
- args: [{
2269
- imports: [
2270
- CommonModule,
2271
- RouterModule,
2272
- RpxTranslationModule.forChild()
2273
- ],
2274
- declarations: [
2275
- ActivityComponent,
2276
- ActivityBannerComponent,
2277
- ActivityIconComponent,
2278
- ],
2279
- exports: [
2280
- ActivityComponent,
2281
- ActivityBannerComponent,
2282
- ActivityIconComponent,
2283
- ],
2284
- providers: [
2285
- ActivityService,
2286
- ActivityPollingService,
2287
- SessionStorageService,
2288
- ]
2289
- }]
2290
- }], null, null); })();
2291
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ActivityModule, { declarations: [ActivityComponent,
2292
- ActivityBannerComponent,
2293
- ActivityIconComponent], imports: [CommonModule,
2294
- RouterModule, i1.RpxTranslationModule], exports: [ActivityComponent,
2295
- ActivityBannerComponent,
2296
- ActivityIconComponent] }); })();
2297
-
2298
- class AlertService {
2299
- router;
2300
- rpxTranslationService;
2301
- // the preserved messages
2302
- preservedError = '';
2303
- preservedWarning = '';
2304
- preservedSuccess = '';
2305
- // TODO: Remove
2306
- message;
2307
- level;
2308
- successes;
2309
- errors;
2310
- warnings;
2311
- // TODO: Remove
2312
- alerts;
2313
- successObserver;
2314
- errorObserver;
2315
- warningObserver;
2316
- // TODO: Remove
2317
- alertObserver;
2318
- preserveAlerts = false;
2319
- constructor(router, rpxTranslationService) {
2320
- this.router = router;
2321
- this.rpxTranslationService = rpxTranslationService;
2322
- this.successes = Observable
2323
- .create(observer => this.successObserver = observer).pipe(publish(), refCount());
2324
- this.successes.subscribe();
2325
- this.errors = Observable
2326
- .create(observer => this.errorObserver = observer).pipe(publish(), refCount());
2327
- this.errors.subscribe();
2328
- this.warnings = Observable
2329
- .create(observer => this.warningObserver = observer).pipe(publish(), refCount());
2330
- this.warnings.subscribe();
2331
- // TODO: Remove
2332
- this.alerts = Observable
2333
- .create(observer => this.alertObserver = observer).pipe(publish(), refCount());
2334
- this.alerts.subscribe();
2335
- this.router
2336
- .events
2337
- .subscribe(event => {
2338
- if (event instanceof NavigationStart) {
2339
- // if there is no longer a preserve alerts setting for the page then clear all observers and preserved messages
2340
- if (!this.preserveAlerts) {
2341
- this.clear();
2342
- }
2343
- // if not, then set the preserving of alerts to false so rendering to a new page
2344
- this.preserveAlerts = false;
2072
+ else {
2073
+ return prefix + this.id;
2345
2074
  }
2346
- });
2347
- }
2348
- clear() {
2349
- this.successObserver.next(null);
2350
- this.errorObserver.next(null);
2351
- this.warningObserver.next(null);
2352
- this.preservedError = '';
2353
- this.preservedWarning = '';
2354
- this.preservedSuccess = '';
2355
- // EUI-3381.
2356
- this.alertObserver.next(null);
2357
- this.message = '';
2358
- }
2359
- error({ phrase, replacements }) {
2360
- const message = this.getTranslationWithReplacements(phrase, replacements);
2361
- this.preservedError = this.preserveMessages(message);
2362
- const alert = { level: 'error', message };
2363
- this.errorObserver.next(alert);
2364
- // EUI-3381.
2365
- this.push(alert);
2366
- }
2367
- warning({ phrase, replacements }) {
2368
- const message = this.getTranslationWithReplacements(phrase, replacements);
2369
- this.preservedWarning = this.preserveMessages(message);
2370
- const alert = { level: 'warning', message };
2371
- this.warningObserver.next(alert);
2372
- // EUI-3381.
2373
- this.push(alert);
2374
- }
2375
- success({ preserve, phrase, replacements }) {
2376
- const message = this.getTranslationWithReplacements(phrase, replacements);
2377
- this.preserveAlerts = preserve || this.preserveAlerts;
2378
- const alert = { level: 'success', message };
2379
- this.preservedSuccess = this.preserveMessages(message);
2380
- this.successObserver.next(alert);
2381
- // EUI-3381.
2382
- this.push(alert);
2383
- }
2384
- getTranslationWithReplacements(phrase, replacements) {
2385
- let message;
2386
- if (replacements) {
2387
- this.rpxTranslationService.getTranslationWithReplacements$(phrase, replacements).subscribe(translation => {
2388
- message = translation;
2389
- });
2390
2075
  }
2391
2076
  else {
2392
- this.rpxTranslationService.getTranslation$(phrase).subscribe(translation => {
2393
- message = translation;
2394
- });
2077
+ CaseField.logger.error('Path too long, possible circular reference in case field hierarchy.');
2078
+ return this.id;
2395
2079
  }
2396
- return message;
2397
2080
  }
2398
- setPreserveAlerts(preserve, urlInfo) {
2399
- // if there is no url setting then just preserve the messages
2400
- if (!urlInfo) {
2401
- this.preserveAlerts = preserve;
2402
- }
2403
- else {
2404
- // check if the url includes the sting given
2405
- this.preserveAlerts = this.currentUrlIncludesInfo(preserve, urlInfo);
2406
- }
2081
+ set isTranslated(val) {
2082
+ this.isTranslatedFlag = val;
2407
2083
  }
2408
- currentUrlIncludesInfo(preserve, urlInfo) {
2409
- // loop through the list of strings and check the router includes all of them
2410
- for (const urlSnip of urlInfo) {
2411
- if (!this.router.url.includes(urlSnip)) {
2412
- // return the opposite boolean value if the router does not include one of the strings
2413
- return !preserve;
2414
- }
2415
- }
2416
- // return the boolean value if all strings are in the url
2417
- return preserve;
2084
+ get isTranslated() {
2085
+ return this.isTranslatedFlag;
2418
2086
  }
2419
- isPreserveAlerts() {
2420
- return this.preserveAlerts;
2087
+ }
2088
+ __decorate([
2089
+ Exclude(),
2090
+ __metadata("design:type", CaseField)
2091
+ ], CaseField.prototype, "parent", void 0);
2092
+ __decorate([
2093
+ Type(() => FieldType),
2094
+ __metadata("design:type", FieldType)
2095
+ ], CaseField.prototype, "field_type", void 0);
2096
+ __decorate([
2097
+ Type(() => WizardPageField),
2098
+ __metadata("design:type", WizardPageField)
2099
+ ], CaseField.prototype, "wizardProps", void 0);
2100
+ __decorate([
2101
+ Expose(),
2102
+ __metadata("design:type", Object),
2103
+ __metadata("design:paramtypes", [Object])
2104
+ ], CaseField.prototype, "value", null);
2105
+ __decorate([
2106
+ Expose(),
2107
+ __metadata("design:type", Object),
2108
+ __metadata("design:paramtypes", [Object])
2109
+ ], CaseField.prototype, "list_items", null);
2110
+ __decorate([
2111
+ Expose(),
2112
+ __metadata("design:type", String),
2113
+ __metadata("design:paramtypes", [])
2114
+ ], CaseField.prototype, "dateTimeEntryFormat", null);
2115
+ __decorate([
2116
+ Expose(),
2117
+ __metadata("design:type", String),
2118
+ __metadata("design:paramtypes", [])
2119
+ ], CaseField.prototype, "dateTimeDisplayFormat", null);
2120
+ __decorate([
2121
+ Expose(),
2122
+ __metadata("design:type", Function),
2123
+ __metadata("design:paramtypes", []),
2124
+ __metadata("design:returntype", void 0)
2125
+ ], CaseField.prototype, "isComplexDisplay", null);
2126
+ __decorate([
2127
+ Expose(),
2128
+ __metadata("design:type", Function),
2129
+ __metadata("design:paramtypes", []),
2130
+ __metadata("design:returntype", void 0)
2131
+ ], CaseField.prototype, "isComplexEntry", null);
2132
+ __decorate([
2133
+ Expose(),
2134
+ __metadata("design:type", Function),
2135
+ __metadata("design:paramtypes", []),
2136
+ __metadata("design:returntype", void 0)
2137
+ ], CaseField.prototype, "isReadonly", null);
2138
+ __decorate([
2139
+ Expose(),
2140
+ __metadata("design:type", Function),
2141
+ __metadata("design:paramtypes", []),
2142
+ __metadata("design:returntype", void 0)
2143
+ ], CaseField.prototype, "isOptional", null);
2144
+ __decorate([
2145
+ Expose(),
2146
+ __metadata("design:type", Function),
2147
+ __metadata("design:paramtypes", []),
2148
+ __metadata("design:returntype", void 0)
2149
+ ], CaseField.prototype, "isMandatory", null);
2150
+ __decorate([
2151
+ Expose(),
2152
+ __metadata("design:type", Function),
2153
+ __metadata("design:paramtypes", []),
2154
+ __metadata("design:returntype", Boolean)
2155
+ ], CaseField.prototype, "isCollection", null);
2156
+ __decorate([
2157
+ Expose(),
2158
+ __metadata("design:type", Function),
2159
+ __metadata("design:paramtypes", []),
2160
+ __metadata("design:returntype", Boolean)
2161
+ ], CaseField.prototype, "isComplex", null);
2162
+ __decorate([
2163
+ Expose(),
2164
+ __metadata("design:type", Function),
2165
+ __metadata("design:paramtypes", []),
2166
+ __metadata("design:returntype", Boolean)
2167
+ ], CaseField.prototype, "isDynamic", null);
2168
+ __decorate([
2169
+ Expose(),
2170
+ __metadata("design:type", Function),
2171
+ __metadata("design:paramtypes", []),
2172
+ __metadata("design:returntype", Boolean)
2173
+ ], CaseField.prototype, "isCaseLink", null);
2174
+ __decorate([
2175
+ Expose(),
2176
+ __metadata("design:type", Function),
2177
+ __metadata("design:paramtypes", [String]),
2178
+ __metadata("design:returntype", String)
2179
+ ], CaseField.prototype, "getHierachicalId", null);
2180
+
2181
+ // @dynamic
2182
+ class WizardPage {
2183
+ id;
2184
+ label;
2185
+ order;
2186
+ wizard_page_fields;
2187
+ case_fields;
2188
+ show_condition;
2189
+ parsedShowCondition;
2190
+ getCol1Fields() {
2191
+ return this.case_fields?.filter(f => !f.wizardProps.page_column_no || f.wizardProps.page_column_no === 1);
2421
2192
  }
2422
- preserveMessages(message) {
2423
- // preserve the messages if set to preserve them
2424
- if (this.isPreserveAlerts()) {
2425
- return message;
2426
- }
2427
- else {
2428
- return '';
2429
- }
2193
+ getCol2Fields() {
2194
+ return this.case_fields?.filter(f => f.wizardProps.page_column_no === 2);
2430
2195
  }
2431
- // TODO: Remove
2432
- push(msgObject) {
2433
- this.message = msgObject.message;
2434
- this.level = msgObject.level;
2435
- this.alertObserver.next({
2436
- level: this.level,
2437
- message: this.message
2438
- });
2196
+ isMultiColumn() {
2197
+ return this.getCol2Fields()?.length > 0;
2439
2198
  }
2440
- static ɵfac = function AlertService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AlertService)(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(i1.RpxTranslationService)); };
2441
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AlertService, factory: AlertService.ɵfac });
2442
2199
  }
2443
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AlertService, [{
2444
- type: Injectable
2445
- }], () => [{ type: i1$1.Router }, { type: i1.RpxTranslationService }], null); })();
2200
+ __decorate([
2201
+ Type(() => WizardPageField),
2202
+ __metadata("design:type", Array)
2203
+ ], WizardPage.prototype, "wizard_page_fields", void 0);
2204
+ __decorate([
2205
+ Type(() => CaseField),
2206
+ __metadata("design:type", Array)
2207
+ ], WizardPage.prototype, "case_fields", void 0);
2446
2208
 
2447
- const DRAFT_PREFIX = 'DRAFT';
2448
- const DRAFT_QUERY_PARAM = 'draft';
2449
- class Draft {
2209
+ // @dynamic
2210
+ class CaseEventTrigger {
2450
2211
  id;
2451
- document;
2452
- type;
2453
- created;
2454
- updated;
2455
- static stripDraftId(draftId) {
2456
- return draftId.slice(DRAFT_PREFIX.length);
2212
+ name;
2213
+ description;
2214
+ case_id;
2215
+ case_fields;
2216
+ event_token;
2217
+ wizard_pages;
2218
+ show_summary;
2219
+ show_event_notes;
2220
+ end_button_label;
2221
+ can_save_draft;
2222
+ hasFields() {
2223
+ return this.case_fields && this.case_fields.length !== 0;
2457
2224
  }
2458
- static isDraft(id) {
2459
- return String(id).startsWith(DRAFT_PREFIX);
2225
+ hasPages() {
2226
+ return this.wizard_pages && this.wizard_pages.length !== 0;
2460
2227
  }
2461
2228
  }
2229
+ __decorate([
2230
+ Type(() => CaseField),
2231
+ __metadata("design:type", Array)
2232
+ ], CaseEventTrigger.prototype, "case_fields", void 0);
2233
+ __decorate([
2234
+ Type(() => WizardPage),
2235
+ __metadata("design:type", Array)
2236
+ ], CaseEventTrigger.prototype, "wizard_pages", void 0);
2462
2237
 
2463
- class DraftService {
2464
- http;
2465
- appConfig;
2466
- errorService;
2467
- static V2_MEDIATYPE_DRAFT_CREATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-create.v2+json;charset=UTF-8';
2468
- static V2_MEDIATYPE_DRAFT_UPDATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-update.v2+json;charset=UTF-8';
2469
- static V2_MEDIATYPE_DRAFT_READ = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-read.v2+json;charset=UTF-8';
2470
- static V2_MEDIATYPE_DRAFT_DELETE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-delete.v2+json;charset=UTF-8';
2471
- constructor(http, appConfig, errorService) {
2472
- this.http = http;
2473
- this.appConfig = appConfig;
2474
- this.errorService = errorService;
2475
- }
2476
- createDraft(ctid, eventData) {
2477
- const saveDraftEndpoint = this.appConfig.getCreateOrUpdateDraftsUrl(ctid);
2478
- const headers = new HttpHeaders()
2479
- .set('experimental', 'true')
2480
- .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_CREATE)
2481
- .set('Content-Type', 'application/json');
2482
- return this.http
2483
- .post(saveDraftEndpoint, eventData, { headers, observe: 'body' })
2484
- .pipe(catchError((error) => {
2485
- this.errorService.setError(error);
2486
- return throwError(error);
2487
- }));
2488
- }
2489
- updateDraft(ctid, draftId, eventData) {
2490
- const saveDraftEndpoint = `${this.appConfig.getCreateOrUpdateDraftsUrl(ctid)}/${draftId}`;
2491
- const headers = new HttpHeaders()
2492
- .set('experimental', 'true')
2493
- .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_UPDATE)
2494
- .set('Content-Type', 'application/json');
2495
- return this.http
2496
- .put(saveDraftEndpoint, eventData, { headers, observe: 'body' })
2497
- .pipe(catchError((error) => {
2498
- this.errorService.setError(error);
2499
- return throwError(error);
2500
- }));
2501
- }
2502
- getDraft(draftId) {
2503
- const url = this.appConfig.getViewOrDeleteDraftsUrl(draftId.slice(DRAFT_PREFIX.length));
2504
- const headers = new HttpHeaders()
2505
- .set('experimental', 'true')
2506
- .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_READ)
2507
- .set('Content-Type', 'application/json');
2508
- return this.http
2509
- .get(url, { headers, observe: 'body' })
2510
- .pipe(catchError((error) => {
2511
- this.errorService.setError(error);
2512
- return throwError(error);
2513
- }));
2514
- }
2515
- deleteDraft(draftId) {
2516
- const url = this.appConfig.getViewOrDeleteDraftsUrl(draftId.slice(DRAFT_PREFIX.length));
2517
- const headers = new HttpHeaders()
2518
- .set('experimental', 'true')
2519
- .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_DELETE)
2520
- .set('Content-Type', 'application/json');
2521
- return this.http
2522
- .delete(url, { headers, observe: 'body' }).pipe(catchError((error) => {
2523
- this.errorService.setError(error);
2524
- return throwError(error);
2525
- }));
2526
- }
2527
- createOrUpdateDraft(caseTypeId, draftId, caseEventData) {
2528
- if (!draftId) {
2529
- return this.createDraft(caseTypeId, caseEventData);
2530
- }
2531
- else {
2532
- return this.updateDraft(caseTypeId, Draft.stripDraftId(draftId), caseEventData);
2533
- }
2534
- }
2535
- static ɵfac = function DraftService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DraftService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(HttpErrorService)); };
2536
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DraftService, factory: DraftService.ɵfac });
2238
+ // tslint:disable:variable-name
2239
+ class CaseViewEvent {
2240
+ id;
2241
+ timestamp;
2242
+ summary;
2243
+ comment;
2244
+ event_id;
2245
+ event_name;
2246
+ state_id;
2247
+ state_name;
2248
+ user_id;
2249
+ user_last_name;
2250
+ user_first_name;
2251
+ significant_item;
2537
2252
  }
2538
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DraftService, [{
2539
- type: Injectable
2540
- }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }], null); })();
2541
2253
 
2542
- class ConditionalShowRegistrarService {
2543
- registeredDirectives = [];
2544
- register(newDirective) {
2545
- this.registeredDirectives.push(newDirective);
2546
- }
2547
- reset() {
2548
- this.registeredDirectives = [];
2549
- }
2550
- static ɵfac = function ConditionalShowRegistrarService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConditionalShowRegistrarService)(); };
2551
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConditionalShowRegistrarService, factory: ConditionalShowRegistrarService.ɵfac });
2254
+ class CaseViewTrigger {
2255
+ id;
2256
+ name;
2257
+ description;
2258
+ order;
2552
2259
  }
2553
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConditionalShowRegistrarService, [{
2554
- type: Injectable
2555
- }], null, null); })();
2556
2260
 
2557
- /** Keeps track of initially hidden fields that toggle to show on the page (parent page).
2558
- * Used to decide whether to redisplay the grey bar when returning to the page during
2559
- * navigation between pages.
2560
- */
2561
- class GreyBarService {
2562
- fieldsToggledToShow = [];
2563
- renderer;
2564
- constructor(rendererFactory) {
2565
- this.renderer = rendererFactory.createRenderer(null, null);
2566
- }
2567
- showGreyBar(field, el) {
2568
- if (!field.isCollection()) {
2569
- this.addGreyBar(el);
2570
- }
2571
- }
2572
- removeGreyBar(el) {
2573
- const divSelector = el.nativeElement.querySelector('div');
2574
- if (divSelector) {
2575
- this.renderer.removeClass(divSelector, 'show-condition-grey-bar');
2576
- }
2577
- }
2578
- addToggledToShow(fieldId) {
2579
- this.fieldsToggledToShow.push(fieldId);
2580
- }
2581
- removeToggledToShow(fieldId) {
2582
- this.fieldsToggledToShow = this.fieldsToggledToShow.filter(id => id !== fieldId);
2583
- }
2584
- wasToggledToShow(fieldId) {
2585
- return this.fieldsToggledToShow.find(id => id === fieldId) !== undefined;
2586
- }
2587
- reset() {
2588
- this.fieldsToggledToShow = [];
2589
- }
2590
- addGreyBar(el) {
2591
- const divSelector = el.nativeElement.querySelector('div');
2592
- if (divSelector) {
2593
- this.renderer.addClass(divSelector, 'show-condition-grey-bar');
2594
- }
2595
- }
2596
- static ɵfac = function GreyBarService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GreyBarService)(i0.ɵɵinject(i0.RendererFactory2)); };
2597
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GreyBarService, factory: GreyBarService.ɵfac });
2261
+ class CaseEvent {
2262
+ id;
2263
+ name;
2264
+ post_state;
2265
+ pre_states;
2266
+ case_fields;
2267
+ description;
2268
+ order;
2269
+ acls;
2598
2270
  }
2599
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GreyBarService, [{
2600
- type: Injectable
2601
- }], () => [{ type: i0.RendererFactory2 }], null); })();
2602
-
2603
- var AddCommentsErrorMessage;
2604
- (function (AddCommentsErrorMessage) {
2605
- AddCommentsErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
2606
- AddCommentsErrorMessage["FLAG_COMMENTS_NOT_ENTERED_EXTERNAL"] = "Please enter comments for this support request";
2607
- AddCommentsErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
2608
- })(AddCommentsErrorMessage || (AddCommentsErrorMessage = {}));
2609
-
2610
- var AddCommentsStep;
2611
- (function (AddCommentsStep) {
2612
- AddCommentsStep["HINT_TEXT"] = "Explain why you are creating this flag. Do not include any sensitive information such as personal details.";
2613
- AddCommentsStep["HINT_TEXT_EXTERNAL"] = "Explain why you are creating this support request. Do not include any sensitive information such as personal details.";
2614
- AddCommentsStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2615
- AddCommentsStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
2616
- })(AddCommentsStep || (AddCommentsStep = {}));
2617
2271
 
2618
- var CaseFlagCheckYourAnswersPageStep;
2619
- (function (CaseFlagCheckYourAnswersPageStep) {
2620
- CaseFlagCheckYourAnswersPageStep["CASE_LEVEL_LOCATION"] = "Case level";
2621
- CaseFlagCheckYourAnswersPageStep["ADD_FLAG_HEADER_TEXT"] = "Add flag to";
2622
- CaseFlagCheckYourAnswersPageStep["ADD_FLAG_HEADER_TEXT_EXTERNAL"] = "Add support to";
2623
- CaseFlagCheckYourAnswersPageStep["UPDATE_FLAG_HEADER_TEXT"] = "Update flag for";
2624
- CaseFlagCheckYourAnswersPageStep["UPDATE_FLAG_HEADER_TEXT_EXTERNAL"] = "Update support for";
2625
- CaseFlagCheckYourAnswersPageStep["FLAG_TYPE_HEADER_TEXT"] = "Flag type";
2626
- CaseFlagCheckYourAnswersPageStep["FLAG_TYPE_HEADER_TEXT_EXTERNAL"] = "Support type";
2627
- CaseFlagCheckYourAnswersPageStep["NONE"] = "";
2628
- })(CaseFlagCheckYourAnswersPageStep || (CaseFlagCheckYourAnswersPageStep = {}));
2272
+ class CaseState {
2273
+ id;
2274
+ name;
2275
+ description;
2276
+ order;
2277
+ }
2629
2278
 
2630
- /**
2631
- * Create and update contexts for external users are, by definition, part of Case Flags 2.1 - thus there is no enum
2632
- * value for these.
2633
- */
2634
- var CaseFlagDisplayContextParameter;
2635
- (function (CaseFlagDisplayContextParameter) {
2636
- CaseFlagDisplayContextParameter["CREATE"] = "#ARGUMENT(CREATE)";
2637
- CaseFlagDisplayContextParameter["CREATE_EXTERNAL"] = "#ARGUMENT(CREATE,EXTERNAL)";
2638
- CaseFlagDisplayContextParameter["CREATE_2_POINT_1"] = "#ARGUMENT(CREATE,VERSION2.1)";
2639
- CaseFlagDisplayContextParameter["READ_EXTERNAL"] = "#ARGUMENT(READ,EXTERNAL)";
2640
- CaseFlagDisplayContextParameter["UPDATE"] = "#ARGUMENT(UPDATE)";
2641
- CaseFlagDisplayContextParameter["UPDATE_EXTERNAL"] = "#ARGUMENT(UPDATE,EXTERNAL)";
2642
- CaseFlagDisplayContextParameter["UPDATE_2_POINT_1"] = "#ARGUMENT(UPDATE,VERSION2.1)";
2643
- })(CaseFlagDisplayContextParameter || (CaseFlagDisplayContextParameter = {}));
2279
+ // Light clone of CaseType to be used in Jurisdiction class
2280
+ // to avoid cyclic dependency
2281
+ class CaseTypeLite {
2282
+ id;
2283
+ name;
2284
+ events;
2285
+ states;
2286
+ description;
2287
+ }
2644
2288
 
2645
- var CaseFlagFormFields;
2646
- (function (CaseFlagFormFields) {
2647
- CaseFlagFormFields["FLAG_TYPE"] = "flagType";
2648
- CaseFlagFormFields["COMMENTS"] = "flagComment";
2649
- CaseFlagFormFields["COMMENTS_WELSH"] = "flagComment_cy";
2650
- CaseFlagFormFields["OTHER_FLAG_DESCRIPTION"] = "otherDescription";
2651
- CaseFlagFormFields["OTHER_FLAG_DESCRIPTION_WELSH"] = "otherDescription_cy";
2652
- CaseFlagFormFields["STATUS"] = "status";
2653
- CaseFlagFormFields["STATUS_CHANGE_REASON"] = "flagStatusReasonChange";
2654
- CaseFlagFormFields["IS_WELSH_TRANSLATION_NEEDED"] = "flagIsWelshTranslationNeeded";
2655
- CaseFlagFormFields["IS_VISIBLE_INTERNALLY_ONLY"] = "flagIsVisibleInternallyOnly";
2656
- })(CaseFlagFormFields || (CaseFlagFormFields = {}));
2289
+ // @dynamics
2290
+ class CaseType {
2291
+ id;
2292
+ name;
2293
+ events;
2294
+ states;
2295
+ case_fields;
2296
+ description;
2297
+ jurisdiction;
2298
+ printEnabled;
2299
+ }
2300
+ __decorate([
2301
+ Type(() => CaseField),
2302
+ __metadata("design:type", Array)
2303
+ ], CaseType.prototype, "case_fields", void 0);
2657
2304
 
2658
- var CaseFlagStatus;
2659
- (function (CaseFlagStatus) {
2660
- CaseFlagStatus["REQUESTED"] = "Requested";
2661
- CaseFlagStatus["ACTIVE"] = "Active";
2662
- CaseFlagStatus["INACTIVE"] = "Inactive";
2663
- CaseFlagStatus["NOT_APPROVED"] = "Not approved";
2664
- })(CaseFlagStatus || (CaseFlagStatus = {}));
2305
+ // tslint:disable:variable-name
2306
+ class EventCaseField {
2307
+ case_field_id;
2308
+ showCondition;
2309
+ }
2665
2310
 
2666
- var CaseFlagSummaryListDisplayMode;
2667
- (function (CaseFlagSummaryListDisplayMode) {
2668
- CaseFlagSummaryListDisplayMode[CaseFlagSummaryListDisplayMode["CREATE"] = 0] = "CREATE";
2669
- CaseFlagSummaryListDisplayMode[CaseFlagSummaryListDisplayMode["MANAGE"] = 1] = "MANAGE";
2670
- })(CaseFlagSummaryListDisplayMode || (CaseFlagSummaryListDisplayMode = {}));
2311
+ class Jurisdiction {
2312
+ id;
2313
+ name;
2314
+ description;
2315
+ caseTypes;
2316
+ currentCaseType;
2317
+ }
2671
2318
 
2672
- var CaseFlagWizardStepTitle;
2673
- (function (CaseFlagWizardStepTitle) {
2674
- CaseFlagWizardStepTitle["SELECT_FLAG_LOCATION"] = "Where should this flag be added?";
2675
- CaseFlagWizardStepTitle["SELECT_FLAG_LOCATION_EXTERNAL"] = "Who is the support for?";
2676
- CaseFlagWizardStepTitle["SELECT_CASE_FLAG"] = "Select flag type";
2677
- CaseFlagWizardStepTitle["SELECT_CASE_FLAG_EXTERNAL"] = "Select support type";
2678
- CaseFlagWizardStepTitle["OTHER_FLAG_TYPE_DESCRIPTION"] = "Enter a flag type";
2679
- CaseFlagWizardStepTitle["OTHER_FLAG_TYPE_DESCRIPTION_EXTERNAL"] = "Enter a support type";
2680
- CaseFlagWizardStepTitle["ADD_FLAG_COMMENTS"] = "Add comments for this flag";
2681
- CaseFlagWizardStepTitle["ADD_FLAG_COMMENTS_EXTERNAL_MODE"] = "Tell us more about the request";
2682
- CaseFlagWizardStepTitle["CONFIRM_FLAG_STATUS"] = "Confirm the status of the flag";
2683
- CaseFlagWizardStepTitle["FLAG_STATUS"] = "Flag status";
2684
- CaseFlagWizardStepTitle["MANAGE_CASE_FLAGS"] = "Manage case flags";
2685
- CaseFlagWizardStepTitle["MANAGE_SUPPORT"] = "Which support is no longer needed?";
2686
- CaseFlagWizardStepTitle["UPDATE_FLAG_TITLE"] = "Update flag";
2687
- CaseFlagWizardStepTitle["UPDATE_FLAG_TITLE_EXTERNAL"] = "Tell us why the support is no longer needed";
2688
- CaseFlagWizardStepTitle["UPDATE_FLAG_ADD_TRANSLATION"] = "Add translations to flag";
2689
- CaseFlagWizardStepTitle["NONE"] = "";
2690
- })(CaseFlagWizardStepTitle || (CaseFlagWizardStepTitle = {}));
2319
+ class Banner {
2320
+ bannerDescription;
2321
+ bannerUrlText;
2322
+ bannerUrl;
2323
+ bannerViewed;
2324
+ bannerEnabled;
2325
+ }
2691
2326
 
2692
- var ConfirmStatusErrorMessage;
2693
- (function (ConfirmStatusErrorMessage) {
2694
- ConfirmStatusErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
2695
- ConfirmStatusErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
2696
- })(ConfirmStatusErrorMessage || (ConfirmStatusErrorMessage = {}));
2327
+ // @dynamic
2328
+ class CaseTab {
2329
+ id;
2330
+ label;
2331
+ order;
2332
+ fields;
2333
+ show_condition;
2334
+ }
2335
+ __decorate([
2336
+ Type(() => CaseField),
2337
+ __metadata("design:type", Array)
2338
+ ], CaseTab.prototype, "fields", void 0);
2697
2339
 
2698
- var ConfirmStatusStep;
2699
- (function (ConfirmStatusStep) {
2700
- ConfirmStatusStep["HINT_TEXT"] = "Describe reason for status; if choosing 'Not approved' provide name of person approving decision.";
2701
- ConfirmStatusStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2702
- })(ConfirmStatusStep || (ConfirmStatusStep = {}));
2340
+ // @dynamic
2341
+ class CaseView {
2342
+ case_id;
2343
+ case_type;
2344
+ state;
2345
+ channels;
2346
+ tabs;
2347
+ triggers;
2348
+ events;
2349
+ metadataFields;
2350
+ basicFields;
2351
+ case_flag;
2352
+ }
2353
+ __decorate([
2354
+ Type(() => CaseTab),
2355
+ __metadata("design:type", Array)
2356
+ ], CaseView.prototype, "tabs", void 0);
2357
+ __decorate([
2358
+ Type(() => CaseField),
2359
+ __metadata("design:type", Array)
2360
+ ], CaseView.prototype, "metadataFields", void 0);
2703
2361
 
2704
- var SearchLanguageInterpreterErrorMessage;
2705
- (function (SearchLanguageInterpreterErrorMessage) {
2706
- SearchLanguageInterpreterErrorMessage["LANGUAGE_NOT_ENTERED"] = "Enter the language that will need to be interpreted";
2707
- SearchLanguageInterpreterErrorMessage["LANGUAGE_CHAR_LIMIT_EXCEEDED"] = "You can enter up to 80 characters for the required language";
2708
- SearchLanguageInterpreterErrorMessage["LANGUAGE_ENTERED_IN_BOTH_FIELDS"] = "The language can only be entered in one of the fields";
2709
- })(SearchLanguageInterpreterErrorMessage || (SearchLanguageInterpreterErrorMessage = {}));
2362
+ class CasePrintDocument {
2363
+ name;
2364
+ type;
2365
+ url;
2366
+ }
2710
2367
 
2711
- var SearchLanguageInterpreterStep;
2712
- (function (SearchLanguageInterpreterStep) {
2713
- SearchLanguageInterpreterStep["HINT_TEXT"] = "Enter the language that will need to be interpreted. If this language is not listed, you can enter it manually.";
2714
- 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.";
2715
- SearchLanguageInterpreterStep["CHECKBOX_LABEL"] = "Enter the language manually";
2716
- SearchLanguageInterpreterStep["INPUT_LABEL"] = "Enter the language";
2717
- })(SearchLanguageInterpreterStep || (SearchLanguageInterpreterStep = {}));
2368
+ var RoleCategory;
2369
+ (function (RoleCategory) {
2370
+ RoleCategory["JUDICIAL"] = "JUDICIAL";
2371
+ RoleCategory["LEGAL_OPERATIONS"] = "LEGAL_OPERATIONS";
2372
+ RoleCategory["ADMIN"] = "ADMIN";
2373
+ RoleCategory["CTSC"] = "CTSC";
2374
+ RoleCategory["PROFESSIONAL"] = "PROFESSIONAL";
2375
+ RoleCategory["CITIZEN"] = "CITIZEN";
2376
+ RoleCategory["ENFORCEMENT"] = "ENFORCEMENT";
2377
+ })(RoleCategory || (RoleCategory = {}));
2378
+ var AMRoleSuffix;
2379
+ (function (AMRoleSuffix) {
2380
+ AMRoleSuffix["JUDICIARY"] = "judiciary";
2381
+ AMRoleSuffix["ADMIN"] = "admin";
2382
+ AMRoleSuffix["PROFESSIONAL"] = "professional";
2383
+ AMRoleSuffix["LEGAL_OPERATIONS"] = "legal-ops";
2384
+ AMRoleSuffix["CITIZEN"] = "citizen";
2385
+ AMRoleSuffix["CTSC"] = "ctsc";
2386
+ AMRoleSuffix["ENFORCEMENT"] = "enforcement";
2387
+ })(AMRoleSuffix || (AMRoleSuffix = {}));
2388
+ var RoleKeyword;
2389
+ (function (RoleKeyword) {
2390
+ RoleKeyword["JUDGE"] = "judge";
2391
+ RoleKeyword["ADMIN"] = "admin";
2392
+ RoleKeyword["SOLICITOR"] = "solicitor";
2393
+ RoleKeyword["CITIZEN"] = "citizen";
2394
+ RoleKeyword["CTSC"] = "ctsc";
2395
+ RoleKeyword["CASEWORKER"] = "caseworker";
2396
+ RoleKeyword["ENFORCEMENT"] = "enforcement";
2397
+ })(RoleKeyword || (RoleKeyword = {}));
2718
2398
 
2719
- var SelectFlagErrorMessage;
2720
- (function (SelectFlagErrorMessage) {
2721
- SelectFlagErrorMessage["MANAGE_CASE_FLAGS_FLAG_NOT_SELECTED"] = "Please make a selection";
2722
- SelectFlagErrorMessage["MANAGE_SUPPORT_FLAG_NOT_SELECTED"] = "Select which support is no longer needed";
2723
- SelectFlagErrorMessage["NO_FLAGS"] = "This case has no flags";
2724
- })(SelectFlagErrorMessage || (SelectFlagErrorMessage = {}));
2399
+ // tslint:disable:variable-name
2400
+ class HRef {
2401
+ href;
2402
+ }
2403
+ class DocumentLinks {
2404
+ self;
2405
+ binary;
2406
+ }
2407
+ class Document {
2408
+ _links;
2409
+ originalDocumentName;
2410
+ hashToken;
2411
+ }
2412
+ class Embedded {
2413
+ documents;
2414
+ }
2415
+ class DocumentData {
2416
+ _embedded;
2417
+ documents;
2418
+ }
2419
+ class FormDocument {
2420
+ document_url;
2421
+ document_binary_url;
2422
+ document_filename;
2423
+ document_hash;
2424
+ upload_timestamp;
2425
+ }
2725
2426
 
2726
- var SelectFlagLocationErrorMessage;
2727
- (function (SelectFlagLocationErrorMessage) {
2728
- SelectFlagLocationErrorMessage["FLAG_LOCATION_NOT_SELECTED"] = "Please make a selection";
2729
- SelectFlagLocationErrorMessage["FLAGS_NOT_CONFIGURED"] = "Flags have not been configured for this case type";
2730
- })(SelectFlagLocationErrorMessage || (SelectFlagLocationErrorMessage = {}));
2427
+ const DRAFT_PREFIX = 'DRAFT';
2428
+ const DRAFT_QUERY_PARAM = 'draft';
2429
+ class Draft {
2430
+ id;
2431
+ document;
2432
+ type;
2433
+ created;
2434
+ updated;
2435
+ static stripDraftId(draftId) {
2436
+ return draftId.slice(DRAFT_PREFIX.length);
2437
+ }
2438
+ static isDraft(id) {
2439
+ return String(id).startsWith(DRAFT_PREFIX);
2440
+ }
2441
+ }
2731
2442
 
2732
- var SelectFlagTypeErrorMessage;
2733
- (function (SelectFlagTypeErrorMessage) {
2734
- SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_SELECTED"] = "Please select a flag type";
2735
- SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_SELECTED_EXTERNAL"] = "Please select a support type";
2736
- SelectFlagTypeErrorMessage["FLAG_TYPE_OPTION_NOT_SELECTED"] = "Select an option";
2737
- SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_ENTERED"] = "Please enter a flag type";
2738
- SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_ENTERED_EXTERNAL"] = "Please enter a support type";
2739
- SelectFlagTypeErrorMessage["FLAG_TYPE_LIMIT_EXCEEDED"] = "You can enter up to 80 characters only";
2740
- })(SelectFlagTypeErrorMessage || (SelectFlagTypeErrorMessage = {}));
2443
+ class OrganisationConverter {
2444
+ static toSimpleAddress(organisationModel) {
2445
+ let simpleAddress = '';
2446
+ if (organisationModel.addressLine1) {
2447
+ simpleAddress += `${organisationModel.addressLine1}<br>`;
2448
+ }
2449
+ if (organisationModel.addressLine2) {
2450
+ simpleAddress += `${organisationModel.addressLine2}<br>`;
2451
+ }
2452
+ if (organisationModel.addressLine3) {
2453
+ simpleAddress += `${organisationModel.addressLine3}<br>`;
2454
+ }
2455
+ if (organisationModel.townCity) {
2456
+ simpleAddress += `${organisationModel.townCity}<br>`;
2457
+ }
2458
+ if (organisationModel.county) {
2459
+ simpleAddress += `${organisationModel.county}<br>`;
2460
+ }
2461
+ if (organisationModel.country) {
2462
+ simpleAddress += `${organisationModel.country}<br>`;
2463
+ }
2464
+ if (organisationModel.postCode) {
2465
+ simpleAddress += `${organisationModel.postCode}<br>`;
2466
+ }
2467
+ return simpleAddress;
2468
+ }
2469
+ toSimpleOrganisationModel(organisationModel) {
2470
+ return {
2471
+ organisationIdentifier: organisationModel.organisationIdentifier,
2472
+ name: organisationModel.name,
2473
+ address: OrganisationConverter.toSimpleAddress(organisationModel)
2474
+ };
2475
+ }
2476
+ static ɵfac = function OrganisationConverter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OrganisationConverter)(); };
2477
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: OrganisationConverter, factory: OrganisationConverter.ɵfac });
2478
+ }
2479
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OrganisationConverter, [{
2480
+ type: Injectable
2481
+ }], null, null); })();
2741
2482
 
2742
- var UpdateFlagAddTranslationErrorMessage;
2743
- (function (UpdateFlagAddTranslationErrorMessage) {
2744
- UpdateFlagAddTranslationErrorMessage["DESCRIPTION_CHAR_LIMIT_EXCEEDED"] = "Original description or translation must be 200 characters or fewer";
2745
- UpdateFlagAddTranslationErrorMessage["COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Original comments or translation must be 200 characters or fewer";
2746
- })(UpdateFlagAddTranslationErrorMessage || (UpdateFlagAddTranslationErrorMessage = {}));
2483
+ class PaginationMetadata {
2484
+ totalResultsCount;
2485
+ totalPagesCount;
2486
+ }
2747
2487
 
2748
- var UpdateFlagAddTranslationStep;
2749
- (function (UpdateFlagAddTranslationStep) {
2750
- UpdateFlagAddTranslationStep["HINT_TEXT"] = "Write translation for flag description or comments in the boxes provided.";
2751
- UpdateFlagAddTranslationStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2752
- })(UpdateFlagAddTranslationStep || (UpdateFlagAddTranslationStep = {}));
2488
+ function hasRoles(profile) {
2489
+ if (profile.user && profile.user.idam && Array.isArray(profile.user.idam.roles)) {
2490
+ return profile.user.idam.roles.length > 0;
2491
+ }
2492
+ return false;
2493
+ }
2494
+ // @dynamic
2495
+ class Profile {
2496
+ user;
2497
+ channels;
2498
+ jurisdictions;
2499
+ default;
2500
+ isSolicitor() {
2501
+ if (hasRoles(this)) {
2502
+ return this.user.idam.roles.find(r => r.endsWith('-solicitor')) !== undefined;
2503
+ }
2504
+ return false;
2505
+ }
2506
+ isCourtAdmin() {
2507
+ if (hasRoles(this)) {
2508
+ return this.user.idam.roles.find(r => r.endsWith('-courtadmin')) !== undefined;
2509
+ }
2510
+ return false;
2511
+ }
2512
+ }
2513
+ __decorate([
2514
+ Type(() => Jurisdiction),
2515
+ __metadata("design:type", Array)
2516
+ ], Profile.prototype, "jurisdictions", void 0);
2753
2517
 
2754
- var UpdateFlagErrorMessage;
2755
- (function (UpdateFlagErrorMessage) {
2756
- UpdateFlagErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
2757
- UpdateFlagErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
2758
- UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
2759
- UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED_EXTERNAL"] = "You must explain why the support is no longer needed";
2760
- UpdateFlagErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
2761
- UpdateFlagErrorMessage["NONE"] = "";
2762
- })(UpdateFlagErrorMessage || (UpdateFlagErrorMessage = {}));
2518
+ class Field {
2519
+ id;
2520
+ field_type;
2521
+ elementPath;
2522
+ value;
2523
+ label;
2524
+ metadata;
2525
+ constructor(id, field_type, elementPath, value, label, metadata) {
2526
+ this.id = id;
2527
+ this.field_type = field_type;
2528
+ this.elementPath = elementPath;
2529
+ this.value = value;
2530
+ this.label = label;
2531
+ this.metadata = metadata;
2532
+ }
2533
+ }
2763
2534
 
2764
- var UpdateFlagStep;
2765
- (function (UpdateFlagStep) {
2766
- UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL"] = "Explain why you are updating this flag. Do not include any sensitive information such as personal details.";
2767
- 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.";
2768
- UpdateFlagStep["COMMENT_HINT_TEXT_EXTERNAL"] = "Do not include any sensitive information such as personal details.";
2769
- UpdateFlagStep["COMMENT_FIELD_LABEL_EXTERNAL"] = "Please provide your comments below";
2770
- UpdateFlagStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2771
- UpdateFlagStep["STATUS_HINT_TEXT"] = "Describe reason for status change.";
2772
- UpdateFlagStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
2773
- })(UpdateFlagStep || (UpdateFlagStep = {}));
2535
+ class SearchResultViewColumn {
2536
+ case_field_id;
2537
+ case_field_type;
2538
+ display_context;
2539
+ display_context_parameter;
2540
+ label;
2541
+ order;
2542
+ }
2774
2543
 
2775
- var CaseFlagFieldState;
2776
- (function (CaseFlagFieldState) {
2777
- CaseFlagFieldState[CaseFlagFieldState["FLAG_LOCATION"] = 0] = "FLAG_LOCATION";
2778
- CaseFlagFieldState[CaseFlagFieldState["FLAG_TYPE"] = 1] = "FLAG_TYPE";
2779
- CaseFlagFieldState[CaseFlagFieldState["FLAG_LANGUAGE_INTERPRETER"] = 2] = "FLAG_LANGUAGE_INTERPRETER";
2780
- CaseFlagFieldState[CaseFlagFieldState["FLAG_COMMENTS"] = 3] = "FLAG_COMMENTS";
2781
- CaseFlagFieldState[CaseFlagFieldState["FLAG_STATUS"] = 4] = "FLAG_STATUS";
2782
- CaseFlagFieldState[CaseFlagFieldState["FLAG_MANAGE_CASE_FLAGS"] = 5] = "FLAG_MANAGE_CASE_FLAGS";
2783
- CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE"] = 6] = "FLAG_UPDATE";
2784
- CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE_WELSH_TRANSLATION"] = 7] = "FLAG_UPDATE_WELSH_TRANSLATION";
2785
- })(CaseFlagFieldState || (CaseFlagFieldState = {}));
2786
- var CaseFlagErrorMessage;
2787
- (function (CaseFlagErrorMessage) {
2788
- CaseFlagErrorMessage["NO_EXTERNAL_FLAGS_COLLECTION"] = "External collection for storing this case flag has not been configured for this case type";
2789
- CaseFlagErrorMessage["NO_INTERNAL_FLAGS_COLLECTION"] = "Internal collection for storing this case flag has not been configured for this case type";
2790
- })(CaseFlagErrorMessage || (CaseFlagErrorMessage = {}));
2544
+ // @dynamic
2545
+ class SearchResultViewItem {
2546
+ case_id;
2547
+ case_fields;
2548
+ hydrated_case_fields;
2549
+ columns;
2550
+ supplementary_data;
2551
+ display_context_parameter;
2552
+ }
2553
+ __decorate([
2554
+ Type(() => CaseField),
2555
+ __metadata("design:type", Array)
2556
+ ], SearchResultViewItem.prototype, "hydrated_case_fields", void 0);
2791
2557
 
2792
- class DashPipe {
2793
- transform(value) {
2794
- return value ? value : '-';
2558
+ // @dynamic
2559
+ class SearchResultView {
2560
+ columns;
2561
+ results;
2562
+ result_error;
2563
+ hasDrafts() {
2564
+ return this.results[0]
2565
+ && this.results[0].case_id
2566
+ && Draft.isDraft(this.results[0].case_id);
2795
2567
  }
2796
- static ɵfac = function DashPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DashPipe)(); };
2797
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDash", type: DashPipe, pure: true, standalone: false });
2798
2568
  }
2799
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DashPipe, [{
2800
- type: Pipe,
2801
- args: [{
2802
- name: 'ccdDash',
2803
- standalone: false
2804
- }]
2805
- }], null, null); })();
2806
-
2807
- /*
2808
- Translate a date time format string from the Java format provided by CCD to the format supported by Angular formatDate()
2809
- Very simple translator that maps unsupported chars to the nearest equivalent.
2810
- If there is no equivalent puts ***x*** into the output where x is the unsupported character
2569
+ __decorate([
2570
+ Type(() => SearchResultViewColumn),
2571
+ __metadata("design:type", Array)
2572
+ ], SearchResultView.prototype, "columns", void 0);
2573
+ __decorate([
2574
+ Type(() => SearchResultViewItem),
2575
+ __metadata("design:type", Array)
2576
+ ], SearchResultView.prototype, "results", void 0);
2811
2577
 
2812
- Java format
2813
- G era text AD; Anno Domini; A
2814
- u year year 2004; 04
2815
- y year-of-era year 2004; 04
2816
- D day-of-year number 189
2817
- M/L month-of-year number/text 7; 07; Jul; July; J
2818
- d day-of-month number 10
2578
+ class SortParameters {
2579
+ comparator;
2580
+ sortOrder;
2581
+ constructor(comparator, sortOrder) {
2582
+ this.comparator = comparator;
2583
+ this.sortOrder = sortOrder;
2584
+ }
2585
+ }
2819
2586
 
2820
- Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter
2821
- Y week-based-year year 1996; 96
2822
- w week-of-week-based-year number 27
2823
- W week-of-month number 4
2824
- E day-of-week text Tue; Tuesday; T
2825
- e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T
2826
- F week-of-month number 3
2587
+ var SortOrder$1;
2588
+ (function (SortOrder) {
2589
+ SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
2590
+ SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
2591
+ SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
2592
+ })(SortOrder$1 || (SortOrder$1 = {}));
2827
2593
 
2828
- a am-pm-of-day text PM
2829
- h clock-hour-of-am-pm (1-12) number 12
2830
- K hour-of-am-pm (0-11) number 0
2831
- k clock-hour-of-am-pm (1-24) number 0
2594
+ class WorkbasketInputModel {
2595
+ label;
2596
+ order;
2597
+ field;
2598
+ metadata;
2599
+ display_context_parameter;
2600
+ }
2601
+ class WorkbasketInput {
2602
+ workbasketInputs;
2603
+ }
2832
2604
 
2833
- H hour-of-day (0-23) number 0
2834
- m minute-of-hour number 30
2835
- s second-of-minute number 55
2836
- S fraction-of-second fraction 978
2837
- A milli-of-day number 1234
2838
- n nano-of-second number 987654321
2839
- N nano-of-day number 1234000000
2840
-
2841
- V time-zone ID zone-id America/Los_Angeles; Z; -08:30
2842
- z time-zone name zone-name Pacific Standard Time; PST
2843
- O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00;
2844
- X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15;
2845
- x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15;
2846
- Z zone-offset offset-Z +0000; -0800; -08:00;
2847
-
2848
- p pad next pad modifier 1
2849
-
2850
- ' escape for text delimiter
2851
- '' single quote literal '
2852
- [ optional section start
2853
- ] optional section end
2854
- # reserved for future use
2855
- { reserved for future use
2856
- } reserved for future use
2605
+ const USER_DETAILS = 'userDetails';
2606
+ const PUI_CASE_MANAGER = 'pui-case-manager';
2607
+ function getUserDetails(sessionStorageService) {
2608
+ const item = sessionStorageService?.getItem(USER_DETAILS);
2609
+ return safeJsonParse(item, null);
2610
+ }
2611
+ function isInternalUser(sessionStorageService) {
2612
+ const userDetails = getUserDetails(sessionStorageService);
2613
+ if (!userDetails?.roles) {
2614
+ return false;
2615
+ }
2616
+ else if (userDetails?.roleCategories?.includes(RoleCategory.ENFORCEMENT)) {
2617
+ return true;
2618
+ }
2619
+ else {
2620
+ return !(userDetails.roles.includes(PUI_CASE_MANAGER) ||
2621
+ userDetails.roles.some((role) => role.toLowerCase().includes(RoleKeyword.JUDGE)));
2622
+ }
2623
+ }
2624
+ function isJudiciaryUser(sessionStorageService) {
2625
+ const userDetails = getUserDetails(sessionStorageService);
2626
+ return !!userDetails?.roles
2627
+ && (userDetails.roles.some((role) => role.toLowerCase().includes(RoleKeyword.JUDGE)));
2628
+ }
2629
+ function roleHasKeyword(keyword, roleWords) {
2630
+ return roleWords.includes(keyword);
2631
+ }
2632
+ function isWorkAllocationUser(sessionStorageService) {
2633
+ const userDetails = getUserDetails(sessionStorageService);
2634
+ return userDetails?.roles
2635
+ && !userDetails.roles.includes(PUI_CASE_MANAGER)
2636
+ &&
2637
+ (userDetails.roles.includes('caseworker-ia-iacjudge')
2638
+ || userDetails.roles.includes('caseworker-ia-caseofficer')
2639
+ || userDetails.roles.includes('caseworker-ia-admofficer')
2640
+ || userDetails.roles.includes('caseworker-civil')
2641
+ || userDetails.roles.includes('caseworker-privatelaw')
2642
+ || userDetails?.roleCategories?.includes(RoleCategory.ENFORCEMENT));
2643
+ }
2644
+ // fallback purely if roleCategories is not available in
2645
+ function getMappedRoleCategories(roles = []) {
2646
+ const roleKeywords = roles.join().split('-').join().split(',');
2647
+ const roleCategoryList = [];
2648
+ if (roleHasKeyword(RoleKeyword.JUDGE, roleKeywords)) {
2649
+ roleCategoryList.push(RoleCategory.JUDICIAL);
2650
+ }
2651
+ if (roleHasKeyword(RoleKeyword.SOLICITOR, roleKeywords)) {
2652
+ roleCategoryList.push(RoleCategory.PROFESSIONAL);
2653
+ }
2654
+ if (roleHasKeyword(RoleKeyword.CITIZEN, roleKeywords)) {
2655
+ roleCategoryList.push(RoleCategory.CITIZEN);
2656
+ }
2657
+ if (roleHasKeyword(RoleKeyword.ADMIN, roleKeywords)) {
2658
+ roleCategoryList.push(RoleCategory.ADMIN);
2659
+ }
2660
+ if (roleHasKeyword(RoleKeyword.CTSC, roleKeywords)) {
2661
+ roleCategoryList.push(RoleCategory.CTSC);
2662
+ }
2663
+ if (roleHasKeyword(RoleKeyword.CASEWORKER, roleKeywords)) {
2664
+ roleCategoryList.push(RoleCategory.LEGAL_OPERATIONS);
2665
+ }
2666
+ if (roleHasKeyword(RoleKeyword.ENFORCEMENT, roleKeywords)) {
2667
+ roleCategoryList.push(RoleCategory.ENFORCEMENT);
2668
+ }
2669
+ return roleCategoryList;
2670
+ }
2671
+ function getAMRoleName(accessType, aMRole) {
2672
+ let roleName = '';
2673
+ switch (aMRole) {
2674
+ case RoleCategory.JUDICIAL:
2675
+ roleName = `${accessType}-access-${AMRoleSuffix.JUDICIARY}`;
2676
+ break;
2677
+ case RoleCategory.PROFESSIONAL:
2678
+ roleName = `${accessType}-access-${AMRoleSuffix.PROFESSIONAL}`;
2679
+ break;
2680
+ case RoleCategory.CITIZEN:
2681
+ roleName = `${accessType}-access-${AMRoleSuffix.CITIZEN}`;
2682
+ break;
2683
+ case RoleCategory.ADMIN:
2684
+ roleName = `${accessType}-access-${AMRoleSuffix.ADMIN}`;
2685
+ break;
2686
+ case RoleCategory.CTSC:
2687
+ roleName = `${accessType}-access-${AMRoleSuffix.CTSC}`;
2688
+ break;
2689
+ case RoleCategory.ENFORCEMENT:
2690
+ roleName = `${accessType}-access-${AMRoleSuffix.ENFORCEMENT}`;
2691
+ break;
2692
+ default:
2693
+ roleName = `${accessType}-access-${AMRoleSuffix.LEGAL_OPERATIONS}`;
2694
+ break;
2695
+ }
2696
+ return roleName;
2697
+ }
2857
2698
 
2858
- Angular dateFormat characters
2859
- Era G, GG & GGG Abbreviated AD
2860
- GGGG Wide Anno Domini
2861
- GGGGG Narrow A
2862
- Year y Numeric: minimum digits 2, 20, 201, 2017, 20173
2863
- yy Numeric: 2 digits + zero padded 02, 20, 01, 17, 73
2864
- yyy Numeric: 3 digits + zero padded 002, 020, 201, 2017, 20173
2865
- yyyy Numeric: 4 digits or more + zero padded 0002, 0020, 0201, 2017, 20173
2866
- Month M Numeric: 1 digit 9, 12
2867
- MM Numeric: 2 digits + zero padded 09, 12
2868
- MMM Abbreviated Sep
2869
- MMMM Wide September
2870
- MMMMM Narrow S
2871
- Month standalone L Numeric: 1 digit 9, 12
2872
- LL Numeric: 2 digits + zero padded 09, 12
2873
- LLL Abbreviated Sep
2874
- LLLL Wide September
2875
- LLLLL Narrow S
2876
- Week of year w Numeric: minimum digits 1... 53
2877
- ww Numeric: 2 digits + zero padded 01... 53
2878
- Week of month W Numeric: 1 digit 1... 5
2879
- Day of month d Numeric: minimum digits 1
2880
- dd Numeric: 2 digits + zero padded 01
2881
- Week day E, EE & EEE Abbreviated Tue
2882
- EEEE Wide Tuesday
2883
- EEEEE Narrow T
2884
- EEEEEE Short Tu
2885
- Period a, aa & aaa Abbreviated am/pm or AM/PM
2886
- aaaa Wide (fallback to a when missing) ante meridiem/post meridiem
2887
- aaaaa Narrow a/p
2888
- Period* B, BB & BBB Abbreviated mid.
2889
- BBBB Wide am, pm, midnight, noon, morning, afternoon, evening, night
2890
- BBBBB Narrow md
2891
- Period standalone* b, bb & bbb Abbreviated mid.
2892
- bbbb Wide am, pm, midnight, noon, morning, afternoon, evening, night
2893
- bbbbb Narrow md
2894
- Hour 1-12 h Numeric: minimum digits 1, 12
2895
- hh Numeric: 2 digits + zero padded 01, 12
2896
- Hour 0-23 H Numeric: minimum digits 0, 23
2897
- HH Numeric: 2 digits + zero padded 00, 23
2898
- Minute m Numeric: minimum digits 8, 59
2899
- mm Numeric: 2 digits + zero padded 08, 59
2900
- Second s Numeric: minimum digits 0... 59
2901
- ss Numeric: 2 digits + zero padded 00... 59
2902
- Fractional seconds S Numeric: 1 digit 0... 9
2903
- SS Numeric: 2 digits + zero padded 00... 99
2904
- SSS Numeric: 3 digits + zero padded (= milliseconds) 000... 999
2905
- Zone z, zz & zzz Short specific non location format (fallback to O) GMT-8
2906
- zzzz Long specific non location format (fallback to OOOO) GMT-08:00
2907
- Z, ZZ & ZZZ ISO8601 basic format -0800
2908
- ZZZZ Long localized GMT format GMT-8:00
2909
- ZZZZZ ISO8601 extended format + Z indicator for offset 0 (= XXXXX) -08:00
2910
- O, OO & OOO Short localized GMT format GMT-8
2911
- OOOO Long localized GMT format GMT-08:00
2912
- */
2913
- class FormatTranslatorService {
2914
- translate(javaFormat) {
2915
- const result = [];
2916
- let prev = '\0';
2917
- let inQuote = false;
2918
- const maybePush = (target, obj, flag) => {
2919
- if (!flag) {
2920
- target.push(obj);
2921
- }
2922
- };
2923
- for (const c of javaFormat) {
2924
- switch (c) {
2925
- case '\'':
2926
- if (prev === '\'') {
2927
- // literal single quote - ignore
2928
- inQuote = false;
2929
- }
2930
- else {
2931
- inQuote = !inQuote;
2932
- }
2933
- break;
2934
- // Due to formatting constraints on the webapp, all 'd' characters should be replaced with 'D' (for Moment library)
2935
- // This is because we want the date, not the day (this format will need to be converted back)
2936
- case 'd':
2937
- maybePush(result, 'D', inQuote);
2938
- break;
2939
- // moment library defines year as capital y
2940
- case 'y':
2941
- maybePush(result, 'Y', inQuote);
2942
- break;
2943
- case 'e':
2944
- case 'c':
2945
- maybePush(result, 'E', inQuote); // no lower case E
2946
- break;
2947
- case 'F':
2948
- maybePush(result, 'W', inQuote);
2949
- break;
2950
- case 'K':
2951
- maybePush(result, 'H', inQuote);
2952
- break;
2953
- case 'k':
2954
- maybePush(result, 'h', inQuote);
2955
- break;
2956
- // commented out A change to '***' due to use in moment library for AM/PM
2957
- // added 'a' specification to stop discrepancy in am/AM pm/PM formatting
2958
- case 'a':
2959
- maybePush(result, 'A', inQuote);
2960
- break;
2961
- case 'n':
2962
- case 'N':
2963
- maybePush(result, `***${c}***`, inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
2964
- break;
2965
- case 'V':
2966
- case 'O':
2967
- maybePush(result, 'z', inQuote);
2968
- break;
2969
- case 'x':
2970
- case 'X':
2971
- maybePush(result, 'Z', inQuote);
2972
- break;
2973
- default:
2974
- maybePush(result, c, inQuote);
2975
- }
2976
- prev = c;
2977
- }
2978
- return result.join('');
2699
+ // @dynamic
2700
+ class ActivityService {
2701
+ http;
2702
+ appConfig;
2703
+ sessionStorageService;
2704
+ static get ACTIVITY_VIEW() { return 'view'; }
2705
+ static get ACTIVITY_EDIT() { return 'edit'; }
2706
+ logger = new StructuredLoggerService();
2707
+ constructor(http, appConfig, sessionStorageService) {
2708
+ this.http = http;
2709
+ this.appConfig = appConfig;
2710
+ this.sessionStorageService = sessionStorageService;
2979
2711
  }
2980
- showOnlyDates(dateFormat) {
2981
- // replace 'd' character with 'D' for the moment library
2982
- // This ensures only dates allowed
2983
- while (dateFormat.includes('d')) {
2984
- dateFormat = dateFormat.replace('d', 'D');
2712
+ get isEnabled() {
2713
+ return this.activityUrl() && this.userAuthorised;
2714
+ }
2715
+ static DUMMY_CASE_REFERENCE = '0';
2716
+ userAuthorised = undefined;
2717
+ static handleHttpError(response) {
2718
+ const error = HttpErrorService.convertToHttpError(response);
2719
+ if (response?.status !== error.status) {
2720
+ error.status = response.status;
2985
2721
  }
2986
- while (dateFormat.includes('y')) {
2987
- dateFormat = dateFormat.replace('y', 'Y');
2722
+ return error;
2723
+ }
2724
+ getOptions() {
2725
+ const userDetails = safeJsonParse(this.sessionStorageService.getItem(USER_DETAILS));
2726
+ let headers = new HttpHeaders().set('Content-Type', 'application/json');
2727
+ if (userDetails?.token) {
2728
+ headers = headers.set('Authorization', userDetails.token);
2988
2729
  }
2989
- return dateFormat;
2730
+ return {
2731
+ headers,
2732
+ withCredentials: true,
2733
+ observe: 'body',
2734
+ };
2990
2735
  }
2991
- removeTime(dateFormat) {
2992
- // remove hours irrelevant of whether 12 or 24 hour clock
2993
- while (dateFormat.includes('H') || dateFormat.includes('h')) {
2994
- dateFormat = dateFormat.replace('H', '');
2995
- dateFormat = dateFormat.replace('h', '');
2736
+ getActivities(...caseId) {
2737
+ try {
2738
+ const options = this.getOptions();
2739
+ const url = `${this.activityUrl()}/cases/${caseId.join(',')}/activity`;
2740
+ return this.http
2741
+ .get(url, options, false, ActivityService.handleHttpError)
2742
+ .pipe(map(response => response));
2996
2743
  }
2997
- // remove minutes
2998
- while (dateFormat.includes('m')) {
2999
- dateFormat = dateFormat.replace('m', '');
2744
+ catch (error) {
2745
+ this.logUserMayNotBeAuthenticated(error);
3000
2746
  }
3001
- // remove seconds (s) and micro seconds (S)
3002
- while (dateFormat.includes('S') || dateFormat.includes('s')) {
3003
- dateFormat = dateFormat.replace('S', '');
3004
- dateFormat = dateFormat.replace('s', '');
2747
+ }
2748
+ postActivity(caseId, activity) {
2749
+ try {
2750
+ const options = this.getOptions();
2751
+ const url = `${this.activityUrl()}/cases/${caseId}/activity`;
2752
+ const body = { activity };
2753
+ return this.http
2754
+ .post(url, body, options, false)
2755
+ .pipe(map(response => response));
3005
2756
  }
3006
- // because there is time removal algorithm can make reasonable assumption to remove colons
3007
- while (dateFormat.includes(':')) {
3008
- dateFormat = dateFormat.replace(':', '');
2757
+ catch (error) {
2758
+ this.logUserMayNotBeAuthenticated(error);
3009
2759
  }
3010
- return dateFormat.trim();
3011
- }
3012
- hasDate(value) {
3013
- return this.translate(value).length &&
3014
- value.toLowerCase().indexOf('d') >= 0 &&
3015
- value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3016
- }
3017
- is24Hour(value) {
3018
- return this.translate(value).length &&
3019
- value.indexOf('H') >= 0;
3020
- }
3021
- hasNoDay(value) {
3022
- return this.translate(value).length && value.toLowerCase().indexOf('d') === -1 &&
3023
- value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3024
- }
3025
- hasNoDayAndMonth(value) {
3026
- return this.translate(value).length &&
3027
- value.toLowerCase().indexOf('d') === -1 &&
3028
- value.indexOf('M') === -1 &&
3029
- value.toLowerCase().indexOf('y') >= 0;
3030
2760
  }
3031
- hasHours(value) {
3032
- return this.translate(value).length && value.toLowerCase().indexOf('h') >= 0 && value.indexOf('m') === -1;
2761
+ verifyUserIsAuthorized() {
2762
+ if (this.sessionStorageService.getItem(USER_DETAILS) && this.activityUrl() && this.userAuthorised === undefined) {
2763
+ this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(() => this.userAuthorised = true, error => {
2764
+ this.userAuthorised = [401, 403].indexOf(error.status) <= -1;
2765
+ });
2766
+ }
3033
2767
  }
3034
- hasMinutes(value) {
3035
- return this.translate(value).length && value.indexOf('m') >= 0 && value.toLowerCase().indexOf('h') >= 0;
2768
+ activityUrl() {
2769
+ return this.appConfig.getActivityUrl();
3036
2770
  }
3037
- hasSeconds(value) {
3038
- return this.translate(value).length && value.toLowerCase().indexOf('s') >= 0;
2771
+ logUserMayNotBeAuthenticated(error) {
2772
+ this.logger.error('User may not be authenticated. Activity request was not sent.', { error });
3039
2773
  }
3040
- static ɵfac = function FormatTranslatorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormatTranslatorService)(); };
3041
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormatTranslatorService, factory: FormatTranslatorService.ɵfac });
2774
+ static ɵfac = function ActivityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(SessionStorageService)); };
2775
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac });
3042
2776
  }
3043
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormatTranslatorService, [{
2777
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
3044
2778
  type: Injectable
3045
- }], null, null); })();
2779
+ }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: SessionStorageService }], null); })();
3046
2780
 
3047
- class DatePipe {
3048
- formatTrans;
3049
- 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)?$');
3050
- // 1 2 3 4 5 6 7 8 9 10 11
3051
- static MONTHS = [
3052
- ['Jan'], ['Feb'], ['Mar'], ['Apr'], ['May'], ['Jun'], ['Jul'], ['Aug'], ['Sep'], ['Oct'], ['Nov'], ['Dec'],
3053
- ];
3054
- /**
3055
- * constructor to allow format translator to be injected
3056
- * @param formatTrans format translator
3057
- */
3058
- constructor(formatTrans) {
3059
- this.formatTrans = formatTrans;
2781
+ // @dynamic
2782
+ class ActivityPollingService {
2783
+ activityService;
2784
+ ngZone;
2785
+ config;
2786
+ logger = new StructuredLoggerService();
2787
+ pendingRequests = new Map();
2788
+ currentTimeoutHandle;
2789
+ pollActivitiesSubscription;
2790
+ pollConfig;
2791
+ batchCollectionDelayMs;
2792
+ maxRequestsPerBatch;
2793
+ constructor(activityService, ngZone, config) {
2794
+ this.activityService = activityService;
2795
+ this.ngZone = ngZone;
2796
+ this.config = config;
2797
+ this.pollConfig = {
2798
+ interval: config.getActivityNexPollRequestMs(),
2799
+ attempts: config.getActivityRetry()
2800
+ };
2801
+ this.batchCollectionDelayMs = config.getActivityBatchCollectionDelayMs();
2802
+ this.maxRequestsPerBatch = config.getActivityMaxRequestPerBatch();
3060
2803
  }
3061
- transform(value, zone, format) {
3062
- let resultDate = null;
3063
- const ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
3064
- if (value) {
3065
- // included to avoid editing the hour twice on second pass through
3066
- // this occurs on case details when datepipe is applied twice
3067
- if (!value.includes('T')) {
3068
- zone = 'utc';
3069
- }
3070
- const match = value.match(DatePipe.DATE_FORMAT_REGEXP);
3071
- // Make sure we actually have a match.
3072
- if (match) {
3073
- let offsetDate = null;
3074
- const date = this.getDate(match);
3075
- if (zone === 'local') {
3076
- offsetDate = this.getOffsetDate(date);
3077
- }
3078
- else {
3079
- offsetDate = this.getDate(match);
3080
- }
3081
- // 'short' format is meaningful to formatDate, but not the same meaning as in the unit tests
3082
- if (this.formatTrans && format && format !== 'short') {
3083
- // support for java style formatting strings for dates
3084
- format = this.translateDateFormat(format);
3085
- resultDate = moment(offsetDate).format(format);
3086
- }
3087
- else {
3088
- // RDM-1149 changed the pipe logic so that it doesn't add an hour to 'Summer Time' dates on DateTime field type
3089
- resultDate = `${offsetDate.getDate()} ${DatePipe.MONTHS[offsetDate.getMonth()]} ${offsetDate.getFullYear()}`;
3090
- if (match[4] && match[5] && match[6] && format !== 'short') {
3091
- resultDate += ', ';
3092
- resultDate += `${this.getHour(offsetDate.getHours().toString())}:`;
3093
- resultDate += `${this.pad(offsetDate.getMinutes())}:`;
3094
- resultDate += `${this.pad(offsetDate.getSeconds())} `;
3095
- resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
3096
- }
3097
- }
3098
- }
3099
- else {
3100
- // EUI-2667. See if what we've been given is actually a formatted date that
3101
- // we could attempt to do something with.
3102
- const parsedDate = Date.parse(value);
3103
- // We successfully parsed it so let's use it.
3104
- if (!isNaN(parsedDate)) {
3105
- const d = new Date(parsedDate);
3106
- // If what we received didn't include time, don't include it here either.
3107
- if (value.indexOf(':') < 0) {
3108
- const shortDate = d.toLocaleDateString('en-GB');
3109
- const shortISO = shortDate.split('/').reverse().join('-');
3110
- return this.transform(shortISO, zone, format);
3111
- }
3112
- // If it did include time, we want a full ISO string.
3113
- const thisMoment = moment(d).format(ISO_FORMAT);
3114
- return this.transform(thisMoment, zone, format);
3115
- }
3116
- }
3117
- }
3118
- return resultDate;
2804
+ get isEnabled() {
2805
+ return this.activityService.isEnabled;
3119
2806
  }
3120
- translateDateFormat(format) {
3121
- if (this.formatTrans) {
3122
- return this.formatTrans.translate(format);
2807
+ subscribeToActivity(caseId, done) {
2808
+ if (!this.isEnabled) {
2809
+ return new Subject();
2810
+ }
2811
+ let subject = this.pendingRequests.get(caseId);
2812
+ if (subject) {
2813
+ subject.subscribe(done);
3123
2814
  }
3124
2815
  else {
3125
- return format;
2816
+ // Only the first pending request should start the batch collection timer.
2817
+ const wasEmpty = this.pendingRequests.size === 0;
2818
+ subject = new Subject();
2819
+ subject.subscribe(done);
2820
+ this.addPendingRequest(caseId, subject);
2821
+ if (wasEmpty) {
2822
+ this.ngZone.runOutsideAngular(() => {
2823
+ this.currentTimeoutHandle = setTimeout(() => this.ngZone.run(() => {
2824
+ this.flushRequests();
2825
+ }), this.batchCollectionDelayMs);
2826
+ });
2827
+ }
3126
2828
  }
3127
- }
3128
- getOffsetDate(date) {
3129
- const localOffset = -date.getTimezoneOffset() / 60;
3130
- return new Date(date.getTime() + localOffset * 3600 * 1000);
3131
- }
3132
- getDate(match) {
3133
- const year = this.toInt(match[1]);
3134
- const month = this.toInt(match[2]) - 1;
3135
- const day = this.toInt(match[3]);
3136
- let resultDate;
3137
- if (match[4] && match[5] && match[6]) {
3138
- const hour = this.toInt(match[4]);
3139
- const minutes = this.toInt(match[5]);
3140
- const seconds = this.toInt(match[6]);
3141
- resultDate = new Date(year, month, day, hour, minutes, seconds, 0);
2829
+ if (this.pendingRequests.size >= this.maxRequestsPerBatch) {
2830
+ this.flushRequests();
3142
2831
  }
3143
- else {
3144
- resultDate = new Date(year, month, day);
2832
+ return subject;
2833
+ }
2834
+ stopPolling() {
2835
+ if (this.pollActivitiesSubscription) {
2836
+ this.pollActivitiesSubscription.unsubscribe();
3145
2837
  }
3146
- return resultDate;
3147
2838
  }
3148
- getHour(hourStr) {
3149
- let hourNum = this.toInt(hourStr);
3150
- if (hourNum > 12) {
3151
- hourNum = hourNum - 12;
2839
+ flushRequests() {
2840
+ if (this.currentTimeoutHandle) {
2841
+ clearTimeout(this.currentTimeoutHandle);
2842
+ this.currentTimeoutHandle = undefined;
3152
2843
  }
3153
- else if (hourNum === 0) {
3154
- hourNum = 12;
2844
+ if (!this.pendingRequests.size) {
2845
+ return;
3155
2846
  }
3156
- return hourNum;
2847
+ const requests = new Map(this.pendingRequests);
2848
+ this.pendingRequests.clear();
2849
+ this.performBatchRequest(requests);
3157
2850
  }
3158
- toInt(str) {
3159
- return parseInt(str, 10);
2851
+ pollActivities(...caseIds) {
2852
+ if (!this.isEnabled) {
2853
+ return EMPTY;
2854
+ }
2855
+ return this.polling(this.activityService.getActivities(...caseIds), this.pollConfig);
3160
2856
  }
3161
- pad(num, padNum = 2) {
3162
- const val = num !== undefined ? num.toString() : '';
3163
- return val.length >= padNum ? val : new Array(padNum - val.length + 1).join('0') + val;
2857
+ postViewActivity(caseId) {
2858
+ return this.postActivity(caseId, ActivityService.ACTIVITY_VIEW);
3164
2859
  }
3165
- static ɵfac = function DatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(FormatTranslatorService, 16)); };
3166
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDate", type: DatePipe, pure: true, standalone: false });
3167
- }
3168
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{
3169
- type: Pipe,
3170
- args: [{
3171
- name: 'ccdDate',
3172
- standalone: false
3173
- }]
3174
- }], () => [{ type: FormatTranslatorService }], null); })();
3175
-
3176
- class FieldLabelPipe {
3177
- rpxTranslationPipe;
3178
- constructor(rpxTranslationPipe) {
3179
- this.rpxTranslationPipe = rpxTranslationPipe;
2860
+ postEditActivity(caseId) {
2861
+ return this.postActivity(caseId, ActivityService.ACTIVITY_EDIT);
3180
2862
  }
3181
- transform(field) {
3182
- if (!field || !field.label) {
3183
- return '';
3184
- }
3185
- else if (!field.display_context) {
3186
- return this.getTranslatedLabel(field);
3187
- }
3188
- return this.getTranslatedLabel(field) + (field.display_context.toUpperCase() === 'OPTIONAL' ?
3189
- ' (' + this.rpxTranslationPipe.transform('Optional') + ')' : '');
2863
+ performBatchRequest(requests) {
2864
+ const caseIds = Array.from(requests.keys()).join();
2865
+ this.ngZone.runOutsideAngular(() => {
2866
+ // run polling outside angular zone so it does not trigger change detection
2867
+ this.pollActivitiesSubscription = this.pollActivities(caseIds).subscribe({
2868
+ // process activity inside zone so it triggers change detection for activity.component.ts
2869
+ next: (activities) => this.ngZone.run(() => {
2870
+ activities.forEach((activity) => {
2871
+ // Ignore activities returned for cases outside this local batch.
2872
+ requests.get(activity.caseId)?.next(activity);
2873
+ });
2874
+ }),
2875
+ error: (err) => this.ngZone.run(() => {
2876
+ this.logger.error('Error while polling activities.', { error: err });
2877
+ Array.from(requests.values()).forEach((subject) => subject.error(err));
2878
+ })
2879
+ });
2880
+ });
3190
2881
  }
3191
- getTranslatedLabel(field) {
3192
- if (!field.isTranslated) {
3193
- return this.rpxTranslationPipe.transform(field.label);
3194
- }
3195
- else {
3196
- return field.label;
2882
+ postActivity(caseId, activityType) {
2883
+ if (!this.isEnabled) {
2884
+ return EMPTY;
3197
2885
  }
2886
+ const pollingConfig = {
2887
+ ...this.pollConfig,
2888
+ interval: 5000 // inline with CCD Backend
2889
+ };
2890
+ return this.polling(this.activityService.postActivity(caseId, activityType), pollingConfig);
3198
2891
  }
3199
- getOriginalLabelForYesNoTranslation(field) {
3200
- return field.originalLabel || field.label;
3201
- }
3202
- static ɵfac = function FieldLabelPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FieldLabelPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslatePipe, 16)); };
3203
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFieldLabel", type: FieldLabelPipe, pure: false, standalone: false });
3204
- }
3205
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldLabelPipe, [{
3206
- type: Pipe,
3207
- args: [{
3208
- name: 'ccdFieldLabel',
3209
- pure: false,
3210
- standalone: false
3211
- }]
3212
- }], () => [{ type: i1.RpxTranslatePipe }], null); })();
3213
-
3214
- class FirstErrorPipe {
3215
- rpxTranslationService;
3216
- injector;
3217
- asyncPipe;
3218
- constructor(rpxTranslationService, injector) {
3219
- this.rpxTranslationService = rpxTranslationService;
3220
- this.injector = injector;
3221
- this.asyncPipe = new AsyncPipe(this.injector.get(ChangeDetectorRef));
2892
+ addPendingRequest(caseId, subject) {
2893
+ this.pendingRequests.set(caseId, subject);
2894
+ // Components complete their returned Subject on destroy; remove it so a later same-case subscription gets a fresh Subject.
2895
+ subject.subscribe({
2896
+ complete: () => this.removePendingRequest(caseId, subject),
2897
+ error: () => this.removePendingRequest(caseId, subject)
2898
+ });
3222
2899
  }
3223
- transform(value, args) {
3224
- if (!value) {
3225
- return '';
3226
- }
3227
- if (!args) {
3228
- args = 'Field';
3229
- }
3230
- const keys = Object.keys(value);
3231
- if (!keys.length) {
3232
- return '';
3233
- }
3234
- let errorMessage;
3235
- if (keys[0] === 'required') {
3236
- errorMessage = '%FIELDLABEL% is required';
3237
- }
3238
- else if (keys[0] === 'pattern') {
3239
- errorMessage = 'The data entered is not valid for %FIELDLABEL%';
3240
- }
3241
- else if (keys[0] === 'markDownPattern') {
3242
- errorMessage = 'The data entered is not valid for %FIELDLABEL%. Link mark up characters are not allowed in this field';
3243
- }
3244
- else if (keys[0] === 'minlength') {
3245
- errorMessage = '%FIELDLABEL% is below the minimum length';
3246
- }
3247
- else if (keys[0] === 'maxlength') {
3248
- errorMessage = '%FIELDLABEL% exceeds the maximum length';
3249
- }
3250
- else if (value.hasOwnProperty('matDatetimePickerParse')) {
3251
- errorMessage = 'The date entered is not valid. Please provide a valid date';
2900
+ removePendingRequest(caseId, subject) {
2901
+ if (this.pendingRequests.get(caseId) !== subject) {
2902
+ return;
3252
2903
  }
3253
- else {
3254
- errorMessage = value[keys[0]];
2904
+ this.pendingRequests.delete(caseId);
2905
+ if (!this.pendingRequests.size && this.currentTimeoutHandle) {
2906
+ clearTimeout(this.currentTimeoutHandle);
2907
+ this.currentTimeoutHandle = undefined;
3255
2908
  }
3256
- const o = this.rpxTranslationService.getTranslation$(args).pipe(switchMap(fieldLabel => this.rpxTranslationService.getTranslationWithReplacements$(errorMessage, { FIELDLABEL: fieldLabel })));
3257
- return this.asyncPipe.transform(o);
3258
2909
  }
3259
- ngOnDestroy() {
3260
- this.asyncPipe.ngOnDestroy();
2910
+ polling(request$, options) {
2911
+ const pollingOptions = {
2912
+ interval: options.interval,
2913
+ attempts: options.attempts ?? 9,
2914
+ exponentialUnit: options.exponentialUnit ?? 1000
2915
+ };
2916
+ return concat(request$, defer(() => timer(pollingOptions.interval).pipe(switchMap(() => request$))).pipe(repeat())).pipe(
2917
+ // Preserve consecutive-failure retry behaviour using the current RxJS retry config.
2918
+ retry({
2919
+ count: pollingOptions.attempts,
2920
+ delay: (_error, retryCount) => timer(this.getExponentialRetryDelay(retryCount, pollingOptions.exponentialUnit)),
2921
+ resetOnSuccess: true
2922
+ }));
3261
2923
  }
3262
- static ɵfac = function FirstErrorPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FirstErrorPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslationService, 16), i0.ɵɵdirectiveInject(i0.Injector, 16)); };
3263
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFirstError", type: FirstErrorPipe, pure: false, standalone: false });
3264
- }
3265
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FirstErrorPipe, [{
3266
- type: Pipe,
3267
- args: [{
3268
- name: 'ccdFirstError',
3269
- pure: false,
3270
- standalone: false
3271
- }]
3272
- }], () => [{ type: i1.RpxTranslationService }, { type: i0.Injector }], null); })();
3273
-
3274
- class IsCompoundPipe {
3275
- static COMPOUND_TYPES = [
3276
- 'Complex',
3277
- 'Label',
3278
- 'AddressGlobal',
3279
- 'AddressUK',
3280
- 'AddressGlobalUK',
3281
- 'CasePaymentHistoryViewer',
3282
- 'CaseHistoryViewer',
3283
- 'Organisation',
3284
- 'WaysToPay',
3285
- 'ComponentLauncher',
3286
- 'FlagLauncher',
3287
- 'CaseFlag'
3288
- ];
3289
- static EXCLUDE = [
3290
- 'CaseLink',
3291
- 'JudicialUser'
3292
- ];
3293
- transform(field) {
3294
- if (!field || !field.field_type || !field.field_type.type) {
3295
- return false;
3296
- }
3297
- if (IsCompoundPipe.COMPOUND_TYPES.indexOf(field.field_type.type) !== -1) {
3298
- if (IsCompoundPipe.EXCLUDE.indexOf(field.field_type.id) !== -1) {
3299
- return false;
3300
- }
3301
- return true;
3302
- }
3303
- return false;
2924
+ getExponentialRetryDelay(consecutiveErrorsCount, exponentialUnit) {
2925
+ return Math.pow(2, consecutiveErrorsCount - 1) * exponentialUnit;
3304
2926
  }
3305
- static ɵfac = function IsCompoundPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsCompoundPipe)(); };
3306
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsCompound", type: IsCompoundPipe, pure: true, standalone: false });
2927
+ static ɵfac = function ActivityPollingService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityPollingService)(i0.ɵɵinject(ActivityService), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(AbstractAppConfig)); };
2928
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityPollingService, factory: ActivityPollingService.ɵfac });
3307
2929
  }
3308
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsCompoundPipe, [{
3309
- type: Pipe,
3310
- args: [{
3311
- name: 'ccdIsCompound',
3312
- standalone: false
3313
- }]
3314
- }], null, null); })();
2930
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityPollingService, [{
2931
+ type: Injectable
2932
+ }], () => [{ type: ActivityService }, { type: i0.NgZone }, { type: AbstractAppConfig }], null); })();
3315
2933
 
3316
- class CaseFieldService {
3317
- isOptional(field) {
3318
- if (!field || !field.display_context) {
3319
- return false;
3320
- }
3321
- return field.display_context.toUpperCase() === 'OPTIONAL';
3322
- }
3323
- isReadOnly(field) {
3324
- if (!field || !field.display_context) {
3325
- return false;
3326
- }
3327
- return field.display_context.toUpperCase() === 'READONLY';
2934
+ function ActivityComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2935
+ i0.ɵɵelementStart(0, "div");
2936
+ i0.ɵɵelement(1, "ccd-activity-icon", 5);
2937
+ i0.ɵɵpipe(2, "rpxTranslate");
2938
+ i0.ɵɵelementEnd();
2939
+ } if (rf & 2) {
2940
+ const ctx_r0 = i0.ɵɵnextContext(2);
2941
+ i0.ɵɵclassProp("activityEditorsAndViewersIcons", ctx_r0.viewersPresent())("activityEditorsIcon", !ctx_r0.viewersPresent());
2942
+ i0.ɵɵadvance();
2943
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 5, ctx_r0.editorsText));
2944
+ } }
2945
+ function ActivityComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
2946
+ i0.ɵɵelementStart(0, "div", 6);
2947
+ i0.ɵɵelement(1, "ccd-activity-icon", 7);
2948
+ i0.ɵɵpipe(2, "rpxTranslate");
2949
+ i0.ɵɵelementEnd();
2950
+ } if (rf & 2) {
2951
+ const ctx_r0 = i0.ɵɵnextContext(2);
2952
+ i0.ɵɵadvance();
2953
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2954
+ } }
2955
+ function ActivityComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
2956
+ i0.ɵɵelementStart(0, "div");
2957
+ i0.ɵɵelement(1, "ccd-activity-banner", 8);
2958
+ i0.ɵɵpipe(2, "rpxTranslate");
2959
+ i0.ɵɵelementEnd();
2960
+ } if (rf & 2) {
2961
+ const ctx_r0 = i0.ɵɵnextContext(2);
2962
+ i0.ɵɵadvance();
2963
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.editorsText));
2964
+ } }
2965
+ function ActivityComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
2966
+ i0.ɵɵelementStart(0, "div");
2967
+ i0.ɵɵelement(1, "ccd-activity-banner", 9);
2968
+ i0.ɵɵpipe(2, "rpxTranslate");
2969
+ i0.ɵɵelementEnd();
2970
+ } if (rf & 2) {
2971
+ const ctx_r0 = i0.ɵɵnextContext(2);
2972
+ i0.ɵɵadvance();
2973
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2974
+ } }
2975
+ function ActivityComponent_div_0_Template(rf, ctx) { if (rf & 1) {
2976
+ i0.ɵɵelementStart(0, "div", 1);
2977
+ 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);
2978
+ i0.ɵɵelementEnd();
2979
+ } if (rf & 2) {
2980
+ const ctx_r0 = i0.ɵɵnextContext();
2981
+ i0.ɵɵadvance();
2982
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.editorsPresent());
2983
+ i0.ɵɵadvance();
2984
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.viewersPresent());
2985
+ i0.ɵɵadvance();
2986
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.editorsPresent());
2987
+ i0.ɵɵadvance();
2988
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.viewersPresent());
2989
+ } }
2990
+ class ActivityComponent {
2991
+ activityPollingService;
2992
+ activity;
2993
+ dspMode = DisplayMode;
2994
+ viewersText;
2995
+ editorsText;
2996
+ subscription;
2997
+ caseId;
2998
+ displayMode;
2999
+ VIEWERS_PREFIX = '';
3000
+ VIEWERS_SUFFIX = 'viewing this case';
3001
+ EDITORS_PREFIX = 'This case is being updated by ';
3002
+ EDITORS_SUFFIX = '';
3003
+ constructor(activityPollingService) {
3004
+ this.activityPollingService = activityPollingService;
3328
3005
  }
3329
- isMandatory(field) {
3330
- if (!field || !field.display_context) {
3331
- return false;
3332
- }
3333
- return field.display_context.toUpperCase() === 'MANDATORY';
3006
+ ngOnInit() {
3007
+ this.activity = new Activity();
3008
+ this.activity.caseId = this.caseId;
3009
+ this.activity.editors = [];
3010
+ this.activity.unknownEditors = 0;
3011
+ this.activity.viewers = [];
3012
+ this.activity.unknownViewers = 0;
3013
+ this.viewersText = '';
3014
+ this.editorsText = '';
3015
+ this.subscription = this.activityPollingService.subscribeToActivity(this.caseId, newActivity => this.onActivityChange(newActivity));
3334
3016
  }
3335
- isLabel(field) {
3336
- if (!field || !field.field_type) {
3337
- return false;
3338
- }
3339
- return field.field_type.type === 'Label';
3017
+ onActivityChange(newActivity) {
3018
+ this.activity = newActivity;
3019
+ this.viewersText = this.generateDescription(this.VIEWERS_PREFIX, this.VIEWERS_SUFFIX, this.activity.viewers, this.activity.unknownViewers);
3020
+ this.editorsText = this.generateDescription(this.EDITORS_PREFIX, this.EDITORS_SUFFIX, this.activity.editors, this.activity.unknownEditors);
3340
3021
  }
3341
- static ɵfac = function CaseFieldService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFieldService)(); };
3342
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFieldService, factory: CaseFieldService.ɵfac });
3343
- }
3344
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFieldService, [{
3345
- type: Injectable
3346
- }], null, null); })();
3347
-
3348
- class IsMandatoryPipe {
3349
- caseFieldService;
3350
- constructor(caseFieldService) {
3351
- this.caseFieldService = caseFieldService;
3022
+ isActivityEnabled() {
3023
+ return this.activityPollingService.isEnabled;
3352
3024
  }
3353
- transform(field) {
3354
- return this.caseFieldService.isMandatory(field);
3025
+ isActiveCase() {
3026
+ return this.activity.editors.length || this.activity.viewers.length || this.activity.unknownEditors || this.activity.unknownViewers;
3355
3027
  }
3356
- static ɵfac = function IsMandatoryPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsMandatoryPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3357
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsMandatory", type: IsMandatoryPipe, pure: true, standalone: false });
3358
- }
3359
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsMandatoryPipe, [{
3360
- type: Pipe,
3361
- args: [{
3362
- name: 'ccdIsMandatory',
3363
- standalone: false
3364
- }]
3365
- }], () => [{ type: CaseFieldService }], null); })();
3366
-
3367
- class IsReadOnlyPipe {
3368
- caseFieldService;
3369
- constructor(caseFieldService) {
3370
- this.caseFieldService = caseFieldService;
3028
+ viewersPresent() {
3029
+ return (this.activity.viewers.length > 0 || this.activity.unknownViewers > 0);
3371
3030
  }
3372
- transform(field) {
3373
- return this.caseFieldService.isReadOnly(field);
3031
+ editorsPresent() {
3032
+ return (this.activity.editors.length > 0 || this.activity.unknownEditors > 0);
3374
3033
  }
3375
- static ɵfac = function IsReadOnlyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3376
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnly", type: IsReadOnlyPipe, pure: true, standalone: false });
3377
- }
3378
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyPipe, [{
3379
- type: Pipe,
3380
- args: [{
3381
- name: 'ccdIsReadOnly',
3382
- standalone: false
3383
- }]
3384
- }], () => [{ type: CaseFieldService }], null); })();
3385
-
3386
- class IsReadOnlyAndNotCollectionPipe {
3387
- caseFieldService;
3388
- constructor(caseFieldService) {
3389
- this.caseFieldService = caseFieldService;
3034
+ ngOnDestroy() {
3035
+ if (this.subscription) {
3036
+ this.subscription.complete();
3037
+ }
3038
+ this.activityPollingService.stopPolling();
3390
3039
  }
3391
- transform(field) {
3392
- if (!field || !field.field_type || !field.field_type.type) {
3393
- return false;
3040
+ generateDescription(prefix, suffix, namesArray, unknownCount) {
3041
+ let resultText = prefix;
3042
+ resultText += namesArray.map(activityInfo => `${activityInfo.forename} ${activityInfo.surname}`).join(', ');
3043
+ if (unknownCount > 0) {
3044
+ resultText += (namesArray.length > 0 ? ` and ${unknownCount} other` : `${unknownCount} user`);
3045
+ resultText += (unknownCount > 1 ? 's' : '');
3394
3046
  }
3395
- if (this.isCollection(field)) {
3396
- return false;
3047
+ else {
3048
+ resultText = this.replaceLastCommaWithAnd(resultText);
3397
3049
  }
3398
- return this.caseFieldService.isReadOnly(field);
3050
+ if (suffix.length > 0) {
3051
+ if (namesArray.length + unknownCount > 1) {
3052
+ resultText += ` are ${suffix}`;
3053
+ }
3054
+ else {
3055
+ resultText += ` is ${suffix}`;
3056
+ }
3057
+ }
3058
+ return resultText;
3399
3059
  }
3400
- // CaseField @Expose() doesn't work with the pipe in here, so leaving the manual check
3401
- isCollection(field) {
3402
- return field.field_type && field.field_type.type === 'Collection';
3060
+ replaceLastCommaWithAnd(str) {
3061
+ return str.trim().replace(/,([^,]*)$/, ' and $1').split(' ').join(' ');
3403
3062
  }
3404
- static ɵfac = function IsReadOnlyAndNotCollectionPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyAndNotCollectionPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3405
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnlyAndNotCollection", type: IsReadOnlyAndNotCollectionPipe, pure: true, standalone: false });
3063
+ static ɵfac = function ActivityComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityComponent)(i0.ɵɵdirectiveInject(ActivityPollingService)); };
3064
+ 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) {
3065
+ i0.ɵɵtemplate(0, ActivityComponent_div_0_Template, 5, 4, "div", 0);
3066
+ } if (rf & 2) {
3067
+ i0.ɵɵproperty("ngIf", ctx.isActivityEnabled());
3068
+ } }, dependencies: [i4.NgIf, ActivityBannerComponent, ActivityIconComponent, i1.RpxTranslatePipe], styles: [".activityEditorsIcon[_ngcontent-%COMP%]{margin-left:14px}.activityEditorsAndViewersIcons[_ngcontent-%COMP%], .activityViewersIcon[_ngcontent-%COMP%]{float:left;margin-left:14px}"] });
3406
3069
  }
3407
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyAndNotCollectionPipe, [{
3408
- type: Pipe,
3409
- args: [{
3410
- name: 'ccdIsReadOnlyAndNotCollection',
3411
- standalone: false
3412
- }]
3413
- }], () => [{ type: CaseFieldService }], null); })();
3070
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityComponent, [{
3071
+ type: Component,
3072
+ 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"] }]
3073
+ }], () => [{ type: ActivityPollingService }], { caseId: [{
3074
+ type: Input
3075
+ }], displayMode: [{
3076
+ type: Input
3077
+ }] }); })();
3078
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ActivityComponent, { className: "ActivityComponent", filePath: "lib/shared/components/activity/activity.component.ts", lineNumber: 12 }); })();
3414
3079
 
3415
- class PaletteUtilsModule {
3416
- static ɵfac = function PaletteUtilsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PaletteUtilsModule)(); };
3417
- static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaletteUtilsModule });
3080
+ class ActivityModule {
3081
+ static ɵfac = function ActivityModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityModule)(); };
3082
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ActivityModule });
3418
3083
  static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
3419
- IsCompoundPipe,
3420
- RpxTranslatePipe
3084
+ ActivityService,
3085
+ ActivityPollingService,
3086
+ SessionStorageService,
3421
3087
  ], imports: [CommonModule,
3088
+ RouterModule,
3422
3089
  RpxTranslationModule.forChild()] });
3423
3090
  }
3424
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaletteUtilsModule, [{
3091
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityModule, [{
3425
3092
  type: NgModule,
3426
3093
  args: [{
3427
3094
  imports: [
3428
3095
  CommonModule,
3096
+ RouterModule,
3429
3097
  RpxTranslationModule.forChild()
3430
3098
  ],
3431
3099
  declarations: [
3432
- DatePipe,
3433
- FieldLabelPipe,
3434
- FirstErrorPipe,
3435
- IsCompoundPipe,
3436
- IsMandatoryPipe,
3437
- IsReadOnlyPipe,
3438
- IsReadOnlyAndNotCollectionPipe,
3439
- DashPipe
3100
+ ActivityComponent,
3101
+ ActivityBannerComponent,
3102
+ ActivityIconComponent,
3440
3103
  ],
3441
3104
  exports: [
3442
- DatePipe,
3443
- FieldLabelPipe,
3444
- FirstErrorPipe,
3445
- IsCompoundPipe,
3446
- IsMandatoryPipe,
3447
- IsReadOnlyPipe,
3448
- IsReadOnlyAndNotCollectionPipe,
3449
- DashPipe
3105
+ ActivityComponent,
3106
+ ActivityBannerComponent,
3107
+ ActivityIconComponent,
3450
3108
  ],
3451
3109
  providers: [
3452
- IsCompoundPipe,
3453
- RpxTranslatePipe
3110
+ ActivityService,
3111
+ ActivityPollingService,
3112
+ SessionStorageService,
3454
3113
  ]
3455
3114
  }]
3456
3115
  }], null, null); })();
3457
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaletteUtilsModule, { declarations: [DatePipe,
3458
- FieldLabelPipe,
3459
- FirstErrorPipe,
3460
- IsCompoundPipe,
3461
- IsMandatoryPipe,
3462
- IsReadOnlyPipe,
3463
- IsReadOnlyAndNotCollectionPipe,
3464
- DashPipe], imports: [CommonModule, i1.RpxTranslationModule], exports: [DatePipe,
3465
- FieldLabelPipe,
3466
- FirstErrorPipe,
3467
- IsCompoundPipe,
3468
- IsMandatoryPipe,
3469
- IsReadOnlyPipe,
3470
- IsReadOnlyAndNotCollectionPipe,
3471
- DashPipe] }); })();
3472
-
3473
- // tslint:disable:variable-name
3474
- class AddressModel {
3475
- AddressLine1 = '';
3476
- AddressLine2 = '';
3477
- AddressLine3 = '';
3478
- PostTown = '';
3479
- County = '';
3480
- PostCode = '';
3481
- Country = '';
3482
- }
3116
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ActivityModule, { declarations: [ActivityComponent,
3117
+ ActivityBannerComponent,
3118
+ ActivityIconComponent], imports: [CommonModule,
3119
+ RouterModule, i1.RpxTranslationModule], exports: [ActivityComponent,
3120
+ ActivityBannerComponent,
3121
+ ActivityIconComponent] }); })();
3483
3122
 
3484
- class Alert {
3485
- level;
3123
+ class AlertService {
3124
+ router;
3125
+ rpxTranslationService;
3126
+ // the preserved messages
3127
+ preservedError = '';
3128
+ preservedWarning = '';
3129
+ preservedSuccess = '';
3130
+ // TODO: Remove
3486
3131
  message;
3487
- }
3488
-
3489
- // tslint:disable:variable-name
3490
- class CaseDetails {
3491
- id;
3492
- jurisdiction;
3493
- case_type_id;
3494
- state;
3495
- created_date;
3496
- last_modified;
3497
- locked_by_user_id;
3498
- security_level;
3499
- case_data;
3500
- }
3501
-
3502
- // tslint:disable:variable-name
3503
- class CaseEventData {
3504
- event;
3505
- data;
3506
- event_data; // full event data
3507
- event_token;
3508
- ignore_warning;
3509
- draft_id;
3510
- case_reference;
3511
- }
3512
-
3513
- class WizardPageField {
3514
- case_field_id;
3515
- order;
3516
- page_column_no;
3517
- complex_field_overrides;
3518
- }
3519
-
3520
- class FixedListItem {
3521
- code;
3522
- label;
3523
- order;
3524
- }
3525
-
3526
- // @dynamic
3527
- class FieldType {
3528
- id;
3529
- type;
3530
- min;
3531
- max;
3532
- regular_expression;
3533
- fixed_list_items;
3534
- complex_fields;
3535
- collection_field_type;
3536
- }
3537
- __decorate([
3538
- Type(() => FixedListItem),
3539
- __metadata("design:type", Array)
3540
- ], FieldType.prototype, "fixed_list_items", void 0);
3541
- __decorate([
3542
- Type(() => CaseField),
3543
- __metadata("design:type", Array)
3544
- ], FieldType.prototype, "complex_fields", void 0);
3545
- __decorate([
3546
- Type(() => FieldType),
3547
- __metadata("design:type", FieldType)
3548
- ], FieldType.prototype, "collection_field_type", void 0);
3549
-
3550
- // @dynamic
3551
- class CaseField {
3552
- static logger = new StructuredLoggerService();
3553
- id;
3554
- hidden;
3555
- hiddenCannotChange;
3556
- label;
3557
- originalLabel;
3558
- noCacheLabel;
3559
- order;
3560
- parent;
3561
- field_type;
3562
- hint_text;
3563
- security_label;
3564
- display_context;
3565
- display_context_parameter;
3566
- month_format;
3567
- show_condition;
3568
- show_summary_change_option;
3569
- show_summary_content_option;
3570
- acls;
3571
- metadata;
3572
- formatted_value;
3573
- retain_hidden_value;
3574
- wizardProps;
3575
- _value;
3576
- _list_items = [];
3577
- isTranslatedFlag = false;
3578
- get value() {
3579
- if (this.field_type && (this.field_type.type === 'DynamicList' || this.field_type.type === 'DynamicRadioList')) {
3580
- return this._value && this._value.value ? this._value.value.code : this._value;
3581
- }
3582
- else if (this.field_type && this.field_type.type === 'DynamicMultiSelectList') {
3583
- return this._value && this._value.value ? this._value.value : this._value;
3584
- }
3585
- else {
3586
- return this._value;
3587
- }
3588
- }
3589
- set value(value) {
3590
- if (this.isDynamic()) {
3591
- if (value && value instanceof Object && value.list_items) {
3592
- this._list_items = value.list_items;
3593
- }
3594
- else if (!this._list_items || this._list_items.length === 0) {
3595
- // Extract the list items from the current value if that's the only place they exist.
3596
- this._list_items = this.list_items;
3597
- if (!value || !value.value) {
3598
- value = null;
3132
+ level;
3133
+ successes;
3134
+ errors;
3135
+ warnings;
3136
+ // TODO: Remove
3137
+ alerts;
3138
+ successObserver;
3139
+ errorObserver;
3140
+ warningObserver;
3141
+ // TODO: Remove
3142
+ alertObserver;
3143
+ preserveAlerts = false;
3144
+ constructor(router, rpxTranslationService) {
3145
+ this.router = router;
3146
+ this.rpxTranslationService = rpxTranslationService;
3147
+ this.successes = Observable
3148
+ .create(observer => this.successObserver = observer).pipe(publish(), refCount());
3149
+ this.successes.subscribe();
3150
+ this.errors = Observable
3151
+ .create(observer => this.errorObserver = observer).pipe(publish(), refCount());
3152
+ this.errors.subscribe();
3153
+ this.warnings = Observable
3154
+ .create(observer => this.warningObserver = observer).pipe(publish(), refCount());
3155
+ this.warnings.subscribe();
3156
+ // TODO: Remove
3157
+ this.alerts = Observable
3158
+ .create(observer => this.alertObserver = observer).pipe(publish(), refCount());
3159
+ this.alerts.subscribe();
3160
+ this.router
3161
+ .events
3162
+ .subscribe(event => {
3163
+ if (event instanceof NavigationStart) {
3164
+ // if there is no longer a preserve alerts setting for the page then clear all observers and preserved messages
3165
+ if (!this.preserveAlerts) {
3166
+ this.clear();
3599
3167
  }
3168
+ // if not, then set the preserving of alerts to false so rendering to a new page
3169
+ this.preserveAlerts = false;
3600
3170
  }
3601
- }
3602
- this._value = value;
3171
+ });
3603
3172
  }
3604
- get list_items() {
3605
- if (this.isDynamic()) {
3606
- return this._value && this._value.list_items ? this._value.list_items : this._list_items;
3607
- }
3608
- else {
3609
- return this.field_type.fixed_list_items;
3610
- }
3173
+ clear() {
3174
+ this.successObserver.next(null);
3175
+ this.errorObserver.next(null);
3176
+ this.warningObserver.next(null);
3177
+ this.preservedError = '';
3178
+ this.preservedWarning = '';
3179
+ this.preservedSuccess = '';
3180
+ // EUI-3381.
3181
+ this.alertObserver.next(null);
3182
+ this.message = '';
3611
3183
  }
3612
- set list_items(items) {
3613
- if ((items && !this._list_items) || (items?.length > this._list_items?.length)) {
3614
- this._list_items = items;
3615
- }
3184
+ error({ phrase, replacements }) {
3185
+ const message = this.getTranslationWithReplacements(phrase, replacements);
3186
+ this.preservedError = this.preserveMessages(message);
3187
+ const alert = { level: 'error', message };
3188
+ this.errorObserver.next(alert);
3189
+ // EUI-3381.
3190
+ this.push(alert);
3616
3191
  }
3617
- get dateTimeEntryFormat() {
3618
- if (this.isComplexDisplay()) {
3619
- return null;
3192
+ warning({ phrase, replacements }) {
3193
+ const message = this.getTranslationWithReplacements(phrase, replacements);
3194
+ this.preservedWarning = this.preserveMessages(message);
3195
+ const alert = { level: 'warning', message };
3196
+ this.warningObserver.next(alert);
3197
+ // EUI-3381.
3198
+ this.push(alert);
3199
+ }
3200
+ success({ preserve, phrase, replacements }) {
3201
+ const message = this.getTranslationWithReplacements(phrase, replacements);
3202
+ this.preserveAlerts = preserve || this.preserveAlerts;
3203
+ const alert = { level: 'success', message };
3204
+ this.preservedSuccess = this.preserveMessages(message);
3205
+ this.successObserver.next(alert);
3206
+ // EUI-3381.
3207
+ this.push(alert);
3208
+ }
3209
+ getTranslationWithReplacements(phrase, replacements) {
3210
+ let message;
3211
+ if (replacements) {
3212
+ this.rpxTranslationService.getTranslationWithReplacements$(phrase, replacements).subscribe(translation => {
3213
+ message = translation;
3214
+ });
3620
3215
  }
3621
- if (this.display_context_parameter) {
3622
- return this.extractBracketValue(this.display_context_parameter, '#DATETIMEENTRY');
3216
+ else {
3217
+ this.rpxTranslationService.getTranslation$(phrase).subscribe(translation => {
3218
+ message = translation;
3219
+ });
3623
3220
  }
3624
- return null;
3221
+ return message;
3625
3222
  }
3626
- get dateTimeDisplayFormat() {
3627
- if (this.isComplexEntry()) {
3628
- return null;
3223
+ setPreserveAlerts(preserve, urlInfo) {
3224
+ // if there is no url setting then just preserve the messages
3225
+ if (!urlInfo) {
3226
+ this.preserveAlerts = preserve;
3629
3227
  }
3630
- if (this.display_context_parameter) {
3631
- return this.extractBracketValue(this.display_context_parameter, '#DATETIMEDISPLAY');
3228
+ else {
3229
+ // check if the url includes the sting given
3230
+ this.preserveAlerts = this.currentUrlIncludesInfo(preserve, urlInfo);
3632
3231
  }
3633
- return null;
3634
- }
3635
- isComplexDisplay() {
3636
- return (this.isComplex() || this.isCollection()) && this.isReadonly();
3637
3232
  }
3638
- isComplexEntry() {
3639
- return (this.isComplex() || this.isCollection()) && (this.isOptional() || this.isMandatory());
3233
+ currentUrlIncludesInfo(preserve, urlInfo) {
3234
+ // loop through the list of strings and check the router includes all of them
3235
+ for (const urlSnip of urlInfo) {
3236
+ if (!this.router.url.includes(urlSnip)) {
3237
+ // return the opposite boolean value if the router does not include one of the strings
3238
+ return !preserve;
3239
+ }
3240
+ }
3241
+ // return the boolean value if all strings are in the url
3242
+ return preserve;
3640
3243
  }
3641
- isReadonly() {
3642
- return !_.isEmpty(this.display_context)
3643
- && this.display_context.toUpperCase() === 'READONLY';
3244
+ isPreserveAlerts() {
3245
+ return this.preserveAlerts;
3644
3246
  }
3645
- isOptional() {
3646
- return !_.isEmpty(this.display_context)
3647
- && this.display_context.toUpperCase() === 'OPTIONAL';
3247
+ preserveMessages(message) {
3248
+ // preserve the messages if set to preserve them
3249
+ if (this.isPreserveAlerts()) {
3250
+ return message;
3251
+ }
3252
+ else {
3253
+ return '';
3254
+ }
3648
3255
  }
3649
- isMandatory() {
3650
- return !_.isEmpty(this.display_context)
3651
- && this.display_context.toUpperCase() === 'MANDATORY';
3256
+ // TODO: Remove
3257
+ push(msgObject) {
3258
+ this.message = msgObject.message;
3259
+ this.level = msgObject.level;
3260
+ this.alertObserver.next({
3261
+ level: this.level,
3262
+ message: this.message
3263
+ });
3652
3264
  }
3653
- isCollection() {
3654
- return this.field_type && this.field_type.type === 'Collection';
3265
+ static ɵfac = function AlertService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AlertService)(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(i1.RpxTranslationService)); };
3266
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AlertService, factory: AlertService.ɵfac });
3267
+ }
3268
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AlertService, [{
3269
+ type: Injectable
3270
+ }], () => [{ type: i1$1.Router }, { type: i1.RpxTranslationService }], null); })();
3271
+
3272
+ class DraftService {
3273
+ http;
3274
+ appConfig;
3275
+ errorService;
3276
+ static V2_MEDIATYPE_DRAFT_CREATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-create.v2+json;charset=UTF-8';
3277
+ static V2_MEDIATYPE_DRAFT_UPDATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-update.v2+json;charset=UTF-8';
3278
+ static V2_MEDIATYPE_DRAFT_READ = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-read.v2+json;charset=UTF-8';
3279
+ static V2_MEDIATYPE_DRAFT_DELETE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-draft-delete.v2+json;charset=UTF-8';
3280
+ constructor(http, appConfig, errorService) {
3281
+ this.http = http;
3282
+ this.appConfig = appConfig;
3283
+ this.errorService = errorService;
3655
3284
  }
3656
- isComplex() {
3657
- return this.field_type && this.field_type.type === 'Complex';
3285
+ createDraft(ctid, eventData) {
3286
+ const saveDraftEndpoint = this.appConfig.getCreateOrUpdateDraftsUrl(ctid);
3287
+ const headers = new HttpHeaders()
3288
+ .set('experimental', 'true')
3289
+ .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_CREATE)
3290
+ .set('Content-Type', 'application/json');
3291
+ return this.http
3292
+ .post(saveDraftEndpoint, eventData, { headers, observe: 'body' })
3293
+ .pipe(catchError((error) => {
3294
+ this.errorService.setError(error);
3295
+ return throwError(error);
3296
+ }));
3658
3297
  }
3659
- isDynamic() {
3660
- const dynamicFieldTypes = ['DynamicList', 'DynamicRadioList', 'DynamicMultiSelectList'];
3661
- if (!this.field_type) {
3662
- return false;
3663
- }
3664
- return dynamicFieldTypes.some(t => t === this.field_type.type);
3298
+ updateDraft(ctid, draftId, eventData) {
3299
+ const saveDraftEndpoint = `${this.appConfig.getCreateOrUpdateDraftsUrl(ctid)}/${draftId}`;
3300
+ const headers = new HttpHeaders()
3301
+ .set('experimental', 'true')
3302
+ .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_UPDATE)
3303
+ .set('Content-Type', 'application/json');
3304
+ return this.http
3305
+ .put(saveDraftEndpoint, eventData, { headers, observe: 'body' })
3306
+ .pipe(catchError((error) => {
3307
+ this.errorService.setError(error);
3308
+ return throwError(error);
3309
+ }));
3665
3310
  }
3666
- isCaseLink() {
3667
- return this.isComplex()
3668
- && this.field_type.id === 'CaseLink'
3669
- && this.field_type.complex_fields.some(cf => cf.id === 'CaseReference');
3311
+ getDraft(draftId) {
3312
+ const url = this.appConfig.getViewOrDeleteDraftsUrl(draftId.slice(DRAFT_PREFIX.length));
3313
+ const headers = new HttpHeaders()
3314
+ .set('experimental', 'true')
3315
+ .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_READ)
3316
+ .set('Content-Type', 'application/json');
3317
+ return this.http
3318
+ .get(url, { headers, observe: 'body' })
3319
+ .pipe(catchError((error) => {
3320
+ this.errorService.setError(error);
3321
+ return throwError(error);
3322
+ }));
3670
3323
  }
3671
- extractBracketValue(fmt, paramName, leftBracket = '(', rightBracket = ')') {
3672
- fmt = fmt.split(',')
3673
- .find(a => a.trim().startsWith(paramName));
3674
- if (fmt) {
3675
- const s = fmt.indexOf(leftBracket) + 1;
3676
- const e = fmt.indexOf(rightBracket, s);
3677
- if (e > s && s >= 0) {
3678
- return fmt.substr(s, (e - s));
3679
- }
3680
- }
3681
- return null;
3324
+ deleteDraft(draftId) {
3325
+ const url = this.appConfig.getViewOrDeleteDraftsUrl(draftId.slice(DRAFT_PREFIX.length));
3326
+ const headers = new HttpHeaders()
3327
+ .set('experimental', 'true')
3328
+ .set('Accept', DraftService.V2_MEDIATYPE_DRAFT_DELETE)
3329
+ .set('Content-Type', 'application/json');
3330
+ return this.http
3331
+ .delete(url, { headers, observe: 'body' }).pipe(catchError((error) => {
3332
+ this.errorService.setError(error);
3333
+ return throwError(error);
3334
+ }));
3682
3335
  }
3683
- // Ascend the hierarchy to get the full path of the field
3684
- getHierachicalId(curr) {
3685
- const prefix = curr ? curr + "_" : "";
3686
- if (prefix.length < 1024) {
3687
- if (this.parent) {
3688
- return this.parent.getHierachicalId(prefix + this.id);
3689
- }
3690
- else {
3691
- return prefix + this.id;
3692
- }
3336
+ createOrUpdateDraft(caseTypeId, draftId, caseEventData) {
3337
+ if (!draftId) {
3338
+ return this.createDraft(caseTypeId, caseEventData);
3693
3339
  }
3694
3340
  else {
3695
- CaseField.logger.error('Path too long, possible circular reference in case field hierarchy.');
3696
- return this.id;
3341
+ return this.updateDraft(caseTypeId, Draft.stripDraftId(draftId), caseEventData);
3697
3342
  }
3698
3343
  }
3699
- set isTranslated(val) {
3700
- this.isTranslatedFlag = val;
3344
+ static ɵfac = function DraftService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DraftService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(HttpErrorService)); };
3345
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DraftService, factory: DraftService.ɵfac });
3346
+ }
3347
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DraftService, [{
3348
+ type: Injectable
3349
+ }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }], null); })();
3350
+
3351
+ class ConditionalShowRegistrarService {
3352
+ registeredDirectives = [];
3353
+ register(newDirective) {
3354
+ this.registeredDirectives.push(newDirective);
3701
3355
  }
3702
- get isTranslated() {
3703
- return this.isTranslatedFlag;
3356
+ reset() {
3357
+ this.registeredDirectives = [];
3704
3358
  }
3359
+ static ɵfac = function ConditionalShowRegistrarService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConditionalShowRegistrarService)(); };
3360
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConditionalShowRegistrarService, factory: ConditionalShowRegistrarService.ɵfac });
3705
3361
  }
3706
- __decorate([
3707
- Exclude(),
3708
- __metadata("design:type", CaseField)
3709
- ], CaseField.prototype, "parent", void 0);
3710
- __decorate([
3711
- Type(() => FieldType),
3712
- __metadata("design:type", FieldType)
3713
- ], CaseField.prototype, "field_type", void 0);
3714
- __decorate([
3715
- Type(() => WizardPageField),
3716
- __metadata("design:type", WizardPageField)
3717
- ], CaseField.prototype, "wizardProps", void 0);
3718
- __decorate([
3719
- Expose(),
3720
- __metadata("design:type", Object),
3721
- __metadata("design:paramtypes", [Object])
3722
- ], CaseField.prototype, "value", null);
3723
- __decorate([
3724
- Expose(),
3725
- __metadata("design:type", Object),
3726
- __metadata("design:paramtypes", [Object])
3727
- ], CaseField.prototype, "list_items", null);
3728
- __decorate([
3729
- Expose(),
3730
- __metadata("design:type", String),
3731
- __metadata("design:paramtypes", [])
3732
- ], CaseField.prototype, "dateTimeEntryFormat", null);
3733
- __decorate([
3734
- Expose(),
3735
- __metadata("design:type", String),
3736
- __metadata("design:paramtypes", [])
3737
- ], CaseField.prototype, "dateTimeDisplayFormat", null);
3738
- __decorate([
3739
- Expose(),
3740
- __metadata("design:type", Function),
3741
- __metadata("design:paramtypes", []),
3742
- __metadata("design:returntype", void 0)
3743
- ], CaseField.prototype, "isComplexDisplay", null);
3744
- __decorate([
3745
- Expose(),
3746
- __metadata("design:type", Function),
3747
- __metadata("design:paramtypes", []),
3748
- __metadata("design:returntype", void 0)
3749
- ], CaseField.prototype, "isComplexEntry", null);
3750
- __decorate([
3751
- Expose(),
3752
- __metadata("design:type", Function),
3753
- __metadata("design:paramtypes", []),
3754
- __metadata("design:returntype", void 0)
3755
- ], CaseField.prototype, "isReadonly", null);
3756
- __decorate([
3757
- Expose(),
3758
- __metadata("design:type", Function),
3759
- __metadata("design:paramtypes", []),
3760
- __metadata("design:returntype", void 0)
3761
- ], CaseField.prototype, "isOptional", null);
3762
- __decorate([
3763
- Expose(),
3764
- __metadata("design:type", Function),
3765
- __metadata("design:paramtypes", []),
3766
- __metadata("design:returntype", void 0)
3767
- ], CaseField.prototype, "isMandatory", null);
3768
- __decorate([
3769
- Expose(),
3770
- __metadata("design:type", Function),
3771
- __metadata("design:paramtypes", []),
3772
- __metadata("design:returntype", Boolean)
3773
- ], CaseField.prototype, "isCollection", null);
3774
- __decorate([
3775
- Expose(),
3776
- __metadata("design:type", Function),
3777
- __metadata("design:paramtypes", []),
3778
- __metadata("design:returntype", Boolean)
3779
- ], CaseField.prototype, "isComplex", null);
3780
- __decorate([
3781
- Expose(),
3782
- __metadata("design:type", Function),
3783
- __metadata("design:paramtypes", []),
3784
- __metadata("design:returntype", Boolean)
3785
- ], CaseField.prototype, "isDynamic", null);
3786
- __decorate([
3787
- Expose(),
3788
- __metadata("design:type", Function),
3789
- __metadata("design:paramtypes", []),
3790
- __metadata("design:returntype", Boolean)
3791
- ], CaseField.prototype, "isCaseLink", null);
3792
- __decorate([
3793
- Expose(),
3794
- __metadata("design:type", Function),
3795
- __metadata("design:paramtypes", [String]),
3796
- __metadata("design:returntype", String)
3797
- ], CaseField.prototype, "getHierachicalId", null);
3362
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConditionalShowRegistrarService, [{
3363
+ type: Injectable
3364
+ }], null, null); })();
3798
3365
 
3799
- // @dynamic
3800
- class WizardPage {
3801
- id;
3802
- label;
3803
- order;
3804
- wizard_page_fields;
3805
- case_fields;
3806
- show_condition;
3807
- parsedShowCondition;
3808
- getCol1Fields() {
3809
- return this.case_fields?.filter(f => !f.wizardProps.page_column_no || f.wizardProps.page_column_no === 1);
3366
+ /** Keeps track of initially hidden fields that toggle to show on the page (parent page).
3367
+ * Used to decide whether to redisplay the grey bar when returning to the page during
3368
+ * navigation between pages.
3369
+ */
3370
+ class GreyBarService {
3371
+ fieldsToggledToShow = [];
3372
+ renderer;
3373
+ constructor(rendererFactory) {
3374
+ this.renderer = rendererFactory.createRenderer(null, null);
3810
3375
  }
3811
- getCol2Fields() {
3812
- return this.case_fields?.filter(f => f.wizardProps.page_column_no === 2);
3376
+ showGreyBar(field, el) {
3377
+ if (!field.isCollection()) {
3378
+ this.addGreyBar(el);
3379
+ }
3813
3380
  }
3814
- isMultiColumn() {
3815
- return this.getCol2Fields()?.length > 0;
3381
+ removeGreyBar(el) {
3382
+ const divSelector = el.nativeElement.querySelector('div');
3383
+ if (divSelector) {
3384
+ this.renderer.removeClass(divSelector, 'show-condition-grey-bar');
3385
+ }
3816
3386
  }
3817
- }
3818
- __decorate([
3819
- Type(() => WizardPageField),
3820
- __metadata("design:type", Array)
3821
- ], WizardPage.prototype, "wizard_page_fields", void 0);
3822
- __decorate([
3823
- Type(() => CaseField),
3824
- __metadata("design:type", Array)
3825
- ], WizardPage.prototype, "case_fields", void 0);
3826
-
3827
- // @dynamic
3828
- class CaseEventTrigger {
3829
- id;
3830
- name;
3831
- description;
3832
- case_id;
3833
- case_fields;
3834
- event_token;
3835
- wizard_pages;
3836
- show_summary;
3837
- show_event_notes;
3838
- end_button_label;
3839
- can_save_draft;
3840
- hasFields() {
3841
- return this.case_fields && this.case_fields.length !== 0;
3387
+ addToggledToShow(fieldId) {
3388
+ this.fieldsToggledToShow.push(fieldId);
3842
3389
  }
3843
- hasPages() {
3844
- return this.wizard_pages && this.wizard_pages.length !== 0;
3390
+ removeToggledToShow(fieldId) {
3391
+ this.fieldsToggledToShow = this.fieldsToggledToShow.filter(id => id !== fieldId);
3392
+ }
3393
+ wasToggledToShow(fieldId) {
3394
+ return this.fieldsToggledToShow.find(id => id === fieldId) !== undefined;
3395
+ }
3396
+ reset() {
3397
+ this.fieldsToggledToShow = [];
3398
+ }
3399
+ addGreyBar(el) {
3400
+ const divSelector = el.nativeElement.querySelector('div');
3401
+ if (divSelector) {
3402
+ this.renderer.addClass(divSelector, 'show-condition-grey-bar');
3403
+ }
3845
3404
  }
3405
+ static ɵfac = function GreyBarService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GreyBarService)(i0.ɵɵinject(i0.RendererFactory2)); };
3406
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GreyBarService, factory: GreyBarService.ɵfac });
3846
3407
  }
3847
- __decorate([
3848
- Type(() => CaseField),
3849
- __metadata("design:type", Array)
3850
- ], CaseEventTrigger.prototype, "case_fields", void 0);
3851
- __decorate([
3852
- Type(() => WizardPage),
3853
- __metadata("design:type", Array)
3854
- ], CaseEventTrigger.prototype, "wizard_pages", void 0);
3408
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GreyBarService, [{
3409
+ type: Injectable
3410
+ }], () => [{ type: i0.RendererFactory2 }], null); })();
3855
3411
 
3856
- // tslint:disable:variable-name
3857
- class CaseViewEvent {
3858
- id;
3859
- timestamp;
3860
- summary;
3861
- comment;
3862
- event_id;
3863
- event_name;
3864
- state_id;
3865
- state_name;
3866
- user_id;
3867
- user_last_name;
3868
- user_first_name;
3869
- significant_item;
3870
- }
3412
+ var AddCommentsErrorMessage;
3413
+ (function (AddCommentsErrorMessage) {
3414
+ AddCommentsErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
3415
+ AddCommentsErrorMessage["FLAG_COMMENTS_NOT_ENTERED_EXTERNAL"] = "Please enter comments for this support request";
3416
+ AddCommentsErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
3417
+ })(AddCommentsErrorMessage || (AddCommentsErrorMessage = {}));
3871
3418
 
3872
- class CaseViewTrigger {
3873
- id;
3874
- name;
3875
- description;
3876
- order;
3877
- }
3419
+ var AddCommentsStep;
3420
+ (function (AddCommentsStep) {
3421
+ AddCommentsStep["HINT_TEXT"] = "Explain why you are creating this flag. Do not include any sensitive information such as personal details.";
3422
+ AddCommentsStep["HINT_TEXT_EXTERNAL"] = "Explain why you are creating this support request. Do not include any sensitive information such as personal details.";
3423
+ AddCommentsStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3424
+ AddCommentsStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
3425
+ })(AddCommentsStep || (AddCommentsStep = {}));
3878
3426
 
3879
- class CaseEvent {
3880
- id;
3881
- name;
3882
- post_state;
3883
- pre_states;
3884
- case_fields;
3885
- description;
3886
- order;
3887
- acls;
3888
- }
3427
+ var CaseFlagCheckYourAnswersPageStep;
3428
+ (function (CaseFlagCheckYourAnswersPageStep) {
3429
+ CaseFlagCheckYourAnswersPageStep["CASE_LEVEL_LOCATION"] = "Case level";
3430
+ CaseFlagCheckYourAnswersPageStep["ADD_FLAG_HEADER_TEXT"] = "Add flag to";
3431
+ CaseFlagCheckYourAnswersPageStep["ADD_FLAG_HEADER_TEXT_EXTERNAL"] = "Add support to";
3432
+ CaseFlagCheckYourAnswersPageStep["UPDATE_FLAG_HEADER_TEXT"] = "Update flag for";
3433
+ CaseFlagCheckYourAnswersPageStep["UPDATE_FLAG_HEADER_TEXT_EXTERNAL"] = "Update support for";
3434
+ CaseFlagCheckYourAnswersPageStep["FLAG_TYPE_HEADER_TEXT"] = "Flag type";
3435
+ CaseFlagCheckYourAnswersPageStep["FLAG_TYPE_HEADER_TEXT_EXTERNAL"] = "Support type";
3436
+ CaseFlagCheckYourAnswersPageStep["NONE"] = "";
3437
+ })(CaseFlagCheckYourAnswersPageStep || (CaseFlagCheckYourAnswersPageStep = {}));
3889
3438
 
3890
- class CaseState {
3891
- id;
3892
- name;
3893
- description;
3894
- order;
3895
- }
3439
+ /**
3440
+ * Create and update contexts for external users are, by definition, part of Case Flags 2.1 - thus there is no enum
3441
+ * value for these.
3442
+ */
3443
+ var CaseFlagDisplayContextParameter;
3444
+ (function (CaseFlagDisplayContextParameter) {
3445
+ CaseFlagDisplayContextParameter["CREATE"] = "#ARGUMENT(CREATE)";
3446
+ CaseFlagDisplayContextParameter["CREATE_EXTERNAL"] = "#ARGUMENT(CREATE,EXTERNAL)";
3447
+ CaseFlagDisplayContextParameter["CREATE_2_POINT_1"] = "#ARGUMENT(CREATE,VERSION2.1)";
3448
+ CaseFlagDisplayContextParameter["READ_EXTERNAL"] = "#ARGUMENT(READ,EXTERNAL)";
3449
+ CaseFlagDisplayContextParameter["UPDATE"] = "#ARGUMENT(UPDATE)";
3450
+ CaseFlagDisplayContextParameter["UPDATE_EXTERNAL"] = "#ARGUMENT(UPDATE,EXTERNAL)";
3451
+ CaseFlagDisplayContextParameter["UPDATE_2_POINT_1"] = "#ARGUMENT(UPDATE,VERSION2.1)";
3452
+ })(CaseFlagDisplayContextParameter || (CaseFlagDisplayContextParameter = {}));
3896
3453
 
3897
- // Light clone of CaseType to be used in Jurisdiction class
3898
- // to avoid cyclic dependency
3899
- class CaseTypeLite {
3900
- id;
3901
- name;
3902
- events;
3903
- states;
3904
- description;
3905
- }
3454
+ var CaseFlagFormFields;
3455
+ (function (CaseFlagFormFields) {
3456
+ CaseFlagFormFields["FLAG_TYPE"] = "flagType";
3457
+ CaseFlagFormFields["COMMENTS"] = "flagComment";
3458
+ CaseFlagFormFields["COMMENTS_WELSH"] = "flagComment_cy";
3459
+ CaseFlagFormFields["OTHER_FLAG_DESCRIPTION"] = "otherDescription";
3460
+ CaseFlagFormFields["OTHER_FLAG_DESCRIPTION_WELSH"] = "otherDescription_cy";
3461
+ CaseFlagFormFields["STATUS"] = "status";
3462
+ CaseFlagFormFields["STATUS_CHANGE_REASON"] = "flagStatusReasonChange";
3463
+ CaseFlagFormFields["IS_WELSH_TRANSLATION_NEEDED"] = "flagIsWelshTranslationNeeded";
3464
+ CaseFlagFormFields["IS_VISIBLE_INTERNALLY_ONLY"] = "flagIsVisibleInternallyOnly";
3465
+ })(CaseFlagFormFields || (CaseFlagFormFields = {}));
3906
3466
 
3907
- // @dynamics
3908
- class CaseType {
3909
- id;
3910
- name;
3911
- events;
3912
- states;
3913
- case_fields;
3914
- description;
3915
- jurisdiction;
3916
- printEnabled;
3917
- }
3918
- __decorate([
3919
- Type(() => CaseField),
3920
- __metadata("design:type", Array)
3921
- ], CaseType.prototype, "case_fields", void 0);
3467
+ var CaseFlagStatus;
3468
+ (function (CaseFlagStatus) {
3469
+ CaseFlagStatus["REQUESTED"] = "Requested";
3470
+ CaseFlagStatus["ACTIVE"] = "Active";
3471
+ CaseFlagStatus["INACTIVE"] = "Inactive";
3472
+ CaseFlagStatus["NOT_APPROVED"] = "Not approved";
3473
+ })(CaseFlagStatus || (CaseFlagStatus = {}));
3922
3474
 
3923
- // tslint:disable:variable-name
3924
- class EventCaseField {
3925
- case_field_id;
3926
- showCondition;
3927
- }
3475
+ var CaseFlagSummaryListDisplayMode;
3476
+ (function (CaseFlagSummaryListDisplayMode) {
3477
+ CaseFlagSummaryListDisplayMode[CaseFlagSummaryListDisplayMode["CREATE"] = 0] = "CREATE";
3478
+ CaseFlagSummaryListDisplayMode[CaseFlagSummaryListDisplayMode["MANAGE"] = 1] = "MANAGE";
3479
+ })(CaseFlagSummaryListDisplayMode || (CaseFlagSummaryListDisplayMode = {}));
3928
3480
 
3929
- class Jurisdiction {
3930
- id;
3931
- name;
3932
- description;
3933
- caseTypes;
3934
- currentCaseType;
3935
- }
3481
+ var CaseFlagWizardStepTitle;
3482
+ (function (CaseFlagWizardStepTitle) {
3483
+ CaseFlagWizardStepTitle["SELECT_FLAG_LOCATION"] = "Where should this flag be added?";
3484
+ CaseFlagWizardStepTitle["SELECT_FLAG_LOCATION_EXTERNAL"] = "Who is the support for?";
3485
+ CaseFlagWizardStepTitle["SELECT_CASE_FLAG"] = "Select flag type";
3486
+ CaseFlagWizardStepTitle["SELECT_CASE_FLAG_EXTERNAL"] = "Select support type";
3487
+ CaseFlagWizardStepTitle["OTHER_FLAG_TYPE_DESCRIPTION"] = "Enter a flag type";
3488
+ CaseFlagWizardStepTitle["OTHER_FLAG_TYPE_DESCRIPTION_EXTERNAL"] = "Enter a support type";
3489
+ CaseFlagWizardStepTitle["ADD_FLAG_COMMENTS"] = "Add comments for this flag";
3490
+ CaseFlagWizardStepTitle["ADD_FLAG_COMMENTS_EXTERNAL_MODE"] = "Tell us more about the request";
3491
+ CaseFlagWizardStepTitle["CONFIRM_FLAG_STATUS"] = "Confirm the status of the flag";
3492
+ CaseFlagWizardStepTitle["FLAG_STATUS"] = "Flag status";
3493
+ CaseFlagWizardStepTitle["MANAGE_CASE_FLAGS"] = "Manage case flags";
3494
+ CaseFlagWizardStepTitle["MANAGE_SUPPORT"] = "Which support is no longer needed?";
3495
+ CaseFlagWizardStepTitle["UPDATE_FLAG_TITLE"] = "Update flag";
3496
+ CaseFlagWizardStepTitle["UPDATE_FLAG_TITLE_EXTERNAL"] = "Tell us why the support is no longer needed";
3497
+ CaseFlagWizardStepTitle["UPDATE_FLAG_ADD_TRANSLATION"] = "Add translations to flag";
3498
+ CaseFlagWizardStepTitle["NONE"] = "";
3499
+ })(CaseFlagWizardStepTitle || (CaseFlagWizardStepTitle = {}));
3936
3500
 
3937
- class Banner {
3938
- bannerDescription;
3939
- bannerUrlText;
3940
- bannerUrl;
3941
- bannerViewed;
3942
- bannerEnabled;
3943
- }
3501
+ var ConfirmStatusErrorMessage;
3502
+ (function (ConfirmStatusErrorMessage) {
3503
+ ConfirmStatusErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
3504
+ ConfirmStatusErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
3505
+ })(ConfirmStatusErrorMessage || (ConfirmStatusErrorMessage = {}));
3944
3506
 
3945
- // @dynamic
3946
- class CaseTab {
3947
- id;
3948
- label;
3949
- order;
3950
- fields;
3951
- show_condition;
3507
+ var ConfirmStatusStep;
3508
+ (function (ConfirmStatusStep) {
3509
+ ConfirmStatusStep["HINT_TEXT"] = "Describe reason for status; if choosing 'Not approved' provide name of person approving decision.";
3510
+ ConfirmStatusStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3511
+ })(ConfirmStatusStep || (ConfirmStatusStep = {}));
3512
+
3513
+ var SearchLanguageInterpreterErrorMessage;
3514
+ (function (SearchLanguageInterpreterErrorMessage) {
3515
+ SearchLanguageInterpreterErrorMessage["LANGUAGE_NOT_ENTERED"] = "Enter the language that will need to be interpreted";
3516
+ SearchLanguageInterpreterErrorMessage["LANGUAGE_CHAR_LIMIT_EXCEEDED"] = "You can enter up to 80 characters for the required language";
3517
+ SearchLanguageInterpreterErrorMessage["LANGUAGE_ENTERED_IN_BOTH_FIELDS"] = "The language can only be entered in one of the fields";
3518
+ })(SearchLanguageInterpreterErrorMessage || (SearchLanguageInterpreterErrorMessage = {}));
3519
+
3520
+ var SearchLanguageInterpreterStep;
3521
+ (function (SearchLanguageInterpreterStep) {
3522
+ SearchLanguageInterpreterStep["HINT_TEXT"] = "Enter the language that will need to be interpreted. If this language is not listed, you can enter it manually.";
3523
+ 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.";
3524
+ SearchLanguageInterpreterStep["CHECKBOX_LABEL"] = "Enter the language manually";
3525
+ SearchLanguageInterpreterStep["INPUT_LABEL"] = "Enter the language";
3526
+ })(SearchLanguageInterpreterStep || (SearchLanguageInterpreterStep = {}));
3527
+
3528
+ var SelectFlagErrorMessage;
3529
+ (function (SelectFlagErrorMessage) {
3530
+ SelectFlagErrorMessage["MANAGE_CASE_FLAGS_FLAG_NOT_SELECTED"] = "Please make a selection";
3531
+ SelectFlagErrorMessage["MANAGE_SUPPORT_FLAG_NOT_SELECTED"] = "Select which support is no longer needed";
3532
+ SelectFlagErrorMessage["NO_FLAGS"] = "This case has no flags";
3533
+ })(SelectFlagErrorMessage || (SelectFlagErrorMessage = {}));
3534
+
3535
+ var SelectFlagLocationErrorMessage;
3536
+ (function (SelectFlagLocationErrorMessage) {
3537
+ SelectFlagLocationErrorMessage["FLAG_LOCATION_NOT_SELECTED"] = "Please make a selection";
3538
+ SelectFlagLocationErrorMessage["FLAGS_NOT_CONFIGURED"] = "Flags have not been configured for this case type";
3539
+ })(SelectFlagLocationErrorMessage || (SelectFlagLocationErrorMessage = {}));
3540
+
3541
+ var SelectFlagTypeErrorMessage;
3542
+ (function (SelectFlagTypeErrorMessage) {
3543
+ SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_SELECTED"] = "Please select a flag type";
3544
+ SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_SELECTED_EXTERNAL"] = "Please select a support type";
3545
+ SelectFlagTypeErrorMessage["FLAG_TYPE_OPTION_NOT_SELECTED"] = "Select an option";
3546
+ SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_ENTERED"] = "Please enter a flag type";
3547
+ SelectFlagTypeErrorMessage["FLAG_TYPE_NOT_ENTERED_EXTERNAL"] = "Please enter a support type";
3548
+ SelectFlagTypeErrorMessage["FLAG_TYPE_LIMIT_EXCEEDED"] = "You can enter up to 80 characters only";
3549
+ })(SelectFlagTypeErrorMessage || (SelectFlagTypeErrorMessage = {}));
3550
+
3551
+ var UpdateFlagAddTranslationErrorMessage;
3552
+ (function (UpdateFlagAddTranslationErrorMessage) {
3553
+ UpdateFlagAddTranslationErrorMessage["DESCRIPTION_CHAR_LIMIT_EXCEEDED"] = "Original description or translation must be 200 characters or fewer";
3554
+ UpdateFlagAddTranslationErrorMessage["COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Original comments or translation must be 200 characters or fewer";
3555
+ })(UpdateFlagAddTranslationErrorMessage || (UpdateFlagAddTranslationErrorMessage = {}));
3556
+
3557
+ var UpdateFlagAddTranslationStep;
3558
+ (function (UpdateFlagAddTranslationStep) {
3559
+ UpdateFlagAddTranslationStep["HINT_TEXT"] = "Write translation for flag description or comments in the boxes provided.";
3560
+ UpdateFlagAddTranslationStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3561
+ })(UpdateFlagAddTranslationStep || (UpdateFlagAddTranslationStep = {}));
3562
+
3563
+ var UpdateFlagErrorMessage;
3564
+ (function (UpdateFlagErrorMessage) {
3565
+ UpdateFlagErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
3566
+ UpdateFlagErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
3567
+ UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
3568
+ UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED_EXTERNAL"] = "You must explain why the support is no longer needed";
3569
+ UpdateFlagErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
3570
+ UpdateFlagErrorMessage["NONE"] = "";
3571
+ })(UpdateFlagErrorMessage || (UpdateFlagErrorMessage = {}));
3572
+
3573
+ var UpdateFlagStep;
3574
+ (function (UpdateFlagStep) {
3575
+ UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL"] = "Explain why you are updating this flag. Do not include any sensitive information such as personal details.";
3576
+ 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.";
3577
+ UpdateFlagStep["COMMENT_HINT_TEXT_EXTERNAL"] = "Do not include any sensitive information such as personal details.";
3578
+ UpdateFlagStep["COMMENT_FIELD_LABEL_EXTERNAL"] = "Please provide your comments below";
3579
+ UpdateFlagStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3580
+ UpdateFlagStep["STATUS_HINT_TEXT"] = "Describe reason for status change.";
3581
+ UpdateFlagStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
3582
+ })(UpdateFlagStep || (UpdateFlagStep = {}));
3583
+
3584
+ var CaseFlagFieldState;
3585
+ (function (CaseFlagFieldState) {
3586
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_LOCATION"] = 0] = "FLAG_LOCATION";
3587
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_TYPE"] = 1] = "FLAG_TYPE";
3588
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_LANGUAGE_INTERPRETER"] = 2] = "FLAG_LANGUAGE_INTERPRETER";
3589
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_COMMENTS"] = 3] = "FLAG_COMMENTS";
3590
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_STATUS"] = 4] = "FLAG_STATUS";
3591
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_MANAGE_CASE_FLAGS"] = 5] = "FLAG_MANAGE_CASE_FLAGS";
3592
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE"] = 6] = "FLAG_UPDATE";
3593
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE_WELSH_TRANSLATION"] = 7] = "FLAG_UPDATE_WELSH_TRANSLATION";
3594
+ })(CaseFlagFieldState || (CaseFlagFieldState = {}));
3595
+ var CaseFlagErrorMessage;
3596
+ (function (CaseFlagErrorMessage) {
3597
+ CaseFlagErrorMessage["NO_EXTERNAL_FLAGS_COLLECTION"] = "External collection for storing this case flag has not been configured for this case type";
3598
+ CaseFlagErrorMessage["NO_INTERNAL_FLAGS_COLLECTION"] = "Internal collection for storing this case flag has not been configured for this case type";
3599
+ })(CaseFlagErrorMessage || (CaseFlagErrorMessage = {}));
3600
+
3601
+ class DashPipe {
3602
+ transform(value) {
3603
+ return value ? value : '-';
3604
+ }
3605
+ static ɵfac = function DashPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DashPipe)(); };
3606
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDash", type: DashPipe, pure: true, standalone: false });
3952
3607
  }
3953
- __decorate([
3954
- Type(() => CaseField),
3955
- __metadata("design:type", Array)
3956
- ], CaseTab.prototype, "fields", void 0);
3608
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DashPipe, [{
3609
+ type: Pipe,
3610
+ args: [{
3611
+ name: 'ccdDash',
3612
+ standalone: false
3613
+ }]
3614
+ }], null, null); })();
3957
3615
 
3958
- // @dynamic
3959
- class CaseView {
3960
- case_id;
3961
- case_type;
3962
- state;
3963
- channels;
3964
- tabs;
3965
- triggers;
3966
- events;
3967
- metadataFields;
3968
- basicFields;
3969
- case_flag;
3616
+ /*
3617
+ Translate a date time format string from the Java format provided by CCD to the format supported by Angular formatDate()
3618
+ Very simple translator that maps unsupported chars to the nearest equivalent.
3619
+ If there is no equivalent puts ***x*** into the output where x is the unsupported character
3620
+
3621
+ Java format
3622
+ G era text AD; Anno Domini; A
3623
+ u year year 2004; 04
3624
+ y year-of-era year 2004; 04
3625
+ D day-of-year number 189
3626
+ M/L month-of-year number/text 7; 07; Jul; July; J
3627
+ d day-of-month number 10
3628
+
3629
+ Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter
3630
+ Y week-based-year year 1996; 96
3631
+ w week-of-week-based-year number 27
3632
+ W week-of-month number 4
3633
+ E day-of-week text Tue; Tuesday; T
3634
+ e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T
3635
+ F week-of-month number 3
3636
+
3637
+ a am-pm-of-day text PM
3638
+ h clock-hour-of-am-pm (1-12) number 12
3639
+ K hour-of-am-pm (0-11) number 0
3640
+ k clock-hour-of-am-pm (1-24) number 0
3641
+
3642
+ H hour-of-day (0-23) number 0
3643
+ m minute-of-hour number 30
3644
+ s second-of-minute number 55
3645
+ S fraction-of-second fraction 978
3646
+ A milli-of-day number 1234
3647
+ n nano-of-second number 987654321
3648
+ N nano-of-day number 1234000000
3649
+
3650
+ V time-zone ID zone-id America/Los_Angeles; Z; -08:30
3651
+ z time-zone name zone-name Pacific Standard Time; PST
3652
+ O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00;
3653
+ X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15;
3654
+ x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15;
3655
+ Z zone-offset offset-Z +0000; -0800; -08:00;
3656
+
3657
+ p pad next pad modifier 1
3658
+
3659
+ ' escape for text delimiter
3660
+ '' single quote literal '
3661
+ [ optional section start
3662
+ ] optional section end
3663
+ # reserved for future use
3664
+ { reserved for future use
3665
+ } reserved for future use
3666
+
3667
+ Angular dateFormat characters
3668
+ Era G, GG & GGG Abbreviated AD
3669
+ GGGG Wide Anno Domini
3670
+ GGGGG Narrow A
3671
+ Year y Numeric: minimum digits 2, 20, 201, 2017, 20173
3672
+ yy Numeric: 2 digits + zero padded 02, 20, 01, 17, 73
3673
+ yyy Numeric: 3 digits + zero padded 002, 020, 201, 2017, 20173
3674
+ yyyy Numeric: 4 digits or more + zero padded 0002, 0020, 0201, 2017, 20173
3675
+ Month M Numeric: 1 digit 9, 12
3676
+ MM Numeric: 2 digits + zero padded 09, 12
3677
+ MMM Abbreviated Sep
3678
+ MMMM Wide September
3679
+ MMMMM Narrow S
3680
+ Month standalone L Numeric: 1 digit 9, 12
3681
+ LL Numeric: 2 digits + zero padded 09, 12
3682
+ LLL Abbreviated Sep
3683
+ LLLL Wide September
3684
+ LLLLL Narrow S
3685
+ Week of year w Numeric: minimum digits 1... 53
3686
+ ww Numeric: 2 digits + zero padded 01... 53
3687
+ Week of month W Numeric: 1 digit 1... 5
3688
+ Day of month d Numeric: minimum digits 1
3689
+ dd Numeric: 2 digits + zero padded 01
3690
+ Week day E, EE & EEE Abbreviated Tue
3691
+ EEEE Wide Tuesday
3692
+ EEEEE Narrow T
3693
+ EEEEEE Short Tu
3694
+ Period a, aa & aaa Abbreviated am/pm or AM/PM
3695
+ aaaa Wide (fallback to a when missing) ante meridiem/post meridiem
3696
+ aaaaa Narrow a/p
3697
+ Period* B, BB & BBB Abbreviated mid.
3698
+ BBBB Wide am, pm, midnight, noon, morning, afternoon, evening, night
3699
+ BBBBB Narrow md
3700
+ Period standalone* b, bb & bbb Abbreviated mid.
3701
+ bbbb Wide am, pm, midnight, noon, morning, afternoon, evening, night
3702
+ bbbbb Narrow md
3703
+ Hour 1-12 h Numeric: minimum digits 1, 12
3704
+ hh Numeric: 2 digits + zero padded 01, 12
3705
+ Hour 0-23 H Numeric: minimum digits 0, 23
3706
+ HH Numeric: 2 digits + zero padded 00, 23
3707
+ Minute m Numeric: minimum digits 8, 59
3708
+ mm Numeric: 2 digits + zero padded 08, 59
3709
+ Second s Numeric: minimum digits 0... 59
3710
+ ss Numeric: 2 digits + zero padded 00... 59
3711
+ Fractional seconds S Numeric: 1 digit 0... 9
3712
+ SS Numeric: 2 digits + zero padded 00... 99
3713
+ SSS Numeric: 3 digits + zero padded (= milliseconds) 000... 999
3714
+ Zone z, zz & zzz Short specific non location format (fallback to O) GMT-8
3715
+ zzzz Long specific non location format (fallback to OOOO) GMT-08:00
3716
+ Z, ZZ & ZZZ ISO8601 basic format -0800
3717
+ ZZZZ Long localized GMT format GMT-8:00
3718
+ ZZZZZ ISO8601 extended format + Z indicator for offset 0 (= XXXXX) -08:00
3719
+ O, OO & OOO Short localized GMT format GMT-8
3720
+ OOOO Long localized GMT format GMT-08:00
3721
+ */
3722
+ class FormatTranslatorService {
3723
+ translate(javaFormat) {
3724
+ const result = [];
3725
+ let prev = '\0';
3726
+ let inQuote = false;
3727
+ const maybePush = (target, obj, flag) => {
3728
+ if (!flag) {
3729
+ target.push(obj);
3730
+ }
3731
+ };
3732
+ for (const c of javaFormat) {
3733
+ switch (c) {
3734
+ case '\'':
3735
+ if (prev === '\'') {
3736
+ // literal single quote - ignore
3737
+ inQuote = false;
3738
+ }
3739
+ else {
3740
+ inQuote = !inQuote;
3741
+ }
3742
+ break;
3743
+ // Due to formatting constraints on the webapp, all 'd' characters should be replaced with 'D' (for Moment library)
3744
+ // This is because we want the date, not the day (this format will need to be converted back)
3745
+ case 'd':
3746
+ maybePush(result, 'D', inQuote);
3747
+ break;
3748
+ // moment library defines year as capital y
3749
+ case 'y':
3750
+ maybePush(result, 'Y', inQuote);
3751
+ break;
3752
+ case 'e':
3753
+ case 'c':
3754
+ maybePush(result, 'E', inQuote); // no lower case E
3755
+ break;
3756
+ case 'F':
3757
+ maybePush(result, 'W', inQuote);
3758
+ break;
3759
+ case 'K':
3760
+ maybePush(result, 'H', inQuote);
3761
+ break;
3762
+ case 'k':
3763
+ maybePush(result, 'h', inQuote);
3764
+ break;
3765
+ // commented out A change to '***' due to use in moment library for AM/PM
3766
+ // added 'a' specification to stop discrepancy in am/AM pm/PM formatting
3767
+ case 'a':
3768
+ maybePush(result, 'A', inQuote);
3769
+ break;
3770
+ case 'n':
3771
+ case 'N':
3772
+ maybePush(result, `***${c}***`, inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
3773
+ break;
3774
+ case 'V':
3775
+ case 'O':
3776
+ maybePush(result, 'z', inQuote);
3777
+ break;
3778
+ case 'x':
3779
+ case 'X':
3780
+ maybePush(result, 'Z', inQuote);
3781
+ break;
3782
+ default:
3783
+ maybePush(result, c, inQuote);
3784
+ }
3785
+ prev = c;
3786
+ }
3787
+ return result.join('');
3788
+ }
3789
+ showOnlyDates(dateFormat) {
3790
+ // replace 'd' character with 'D' for the moment library
3791
+ // This ensures only dates allowed
3792
+ while (dateFormat.includes('d')) {
3793
+ dateFormat = dateFormat.replace('d', 'D');
3794
+ }
3795
+ while (dateFormat.includes('y')) {
3796
+ dateFormat = dateFormat.replace('y', 'Y');
3797
+ }
3798
+ return dateFormat;
3799
+ }
3800
+ removeTime(dateFormat) {
3801
+ // remove hours irrelevant of whether 12 or 24 hour clock
3802
+ while (dateFormat.includes('H') || dateFormat.includes('h')) {
3803
+ dateFormat = dateFormat.replace('H', '');
3804
+ dateFormat = dateFormat.replace('h', '');
3805
+ }
3806
+ // remove minutes
3807
+ while (dateFormat.includes('m')) {
3808
+ dateFormat = dateFormat.replace('m', '');
3809
+ }
3810
+ // remove seconds (s) and micro seconds (S)
3811
+ while (dateFormat.includes('S') || dateFormat.includes('s')) {
3812
+ dateFormat = dateFormat.replace('S', '');
3813
+ dateFormat = dateFormat.replace('s', '');
3814
+ }
3815
+ // because there is time removal algorithm can make reasonable assumption to remove colons
3816
+ while (dateFormat.includes(':')) {
3817
+ dateFormat = dateFormat.replace(':', '');
3818
+ }
3819
+ return dateFormat.trim();
3820
+ }
3821
+ hasDate(value) {
3822
+ return this.translate(value).length &&
3823
+ value.toLowerCase().indexOf('d') >= 0 &&
3824
+ value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3825
+ }
3826
+ is24Hour(value) {
3827
+ return this.translate(value).length &&
3828
+ value.indexOf('H') >= 0;
3829
+ }
3830
+ hasNoDay(value) {
3831
+ return this.translate(value).length && value.toLowerCase().indexOf('d') === -1 &&
3832
+ value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3833
+ }
3834
+ hasNoDayAndMonth(value) {
3835
+ return this.translate(value).length &&
3836
+ value.toLowerCase().indexOf('d') === -1 &&
3837
+ value.indexOf('M') === -1 &&
3838
+ value.toLowerCase().indexOf('y') >= 0;
3839
+ }
3840
+ hasHours(value) {
3841
+ return this.translate(value).length && value.toLowerCase().indexOf('h') >= 0 && value.indexOf('m') === -1;
3842
+ }
3843
+ hasMinutes(value) {
3844
+ return this.translate(value).length && value.indexOf('m') >= 0 && value.toLowerCase().indexOf('h') >= 0;
3845
+ }
3846
+ hasSeconds(value) {
3847
+ return this.translate(value).length && value.toLowerCase().indexOf('s') >= 0;
3848
+ }
3849
+ static ɵfac = function FormatTranslatorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormatTranslatorService)(); };
3850
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormatTranslatorService, factory: FormatTranslatorService.ɵfac });
3970
3851
  }
3971
- __decorate([
3972
- Type(() => CaseTab),
3973
- __metadata("design:type", Array)
3974
- ], CaseView.prototype, "tabs", void 0);
3975
- __decorate([
3976
- Type(() => CaseField),
3977
- __metadata("design:type", Array)
3978
- ], CaseView.prototype, "metadataFields", void 0);
3852
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormatTranslatorService, [{
3853
+ type: Injectable
3854
+ }], null, null); })();
3979
3855
 
3980
- class CasePrintDocument {
3981
- name;
3982
- type;
3983
- url;
3856
+ class DatePipe {
3857
+ formatTrans;
3858
+ 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)?$');
3859
+ // 1 2 3 4 5 6 7 8 9 10 11
3860
+ static MONTHS = [
3861
+ ['Jan'], ['Feb'], ['Mar'], ['Apr'], ['May'], ['Jun'], ['Jul'], ['Aug'], ['Sep'], ['Oct'], ['Nov'], ['Dec'],
3862
+ ];
3863
+ /**
3864
+ * constructor to allow format translator to be injected
3865
+ * @param formatTrans format translator
3866
+ */
3867
+ constructor(formatTrans) {
3868
+ this.formatTrans = formatTrans;
3869
+ }
3870
+ transform(value, zone, format) {
3871
+ let resultDate = null;
3872
+ const ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
3873
+ if (value) {
3874
+ // included to avoid editing the hour twice on second pass through
3875
+ // this occurs on case details when datepipe is applied twice
3876
+ if (!value.includes('T')) {
3877
+ zone = 'utc';
3878
+ }
3879
+ const match = value.match(DatePipe.DATE_FORMAT_REGEXP);
3880
+ // Make sure we actually have a match.
3881
+ if (match) {
3882
+ let offsetDate = null;
3883
+ const date = this.getDate(match);
3884
+ if (zone === 'local') {
3885
+ offsetDate = this.getOffsetDate(date);
3886
+ }
3887
+ else {
3888
+ offsetDate = this.getDate(match);
3889
+ }
3890
+ // 'short' format is meaningful to formatDate, but not the same meaning as in the unit tests
3891
+ if (this.formatTrans && format && format !== 'short') {
3892
+ // support for java style formatting strings for dates
3893
+ format = this.translateDateFormat(format);
3894
+ resultDate = moment(offsetDate).format(format);
3895
+ }
3896
+ else {
3897
+ // RDM-1149 changed the pipe logic so that it doesn't add an hour to 'Summer Time' dates on DateTime field type
3898
+ resultDate = `${offsetDate.getDate()} ${DatePipe.MONTHS[offsetDate.getMonth()]} ${offsetDate.getFullYear()}`;
3899
+ if (match[4] && match[5] && match[6] && format !== 'short') {
3900
+ resultDate += ', ';
3901
+ resultDate += `${this.getHour(offsetDate.getHours().toString())}:`;
3902
+ resultDate += `${this.pad(offsetDate.getMinutes())}:`;
3903
+ resultDate += `${this.pad(offsetDate.getSeconds())} `;
3904
+ resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
3905
+ }
3906
+ }
3907
+ }
3908
+ else {
3909
+ // EUI-2667. See if what we've been given is actually a formatted date that
3910
+ // we could attempt to do something with.
3911
+ const parsedDate = Date.parse(value);
3912
+ // We successfully parsed it so let's use it.
3913
+ if (!isNaN(parsedDate)) {
3914
+ const d = new Date(parsedDate);
3915
+ // If what we received didn't include time, don't include it here either.
3916
+ if (value.indexOf(':') < 0) {
3917
+ const shortDate = d.toLocaleDateString('en-GB');
3918
+ const shortISO = shortDate.split('/').reverse().join('-');
3919
+ return this.transform(shortISO, zone, format);
3920
+ }
3921
+ // If it did include time, we want a full ISO string.
3922
+ const thisMoment = moment(d).format(ISO_FORMAT);
3923
+ return this.transform(thisMoment, zone, format);
3924
+ }
3925
+ }
3926
+ }
3927
+ return resultDate;
3928
+ }
3929
+ translateDateFormat(format) {
3930
+ if (this.formatTrans) {
3931
+ return this.formatTrans.translate(format);
3932
+ }
3933
+ else {
3934
+ return format;
3935
+ }
3936
+ }
3937
+ getOffsetDate(date) {
3938
+ const localOffset = -date.getTimezoneOffset() / 60;
3939
+ return new Date(date.getTime() + localOffset * 3600 * 1000);
3940
+ }
3941
+ getDate(match) {
3942
+ const year = this.toInt(match[1]);
3943
+ const month = this.toInt(match[2]) - 1;
3944
+ const day = this.toInt(match[3]);
3945
+ let resultDate;
3946
+ if (match[4] && match[5] && match[6]) {
3947
+ const hour = this.toInt(match[4]);
3948
+ const minutes = this.toInt(match[5]);
3949
+ const seconds = this.toInt(match[6]);
3950
+ resultDate = new Date(year, month, day, hour, minutes, seconds, 0);
3951
+ }
3952
+ else {
3953
+ resultDate = new Date(year, month, day);
3954
+ }
3955
+ return resultDate;
3956
+ }
3957
+ getHour(hourStr) {
3958
+ let hourNum = this.toInt(hourStr);
3959
+ if (hourNum > 12) {
3960
+ hourNum = hourNum - 12;
3961
+ }
3962
+ else if (hourNum === 0) {
3963
+ hourNum = 12;
3964
+ }
3965
+ return hourNum;
3966
+ }
3967
+ toInt(str) {
3968
+ return parseInt(str, 10);
3969
+ }
3970
+ pad(num, padNum = 2) {
3971
+ const val = num !== undefined ? num.toString() : '';
3972
+ return val.length >= padNum ? val : new Array(padNum - val.length + 1).join('0') + val;
3973
+ }
3974
+ static ɵfac = function DatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(FormatTranslatorService, 16)); };
3975
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDate", type: DatePipe, pure: true, standalone: false });
3984
3976
  }
3977
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{
3978
+ type: Pipe,
3979
+ args: [{
3980
+ name: 'ccdDate',
3981
+ standalone: false
3982
+ }]
3983
+ }], () => [{ type: FormatTranslatorService }], null); })();
3985
3984
 
3986
- // tslint:disable:variable-name
3987
- class HRef {
3988
- href;
3989
- }
3990
- class DocumentLinks {
3991
- self;
3992
- binary;
3993
- }
3994
- class Document {
3995
- _links;
3996
- originalDocumentName;
3997
- hashToken;
3998
- }
3999
- class Embedded {
4000
- documents;
4001
- }
4002
- class DocumentData {
4003
- _embedded;
4004
- documents;
4005
- }
4006
- class FormDocument {
4007
- document_url;
4008
- document_binary_url;
4009
- document_filename;
4010
- document_hash;
4011
- upload_timestamp;
3985
+ class FieldLabelPipe {
3986
+ rpxTranslationPipe;
3987
+ constructor(rpxTranslationPipe) {
3988
+ this.rpxTranslationPipe = rpxTranslationPipe;
3989
+ }
3990
+ transform(field) {
3991
+ if (!field || !field.label) {
3992
+ return '';
3993
+ }
3994
+ else if (!field.display_context) {
3995
+ return this.getTranslatedLabel(field);
3996
+ }
3997
+ return this.getTranslatedLabel(field) + (field.display_context.toUpperCase() === 'OPTIONAL' ?
3998
+ ' (' + this.rpxTranslationPipe.transform('Optional') + ')' : '');
3999
+ }
4000
+ getTranslatedLabel(field) {
4001
+ if (!field.isTranslated) {
4002
+ return this.rpxTranslationPipe.transform(field.label);
4003
+ }
4004
+ else {
4005
+ return field.label;
4006
+ }
4007
+ }
4008
+ getOriginalLabelForYesNoTranslation(field) {
4009
+ return field.originalLabel || field.label;
4010
+ }
4011
+ static ɵfac = function FieldLabelPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FieldLabelPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslatePipe, 16)); };
4012
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFieldLabel", type: FieldLabelPipe, pure: false, standalone: false });
4012
4013
  }
4014
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldLabelPipe, [{
4015
+ type: Pipe,
4016
+ args: [{
4017
+ name: 'ccdFieldLabel',
4018
+ pure: false,
4019
+ standalone: false
4020
+ }]
4021
+ }], () => [{ type: i1.RpxTranslatePipe }], null); })();
4013
4022
 
4014
- class OrganisationConverter {
4015
- static toSimpleAddress(organisationModel) {
4016
- let simpleAddress = '';
4017
- if (organisationModel.addressLine1) {
4018
- simpleAddress += `${organisationModel.addressLine1}<br>`;
4023
+ class FirstErrorPipe {
4024
+ rpxTranslationService;
4025
+ injector;
4026
+ asyncPipe;
4027
+ constructor(rpxTranslationService, injector) {
4028
+ this.rpxTranslationService = rpxTranslationService;
4029
+ this.injector = injector;
4030
+ this.asyncPipe = new AsyncPipe(this.injector.get(ChangeDetectorRef));
4031
+ }
4032
+ transform(value, args) {
4033
+ if (!value) {
4034
+ return '';
4019
4035
  }
4020
- if (organisationModel.addressLine2) {
4021
- simpleAddress += `${organisationModel.addressLine2}<br>`;
4036
+ if (!args) {
4037
+ args = 'Field';
4022
4038
  }
4023
- if (organisationModel.addressLine3) {
4024
- simpleAddress += `${organisationModel.addressLine3}<br>`;
4039
+ const keys = Object.keys(value);
4040
+ if (!keys.length) {
4041
+ return '';
4025
4042
  }
4026
- if (organisationModel.townCity) {
4027
- simpleAddress += `${organisationModel.townCity}<br>`;
4043
+ let errorMessage;
4044
+ if (keys[0] === 'required') {
4045
+ errorMessage = '%FIELDLABEL% is required';
4028
4046
  }
4029
- if (organisationModel.county) {
4030
- simpleAddress += `${organisationModel.county}<br>`;
4047
+ else if (keys[0] === 'pattern') {
4048
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%';
4031
4049
  }
4032
- if (organisationModel.country) {
4033
- simpleAddress += `${organisationModel.country}<br>`;
4050
+ else if (keys[0] === 'markDownPattern') {
4051
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%. Link mark up characters are not allowed in this field';
4034
4052
  }
4035
- if (organisationModel.postCode) {
4036
- simpleAddress += `${organisationModel.postCode}<br>`;
4053
+ else if (keys[0] === 'minlength') {
4054
+ errorMessage = '%FIELDLABEL% is below the minimum length';
4037
4055
  }
4038
- return simpleAddress;
4056
+ else if (keys[0] === 'maxlength') {
4057
+ errorMessage = '%FIELDLABEL% exceeds the maximum length';
4058
+ }
4059
+ else if (value.hasOwnProperty('matDatetimePickerParse')) {
4060
+ errorMessage = 'The date entered is not valid. Please provide a valid date';
4061
+ }
4062
+ else {
4063
+ errorMessage = value[keys[0]];
4064
+ }
4065
+ const o = this.rpxTranslationService.getTranslation$(args).pipe(switchMap(fieldLabel => this.rpxTranslationService.getTranslationWithReplacements$(errorMessage, { FIELDLABEL: fieldLabel })));
4066
+ return this.asyncPipe.transform(o);
4039
4067
  }
4040
- toSimpleOrganisationModel(organisationModel) {
4041
- return {
4042
- organisationIdentifier: organisationModel.organisationIdentifier,
4043
- name: organisationModel.name,
4044
- address: OrganisationConverter.toSimpleAddress(organisationModel)
4045
- };
4068
+ ngOnDestroy() {
4069
+ this.asyncPipe.ngOnDestroy();
4046
4070
  }
4047
- static ɵfac = function OrganisationConverter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OrganisationConverter)(); };
4048
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: OrganisationConverter, factory: OrganisationConverter.ɵfac });
4071
+ static ɵfac = function FirstErrorPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FirstErrorPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslationService, 16), i0.ɵɵdirectiveInject(i0.Injector, 16)); };
4072
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFirstError", type: FirstErrorPipe, pure: false, standalone: false });
4049
4073
  }
4050
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OrganisationConverter, [{
4051
- type: Injectable
4052
- }], null, null); })();
4074
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FirstErrorPipe, [{
4075
+ type: Pipe,
4076
+ args: [{
4077
+ name: 'ccdFirstError',
4078
+ pure: false,
4079
+ standalone: false
4080
+ }]
4081
+ }], () => [{ type: i1.RpxTranslationService }, { type: i0.Injector }], null); })();
4053
4082
 
4054
- class PaginationMetadata {
4055
- totalResultsCount;
4056
- totalPagesCount;
4083
+ class IsCompoundPipe {
4084
+ static COMPOUND_TYPES = [
4085
+ 'Complex',
4086
+ 'Label',
4087
+ 'AddressGlobal',
4088
+ 'AddressUK',
4089
+ 'AddressGlobalUK',
4090
+ 'CasePaymentHistoryViewer',
4091
+ 'CaseHistoryViewer',
4092
+ 'Organisation',
4093
+ 'WaysToPay',
4094
+ 'ComponentLauncher',
4095
+ 'FlagLauncher',
4096
+ 'CaseFlag'
4097
+ ];
4098
+ static EXCLUDE = [
4099
+ 'CaseLink',
4100
+ 'JudicialUser'
4101
+ ];
4102
+ transform(field) {
4103
+ if (!field || !field.field_type || !field.field_type.type) {
4104
+ return false;
4105
+ }
4106
+ if (IsCompoundPipe.COMPOUND_TYPES.indexOf(field.field_type.type) !== -1) {
4107
+ if (IsCompoundPipe.EXCLUDE.indexOf(field.field_type.id) !== -1) {
4108
+ return false;
4109
+ }
4110
+ return true;
4111
+ }
4112
+ return false;
4113
+ }
4114
+ static ɵfac = function IsCompoundPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsCompoundPipe)(); };
4115
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsCompound", type: IsCompoundPipe, pure: true, standalone: false });
4057
4116
  }
4117
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsCompoundPipe, [{
4118
+ type: Pipe,
4119
+ args: [{
4120
+ name: 'ccdIsCompound',
4121
+ standalone: false
4122
+ }]
4123
+ }], null, null); })();
4058
4124
 
4059
- function hasRoles(profile) {
4060
- if (profile.user && profile.user.idam && Array.isArray(profile.user.idam.roles)) {
4061
- return profile.user.idam.roles.length > 0;
4125
+ class CaseFieldService {
4126
+ isOptional(field) {
4127
+ if (!field || !field.display_context) {
4128
+ return false;
4129
+ }
4130
+ return field.display_context.toUpperCase() === 'OPTIONAL';
4062
4131
  }
4063
- return false;
4064
- }
4065
- // @dynamic
4066
- class Profile {
4067
- user;
4068
- channels;
4069
- jurisdictions;
4070
- default;
4071
- isSolicitor() {
4072
- if (hasRoles(this)) {
4073
- return this.user.idam.roles.find(r => r.endsWith('-solicitor')) !== undefined;
4132
+ isReadOnly(field) {
4133
+ if (!field || !field.display_context) {
4134
+ return false;
4074
4135
  }
4075
- return false;
4136
+ return field.display_context.toUpperCase() === 'READONLY';
4076
4137
  }
4077
- isCourtAdmin() {
4078
- if (hasRoles(this)) {
4079
- return this.user.idam.roles.find(r => r.endsWith('-courtadmin')) !== undefined;
4138
+ isMandatory(field) {
4139
+ if (!field || !field.display_context) {
4140
+ return false;
4080
4141
  }
4081
- return false;
4142
+ return field.display_context.toUpperCase() === 'MANDATORY';
4082
4143
  }
4083
- }
4084
- __decorate([
4085
- Type(() => Jurisdiction),
4086
- __metadata("design:type", Array)
4087
- ], Profile.prototype, "jurisdictions", void 0);
4088
-
4089
- class Field {
4090
- id;
4091
- field_type;
4092
- elementPath;
4093
- value;
4094
- label;
4095
- metadata;
4096
- constructor(id, field_type, elementPath, value, label, metadata) {
4097
- this.id = id;
4098
- this.field_type = field_type;
4099
- this.elementPath = elementPath;
4100
- this.value = value;
4101
- this.label = label;
4102
- this.metadata = metadata;
4144
+ isLabel(field) {
4145
+ if (!field || !field.field_type) {
4146
+ return false;
4147
+ }
4148
+ return field.field_type.type === 'Label';
4103
4149
  }
4150
+ static ɵfac = function CaseFieldService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFieldService)(); };
4151
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFieldService, factory: CaseFieldService.ɵfac });
4104
4152
  }
4153
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFieldService, [{
4154
+ type: Injectable
4155
+ }], null, null); })();
4105
4156
 
4106
- class SearchResultViewColumn {
4107
- case_field_id;
4108
- case_field_type;
4109
- display_context;
4110
- display_context_parameter;
4111
- label;
4112
- order;
4113
- }
4114
-
4115
- // @dynamic
4116
- class SearchResultViewItem {
4117
- case_id;
4118
- case_fields;
4119
- hydrated_case_fields;
4120
- columns;
4121
- supplementary_data;
4122
- display_context_parameter;
4157
+ class IsMandatoryPipe {
4158
+ caseFieldService;
4159
+ constructor(caseFieldService) {
4160
+ this.caseFieldService = caseFieldService;
4161
+ }
4162
+ transform(field) {
4163
+ return this.caseFieldService.isMandatory(field);
4164
+ }
4165
+ static ɵfac = function IsMandatoryPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsMandatoryPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4166
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsMandatory", type: IsMandatoryPipe, pure: true, standalone: false });
4123
4167
  }
4124
- __decorate([
4125
- Type(() => CaseField),
4126
- __metadata("design:type", Array)
4127
- ], SearchResultViewItem.prototype, "hydrated_case_fields", void 0);
4168
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsMandatoryPipe, [{
4169
+ type: Pipe,
4170
+ args: [{
4171
+ name: 'ccdIsMandatory',
4172
+ standalone: false
4173
+ }]
4174
+ }], () => [{ type: CaseFieldService }], null); })();
4128
4175
 
4129
- // @dynamic
4130
- class SearchResultView {
4131
- columns;
4132
- results;
4133
- result_error;
4134
- hasDrafts() {
4135
- return this.results[0]
4136
- && this.results[0].case_id
4137
- && Draft.isDraft(this.results[0].case_id);
4176
+ class IsReadOnlyPipe {
4177
+ caseFieldService;
4178
+ constructor(caseFieldService) {
4179
+ this.caseFieldService = caseFieldService;
4180
+ }
4181
+ transform(field) {
4182
+ return this.caseFieldService.isReadOnly(field);
4138
4183
  }
4184
+ static ɵfac = function IsReadOnlyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4185
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnly", type: IsReadOnlyPipe, pure: true, standalone: false });
4139
4186
  }
4140
- __decorate([
4141
- Type(() => SearchResultViewColumn),
4142
- __metadata("design:type", Array)
4143
- ], SearchResultView.prototype, "columns", void 0);
4144
- __decorate([
4145
- Type(() => SearchResultViewItem),
4146
- __metadata("design:type", Array)
4147
- ], SearchResultView.prototype, "results", void 0);
4187
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyPipe, [{
4188
+ type: Pipe,
4189
+ args: [{
4190
+ name: 'ccdIsReadOnly',
4191
+ standalone: false
4192
+ }]
4193
+ }], () => [{ type: CaseFieldService }], null); })();
4148
4194
 
4149
- class SortParameters {
4150
- comparator;
4151
- sortOrder;
4152
- constructor(comparator, sortOrder) {
4153
- this.comparator = comparator;
4154
- this.sortOrder = sortOrder;
4195
+ class IsReadOnlyAndNotCollectionPipe {
4196
+ caseFieldService;
4197
+ constructor(caseFieldService) {
4198
+ this.caseFieldService = caseFieldService;
4199
+ }
4200
+ transform(field) {
4201
+ if (!field || !field.field_type || !field.field_type.type) {
4202
+ return false;
4203
+ }
4204
+ if (this.isCollection(field)) {
4205
+ return false;
4206
+ }
4207
+ return this.caseFieldService.isReadOnly(field);
4208
+ }
4209
+ // CaseField @Expose() doesn't work with the pipe in here, so leaving the manual check
4210
+ isCollection(field) {
4211
+ return field.field_type && field.field_type.type === 'Collection';
4155
4212
  }
4213
+ static ɵfac = function IsReadOnlyAndNotCollectionPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyAndNotCollectionPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4214
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnlyAndNotCollection", type: IsReadOnlyAndNotCollectionPipe, pure: true, standalone: false });
4156
4215
  }
4216
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyAndNotCollectionPipe, [{
4217
+ type: Pipe,
4218
+ args: [{
4219
+ name: 'ccdIsReadOnlyAndNotCollection',
4220
+ standalone: false
4221
+ }]
4222
+ }], () => [{ type: CaseFieldService }], null); })();
4157
4223
 
4158
- var SortOrder$1;
4159
- (function (SortOrder) {
4160
- SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
4161
- SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
4162
- SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
4163
- })(SortOrder$1 || (SortOrder$1 = {}));
4164
-
4165
- class WorkbasketInputModel {
4166
- label;
4167
- order;
4168
- field;
4169
- metadata;
4170
- display_context_parameter;
4171
- }
4172
- class WorkbasketInput {
4173
- workbasketInputs;
4224
+ class PaletteUtilsModule {
4225
+ static ɵfac = function PaletteUtilsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PaletteUtilsModule)(); };
4226
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaletteUtilsModule });
4227
+ static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
4228
+ IsCompoundPipe,
4229
+ RpxTranslatePipe
4230
+ ], imports: [CommonModule,
4231
+ RpxTranslationModule.forChild()] });
4174
4232
  }
4233
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaletteUtilsModule, [{
4234
+ type: NgModule,
4235
+ args: [{
4236
+ imports: [
4237
+ CommonModule,
4238
+ RpxTranslationModule.forChild()
4239
+ ],
4240
+ declarations: [
4241
+ DatePipe,
4242
+ FieldLabelPipe,
4243
+ FirstErrorPipe,
4244
+ IsCompoundPipe,
4245
+ IsMandatoryPipe,
4246
+ IsReadOnlyPipe,
4247
+ IsReadOnlyAndNotCollectionPipe,
4248
+ DashPipe
4249
+ ],
4250
+ exports: [
4251
+ DatePipe,
4252
+ FieldLabelPipe,
4253
+ FirstErrorPipe,
4254
+ IsCompoundPipe,
4255
+ IsMandatoryPipe,
4256
+ IsReadOnlyPipe,
4257
+ IsReadOnlyAndNotCollectionPipe,
4258
+ DashPipe
4259
+ ],
4260
+ providers: [
4261
+ IsCompoundPipe,
4262
+ RpxTranslatePipe
4263
+ ]
4264
+ }]
4265
+ }], null, null); })();
4266
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaletteUtilsModule, { declarations: [DatePipe,
4267
+ FieldLabelPipe,
4268
+ FirstErrorPipe,
4269
+ IsCompoundPipe,
4270
+ IsMandatoryPipe,
4271
+ IsReadOnlyPipe,
4272
+ IsReadOnlyAndNotCollectionPipe,
4273
+ DashPipe], imports: [CommonModule, i1.RpxTranslationModule], exports: [DatePipe,
4274
+ FieldLabelPipe,
4275
+ FirstErrorPipe,
4276
+ IsCompoundPipe,
4277
+ IsMandatoryPipe,
4278
+ IsReadOnlyPipe,
4279
+ IsReadOnlyAndNotCollectionPipe,
4280
+ DashPipe] }); })();
4175
4281
 
4176
4282
  // @dynamic
4177
4283
  class FieldsUtils {
@@ -9539,76 +9645,6 @@ class BrowserService {
9539
9645
  }], null, null); })();
9540
9646
 
9541
9647
  class CaseAccessUtils {
9542
- // User role mapping
9543
- static JUDGE_ROLE = 'judge';
9544
- static JUDGE_ROLE_CATEGORY = 'JUDICIAL';
9545
- static JUDGE_ROLE_NAME = 'judiciary';
9546
- static ADMIN_ROLE = 'admin';
9547
- static ADMIN_ROLE_CATEGORY = 'ADMIN';
9548
- static ADMIN_ROLE_NAME = 'admin';
9549
- static PROFESSIONAL_ROLE = 'solicitor';
9550
- static PROFESSIONAL_ROLE_CATEGORY = 'PROFESSIONAL';
9551
- static PROFESSIONAL_ROLE_NAME = 'professional';
9552
- static LEGAL_OPERATIONS_ROLE = 'caseworker';
9553
- static LEGAL_OPERATIONS_ROLE_CATEGORY = 'LEGAL_OPERATIONS';
9554
- static LEGAL_OPERATIONS_ROLE_NAME = 'legal-ops';
9555
- static CITIZEN_ROLE = 'citizen';
9556
- static CITIZEN_ROLE_CATEGORY = 'CITIZEN';
9557
- static CITIZEN_ROLE_NAME = 'citizen';
9558
- static CTSC_ROLE = 'ctsc';
9559
- static CTSC_ROLE_CATEGORY = 'CTSC';
9560
- static CTSC_ROLE_NAME = 'ctsc';
9561
- // fallback purely if roleCategories is not available in
9562
- getMappedRoleCategories(roles = []) {
9563
- const roleKeywords = roles.join().split('-').join().split(',');
9564
- const roleCategoryList = [];
9565
- if (this.roleHasKeyword(CaseAccessUtils.JUDGE_ROLE, roleKeywords)) {
9566
- roleCategoryList.push(CaseAccessUtils.JUDGE_ROLE_CATEGORY);
9567
- }
9568
- if (this.roleHasKeyword(CaseAccessUtils.PROFESSIONAL_ROLE, roleKeywords)) {
9569
- roleCategoryList.push(CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY);
9570
- }
9571
- if (this.roleHasKeyword(CaseAccessUtils.CITIZEN_ROLE, roleKeywords)) {
9572
- roleCategoryList.push(CaseAccessUtils.CITIZEN_ROLE_CATEGORY);
9573
- }
9574
- if (this.roleHasKeyword(CaseAccessUtils.ADMIN_ROLE, roleKeywords)) {
9575
- roleCategoryList.push(CaseAccessUtils.ADMIN_ROLE_CATEGORY);
9576
- }
9577
- if (this.roleHasKeyword(CaseAccessUtils.CTSC_ROLE, roleKeywords)) {
9578
- roleCategoryList.push(CaseAccessUtils.CTSC_ROLE_CATEGORY);
9579
- }
9580
- if (this.roleHasKeyword(CaseAccessUtils.LEGAL_OPERATIONS_ROLE, roleKeywords)) {
9581
- roleCategoryList.push(CaseAccessUtils.LEGAL_OPERATIONS_ROLE_CATEGORY);
9582
- }
9583
- return roleCategoryList;
9584
- }
9585
- roleHasKeyword(keyword, roleWords) {
9586
- return roleWords.includes(keyword);
9587
- }
9588
- getAMRoleName(accessType, aMRole) {
9589
- let roleName = '';
9590
- switch (aMRole) {
9591
- case CaseAccessUtils.JUDGE_ROLE_CATEGORY:
9592
- roleName = `${accessType}-access-${CaseAccessUtils.JUDGE_ROLE_NAME}`;
9593
- break;
9594
- case CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY:
9595
- roleName = `${accessType}-access-${CaseAccessUtils.PROFESSIONAL_ROLE_NAME}`;
9596
- break;
9597
- case CaseAccessUtils.CITIZEN_ROLE_CATEGORY:
9598
- roleName = `${accessType}-access-${CaseAccessUtils.CITIZEN_ROLE_NAME}`;
9599
- break;
9600
- case CaseAccessUtils.ADMIN_ROLE_CATEGORY:
9601
- roleName = `${accessType}-access-${CaseAccessUtils.ADMIN_ROLE_NAME}`;
9602
- break;
9603
- case CaseAccessUtils.CTSC_ROLE_CATEGORY:
9604
- roleName = `${accessType}-access-${CaseAccessUtils.CTSC_ROLE_NAME}`;
9605
- break;
9606
- default:
9607
- roleName = `${accessType}-access-${CaseAccessUtils.LEGAL_OPERATIONS_ROLE_NAME}`;
9608
- break;
9609
- }
9610
- return roleName;
9611
- }
9612
9648
  getAMPayload(assignerId, actorId, roleName, roleCategory, grantType, caseId, details, beginTime = null, endTime = null, isNew = false) {
9613
9649
  const process = details.caseReference !== undefined ? 'challenged-access' : 'specific-access';
9614
9650
  const payload = {
@@ -11477,9 +11513,9 @@ class CasesService {
11477
11513
  }
11478
11514
  // EXUI-4758 - getMappedRoleCategories no longer returns a single string, checks all roles to get the most likely roleCategory
11479
11515
  // Unsure whether we should be using mapped role categories any more - should trust the roleCategories from userInfo if they exist
11480
- const roleCategories = userInfo.roleCategories || camUtils.getMappedRoleCategories(userInfo.roles);
11516
+ const roleCategories = userInfo.roleCategories || getMappedRoleCategories(userInfo.roles);
11481
11517
  // If user has no role categories, default to LEGAL_OPERATIONS
11482
- const roleName = camUtils.getAMRoleName('challenged', roleCategories?.length > 0 ? roleCategories[0] : "LEGAL_OPERATIONS");
11518
+ const roleName = getAMRoleName('challenged', roleCategories?.length > 0 ? roleCategories[0] : RoleCategory.LEGAL_OPERATIONS);
11483
11519
  const beginTime = new Date();
11484
11520
  const endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
11485
11521
  const id = userInfo.id ? userInfo.id : userInfo.uid;
@@ -11496,10 +11532,10 @@ class CasesService {
11496
11532
  return throwError(() => new Error('User info not found in session storage'));
11497
11533
  }
11498
11534
  // EXUI-4758 - See above comment
11499
- const roleCategories = userInfo.roleCategories || camUtils.getMappedRoleCategories(userInfo.roles);
11535
+ const roleCategories = userInfo.roleCategories || getMappedRoleCategories(userInfo.roles);
11500
11536
  // EXUI-4758 - Return first roleCategory as the roleCategory for now, unless not present, in which case default to LEGAL_OPERATIONS
11501
- const roleCategory = roleCategories?.length > 0 ? roleCategories[0] : "LEGAL_OPERATIONS";
11502
- const roleName = camUtils.getAMRoleName('specific', roleCategory);
11537
+ const roleCategory = roleCategories?.length > 0 ? roleCategories[0] : RoleCategory.LEGAL_OPERATIONS;
11538
+ const roleName = getAMRoleName('specific', roleCategory);
11503
11539
  const id = userInfo.id ? userInfo.id : userInfo.uid;
11504
11540
  const payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);
11505
11541
  payload.roleRequest = {
@@ -36748,16 +36784,8 @@ class CaseResolver {
36748
36784
  }
36749
36785
  // as discussed for EUI-5456, need functionality to go to default page
36750
36786
  goToDefaultPage() {
36751
- const userDetails = safeJsonParse(this.sessionStorage.getItem(USER_DETAILS));
36752
- userDetails && userDetails.roles
36753
- && !userDetails.roles.includes(PUI_CASE_MANAGER)
36754
- &&
36755
- (userDetails.roles.includes('caseworker-ia-iacjudge')
36756
- || userDetails.roles.includes('caseworker-ia-caseofficer')
36757
- || userDetails.roles.includes('caseworker-ia-admofficer')
36758
- || userDetails.roles.includes('caseworker-civil')
36759
- || userDetails.roles.includes('caseworker-privatelaw'))
36760
- ? this.router.navigate([CaseResolver.defaultWAPage]) : this.router.navigate([CaseResolver.defaultPage]);
36787
+ isWorkAllocationUser(this.sessionStorage) ?
36788
+ this.router.navigate([CaseResolver.defaultWAPage]) : this.router.navigate([CaseResolver.defaultPage]);
36761
36789
  }
36762
36790
  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)); };
36763
36791
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseResolver, factory: CaseResolver.ɵfac });
@@ -42830,5 +42858,5 @@ class TestRouteSnapshotBuilder {
42830
42858
  * Generated bundle index. Do not edit.
42831
42859
  */
42832
42860
 
42833
- 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 };
42861
+ 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, 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, 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 };
42834
42862
  //# sourceMappingURL=hmcts-ccd-case-ui-toolkit.mjs.map