@hmcts/ccd-case-ui-toolkit 7.4.28-pofcc-156 → 7.4.29-9049

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.
@@ -14,9 +14,9 @@ import * as i1$2 from '@angular/router';
14
14
  import { RouterModule, NavigationStart, NavigationEnd } from '@angular/router';
15
15
  import * as i4 from '@angular/forms';
16
16
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
17
+ import moment from 'moment';
17
18
  import * as _ from 'underscore';
18
19
  import 'reflect-metadata';
19
- import moment from 'moment';
20
20
  import { StateMachine } from '@edium/fsm';
21
21
  import * as i1$3 from '@angular/material/dialog';
22
22
  import { MatDialogConfig, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
@@ -1959,1230 +1959,372 @@ class SessionStorageGuard {
1959
1959
  args: [SessionJsonErrorLogger]
1960
1960
  }] }], null); })();
1961
1961
 
1962
- // tslint:disable:variable-name
1963
- class AddressModel {
1964
- AddressLine1 = '';
1965
- AddressLine2 = '';
1966
- AddressLine3 = '';
1967
- PostTown = '';
1968
- County = '';
1969
- PostCode = '';
1970
- Country = '';
1971
- }
1972
-
1973
- class Alert {
1974
- level;
1975
- message;
1976
- }
1977
-
1978
- // tslint:disable:variable-name
1979
- class CaseDetails {
1980
- id;
1981
- jurisdiction;
1982
- case_type_id;
1983
- state;
1984
- created_date;
1985
- last_modified;
1986
- locked_by_user_id;
1987
- security_level;
1988
- case_data;
1989
- }
1990
-
1991
- // tslint:disable:variable-name
1992
- class CaseEventData {
1993
- event;
1994
- data;
1995
- event_data; // full event data
1996
- event_token;
1997
- ignore_warning;
1998
- draft_id;
1999
- case_reference;
1962
+ const USER_DETAILS = 'userDetails';
1963
+ const PUI_CASE_MANAGER = 'pui-case-manager';
1964
+ const JUDGE = 'judge';
1965
+ function getUserDetails(sessionStorageService) {
1966
+ const item = sessionStorageService?.getItem(USER_DETAILS);
1967
+ return safeJsonParse(item, null);
2000
1968
  }
2001
-
2002
- class WizardPageField {
2003
- case_field_id;
2004
- order;
2005
- page_column_no;
2006
- complex_field_overrides;
1969
+ function isInternalUser(sessionStorageService) {
1970
+ const userDetails = getUserDetails(sessionStorageService);
1971
+ return !!userDetails?.roles
1972
+ && !(userDetails.roles.includes(PUI_CASE_MANAGER)
1973
+ || userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
2007
1974
  }
2008
-
2009
- class FixedListItem {
2010
- code;
2011
- label;
2012
- order;
1975
+ function isJudiciaryUser(sessionStorageService) {
1976
+ const userDetails = getUserDetails(sessionStorageService);
1977
+ return !!userDetails?.roles
1978
+ && (userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
2013
1979
  }
2014
1980
 
2015
1981
  // @dynamic
2016
- class FieldType {
2017
- id;
2018
- type;
2019
- min;
2020
- max;
2021
- regular_expression;
2022
- fixed_list_items;
2023
- complex_fields;
2024
- collection_field_type;
1982
+ class ActivityService {
1983
+ http;
1984
+ appConfig;
1985
+ sessionStorageService;
1986
+ static get ACTIVITY_VIEW() { return 'view'; }
1987
+ static get ACTIVITY_EDIT() { return 'edit'; }
1988
+ logger = new StructuredLoggerService();
1989
+ constructor(http, appConfig, sessionStorageService) {
1990
+ this.http = http;
1991
+ this.appConfig = appConfig;
1992
+ this.sessionStorageService = sessionStorageService;
1993
+ }
1994
+ get isEnabled() {
1995
+ return this.activityUrl() && this.userAuthorised;
1996
+ }
1997
+ static DUMMY_CASE_REFERENCE = '0';
1998
+ userAuthorised = undefined;
1999
+ static handleHttpError(response) {
2000
+ const error = HttpErrorService.convertToHttpError(response);
2001
+ if (response?.status !== error.status) {
2002
+ error.status = response.status;
2003
+ }
2004
+ return error;
2005
+ }
2006
+ getOptions() {
2007
+ const userDetails = safeJsonParse(this.sessionStorageService.getItem(USER_DETAILS));
2008
+ let headers = new HttpHeaders().set('Content-Type', 'application/json');
2009
+ if (userDetails?.token) {
2010
+ headers = headers.set('Authorization', userDetails.token);
2011
+ }
2012
+ return {
2013
+ headers,
2014
+ withCredentials: true,
2015
+ observe: 'body',
2016
+ };
2017
+ }
2018
+ getActivities(...caseId) {
2019
+ try {
2020
+ const options = this.getOptions();
2021
+ const url = `${this.activityUrl()}/cases/${caseId.join(',')}/activity`;
2022
+ return this.http
2023
+ .get(url, options, false, ActivityService.handleHttpError)
2024
+ .pipe(map(response => response));
2025
+ }
2026
+ catch (error) {
2027
+ this.logUserMayNotBeAuthenticated(error);
2028
+ }
2029
+ }
2030
+ postActivity(caseId, activity) {
2031
+ try {
2032
+ const options = this.getOptions();
2033
+ const url = `${this.activityUrl()}/cases/${caseId}/activity`;
2034
+ const body = { activity };
2035
+ return this.http
2036
+ .post(url, body, options, false)
2037
+ .pipe(map(response => response));
2038
+ }
2039
+ catch (error) {
2040
+ this.logUserMayNotBeAuthenticated(error);
2041
+ }
2042
+ }
2043
+ verifyUserIsAuthorized() {
2044
+ if (this.sessionStorageService.getItem(USER_DETAILS) && this.activityUrl() && this.userAuthorised === undefined) {
2045
+ this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(() => this.userAuthorised = true, error => {
2046
+ this.userAuthorised = [401, 403].indexOf(error.status) <= -1;
2047
+ });
2048
+ }
2049
+ }
2050
+ activityUrl() {
2051
+ return this.appConfig.getActivityUrl();
2052
+ }
2053
+ logUserMayNotBeAuthenticated(error) {
2054
+ this.logger.error('User may not be authenticated. Activity request was not sent.', { error });
2055
+ }
2056
+ static ɵfac = function ActivityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(SessionStorageService)); };
2057
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac });
2025
2058
  }
2026
- __decorate([
2027
- Type(() => FixedListItem),
2028
- __metadata("design:type", Array)
2029
- ], FieldType.prototype, "fixed_list_items", void 0);
2030
- __decorate([
2031
- Type(() => CaseField),
2032
- __metadata("design:type", Array)
2033
- ], FieldType.prototype, "complex_fields", void 0);
2034
- __decorate([
2035
- Type(() => FieldType),
2036
- __metadata("design:type", FieldType)
2037
- ], FieldType.prototype, "collection_field_type", void 0);
2059
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
2060
+ type: Injectable
2061
+ }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: SessionStorageService }], null); })();
2038
2062
 
2039
2063
  // @dynamic
2040
- class CaseField {
2041
- static logger = new StructuredLoggerService();
2042
- id;
2043
- hidden;
2044
- hiddenCannotChange;
2045
- label;
2046
- originalLabel;
2047
- noCacheLabel;
2048
- order;
2049
- parent;
2050
- field_type;
2051
- hint_text;
2052
- security_label;
2053
- display_context;
2054
- display_context_parameter;
2055
- month_format;
2056
- show_condition;
2057
- show_summary_change_option;
2058
- show_summary_content_option;
2059
- acls;
2060
- metadata;
2061
- formatted_value;
2062
- retain_hidden_value;
2063
- wizardProps;
2064
- _value;
2065
- _list_items = [];
2066
- isTranslatedFlag = false;
2067
- get value() {
2068
- if (this.field_type && (this.field_type.type === 'DynamicList' || this.field_type.type === 'DynamicRadioList')) {
2069
- return this._value && this._value.value ? this._value.value.code : this._value;
2064
+ class ActivityPollingService {
2065
+ activityService;
2066
+ ngZone;
2067
+ config;
2068
+ logger = new StructuredLoggerService();
2069
+ pendingRequests = new Map();
2070
+ currentTimeoutHandle;
2071
+ pollActivitiesSubscription;
2072
+ pollConfig;
2073
+ batchCollectionDelayMs;
2074
+ maxRequestsPerBatch;
2075
+ constructor(activityService, ngZone, config) {
2076
+ this.activityService = activityService;
2077
+ this.ngZone = ngZone;
2078
+ this.config = config;
2079
+ this.pollConfig = {
2080
+ interval: config.getActivityNexPollRequestMs(),
2081
+ attempts: config.getActivityRetry()
2082
+ };
2083
+ this.batchCollectionDelayMs = config.getActivityBatchCollectionDelayMs();
2084
+ this.maxRequestsPerBatch = config.getActivityMaxRequestPerBatch();
2085
+ }
2086
+ get isEnabled() {
2087
+ return this.activityService.isEnabled;
2088
+ }
2089
+ subscribeToActivity(caseId, done) {
2090
+ if (!this.isEnabled) {
2091
+ return new Subject();
2070
2092
  }
2071
- else if (this.field_type && this.field_type.type === 'DynamicMultiSelectList') {
2072
- return this._value && this._value.value ? this._value.value : this._value;
2093
+ let subject = this.pendingRequests.get(caseId);
2094
+ if (subject) {
2095
+ subject.subscribe(done);
2073
2096
  }
2074
2097
  else {
2075
- return this._value;
2098
+ // Only the first pending request should start the batch collection timer.
2099
+ const wasEmpty = this.pendingRequests.size === 0;
2100
+ subject = new Subject();
2101
+ subject.subscribe(done);
2102
+ this.addPendingRequest(caseId, subject);
2103
+ if (wasEmpty) {
2104
+ this.ngZone.runOutsideAngular(() => {
2105
+ this.currentTimeoutHandle = setTimeout(() => this.ngZone.run(() => {
2106
+ this.flushRequests();
2107
+ }), this.batchCollectionDelayMs);
2108
+ });
2109
+ }
2110
+ }
2111
+ if (this.pendingRequests.size >= this.maxRequestsPerBatch) {
2112
+ this.flushRequests();
2076
2113
  }
2114
+ return subject;
2077
2115
  }
2078
- set value(value) {
2079
- if (this.isDynamic()) {
2080
- if (value && value instanceof Object && value.list_items) {
2081
- this._list_items = value.list_items;
2082
- }
2083
- else if (!this._list_items || this._list_items.length === 0) {
2084
- // Extract the list items from the current value if that's the only place they exist.
2085
- this._list_items = this.list_items;
2086
- if (!value || !value.value) {
2087
- value = null;
2088
- }
2089
- }
2116
+ stopPolling() {
2117
+ if (this.pollActivitiesSubscription) {
2118
+ this.pollActivitiesSubscription.unsubscribe();
2090
2119
  }
2091
- this._value = value;
2092
2120
  }
2093
- get list_items() {
2094
- if (this.isDynamic()) {
2095
- return this._value && this._value.list_items ? this._value.list_items : this._list_items;
2121
+ flushRequests() {
2122
+ if (this.currentTimeoutHandle) {
2123
+ clearTimeout(this.currentTimeoutHandle);
2124
+ this.currentTimeoutHandle = undefined;
2096
2125
  }
2097
- else {
2098
- return this.field_type.fixed_list_items;
2126
+ if (!this.pendingRequests.size) {
2127
+ return;
2099
2128
  }
2129
+ const requests = new Map(this.pendingRequests);
2130
+ this.pendingRequests.clear();
2131
+ this.performBatchRequest(requests);
2100
2132
  }
2101
- set list_items(items) {
2102
- if ((items && !this._list_items) || (items?.length > this._list_items?.length)) {
2103
- this._list_items = items;
2133
+ pollActivities(...caseIds) {
2134
+ if (!this.isEnabled) {
2135
+ return EMPTY;
2104
2136
  }
2137
+ return this.polling(this.activityService.getActivities(...caseIds), this.pollConfig);
2105
2138
  }
2106
- get dateTimeEntryFormat() {
2107
- if (this.isComplexDisplay()) {
2108
- return null;
2109
- }
2110
- if (this.display_context_parameter) {
2111
- return this.extractBracketValue(this.display_context_parameter, '#DATETIMEENTRY');
2139
+ postViewActivity(caseId) {
2140
+ return this.postActivity(caseId, ActivityService.ACTIVITY_VIEW);
2141
+ }
2142
+ postEditActivity(caseId) {
2143
+ return this.postActivity(caseId, ActivityService.ACTIVITY_EDIT);
2144
+ }
2145
+ performBatchRequest(requests) {
2146
+ const caseIds = Array.from(requests.keys()).join();
2147
+ this.ngZone.runOutsideAngular(() => {
2148
+ // run polling outside angular zone so it does not trigger change detection
2149
+ this.pollActivitiesSubscription = this.pollActivities(caseIds).subscribe({
2150
+ // process activity inside zone so it triggers change detection for activity.component.ts
2151
+ next: (activities) => this.ngZone.run(() => {
2152
+ activities.forEach((activity) => {
2153
+ // Ignore activities returned for cases outside this local batch.
2154
+ requests.get(activity.caseId)?.next(activity);
2155
+ });
2156
+ }),
2157
+ error: (err) => this.ngZone.run(() => {
2158
+ this.logger.error('Error while polling activities.', { error: err });
2159
+ Array.from(requests.values()).forEach((subject) => subject.error(err));
2160
+ })
2161
+ });
2162
+ });
2163
+ }
2164
+ postActivity(caseId, activityType) {
2165
+ if (!this.isEnabled) {
2166
+ return EMPTY;
2112
2167
  }
2113
- return null;
2168
+ const pollingConfig = {
2169
+ ...this.pollConfig,
2170
+ interval: 5000 // inline with CCD Backend
2171
+ };
2172
+ return this.polling(this.activityService.postActivity(caseId, activityType), pollingConfig);
2114
2173
  }
2115
- get dateTimeDisplayFormat() {
2116
- if (this.isComplexEntry()) {
2117
- return null;
2174
+ addPendingRequest(caseId, subject) {
2175
+ this.pendingRequests.set(caseId, subject);
2176
+ // Components complete their returned Subject on destroy; remove it so a later same-case subscription gets a fresh Subject.
2177
+ subject.subscribe({
2178
+ complete: () => this.removePendingRequest(caseId, subject),
2179
+ error: () => this.removePendingRequest(caseId, subject)
2180
+ });
2181
+ }
2182
+ removePendingRequest(caseId, subject) {
2183
+ if (this.pendingRequests.get(caseId) !== subject) {
2184
+ return;
2118
2185
  }
2119
- if (this.display_context_parameter) {
2120
- return this.extractBracketValue(this.display_context_parameter, '#DATETIMEDISPLAY');
2186
+ this.pendingRequests.delete(caseId);
2187
+ if (!this.pendingRequests.size && this.currentTimeoutHandle) {
2188
+ clearTimeout(this.currentTimeoutHandle);
2189
+ this.currentTimeoutHandle = undefined;
2121
2190
  }
2122
- return null;
2123
2191
  }
2124
- isComplexDisplay() {
2125
- return (this.isComplex() || this.isCollection()) && this.isReadonly();
2192
+ polling(request$, options) {
2193
+ const pollingOptions = {
2194
+ interval: options.interval,
2195
+ attempts: options.attempts ?? 9,
2196
+ exponentialUnit: options.exponentialUnit ?? 1000
2197
+ };
2198
+ return concat(request$, defer(() => timer(pollingOptions.interval).pipe(switchMap(() => request$))).pipe(repeat())).pipe(
2199
+ // Preserve consecutive-failure retry behaviour using the current RxJS retry config.
2200
+ retry({
2201
+ count: pollingOptions.attempts,
2202
+ delay: (_error, retryCount) => timer(this.getExponentialRetryDelay(retryCount, pollingOptions.exponentialUnit)),
2203
+ resetOnSuccess: true
2204
+ }));
2126
2205
  }
2127
- isComplexEntry() {
2128
- return (this.isComplex() || this.isCollection()) && (this.isOptional() || this.isMandatory());
2206
+ getExponentialRetryDelay(consecutiveErrorsCount, exponentialUnit) {
2207
+ return Math.pow(2, consecutiveErrorsCount - 1) * exponentialUnit;
2129
2208
  }
2130
- isReadonly() {
2131
- return !_.isEmpty(this.display_context)
2132
- && this.display_context.toUpperCase() === 'READONLY';
2209
+ static ɵfac = function ActivityPollingService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityPollingService)(i0.ɵɵinject(ActivityService), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(AbstractAppConfig)); };
2210
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityPollingService, factory: ActivityPollingService.ɵfac });
2211
+ }
2212
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityPollingService, [{
2213
+ type: Injectable
2214
+ }], () => [{ type: ActivityService }, { type: i0.NgZone }, { type: AbstractAppConfig }], null); })();
2215
+
2216
+ function ActivityComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2217
+ i0.ɵɵelementStart(0, "div");
2218
+ i0.ɵɵelement(1, "ccd-activity-icon", 5);
2219
+ i0.ɵɵpipe(2, "rpxTranslate");
2220
+ i0.ɵɵelementEnd();
2221
+ } if (rf & 2) {
2222
+ const ctx_r0 = i0.ɵɵnextContext(2);
2223
+ i0.ɵɵclassProp("activityEditorsAndViewersIcons", ctx_r0.viewersPresent())("activityEditorsIcon", !ctx_r0.viewersPresent());
2224
+ i0.ɵɵadvance();
2225
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 5, ctx_r0.editorsText));
2226
+ } }
2227
+ function ActivityComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
2228
+ i0.ɵɵelementStart(0, "div", 6);
2229
+ i0.ɵɵelement(1, "ccd-activity-icon", 7);
2230
+ i0.ɵɵpipe(2, "rpxTranslate");
2231
+ i0.ɵɵelementEnd();
2232
+ } if (rf & 2) {
2233
+ const ctx_r0 = i0.ɵɵnextContext(2);
2234
+ i0.ɵɵadvance();
2235
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2236
+ } }
2237
+ function ActivityComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
2238
+ i0.ɵɵelementStart(0, "div");
2239
+ i0.ɵɵelement(1, "ccd-activity-banner", 8);
2240
+ i0.ɵɵpipe(2, "rpxTranslate");
2241
+ i0.ɵɵelementEnd();
2242
+ } if (rf & 2) {
2243
+ const ctx_r0 = i0.ɵɵnextContext(2);
2244
+ i0.ɵɵadvance();
2245
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.editorsText));
2246
+ } }
2247
+ function ActivityComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
2248
+ i0.ɵɵelementStart(0, "div");
2249
+ i0.ɵɵelement(1, "ccd-activity-banner", 9);
2250
+ i0.ɵɵpipe(2, "rpxTranslate");
2251
+ i0.ɵɵelementEnd();
2252
+ } if (rf & 2) {
2253
+ const ctx_r0 = i0.ɵɵnextContext(2);
2254
+ i0.ɵɵadvance();
2255
+ i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
2256
+ } }
2257
+ function ActivityComponent_div_0_Template(rf, ctx) { if (rf & 1) {
2258
+ i0.ɵɵelementStart(0, "div", 1);
2259
+ 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);
2260
+ i0.ɵɵelementEnd();
2261
+ } if (rf & 2) {
2262
+ const ctx_r0 = i0.ɵɵnextContext();
2263
+ i0.ɵɵadvance();
2264
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.editorsPresent());
2265
+ i0.ɵɵadvance();
2266
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.viewersPresent());
2267
+ i0.ɵɵadvance();
2268
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.editorsPresent());
2269
+ i0.ɵɵadvance();
2270
+ i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.viewersPresent());
2271
+ } }
2272
+ class ActivityComponent {
2273
+ activityPollingService;
2274
+ activity;
2275
+ dspMode = DisplayMode;
2276
+ viewersText;
2277
+ editorsText;
2278
+ subscription;
2279
+ caseId;
2280
+ displayMode;
2281
+ VIEWERS_PREFIX = '';
2282
+ VIEWERS_SUFFIX = 'viewing this case';
2283
+ EDITORS_PREFIX = 'This case is being updated by ';
2284
+ EDITORS_SUFFIX = '';
2285
+ constructor(activityPollingService) {
2286
+ this.activityPollingService = activityPollingService;
2133
2287
  }
2134
- isOptional() {
2135
- return !_.isEmpty(this.display_context)
2136
- && this.display_context.toUpperCase() === 'OPTIONAL';
2288
+ ngOnInit() {
2289
+ this.activity = new Activity();
2290
+ this.activity.caseId = this.caseId;
2291
+ this.activity.editors = [];
2292
+ this.activity.unknownEditors = 0;
2293
+ this.activity.viewers = [];
2294
+ this.activity.unknownViewers = 0;
2295
+ this.viewersText = '';
2296
+ this.editorsText = '';
2297
+ this.subscription = this.activityPollingService.subscribeToActivity(this.caseId, newActivity => this.onActivityChange(newActivity));
2137
2298
  }
2138
- isMandatory() {
2139
- return !_.isEmpty(this.display_context)
2140
- && this.display_context.toUpperCase() === 'MANDATORY';
2299
+ onActivityChange(newActivity) {
2300
+ this.activity = newActivity;
2301
+ this.viewersText = this.generateDescription(this.VIEWERS_PREFIX, this.VIEWERS_SUFFIX, this.activity.viewers, this.activity.unknownViewers);
2302
+ this.editorsText = this.generateDescription(this.EDITORS_PREFIX, this.EDITORS_SUFFIX, this.activity.editors, this.activity.unknownEditors);
2141
2303
  }
2142
- isCollection() {
2143
- return this.field_type && this.field_type.type === 'Collection';
2304
+ isActivityEnabled() {
2305
+ return this.activityPollingService.isEnabled;
2144
2306
  }
2145
- isComplex() {
2146
- return this.field_type && this.field_type.type === 'Complex';
2307
+ isActiveCase() {
2308
+ return this.activity.editors.length || this.activity.viewers.length || this.activity.unknownEditors || this.activity.unknownViewers;
2147
2309
  }
2148
- isDynamic() {
2149
- const dynamicFieldTypes = ['DynamicList', 'DynamicRadioList', 'DynamicMultiSelectList'];
2150
- if (!this.field_type) {
2151
- return false;
2152
- }
2153
- return dynamicFieldTypes.some(t => t === this.field_type.type);
2310
+ viewersPresent() {
2311
+ return (this.activity.viewers.length > 0 || this.activity.unknownViewers > 0);
2154
2312
  }
2155
- isCaseLink() {
2156
- return this.isComplex()
2157
- && this.field_type.id === 'CaseLink'
2158
- && this.field_type.complex_fields.some(cf => cf.id === 'CaseReference');
2313
+ editorsPresent() {
2314
+ return (this.activity.editors.length > 0 || this.activity.unknownEditors > 0);
2159
2315
  }
2160
- extractBracketValue(fmt, paramName, leftBracket = '(', rightBracket = ')') {
2161
- fmt = fmt.split(',')
2162
- .find(a => a.trim().startsWith(paramName));
2163
- if (fmt) {
2164
- const s = fmt.indexOf(leftBracket) + 1;
2165
- const e = fmt.indexOf(rightBracket, s);
2166
- if (e > s && s >= 0) {
2167
- return fmt.substr(s, (e - s));
2168
- }
2316
+ ngOnDestroy() {
2317
+ if (this.subscription) {
2318
+ this.subscription.complete();
2169
2319
  }
2170
- return null;
2320
+ this.activityPollingService.stopPolling();
2171
2321
  }
2172
- // Ascend the hierarchy to get the full path of the field
2173
- getHierachicalId(curr) {
2174
- const prefix = curr ? curr + "_" : "";
2175
- if (prefix.length < 1024) {
2176
- if (this.parent) {
2177
- return this.parent.getHierachicalId(prefix + this.id);
2178
- }
2179
- else {
2180
- return prefix + this.id;
2181
- }
2182
- }
2183
- else {
2184
- CaseField.logger.error('Path too long, possible circular reference in case field hierarchy.');
2185
- return this.id;
2186
- }
2187
- }
2188
- set isTranslated(val) {
2189
- this.isTranslatedFlag = val;
2190
- }
2191
- get isTranslated() {
2192
- return this.isTranslatedFlag;
2193
- }
2194
- }
2195
- __decorate([
2196
- Exclude(),
2197
- __metadata("design:type", CaseField)
2198
- ], CaseField.prototype, "parent", void 0);
2199
- __decorate([
2200
- Type(() => FieldType),
2201
- __metadata("design:type", FieldType)
2202
- ], CaseField.prototype, "field_type", void 0);
2203
- __decorate([
2204
- Type(() => WizardPageField),
2205
- __metadata("design:type", WizardPageField)
2206
- ], CaseField.prototype, "wizardProps", void 0);
2207
- __decorate([
2208
- Expose(),
2209
- __metadata("design:type", Object),
2210
- __metadata("design:paramtypes", [Object])
2211
- ], CaseField.prototype, "value", null);
2212
- __decorate([
2213
- Expose(),
2214
- __metadata("design:type", Object),
2215
- __metadata("design:paramtypes", [Object])
2216
- ], CaseField.prototype, "list_items", null);
2217
- __decorate([
2218
- Expose(),
2219
- __metadata("design:type", String),
2220
- __metadata("design:paramtypes", [])
2221
- ], CaseField.prototype, "dateTimeEntryFormat", null);
2222
- __decorate([
2223
- Expose(),
2224
- __metadata("design:type", String),
2225
- __metadata("design:paramtypes", [])
2226
- ], CaseField.prototype, "dateTimeDisplayFormat", null);
2227
- __decorate([
2228
- Expose(),
2229
- __metadata("design:type", Function),
2230
- __metadata("design:paramtypes", []),
2231
- __metadata("design:returntype", void 0)
2232
- ], CaseField.prototype, "isComplexDisplay", null);
2233
- __decorate([
2234
- Expose(),
2235
- __metadata("design:type", Function),
2236
- __metadata("design:paramtypes", []),
2237
- __metadata("design:returntype", void 0)
2238
- ], CaseField.prototype, "isComplexEntry", null);
2239
- __decorate([
2240
- Expose(),
2241
- __metadata("design:type", Function),
2242
- __metadata("design:paramtypes", []),
2243
- __metadata("design:returntype", void 0)
2244
- ], CaseField.prototype, "isReadonly", null);
2245
- __decorate([
2246
- Expose(),
2247
- __metadata("design:type", Function),
2248
- __metadata("design:paramtypes", []),
2249
- __metadata("design:returntype", void 0)
2250
- ], CaseField.prototype, "isOptional", null);
2251
- __decorate([
2252
- Expose(),
2253
- __metadata("design:type", Function),
2254
- __metadata("design:paramtypes", []),
2255
- __metadata("design:returntype", void 0)
2256
- ], CaseField.prototype, "isMandatory", null);
2257
- __decorate([
2258
- Expose(),
2259
- __metadata("design:type", Function),
2260
- __metadata("design:paramtypes", []),
2261
- __metadata("design:returntype", Boolean)
2262
- ], CaseField.prototype, "isCollection", null);
2263
- __decorate([
2264
- Expose(),
2265
- __metadata("design:type", Function),
2266
- __metadata("design:paramtypes", []),
2267
- __metadata("design:returntype", Boolean)
2268
- ], CaseField.prototype, "isComplex", null);
2269
- __decorate([
2270
- Expose(),
2271
- __metadata("design:type", Function),
2272
- __metadata("design:paramtypes", []),
2273
- __metadata("design:returntype", Boolean)
2274
- ], CaseField.prototype, "isDynamic", null);
2275
- __decorate([
2276
- Expose(),
2277
- __metadata("design:type", Function),
2278
- __metadata("design:paramtypes", []),
2279
- __metadata("design:returntype", Boolean)
2280
- ], CaseField.prototype, "isCaseLink", null);
2281
- __decorate([
2282
- Expose(),
2283
- __metadata("design:type", Function),
2284
- __metadata("design:paramtypes", [String]),
2285
- __metadata("design:returntype", String)
2286
- ], CaseField.prototype, "getHierachicalId", null);
2287
-
2288
- // @dynamic
2289
- class WizardPage {
2290
- id;
2291
- label;
2292
- order;
2293
- wizard_page_fields;
2294
- case_fields;
2295
- show_condition;
2296
- parsedShowCondition;
2297
- getCol1Fields() {
2298
- return this.case_fields?.filter(f => !f.wizardProps.page_column_no || f.wizardProps.page_column_no === 1);
2299
- }
2300
- getCol2Fields() {
2301
- return this.case_fields?.filter(f => f.wizardProps.page_column_no === 2);
2302
- }
2303
- isMultiColumn() {
2304
- return this.getCol2Fields()?.length > 0;
2305
- }
2306
- }
2307
- __decorate([
2308
- Type(() => WizardPageField),
2309
- __metadata("design:type", Array)
2310
- ], WizardPage.prototype, "wizard_page_fields", void 0);
2311
- __decorate([
2312
- Type(() => CaseField),
2313
- __metadata("design:type", Array)
2314
- ], WizardPage.prototype, "case_fields", void 0);
2315
-
2316
- // @dynamic
2317
- class CaseEventTrigger {
2318
- id;
2319
- name;
2320
- description;
2321
- case_id;
2322
- case_fields;
2323
- event_token;
2324
- wizard_pages;
2325
- show_summary;
2326
- show_event_notes;
2327
- end_button_label;
2328
- can_save_draft;
2329
- hasFields() {
2330
- return this.case_fields && this.case_fields.length !== 0;
2331
- }
2332
- hasPages() {
2333
- return this.wizard_pages && this.wizard_pages.length !== 0;
2334
- }
2335
- }
2336
- __decorate([
2337
- Type(() => CaseField),
2338
- __metadata("design:type", Array)
2339
- ], CaseEventTrigger.prototype, "case_fields", void 0);
2340
- __decorate([
2341
- Type(() => WizardPage),
2342
- __metadata("design:type", Array)
2343
- ], CaseEventTrigger.prototype, "wizard_pages", void 0);
2344
-
2345
- // tslint:disable:variable-name
2346
- class CaseViewEvent {
2347
- id;
2348
- timestamp;
2349
- summary;
2350
- comment;
2351
- event_id;
2352
- event_name;
2353
- state_id;
2354
- state_name;
2355
- user_id;
2356
- user_last_name;
2357
- user_first_name;
2358
- significant_item;
2359
- }
2360
-
2361
- class CaseViewTrigger {
2362
- id;
2363
- name;
2364
- description;
2365
- order;
2366
- }
2367
-
2368
- class CaseEvent {
2369
- id;
2370
- name;
2371
- post_state;
2372
- pre_states;
2373
- case_fields;
2374
- description;
2375
- order;
2376
- acls;
2377
- }
2378
-
2379
- class CaseState {
2380
- id;
2381
- name;
2382
- description;
2383
- order;
2384
- }
2385
-
2386
- // Light clone of CaseType to be used in Jurisdiction class
2387
- // to avoid cyclic dependency
2388
- class CaseTypeLite {
2389
- id;
2390
- name;
2391
- events;
2392
- states;
2393
- description;
2394
- }
2395
-
2396
- // @dynamics
2397
- class CaseType {
2398
- id;
2399
- name;
2400
- events;
2401
- states;
2402
- case_fields;
2403
- description;
2404
- jurisdiction;
2405
- printEnabled;
2406
- }
2407
- __decorate([
2408
- Type(() => CaseField),
2409
- __metadata("design:type", Array)
2410
- ], CaseType.prototype, "case_fields", void 0);
2411
-
2412
- // tslint:disable:variable-name
2413
- class EventCaseField {
2414
- case_field_id;
2415
- showCondition;
2416
- }
2417
-
2418
- class Banner {
2419
- bannerDescription;
2420
- bannerUrlText;
2421
- bannerUrl;
2422
- bannerViewed;
2423
- bannerEnabled;
2424
- }
2425
-
2426
- // @dynamic
2427
- class CaseTab {
2428
- id;
2429
- label;
2430
- order;
2431
- fields;
2432
- show_condition;
2433
- defaultFocus;
2434
- }
2435
- __decorate([
2436
- Type(() => CaseField),
2437
- __metadata("design:type", Array)
2438
- ], CaseTab.prototype, "fields", void 0);
2439
-
2440
- // @dynamic
2441
- class CaseView {
2442
- case_id;
2443
- case_type;
2444
- state;
2445
- channels;
2446
- tabs;
2447
- triggers;
2448
- events;
2449
- metadataFields;
2450
- basicFields;
2451
- case_flag;
2452
- }
2453
- __decorate([
2454
- Type(() => CaseTab),
2455
- __metadata("design:type", Array)
2456
- ], CaseView.prototype, "tabs", void 0);
2457
- __decorate([
2458
- Type(() => CaseField),
2459
- __metadata("design:type", Array)
2460
- ], CaseView.prototype, "metadataFields", void 0);
2461
-
2462
- class CasePrintDocument {
2463
- name;
2464
- type;
2465
- url;
2466
- }
2467
-
2468
- var RoleCategory;
2469
- (function (RoleCategory) {
2470
- RoleCategory["JUDICIAL"] = "JUDICIAL";
2471
- RoleCategory["LEGAL_OPERATIONS"] = "LEGAL_OPERATIONS";
2472
- RoleCategory["ADMIN"] = "ADMIN";
2473
- RoleCategory["CTSC"] = "CTSC";
2474
- RoleCategory["PROFESSIONAL"] = "PROFESSIONAL";
2475
- RoleCategory["CITIZEN"] = "CITIZEN";
2476
- RoleCategory["ENFORCEMENT"] = "ENFORCEMENT";
2477
- })(RoleCategory || (RoleCategory = {}));
2478
- var AMRoleSuffix;
2479
- (function (AMRoleSuffix) {
2480
- AMRoleSuffix["JUDICIARY"] = "judiciary";
2481
- AMRoleSuffix["ADMIN"] = "admin";
2482
- AMRoleSuffix["PROFESSIONAL"] = "professional";
2483
- AMRoleSuffix["LEGAL_OPERATIONS"] = "legal-ops";
2484
- AMRoleSuffix["CITIZEN"] = "citizen";
2485
- AMRoleSuffix["CTSC"] = "ctsc";
2486
- AMRoleSuffix["ENFORCEMENT"] = "enforcement";
2487
- })(AMRoleSuffix || (AMRoleSuffix = {}));
2488
- var RoleKeyword;
2489
- (function (RoleKeyword) {
2490
- RoleKeyword["JUDGE"] = "judge";
2491
- RoleKeyword["ADMIN"] = "admin";
2492
- RoleKeyword["SOLICITOR"] = "solicitor";
2493
- RoleKeyword["CITIZEN"] = "citizen";
2494
- RoleKeyword["CTSC"] = "ctsc";
2495
- RoleKeyword["CASEWORKER"] = "caseworker";
2496
- RoleKeyword["ENFORCEMENT"] = "enforcement";
2497
- })(RoleKeyword || (RoleKeyword = {}));
2498
-
2499
- // tslint:disable:variable-name
2500
- class HRef {
2501
- href;
2502
- }
2503
- class DocumentLinks {
2504
- self;
2505
- binary;
2506
- }
2507
- class Document {
2508
- _links;
2509
- originalDocumentName;
2510
- hashToken;
2511
- }
2512
- class Embedded {
2513
- documents;
2514
- }
2515
- class DocumentData {
2516
- _embedded;
2517
- documents;
2518
- }
2519
- class FormDocument {
2520
- document_url;
2521
- document_binary_url;
2522
- document_filename;
2523
- document_hash;
2524
- upload_timestamp;
2525
- }
2526
-
2527
- const DRAFT_PREFIX = 'DRAFT';
2528
- const DRAFT_QUERY_PARAM = 'draft';
2529
- class Draft {
2530
- id;
2531
- document;
2532
- type;
2533
- created;
2534
- updated;
2535
- static stripDraftId(draftId) {
2536
- return draftId.slice(DRAFT_PREFIX.length);
2537
- }
2538
- static isDraft(id) {
2539
- return String(id).startsWith(DRAFT_PREFIX);
2540
- }
2541
- }
2542
-
2543
- class OrganisationConverter {
2544
- static toSimpleAddress(organisationModel) {
2545
- let simpleAddress = '';
2546
- if (organisationModel.addressLine1) {
2547
- simpleAddress += `${organisationModel.addressLine1}<br>`;
2548
- }
2549
- if (organisationModel.addressLine2) {
2550
- simpleAddress += `${organisationModel.addressLine2}<br>`;
2551
- }
2552
- if (organisationModel.addressLine3) {
2553
- simpleAddress += `${organisationModel.addressLine3}<br>`;
2554
- }
2555
- if (organisationModel.townCity) {
2556
- simpleAddress += `${organisationModel.townCity}<br>`;
2557
- }
2558
- if (organisationModel.county) {
2559
- simpleAddress += `${organisationModel.county}<br>`;
2560
- }
2561
- if (organisationModel.country) {
2562
- simpleAddress += `${organisationModel.country}<br>`;
2563
- }
2564
- if (organisationModel.postCode) {
2565
- simpleAddress += `${organisationModel.postCode}<br>`;
2566
- }
2567
- return simpleAddress;
2568
- }
2569
- toSimpleOrganisationModel(organisationModel) {
2570
- return {
2571
- organisationIdentifier: organisationModel.organisationIdentifier,
2572
- name: organisationModel.name,
2573
- address: OrganisationConverter.toSimpleAddress(organisationModel)
2574
- };
2575
- }
2576
- static ɵfac = function OrganisationConverter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OrganisationConverter)(); };
2577
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: OrganisationConverter, factory: OrganisationConverter.ɵfac });
2578
- }
2579
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OrganisationConverter, [{
2580
- type: Injectable
2581
- }], null, null); })();
2582
-
2583
- class PaginationMetadata {
2584
- totalResultsCount;
2585
- totalPagesCount;
2586
- }
2587
-
2588
- class Field {
2589
- id;
2590
- field_type;
2591
- elementPath;
2592
- value;
2593
- label;
2594
- metadata;
2595
- constructor(id, field_type, elementPath, value, label, metadata) {
2596
- this.id = id;
2597
- this.field_type = field_type;
2598
- this.elementPath = elementPath;
2599
- this.value = value;
2600
- this.label = label;
2601
- this.metadata = metadata;
2602
- }
2603
- }
2604
-
2605
- class SearchResultViewColumn {
2606
- case_field_id;
2607
- case_field_type;
2608
- display_context;
2609
- display_context_parameter;
2610
- label;
2611
- order;
2612
- }
2613
-
2614
- // @dynamic
2615
- class SearchResultViewItem {
2616
- case_id;
2617
- case_fields;
2618
- hydrated_case_fields;
2619
- columns;
2620
- supplementary_data;
2621
- display_context_parameter;
2622
- }
2623
- __decorate([
2624
- Type(() => CaseField),
2625
- __metadata("design:type", Array)
2626
- ], SearchResultViewItem.prototype, "hydrated_case_fields", void 0);
2627
-
2628
- // @dynamic
2629
- class SearchResultView {
2630
- columns;
2631
- results;
2632
- result_error;
2633
- hasDrafts() {
2634
- return this.results[0]
2635
- && this.results[0].case_id
2636
- && Draft.isDraft(this.results[0].case_id);
2637
- }
2638
- }
2639
- __decorate([
2640
- Type(() => SearchResultViewColumn),
2641
- __metadata("design:type", Array)
2642
- ], SearchResultView.prototype, "columns", void 0);
2643
- __decorate([
2644
- Type(() => SearchResultViewItem),
2645
- __metadata("design:type", Array)
2646
- ], SearchResultView.prototype, "results", void 0);
2647
-
2648
- class SortParameters {
2649
- comparator;
2650
- sortOrder;
2651
- constructor(comparator, sortOrder) {
2652
- this.comparator = comparator;
2653
- this.sortOrder = sortOrder;
2654
- }
2655
- }
2656
-
2657
- var SortOrder$1;
2658
- (function (SortOrder) {
2659
- SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
2660
- SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
2661
- SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
2662
- })(SortOrder$1 || (SortOrder$1 = {}));
2663
-
2664
- const STAFF_CACHE_ROLE_CATEGORIES = new Set([
2665
- RoleCategory.ADMIN,
2666
- RoleCategory.CTSC,
2667
- RoleCategory.LEGAL_OPERATIONS
2668
- ]);
2669
- const SUPPORTED_ROLE_CATEGORIES = new Set([
2670
- ...STAFF_CACHE_ROLE_CATEGORIES,
2671
- RoleCategory.JUDICIAL,
2672
- ]);
2673
- // Aliases allow the definition to use the shorter, hyphenated form within #ARGUMENT(...)
2674
- const ROLE_CATEGORY_ALIASES = {
2675
- LEGAL_OPS: RoleCategory.LEGAL_OPERATIONS
2676
- };
2677
- const ARGUMENT_REGEX = /#ARGUMENT\(([^)]*)\)/;
2678
- const CATEGORY_PREFIX = 'CATEGORY-';
2679
- const REGION_PREFIX = 'REGION-';
2680
- /**
2681
- * Parses the `display_context_parameter` of a StaffUser field to determine the filters to apply
2682
- * when searching reference data.
2683
- *
2684
- * Expected format: `#ARGUMENT(CATEGORY-LEGAL-OPS,CATEGORY-ADMIN,REGION-1235)`
2685
- */
2686
- function parseStaffUserSearchConfiguration(displayContextParameter) {
2687
- if (!displayContextParameter) {
2688
- return invalidConfiguration();
2689
- }
2690
- const match = ARGUMENT_REGEX.exec(displayContextParameter);
2691
- if (!match?.[1]) {
2692
- return invalidConfiguration();
2693
- }
2694
- const tokens = match[1].split(',').map(token => token.trim());
2695
- if (tokens.some(token => !token)) {
2696
- return invalidConfiguration();
2697
- }
2698
- const roleCategories = [];
2699
- for (const token of tokens) {
2700
- if (token.startsWith(CATEGORY_PREFIX)) {
2701
- const category = normaliseRoleCategory(token.substring(CATEGORY_PREFIX.length));
2702
- if (!isStaffUserRoleCategory(category)) {
2703
- return invalidConfiguration();
2704
- }
2705
- if (!roleCategories.includes(category)) {
2706
- roleCategories.push(category);
2707
- }
2708
- }
2709
- else if (token.startsWith(REGION_PREFIX)) {
2710
- // Region filtering is not supported in this version; REGION- tokens are silently ignored
2711
- }
2712
- else {
2713
- return invalidConfiguration();
2714
- }
2715
- }
2716
- if (!roleCategories.length) {
2717
- return invalidConfiguration();
2718
- }
2719
- return {
2720
- valid: true,
2721
- configuration: {
2722
- roleCategories,
2723
- staffRoleCategories: roleCategories.filter(isStaffCacheRoleCategory),
2724
- includesJudicial: roleCategories.includes(RoleCategory.JUDICIAL)
2725
- }
2726
- };
2727
- }
2728
- function normaliseRoleCategory(category) {
2729
- const normalised = category.replaceAll('-', '_');
2730
- return ROLE_CATEGORY_ALIASES[normalised] || normalised;
2731
- }
2732
- function isStaffUserRoleCategory(category) {
2733
- return SUPPORTED_ROLE_CATEGORIES.has(category);
2734
- }
2735
- function isStaffCacheRoleCategory(category) {
2736
- return STAFF_CACHE_ROLE_CATEGORIES.has(category);
2737
- }
2738
- function invalidConfiguration() {
2739
- return { valid: false, error: 'INVALID_ROLE_CATEGORIES' };
2740
- }
2741
-
2742
- class WorkbasketInputModel {
2743
- label;
2744
- order;
2745
- field;
2746
- metadata;
2747
- display_context_parameter;
2748
- }
2749
- class WorkbasketInput {
2750
- workbasketInputs;
2751
- }
2752
-
2753
- const USER_DETAILS = 'userDetails';
2754
- const PUI_CASE_MANAGER = 'pui-case-manager';
2755
- function getUserDetails(sessionStorageService) {
2756
- const item = sessionStorageService?.getItem(USER_DETAILS);
2757
- return safeJsonParse(item, null);
2758
- }
2759
- function isInternalUser(sessionStorageService) {
2760
- const userDetails = getUserDetails(sessionStorageService);
2761
- return !!userDetails?.roles &&
2762
- !userDetails.roles.includes(PUI_CASE_MANAGER) &&
2763
- !userDetails.roles.some(role => role.toLowerCase().includes(RoleKeyword.JUDGE));
2764
- }
2765
- function isJudiciaryUser(sessionStorageService) {
2766
- const userDetails = getUserDetails(sessionStorageService);
2767
- return !!userDetails?.roles
2768
- && (userDetails.roles.some((role) => role.toLowerCase().includes(RoleKeyword.JUDGE)));
2769
- }
2770
- function roleHasKeyword(keyword, roleWords) {
2771
- return roleWords.includes(keyword);
2772
- }
2773
- function isWorkAllocationUser(sessionStorageService) {
2774
- const userDetails = getUserDetails(sessionStorageService);
2775
- return userDetails?.roles
2776
- && !userDetails.roles.includes(PUI_CASE_MANAGER)
2777
- &&
2778
- (userDetails.roles.includes('caseworker-ia-iacjudge')
2779
- || userDetails.roles.includes('caseworker-ia-caseofficer')
2780
- || userDetails.roles.includes('caseworker-ia-admofficer')
2781
- || userDetails.roles.includes('caseworker-civil')
2782
- || userDetails.roles.includes('caseworker-privatelaw'));
2783
- }
2784
- // fallback purely if roleCategories is not available in
2785
- function getMappedRoleCategories(roles = []) {
2786
- const roleKeywords = roles.join().split('-').join().split(',');
2787
- const roleCategoryList = [];
2788
- if (roleHasKeyword(RoleKeyword.JUDGE, roleKeywords)) {
2789
- roleCategoryList.push(RoleCategory.JUDICIAL);
2790
- }
2791
- if (roleHasKeyword(RoleKeyword.SOLICITOR, roleKeywords)) {
2792
- roleCategoryList.push(RoleCategory.PROFESSIONAL);
2793
- }
2794
- if (roleHasKeyword(RoleKeyword.CITIZEN, roleKeywords)) {
2795
- roleCategoryList.push(RoleCategory.CITIZEN);
2796
- }
2797
- if (roleHasKeyword(RoleKeyword.ADMIN, roleKeywords)) {
2798
- roleCategoryList.push(RoleCategory.ADMIN);
2799
- }
2800
- if (roleHasKeyword(RoleKeyword.CTSC, roleKeywords)) {
2801
- roleCategoryList.push(RoleCategory.CTSC);
2802
- }
2803
- if (roleHasKeyword(RoleKeyword.CASEWORKER, roleKeywords)) {
2804
- roleCategoryList.push(RoleCategory.LEGAL_OPERATIONS);
2805
- }
2806
- if (roleHasKeyword(RoleKeyword.ENFORCEMENT, roleKeywords)) {
2807
- roleCategoryList.push(RoleCategory.ENFORCEMENT);
2808
- }
2809
- return roleCategoryList;
2810
- }
2811
- function getAMRoleName(accessType, aMRole) {
2812
- let roleName = '';
2813
- switch (aMRole) {
2814
- case RoleCategory.JUDICIAL:
2815
- roleName = `${accessType}-access-${AMRoleSuffix.JUDICIARY}`;
2816
- break;
2817
- case RoleCategory.PROFESSIONAL:
2818
- roleName = `${accessType}-access-${AMRoleSuffix.PROFESSIONAL}`;
2819
- break;
2820
- case RoleCategory.CITIZEN:
2821
- roleName = `${accessType}-access-${AMRoleSuffix.CITIZEN}`;
2822
- break;
2823
- case RoleCategory.ADMIN:
2824
- roleName = `${accessType}-access-${AMRoleSuffix.ADMIN}`;
2825
- break;
2826
- case RoleCategory.CTSC:
2827
- roleName = `${accessType}-access-${AMRoleSuffix.CTSC}`;
2828
- break;
2829
- case RoleCategory.ENFORCEMENT:
2830
- roleName = `${accessType}-access-${AMRoleSuffix.ENFORCEMENT}`;
2831
- break;
2832
- default:
2833
- roleName = `${accessType}-access-${AMRoleSuffix.LEGAL_OPERATIONS}`;
2834
- break;
2835
- }
2836
- return roleName;
2837
- }
2838
-
2839
- // @dynamic
2840
- class ActivityService {
2841
- http;
2842
- appConfig;
2843
- sessionStorageService;
2844
- static get ACTIVITY_VIEW() { return 'view'; }
2845
- static get ACTIVITY_EDIT() { return 'edit'; }
2846
- logger = new StructuredLoggerService();
2847
- constructor(http, appConfig, sessionStorageService) {
2848
- this.http = http;
2849
- this.appConfig = appConfig;
2850
- this.sessionStorageService = sessionStorageService;
2851
- }
2852
- get isEnabled() {
2853
- return this.activityUrl() && this.userAuthorised;
2854
- }
2855
- static DUMMY_CASE_REFERENCE = '0';
2856
- userAuthorised = undefined;
2857
- static handleHttpError(response) {
2858
- const error = HttpErrorService.convertToHttpError(response);
2859
- if (response?.status !== error.status) {
2860
- error.status = response.status;
2861
- }
2862
- return error;
2863
- }
2864
- getOptions() {
2865
- const userDetails = safeJsonParse(this.sessionStorageService.getItem(USER_DETAILS));
2866
- let headers = new HttpHeaders().set('Content-Type', 'application/json');
2867
- if (userDetails?.token) {
2868
- headers = headers.set('Authorization', userDetails.token);
2869
- }
2870
- return {
2871
- headers,
2872
- withCredentials: true,
2873
- observe: 'body',
2874
- };
2875
- }
2876
- getActivities(...caseId) {
2877
- try {
2878
- const options = this.getOptions();
2879
- const url = `${this.activityUrl()}/cases/${caseId.join(',')}/activity`;
2880
- return this.http
2881
- .get(url, options, false, ActivityService.handleHttpError)
2882
- .pipe(map(response => response));
2883
- }
2884
- catch (error) {
2885
- this.logUserMayNotBeAuthenticated(error);
2886
- }
2887
- }
2888
- postActivity(caseId, activity) {
2889
- try {
2890
- const options = this.getOptions();
2891
- const url = `${this.activityUrl()}/cases/${caseId}/activity`;
2892
- const body = { activity };
2893
- return this.http
2894
- .post(url, body, options, false)
2895
- .pipe(map(response => response));
2896
- }
2897
- catch (error) {
2898
- this.logUserMayNotBeAuthenticated(error);
2899
- }
2900
- }
2901
- verifyUserIsAuthorized() {
2902
- if (this.sessionStorageService.getItem(USER_DETAILS) && this.activityUrl() && this.userAuthorised === undefined) {
2903
- this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(() => this.userAuthorised = true, error => {
2904
- this.userAuthorised = [401, 403].indexOf(error.status) <= -1;
2905
- });
2906
- }
2907
- }
2908
- activityUrl() {
2909
- return this.appConfig.getActivityUrl();
2910
- }
2911
- logUserMayNotBeAuthenticated(error) {
2912
- this.logger.error('User may not be authenticated. Activity request was not sent.', { error });
2913
- }
2914
- static ɵfac = function ActivityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(SessionStorageService)); };
2915
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac });
2916
- }
2917
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
2918
- type: Injectable
2919
- }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: SessionStorageService }], null); })();
2920
-
2921
- // @dynamic
2922
- class ActivityPollingService {
2923
- activityService;
2924
- ngZone;
2925
- config;
2926
- logger = new StructuredLoggerService();
2927
- pendingRequests = new Map();
2928
- currentTimeoutHandle;
2929
- pollActivitiesSubscription;
2930
- pollConfig;
2931
- batchCollectionDelayMs;
2932
- maxRequestsPerBatch;
2933
- constructor(activityService, ngZone, config) {
2934
- this.activityService = activityService;
2935
- this.ngZone = ngZone;
2936
- this.config = config;
2937
- this.pollConfig = {
2938
- interval: config.getActivityNexPollRequestMs(),
2939
- attempts: config.getActivityRetry()
2940
- };
2941
- this.batchCollectionDelayMs = config.getActivityBatchCollectionDelayMs();
2942
- this.maxRequestsPerBatch = config.getActivityMaxRequestPerBatch();
2943
- }
2944
- get isEnabled() {
2945
- return this.activityService.isEnabled;
2946
- }
2947
- subscribeToActivity(caseId, done) {
2948
- if (!this.isEnabled) {
2949
- return new Subject();
2950
- }
2951
- let subject = this.pendingRequests.get(caseId);
2952
- if (subject) {
2953
- subject.subscribe(done);
2954
- }
2955
- else {
2956
- // Only the first pending request should start the batch collection timer.
2957
- const wasEmpty = this.pendingRequests.size === 0;
2958
- subject = new Subject();
2959
- subject.subscribe(done);
2960
- this.addPendingRequest(caseId, subject);
2961
- if (wasEmpty) {
2962
- this.ngZone.runOutsideAngular(() => {
2963
- this.currentTimeoutHandle = setTimeout(() => this.ngZone.run(() => {
2964
- this.flushRequests();
2965
- }), this.batchCollectionDelayMs);
2966
- });
2967
- }
2968
- }
2969
- if (this.pendingRequests.size >= this.maxRequestsPerBatch) {
2970
- this.flushRequests();
2971
- }
2972
- return subject;
2973
- }
2974
- stopPolling() {
2975
- if (this.pollActivitiesSubscription) {
2976
- this.pollActivitiesSubscription.unsubscribe();
2977
- }
2978
- }
2979
- flushRequests() {
2980
- if (this.currentTimeoutHandle) {
2981
- clearTimeout(this.currentTimeoutHandle);
2982
- this.currentTimeoutHandle = undefined;
2983
- }
2984
- if (!this.pendingRequests.size) {
2985
- return;
2986
- }
2987
- const requests = new Map(this.pendingRequests);
2988
- this.pendingRequests.clear();
2989
- this.performBatchRequest(requests);
2990
- }
2991
- pollActivities(...caseIds) {
2992
- if (!this.isEnabled) {
2993
- return EMPTY;
2994
- }
2995
- return this.polling(this.activityService.getActivities(...caseIds), this.pollConfig);
2996
- }
2997
- postViewActivity(caseId) {
2998
- return this.postActivity(caseId, ActivityService.ACTIVITY_VIEW);
2999
- }
3000
- postEditActivity(caseId) {
3001
- return this.postActivity(caseId, ActivityService.ACTIVITY_EDIT);
3002
- }
3003
- performBatchRequest(requests) {
3004
- const caseIds = Array.from(requests.keys()).join();
3005
- this.ngZone.runOutsideAngular(() => {
3006
- // run polling outside angular zone so it does not trigger change detection
3007
- this.pollActivitiesSubscription = this.pollActivities(caseIds).subscribe({
3008
- // process activity inside zone so it triggers change detection for activity.component.ts
3009
- next: (activities) => this.ngZone.run(() => {
3010
- activities.forEach((activity) => {
3011
- // Ignore activities returned for cases outside this local batch.
3012
- requests.get(activity.caseId)?.next(activity);
3013
- });
3014
- }),
3015
- error: (err) => this.ngZone.run(() => {
3016
- this.logger.error('Error while polling activities.', { error: err });
3017
- Array.from(requests.values()).forEach((subject) => subject.error(err));
3018
- })
3019
- });
3020
- });
3021
- }
3022
- postActivity(caseId, activityType) {
3023
- if (!this.isEnabled) {
3024
- return EMPTY;
3025
- }
3026
- const pollingConfig = {
3027
- ...this.pollConfig,
3028
- interval: 5000 // inline with CCD Backend
3029
- };
3030
- return this.polling(this.activityService.postActivity(caseId, activityType), pollingConfig);
3031
- }
3032
- addPendingRequest(caseId, subject) {
3033
- this.pendingRequests.set(caseId, subject);
3034
- // Components complete their returned Subject on destroy; remove it so a later same-case subscription gets a fresh Subject.
3035
- subject.subscribe({
3036
- complete: () => this.removePendingRequest(caseId, subject),
3037
- error: () => this.removePendingRequest(caseId, subject)
3038
- });
3039
- }
3040
- removePendingRequest(caseId, subject) {
3041
- if (this.pendingRequests.get(caseId) !== subject) {
3042
- return;
3043
- }
3044
- this.pendingRequests.delete(caseId);
3045
- if (!this.pendingRequests.size && this.currentTimeoutHandle) {
3046
- clearTimeout(this.currentTimeoutHandle);
3047
- this.currentTimeoutHandle = undefined;
3048
- }
3049
- }
3050
- polling(request$, options) {
3051
- const pollingOptions = {
3052
- interval: options.interval,
3053
- attempts: options.attempts ?? 9,
3054
- exponentialUnit: options.exponentialUnit ?? 1000
3055
- };
3056
- return concat(request$, defer(() => timer(pollingOptions.interval).pipe(switchMap(() => request$))).pipe(repeat())).pipe(
3057
- // Preserve consecutive-failure retry behaviour using the current RxJS retry config.
3058
- retry({
3059
- count: pollingOptions.attempts,
3060
- delay: (_error, retryCount) => timer(this.getExponentialRetryDelay(retryCount, pollingOptions.exponentialUnit)),
3061
- resetOnSuccess: true
3062
- }));
3063
- }
3064
- getExponentialRetryDelay(consecutiveErrorsCount, exponentialUnit) {
3065
- return Math.pow(2, consecutiveErrorsCount - 1) * exponentialUnit;
3066
- }
3067
- static ɵfac = function ActivityPollingService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityPollingService)(i0.ɵɵinject(ActivityService), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(AbstractAppConfig)); };
3068
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityPollingService, factory: ActivityPollingService.ɵfac });
3069
- }
3070
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityPollingService, [{
3071
- type: Injectable
3072
- }], () => [{ type: ActivityService }, { type: i0.NgZone }, { type: AbstractAppConfig }], null); })();
3073
-
3074
- function ActivityComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
3075
- i0.ɵɵelementStart(0, "div");
3076
- i0.ɵɵelement(1, "ccd-activity-icon", 5);
3077
- i0.ɵɵpipe(2, "rpxTranslate");
3078
- i0.ɵɵelementEnd();
3079
- } if (rf & 2) {
3080
- const ctx_r0 = i0.ɵɵnextContext(2);
3081
- i0.ɵɵclassProp("activityEditorsAndViewersIcons", ctx_r0.viewersPresent())("activityEditorsIcon", !ctx_r0.viewersPresent());
3082
- i0.ɵɵadvance();
3083
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 5, ctx_r0.editorsText));
3084
- } }
3085
- function ActivityComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
3086
- i0.ɵɵelementStart(0, "div", 6);
3087
- i0.ɵɵelement(1, "ccd-activity-icon", 7);
3088
- i0.ɵɵpipe(2, "rpxTranslate");
3089
- i0.ɵɵelementEnd();
3090
- } if (rf & 2) {
3091
- const ctx_r0 = i0.ɵɵnextContext(2);
3092
- i0.ɵɵadvance();
3093
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
3094
- } }
3095
- function ActivityComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
3096
- i0.ɵɵelementStart(0, "div");
3097
- i0.ɵɵelement(1, "ccd-activity-banner", 8);
3098
- i0.ɵɵpipe(2, "rpxTranslate");
3099
- i0.ɵɵelementEnd();
3100
- } if (rf & 2) {
3101
- const ctx_r0 = i0.ɵɵnextContext(2);
3102
- i0.ɵɵadvance();
3103
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.editorsText));
3104
- } }
3105
- function ActivityComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
3106
- i0.ɵɵelementStart(0, "div");
3107
- i0.ɵɵelement(1, "ccd-activity-banner", 9);
3108
- i0.ɵɵpipe(2, "rpxTranslate");
3109
- i0.ɵɵelementEnd();
3110
- } if (rf & 2) {
3111
- const ctx_r0 = i0.ɵɵnextContext(2);
3112
- i0.ɵɵadvance();
3113
- i0.ɵɵproperty("description", i0.ɵɵpipeBind1(2, 1, ctx_r0.viewersText));
3114
- } }
3115
- function ActivityComponent_div_0_Template(rf, ctx) { if (rf & 1) {
3116
- i0.ɵɵelementStart(0, "div", 1);
3117
- 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);
3118
- i0.ɵɵelementEnd();
3119
- } if (rf & 2) {
3120
- const ctx_r0 = i0.ɵɵnextContext();
3121
- i0.ɵɵadvance();
3122
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.editorsPresent());
3123
- i0.ɵɵadvance();
3124
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.ICON && ctx_r0.viewersPresent());
3125
- i0.ɵɵadvance();
3126
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.editorsPresent());
3127
- i0.ɵɵadvance();
3128
- i0.ɵɵproperty("ngIf", ctx_r0.displayMode === ctx_r0.dspMode.BANNER && ctx_r0.viewersPresent());
3129
- } }
3130
- class ActivityComponent {
3131
- activityPollingService;
3132
- activity;
3133
- dspMode = DisplayMode;
3134
- viewersText;
3135
- editorsText;
3136
- subscription;
3137
- caseId;
3138
- displayMode;
3139
- VIEWERS_PREFIX = '';
3140
- VIEWERS_SUFFIX = 'viewing this case';
3141
- EDITORS_PREFIX = 'This case is being updated by ';
3142
- EDITORS_SUFFIX = '';
3143
- constructor(activityPollingService) {
3144
- this.activityPollingService = activityPollingService;
3145
- }
3146
- ngOnInit() {
3147
- this.activity = new Activity();
3148
- this.activity.caseId = this.caseId;
3149
- this.activity.editors = [];
3150
- this.activity.unknownEditors = 0;
3151
- this.activity.viewers = [];
3152
- this.activity.unknownViewers = 0;
3153
- this.viewersText = '';
3154
- this.editorsText = '';
3155
- this.subscription = this.activityPollingService.subscribeToActivity(this.caseId, newActivity => this.onActivityChange(newActivity));
3156
- }
3157
- onActivityChange(newActivity) {
3158
- this.activity = newActivity;
3159
- this.viewersText = this.generateDescription(this.VIEWERS_PREFIX, this.VIEWERS_SUFFIX, this.activity.viewers, this.activity.unknownViewers);
3160
- this.editorsText = this.generateDescription(this.EDITORS_PREFIX, this.EDITORS_SUFFIX, this.activity.editors, this.activity.unknownEditors);
3161
- }
3162
- isActivityEnabled() {
3163
- return this.activityPollingService.isEnabled;
3164
- }
3165
- isActiveCase() {
3166
- return this.activity.editors.length || this.activity.viewers.length || this.activity.unknownEditors || this.activity.unknownViewers;
3167
- }
3168
- viewersPresent() {
3169
- return (this.activity.viewers.length > 0 || this.activity.unknownViewers > 0);
3170
- }
3171
- editorsPresent() {
3172
- return (this.activity.editors.length > 0 || this.activity.unknownEditors > 0);
3173
- }
3174
- ngOnDestroy() {
3175
- if (this.subscription) {
3176
- this.subscription.complete();
3177
- }
3178
- this.activityPollingService.stopPolling();
3179
- }
3180
- generateDescription(prefix, suffix, namesArray, unknownCount) {
3181
- let resultText = prefix;
3182
- resultText += namesArray.map(activityInfo => `${activityInfo.forename} ${activityInfo.surname}`).join(', ');
3183
- if (unknownCount > 0) {
3184
- resultText += (namesArray.length > 0 ? ` and ${unknownCount} other` : `${unknownCount} user`);
3185
- resultText += (unknownCount > 1 ? 's' : '');
2322
+ generateDescription(prefix, suffix, namesArray, unknownCount) {
2323
+ let resultText = prefix;
2324
+ resultText += namesArray.map(activityInfo => `${activityInfo.forename} ${activityInfo.surname}`).join(', ');
2325
+ if (unknownCount > 0) {
2326
+ resultText += (namesArray.length > 0 ? ` and ${unknownCount} other` : `${unknownCount} user`);
2327
+ resultText += (unknownCount > 1 ? 's' : '');
3186
2328
  }
3187
2329
  else {
3188
2330
  resultText = this.replaceLastCommaWithAnd(resultText);
@@ -3402,12 +2544,28 @@ class AlertService {
3402
2544
  message: this.message
3403
2545
  });
3404
2546
  }
3405
- static ɵfac = function AlertService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AlertService)(i0.ɵɵinject(i1$2.Router), i0.ɵɵinject(i1.RpxTranslationService)); };
3406
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AlertService, factory: AlertService.ɵfac });
2547
+ static ɵfac = function AlertService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AlertService)(i0.ɵɵinject(i1$2.Router), i0.ɵɵinject(i1.RpxTranslationService)); };
2548
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AlertService, factory: AlertService.ɵfac });
2549
+ }
2550
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AlertService, [{
2551
+ type: Injectable
2552
+ }], () => [{ type: i1$2.Router }, { type: i1.RpxTranslationService }], null); })();
2553
+
2554
+ const DRAFT_PREFIX = 'DRAFT';
2555
+ const DRAFT_QUERY_PARAM = 'draft';
2556
+ class Draft {
2557
+ id;
2558
+ document;
2559
+ type;
2560
+ created;
2561
+ updated;
2562
+ static stripDraftId(draftId) {
2563
+ return draftId.slice(DRAFT_PREFIX.length);
2564
+ }
2565
+ static isDraft(id) {
2566
+ return String(id).startsWith(DRAFT_PREFIX);
2567
+ }
3407
2568
  }
3408
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AlertService, [{
3409
- type: Injectable
3410
- }], () => [{ type: i1$2.Router }, { type: i1.RpxTranslationService }], null); })();
3411
2569
 
3412
2570
  class DraftService {
3413
2571
  http;
@@ -3694,735 +2852,1479 @@ var UpdateFlagAddTranslationErrorMessage;
3694
2852
  UpdateFlagAddTranslationErrorMessage["COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Original comments or translation must be 200 characters or fewer";
3695
2853
  })(UpdateFlagAddTranslationErrorMessage || (UpdateFlagAddTranslationErrorMessage = {}));
3696
2854
 
3697
- var UpdateFlagAddTranslationStep;
3698
- (function (UpdateFlagAddTranslationStep) {
3699
- UpdateFlagAddTranslationStep["HINT_TEXT"] = "Write translation for flag description or comments in the boxes provided.";
3700
- UpdateFlagAddTranslationStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3701
- })(UpdateFlagAddTranslationStep || (UpdateFlagAddTranslationStep = {}));
2855
+ var UpdateFlagAddTranslationStep;
2856
+ (function (UpdateFlagAddTranslationStep) {
2857
+ UpdateFlagAddTranslationStep["HINT_TEXT"] = "Write translation for flag description or comments in the boxes provided.";
2858
+ UpdateFlagAddTranslationStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2859
+ })(UpdateFlagAddTranslationStep || (UpdateFlagAddTranslationStep = {}));
2860
+
2861
+ var UpdateFlagErrorMessage;
2862
+ (function (UpdateFlagErrorMessage) {
2863
+ UpdateFlagErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
2864
+ UpdateFlagErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
2865
+ UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
2866
+ UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED_EXTERNAL"] = "You must explain why the support is no longer needed";
2867
+ UpdateFlagErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
2868
+ UpdateFlagErrorMessage["NONE"] = "";
2869
+ })(UpdateFlagErrorMessage || (UpdateFlagErrorMessage = {}));
2870
+
2871
+ var UpdateFlagStep;
2872
+ (function (UpdateFlagStep) {
2873
+ UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL"] = "Explain why you are updating this flag. Do not include any sensitive information such as personal details.";
2874
+ 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.";
2875
+ UpdateFlagStep["COMMENT_HINT_TEXT_EXTERNAL"] = "Do not include any sensitive information such as personal details.";
2876
+ UpdateFlagStep["COMMENT_FIELD_LABEL_EXTERNAL"] = "Please provide your comments below";
2877
+ UpdateFlagStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2878
+ UpdateFlagStep["STATUS_HINT_TEXT"] = "Describe reason for status change.";
2879
+ UpdateFlagStep["STATUS_REASON_LABEL"] = "Reason for change";
2880
+ UpdateFlagStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
2881
+ })(UpdateFlagStep || (UpdateFlagStep = {}));
2882
+
2883
+ var CaseFlagFieldState;
2884
+ (function (CaseFlagFieldState) {
2885
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_LOCATION"] = 0] = "FLAG_LOCATION";
2886
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_TYPE"] = 1] = "FLAG_TYPE";
2887
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_LANGUAGE_INTERPRETER"] = 2] = "FLAG_LANGUAGE_INTERPRETER";
2888
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_COMMENTS"] = 3] = "FLAG_COMMENTS";
2889
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_STATUS"] = 4] = "FLAG_STATUS";
2890
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_MANAGE_CASE_FLAGS"] = 5] = "FLAG_MANAGE_CASE_FLAGS";
2891
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE"] = 6] = "FLAG_UPDATE";
2892
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE_WELSH_TRANSLATION"] = 7] = "FLAG_UPDATE_WELSH_TRANSLATION";
2893
+ })(CaseFlagFieldState || (CaseFlagFieldState = {}));
2894
+ var CaseFlagErrorMessage;
2895
+ (function (CaseFlagErrorMessage) {
2896
+ CaseFlagErrorMessage["NO_EXTERNAL_FLAGS_COLLECTION"] = "External collection for storing this case flag has not been configured for this case type";
2897
+ CaseFlagErrorMessage["NO_INTERNAL_FLAGS_COLLECTION"] = "Internal collection for storing this case flag has not been configured for this case type";
2898
+ })(CaseFlagErrorMessage || (CaseFlagErrorMessage = {}));
2899
+
2900
+ class DashPipe {
2901
+ transform(value) {
2902
+ return value ? value : '-';
2903
+ }
2904
+ static ɵfac = function DashPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DashPipe)(); };
2905
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDash", type: DashPipe, pure: true, standalone: false });
2906
+ }
2907
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DashPipe, [{
2908
+ type: Pipe,
2909
+ args: [{
2910
+ name: 'ccdDash',
2911
+ standalone: false
2912
+ }]
2913
+ }], null, null); })();
2914
+
2915
+ /*
2916
+ Translate a date time format string from the Java format provided by CCD to the format supported by Angular formatDate()
2917
+ Very simple translator that maps unsupported chars to the nearest equivalent.
2918
+ If there is no equivalent puts ***x*** into the output where x is the unsupported character
2919
+
2920
+ Java format
2921
+ G era text AD; Anno Domini; A
2922
+ u year year 2004; 04
2923
+ y year-of-era year 2004; 04
2924
+ D day-of-year number 189
2925
+ M/L month-of-year number/text 7; 07; Jul; July; J
2926
+ d day-of-month number 10
2927
+
2928
+ Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter
2929
+ Y week-based-year year 1996; 96
2930
+ w week-of-week-based-year number 27
2931
+ W week-of-month number 4
2932
+ E day-of-week text Tue; Tuesday; T
2933
+ e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T
2934
+ F week-of-month number 3
2935
+
2936
+ a am-pm-of-day text PM
2937
+ h clock-hour-of-am-pm (1-12) number 12
2938
+ K hour-of-am-pm (0-11) number 0
2939
+ k clock-hour-of-am-pm (1-24) number 0
2940
+
2941
+ H hour-of-day (0-23) number 0
2942
+ m minute-of-hour number 30
2943
+ s second-of-minute number 55
2944
+ S fraction-of-second fraction 978
2945
+ A milli-of-day number 1234
2946
+ n nano-of-second number 987654321
2947
+ N nano-of-day number 1234000000
2948
+
2949
+ V time-zone ID zone-id America/Los_Angeles; Z; -08:30
2950
+ z time-zone name zone-name Pacific Standard Time; PST
2951
+ O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00;
2952
+ X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15;
2953
+ x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15;
2954
+ Z zone-offset offset-Z +0000; -0800; -08:00;
2955
+
2956
+ p pad next pad modifier 1
2957
+
2958
+ ' escape for text delimiter
2959
+ '' single quote literal '
2960
+ [ optional section start
2961
+ ] optional section end
2962
+ # reserved for future use
2963
+ { reserved for future use
2964
+ } reserved for future use
2965
+
2966
+ Angular dateFormat characters
2967
+ Era G, GG & GGG Abbreviated AD
2968
+ GGGG Wide Anno Domini
2969
+ GGGGG Narrow A
2970
+ Year y Numeric: minimum digits 2, 20, 201, 2017, 20173
2971
+ yy Numeric: 2 digits + zero padded 02, 20, 01, 17, 73
2972
+ yyy Numeric: 3 digits + zero padded 002, 020, 201, 2017, 20173
2973
+ yyyy Numeric: 4 digits or more + zero padded 0002, 0020, 0201, 2017, 20173
2974
+ Month M Numeric: 1 digit 9, 12
2975
+ MM Numeric: 2 digits + zero padded 09, 12
2976
+ MMM Abbreviated Sep
2977
+ MMMM Wide September
2978
+ MMMMM Narrow S
2979
+ Month standalone L Numeric: 1 digit 9, 12
2980
+ LL Numeric: 2 digits + zero padded 09, 12
2981
+ LLL Abbreviated Sep
2982
+ LLLL Wide September
2983
+ LLLLL Narrow S
2984
+ Week of year w Numeric: minimum digits 1... 53
2985
+ ww Numeric: 2 digits + zero padded 01... 53
2986
+ Week of month W Numeric: 1 digit 1... 5
2987
+ Day of month d Numeric: minimum digits 1
2988
+ dd Numeric: 2 digits + zero padded 01
2989
+ Week day E, EE & EEE Abbreviated Tue
2990
+ EEEE Wide Tuesday
2991
+ EEEEE Narrow T
2992
+ EEEEEE Short Tu
2993
+ Period a, aa & aaa Abbreviated am/pm or AM/PM
2994
+ aaaa Wide (fallback to a when missing) ante meridiem/post meridiem
2995
+ aaaaa Narrow a/p
2996
+ Period* B, BB & BBB Abbreviated mid.
2997
+ BBBB Wide am, pm, midnight, noon, morning, afternoon, evening, night
2998
+ BBBBB Narrow md
2999
+ Period standalone* b, bb & bbb Abbreviated mid.
3000
+ bbbb Wide am, pm, midnight, noon, morning, afternoon, evening, night
3001
+ bbbbb Narrow md
3002
+ Hour 1-12 h Numeric: minimum digits 1, 12
3003
+ hh Numeric: 2 digits + zero padded 01, 12
3004
+ Hour 0-23 H Numeric: minimum digits 0, 23
3005
+ HH Numeric: 2 digits + zero padded 00, 23
3006
+ Minute m Numeric: minimum digits 8, 59
3007
+ mm Numeric: 2 digits + zero padded 08, 59
3008
+ Second s Numeric: minimum digits 0... 59
3009
+ ss Numeric: 2 digits + zero padded 00... 59
3010
+ Fractional seconds S Numeric: 1 digit 0... 9
3011
+ SS Numeric: 2 digits + zero padded 00... 99
3012
+ SSS Numeric: 3 digits + zero padded (= milliseconds) 000... 999
3013
+ Zone z, zz & zzz Short specific non location format (fallback to O) GMT-8
3014
+ zzzz Long specific non location format (fallback to OOOO) GMT-08:00
3015
+ Z, ZZ & ZZZ ISO8601 basic format -0800
3016
+ ZZZZ Long localized GMT format GMT-8:00
3017
+ ZZZZZ ISO8601 extended format + Z indicator for offset 0 (= XXXXX) -08:00
3018
+ O, OO & OOO Short localized GMT format GMT-8
3019
+ OOOO Long localized GMT format GMT-08:00
3020
+ */
3021
+ class FormatTranslatorService {
3022
+ translate(javaFormat) {
3023
+ const result = [];
3024
+ let prev = '\0';
3025
+ let inQuote = false;
3026
+ const maybePush = (target, obj, flag) => {
3027
+ if (!flag) {
3028
+ target.push(obj);
3029
+ }
3030
+ };
3031
+ for (const c of javaFormat) {
3032
+ switch (c) {
3033
+ case '\'':
3034
+ if (prev === '\'') {
3035
+ // literal single quote - ignore
3036
+ inQuote = false;
3037
+ }
3038
+ else {
3039
+ inQuote = !inQuote;
3040
+ }
3041
+ break;
3042
+ // Due to formatting constraints on the webapp, all 'd' characters should be replaced with 'D' (for Moment library)
3043
+ // This is because we want the date, not the day (this format will need to be converted back)
3044
+ case 'd':
3045
+ maybePush(result, 'D', inQuote);
3046
+ break;
3047
+ // moment library defines year as capital y
3048
+ case 'y':
3049
+ maybePush(result, 'Y', inQuote);
3050
+ break;
3051
+ case 'e':
3052
+ case 'c':
3053
+ maybePush(result, 'E', inQuote); // no lower case E
3054
+ break;
3055
+ case 'F':
3056
+ maybePush(result, 'W', inQuote);
3057
+ break;
3058
+ case 'K':
3059
+ maybePush(result, 'H', inQuote);
3060
+ break;
3061
+ case 'k':
3062
+ maybePush(result, 'h', inQuote);
3063
+ break;
3064
+ // commented out A change to '***' due to use in moment library for AM/PM
3065
+ // added 'a' specification to stop discrepancy in am/AM pm/PM formatting
3066
+ case 'a':
3067
+ maybePush(result, 'A', inQuote);
3068
+ break;
3069
+ case 'n':
3070
+ case 'N':
3071
+ maybePush(result, `***${c}***`, inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
3072
+ break;
3073
+ case 'V':
3074
+ case 'O':
3075
+ maybePush(result, 'z', inQuote);
3076
+ break;
3077
+ case 'x':
3078
+ case 'X':
3079
+ maybePush(result, 'Z', inQuote);
3080
+ break;
3081
+ default:
3082
+ maybePush(result, c, inQuote);
3083
+ }
3084
+ prev = c;
3085
+ }
3086
+ return result.join('');
3087
+ }
3088
+ showOnlyDates(dateFormat) {
3089
+ // replace 'd' character with 'D' for the moment library
3090
+ // This ensures only dates allowed
3091
+ while (dateFormat.includes('d')) {
3092
+ dateFormat = dateFormat.replace('d', 'D');
3093
+ }
3094
+ while (dateFormat.includes('y')) {
3095
+ dateFormat = dateFormat.replace('y', 'Y');
3096
+ }
3097
+ return dateFormat;
3098
+ }
3099
+ removeTime(dateFormat) {
3100
+ // remove hours irrelevant of whether 12 or 24 hour clock
3101
+ while (dateFormat.includes('H') || dateFormat.includes('h')) {
3102
+ dateFormat = dateFormat.replace('H', '');
3103
+ dateFormat = dateFormat.replace('h', '');
3104
+ }
3105
+ // remove minutes
3106
+ while (dateFormat.includes('m')) {
3107
+ dateFormat = dateFormat.replace('m', '');
3108
+ }
3109
+ // remove seconds (s) and micro seconds (S)
3110
+ while (dateFormat.includes('S') || dateFormat.includes('s')) {
3111
+ dateFormat = dateFormat.replace('S', '');
3112
+ dateFormat = dateFormat.replace('s', '');
3113
+ }
3114
+ // because there is time removal algorithm can make reasonable assumption to remove colons
3115
+ while (dateFormat.includes(':')) {
3116
+ dateFormat = dateFormat.replace(':', '');
3117
+ }
3118
+ return dateFormat.trim();
3119
+ }
3120
+ hasDate(value) {
3121
+ return this.translate(value).length &&
3122
+ value.toLowerCase().indexOf('d') >= 0 &&
3123
+ value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3124
+ }
3125
+ is24Hour(value) {
3126
+ return this.translate(value).length &&
3127
+ value.indexOf('H') >= 0;
3128
+ }
3129
+ hasNoDay(value) {
3130
+ return this.translate(value).length && value.toLowerCase().indexOf('d') === -1 &&
3131
+ value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3132
+ }
3133
+ hasNoDayAndMonth(value) {
3134
+ return this.translate(value).length &&
3135
+ value.toLowerCase().indexOf('d') === -1 &&
3136
+ value.indexOf('M') === -1 &&
3137
+ value.toLowerCase().indexOf('y') >= 0;
3138
+ }
3139
+ hasHours(value) {
3140
+ return this.translate(value).length && value.toLowerCase().indexOf('h') >= 0 && value.indexOf('m') === -1;
3141
+ }
3142
+ hasMinutes(value) {
3143
+ return this.translate(value).length && value.indexOf('m') >= 0 && value.toLowerCase().indexOf('h') >= 0;
3144
+ }
3145
+ hasSeconds(value) {
3146
+ return this.translate(value).length && value.toLowerCase().indexOf('s') >= 0;
3147
+ }
3148
+ static ɵfac = function FormatTranslatorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormatTranslatorService)(); };
3149
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormatTranslatorService, factory: FormatTranslatorService.ɵfac });
3150
+ }
3151
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormatTranslatorService, [{
3152
+ type: Injectable
3153
+ }], null, null); })();
3154
+
3155
+ class DatePipe {
3156
+ formatTrans;
3157
+ 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)?$');
3158
+ // 1 2 3 4 5 6 7 8 9 10 11
3159
+ static MONTHS = [
3160
+ ['Jan'], ['Feb'], ['Mar'], ['Apr'], ['May'], ['Jun'], ['Jul'], ['Aug'], ['Sep'], ['Oct'], ['Nov'], ['Dec'],
3161
+ ];
3162
+ /**
3163
+ * constructor to allow format translator to be injected
3164
+ * @param formatTrans format translator
3165
+ */
3166
+ constructor(formatTrans) {
3167
+ this.formatTrans = formatTrans;
3168
+ }
3169
+ transform(value, zone, format) {
3170
+ let resultDate = null;
3171
+ const ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
3172
+ if (value) {
3173
+ // included to avoid editing the hour twice on second pass through
3174
+ // this occurs on case details when datepipe is applied twice
3175
+ if (!value.includes('T')) {
3176
+ zone = 'utc';
3177
+ }
3178
+ const match = value.match(DatePipe.DATE_FORMAT_REGEXP);
3179
+ // Make sure we actually have a match.
3180
+ if (match) {
3181
+ let offsetDate = null;
3182
+ const date = this.getDate(match);
3183
+ if (zone === 'local') {
3184
+ offsetDate = this.getOffsetDate(date);
3185
+ }
3186
+ else {
3187
+ offsetDate = this.getDate(match);
3188
+ }
3189
+ // 'short' format is meaningful to formatDate, but not the same meaning as in the unit tests
3190
+ if (this.formatTrans && format && format !== 'short') {
3191
+ // support for java style formatting strings for dates
3192
+ format = this.translateDateFormat(format);
3193
+ resultDate = moment(offsetDate).format(format);
3194
+ }
3195
+ else {
3196
+ // RDM-1149 changed the pipe logic so that it doesn't add an hour to 'Summer Time' dates on DateTime field type
3197
+ resultDate = `${offsetDate.getDate()} ${DatePipe.MONTHS[offsetDate.getMonth()]} ${offsetDate.getFullYear()}`;
3198
+ if (match[4] && match[5] && match[6] && format !== 'short') {
3199
+ resultDate += ', ';
3200
+ resultDate += `${this.getHour(offsetDate.getHours().toString())}:`;
3201
+ resultDate += `${this.pad(offsetDate.getMinutes())}:`;
3202
+ resultDate += `${this.pad(offsetDate.getSeconds())} `;
3203
+ resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
3204
+ }
3205
+ }
3206
+ }
3207
+ else {
3208
+ // EUI-2667. See if what we've been given is actually a formatted date that
3209
+ // we could attempt to do something with.
3210
+ const parsedDate = Date.parse(value);
3211
+ // We successfully parsed it so let's use it.
3212
+ if (!isNaN(parsedDate)) {
3213
+ const d = new Date(parsedDate);
3214
+ // If what we received didn't include time, don't include it here either.
3215
+ if (value.indexOf(':') < 0) {
3216
+ const shortDate = d.toLocaleDateString('en-GB');
3217
+ const shortISO = shortDate.split('/').reverse().join('-');
3218
+ return this.transform(shortISO, zone, format);
3219
+ }
3220
+ // If it did include time, we want a full ISO string.
3221
+ const thisMoment = moment(d).format(ISO_FORMAT);
3222
+ return this.transform(thisMoment, zone, format);
3223
+ }
3224
+ }
3225
+ }
3226
+ return resultDate;
3227
+ }
3228
+ translateDateFormat(format) {
3229
+ if (this.formatTrans) {
3230
+ return this.formatTrans.translate(format);
3231
+ }
3232
+ else {
3233
+ return format;
3234
+ }
3235
+ }
3236
+ getOffsetDate(date) {
3237
+ const localOffset = -date.getTimezoneOffset() / 60;
3238
+ return new Date(date.getTime() + localOffset * 3600 * 1000);
3239
+ }
3240
+ getDate(match) {
3241
+ const year = this.toInt(match[1]);
3242
+ const month = this.toInt(match[2]) - 1;
3243
+ const day = this.toInt(match[3]);
3244
+ let resultDate;
3245
+ if (match[4] && match[5] && match[6]) {
3246
+ const hour = this.toInt(match[4]);
3247
+ const minutes = this.toInt(match[5]);
3248
+ const seconds = this.toInt(match[6]);
3249
+ resultDate = new Date(year, month, day, hour, minutes, seconds, 0);
3250
+ }
3251
+ else {
3252
+ resultDate = new Date(year, month, day);
3253
+ }
3254
+ return resultDate;
3255
+ }
3256
+ getHour(hourStr) {
3257
+ let hourNum = this.toInt(hourStr);
3258
+ if (hourNum > 12) {
3259
+ hourNum = hourNum - 12;
3260
+ }
3261
+ else if (hourNum === 0) {
3262
+ hourNum = 12;
3263
+ }
3264
+ return hourNum;
3265
+ }
3266
+ toInt(str) {
3267
+ return parseInt(str, 10);
3268
+ }
3269
+ pad(num, padNum = 2) {
3270
+ const val = num !== undefined ? num.toString() : '';
3271
+ return val.length >= padNum ? val : new Array(padNum - val.length + 1).join('0') + val;
3272
+ }
3273
+ static ɵfac = function DatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(FormatTranslatorService, 16)); };
3274
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDate", type: DatePipe, pure: true, standalone: false });
3275
+ }
3276
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{
3277
+ type: Pipe,
3278
+ args: [{
3279
+ name: 'ccdDate',
3280
+ standalone: false
3281
+ }]
3282
+ }], () => [{ type: FormatTranslatorService }], null); })();
3283
+
3284
+ class FieldLabelPipe {
3285
+ rpxTranslationPipe;
3286
+ constructor(rpxTranslationPipe) {
3287
+ this.rpxTranslationPipe = rpxTranslationPipe;
3288
+ }
3289
+ transform(field) {
3290
+ if (!field || !field.label) {
3291
+ return '';
3292
+ }
3293
+ else if (!field.display_context) {
3294
+ return this.getTranslatedLabel(field);
3295
+ }
3296
+ return this.getTranslatedLabel(field) + (field.display_context.toUpperCase() === 'OPTIONAL' ?
3297
+ ' (' + this.rpxTranslationPipe.transform('Optional') + ')' : '');
3298
+ }
3299
+ getTranslatedLabel(field) {
3300
+ if (!field.isTranslated) {
3301
+ return this.rpxTranslationPipe.transform(field.label);
3302
+ }
3303
+ else {
3304
+ return field.label;
3305
+ }
3306
+ }
3307
+ getOriginalLabelForYesNoTranslation(field) {
3308
+ return field.originalLabel || field.label;
3309
+ }
3310
+ static ɵfac = function FieldLabelPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FieldLabelPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslatePipe, 16)); };
3311
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFieldLabel", type: FieldLabelPipe, pure: false, standalone: false });
3312
+ }
3313
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldLabelPipe, [{
3314
+ type: Pipe,
3315
+ args: [{
3316
+ name: 'ccdFieldLabel',
3317
+ pure: false,
3318
+ standalone: false
3319
+ }]
3320
+ }], () => [{ type: i1.RpxTranslatePipe }], null); })();
3321
+
3322
+ class FirstErrorPipe {
3323
+ rpxTranslationService;
3324
+ injector;
3325
+ asyncPipe;
3326
+ constructor(rpxTranslationService, injector) {
3327
+ this.rpxTranslationService = rpxTranslationService;
3328
+ this.injector = injector;
3329
+ this.asyncPipe = new AsyncPipe(this.injector.get(ChangeDetectorRef));
3330
+ }
3331
+ transform(value, args) {
3332
+ if (!value) {
3333
+ return '';
3334
+ }
3335
+ if (!args) {
3336
+ args = 'Field';
3337
+ }
3338
+ const keys = Object.keys(value);
3339
+ if (!keys.length) {
3340
+ return '';
3341
+ }
3342
+ let errorMessage;
3343
+ if (keys[0] === 'required') {
3344
+ errorMessage = '%FIELDLABEL% is required';
3345
+ }
3346
+ else if (keys[0] === 'pattern') {
3347
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%';
3348
+ }
3349
+ else if (keys[0] === 'markDownPattern') {
3350
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%. Link mark up characters are not allowed in this field';
3351
+ }
3352
+ else if (keys[0] === 'unsafeRichText') {
3353
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%. Potentially unsafe HTML content is not allowed in this field';
3354
+ }
3355
+ else if (keys[0] === 'minlength') {
3356
+ errorMessage = '%FIELDLABEL% is below the minimum length';
3357
+ }
3358
+ else if (keys[0] === 'maxlength') {
3359
+ errorMessage = '%FIELDLABEL% exceeds the maximum length';
3360
+ }
3361
+ else if (value.hasOwnProperty('matDatetimePickerParse')) {
3362
+ errorMessage = 'The date entered is not valid. Please provide a valid date';
3363
+ }
3364
+ else {
3365
+ errorMessage = value[keys[0]];
3366
+ }
3367
+ const o = this.rpxTranslationService.getTranslation$(args).pipe(switchMap(fieldLabel => this.rpxTranslationService.getTranslationWithReplacements$(errorMessage, { FIELDLABEL: fieldLabel })));
3368
+ return this.asyncPipe.transform(o);
3369
+ }
3370
+ ngOnDestroy() {
3371
+ this.asyncPipe.ngOnDestroy();
3372
+ }
3373
+ static ɵfac = function FirstErrorPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FirstErrorPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslationService, 16), i0.ɵɵdirectiveInject(i0.Injector, 16)); };
3374
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFirstError", type: FirstErrorPipe, pure: false, standalone: false });
3375
+ }
3376
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FirstErrorPipe, [{
3377
+ type: Pipe,
3378
+ args: [{
3379
+ name: 'ccdFirstError',
3380
+ pure: false,
3381
+ standalone: false
3382
+ }]
3383
+ }], () => [{ type: i1.RpxTranslationService }, { type: i0.Injector }], null); })();
3384
+
3385
+ class IsCompoundPipe {
3386
+ static COMPOUND_TYPES = [
3387
+ 'Complex',
3388
+ 'Label',
3389
+ 'AddressGlobal',
3390
+ 'AddressUK',
3391
+ 'AddressGlobalUK',
3392
+ 'CasePaymentHistoryViewer',
3393
+ 'CaseHistoryViewer',
3394
+ 'Organisation',
3395
+ 'WaysToPay',
3396
+ 'ComponentLauncher',
3397
+ 'FlagLauncher',
3398
+ 'CaseFlag'
3399
+ ];
3400
+ static EXCLUDE = [
3401
+ 'CaseLink',
3402
+ 'JudicialUser',
3403
+ 'StaffUser'
3404
+ ];
3405
+ transform(field) {
3406
+ if (!field || !field.field_type || !field.field_type.type) {
3407
+ return false;
3408
+ }
3409
+ if (IsCompoundPipe.COMPOUND_TYPES.indexOf(field.field_type.type) !== -1) {
3410
+ if (IsCompoundPipe.EXCLUDE.indexOf(field.field_type.id) !== -1) {
3411
+ return false;
3412
+ }
3413
+ return true;
3414
+ }
3415
+ return false;
3416
+ }
3417
+ static ɵfac = function IsCompoundPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsCompoundPipe)(); };
3418
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsCompound", type: IsCompoundPipe, pure: true, standalone: false });
3419
+ }
3420
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsCompoundPipe, [{
3421
+ type: Pipe,
3422
+ args: [{
3423
+ name: 'ccdIsCompound',
3424
+ standalone: false
3425
+ }]
3426
+ }], null, null); })();
3702
3427
 
3703
- var UpdateFlagErrorMessage;
3704
- (function (UpdateFlagErrorMessage) {
3705
- UpdateFlagErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
3706
- UpdateFlagErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
3707
- UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
3708
- UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED_EXTERNAL"] = "You must explain why the support is no longer needed";
3709
- UpdateFlagErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
3710
- UpdateFlagErrorMessage["NONE"] = "";
3711
- })(UpdateFlagErrorMessage || (UpdateFlagErrorMessage = {}));
3428
+ class CaseFieldService {
3429
+ isOptional(field) {
3430
+ if (!field || !field.display_context) {
3431
+ return false;
3432
+ }
3433
+ return field.display_context.toUpperCase() === 'OPTIONAL';
3434
+ }
3435
+ isReadOnly(field) {
3436
+ if (!field || !field.display_context) {
3437
+ return false;
3438
+ }
3439
+ return field.display_context.toUpperCase() === 'READONLY';
3440
+ }
3441
+ isMandatory(field) {
3442
+ if (!field || !field.display_context) {
3443
+ return false;
3444
+ }
3445
+ return field.display_context.toUpperCase() === 'MANDATORY';
3446
+ }
3447
+ isLabel(field) {
3448
+ if (!field || !field.field_type) {
3449
+ return false;
3450
+ }
3451
+ return field.field_type.type === 'Label';
3452
+ }
3453
+ static ɵfac = function CaseFieldService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFieldService)(); };
3454
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFieldService, factory: CaseFieldService.ɵfac });
3455
+ }
3456
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFieldService, [{
3457
+ type: Injectable
3458
+ }], null, null); })();
3712
3459
 
3713
- var UpdateFlagStep;
3714
- (function (UpdateFlagStep) {
3715
- UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL"] = "Explain why you are updating this flag. Do not include any sensitive information such as personal details.";
3716
- 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.";
3717
- UpdateFlagStep["COMMENT_HINT_TEXT_EXTERNAL"] = "Do not include any sensitive information such as personal details.";
3718
- UpdateFlagStep["COMMENT_FIELD_LABEL_EXTERNAL"] = "Please provide your comments below";
3719
- UpdateFlagStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3720
- UpdateFlagStep["STATUS_HINT_TEXT"] = "Describe reason for status change.";
3721
- UpdateFlagStep["STATUS_REASON_LABEL"] = "Reason for change";
3722
- UpdateFlagStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
3723
- })(UpdateFlagStep || (UpdateFlagStep = {}));
3460
+ class IsMandatoryPipe {
3461
+ caseFieldService;
3462
+ constructor(caseFieldService) {
3463
+ this.caseFieldService = caseFieldService;
3464
+ }
3465
+ transform(field) {
3466
+ return this.caseFieldService.isMandatory(field);
3467
+ }
3468
+ static ɵfac = function IsMandatoryPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsMandatoryPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3469
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsMandatory", type: IsMandatoryPipe, pure: true, standalone: false });
3470
+ }
3471
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsMandatoryPipe, [{
3472
+ type: Pipe,
3473
+ args: [{
3474
+ name: 'ccdIsMandatory',
3475
+ standalone: false
3476
+ }]
3477
+ }], () => [{ type: CaseFieldService }], null); })();
3724
3478
 
3725
- var CaseFlagFieldState;
3726
- (function (CaseFlagFieldState) {
3727
- CaseFlagFieldState[CaseFlagFieldState["FLAG_LOCATION"] = 0] = "FLAG_LOCATION";
3728
- CaseFlagFieldState[CaseFlagFieldState["FLAG_TYPE"] = 1] = "FLAG_TYPE";
3729
- CaseFlagFieldState[CaseFlagFieldState["FLAG_LANGUAGE_INTERPRETER"] = 2] = "FLAG_LANGUAGE_INTERPRETER";
3730
- CaseFlagFieldState[CaseFlagFieldState["FLAG_COMMENTS"] = 3] = "FLAG_COMMENTS";
3731
- CaseFlagFieldState[CaseFlagFieldState["FLAG_STATUS"] = 4] = "FLAG_STATUS";
3732
- CaseFlagFieldState[CaseFlagFieldState["FLAG_MANAGE_CASE_FLAGS"] = 5] = "FLAG_MANAGE_CASE_FLAGS";
3733
- CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE"] = 6] = "FLAG_UPDATE";
3734
- CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE_WELSH_TRANSLATION"] = 7] = "FLAG_UPDATE_WELSH_TRANSLATION";
3735
- })(CaseFlagFieldState || (CaseFlagFieldState = {}));
3736
- var CaseFlagErrorMessage;
3737
- (function (CaseFlagErrorMessage) {
3738
- CaseFlagErrorMessage["NO_EXTERNAL_FLAGS_COLLECTION"] = "External collection for storing this case flag has not been configured for this case type";
3739
- CaseFlagErrorMessage["NO_INTERNAL_FLAGS_COLLECTION"] = "Internal collection for storing this case flag has not been configured for this case type";
3740
- })(CaseFlagErrorMessage || (CaseFlagErrorMessage = {}));
3479
+ class IsReadOnlyPipe {
3480
+ caseFieldService;
3481
+ constructor(caseFieldService) {
3482
+ this.caseFieldService = caseFieldService;
3483
+ }
3484
+ transform(field) {
3485
+ return this.caseFieldService.isReadOnly(field);
3486
+ }
3487
+ static ɵfac = function IsReadOnlyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3488
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnly", type: IsReadOnlyPipe, pure: true, standalone: false });
3489
+ }
3490
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyPipe, [{
3491
+ type: Pipe,
3492
+ args: [{
3493
+ name: 'ccdIsReadOnly',
3494
+ standalone: false
3495
+ }]
3496
+ }], () => [{ type: CaseFieldService }], null); })();
3741
3497
 
3742
- class DashPipe {
3743
- transform(value) {
3744
- return value ? value : '-';
3498
+ class IsReadOnlyAndNotCollectionPipe {
3499
+ caseFieldService;
3500
+ constructor(caseFieldService) {
3501
+ this.caseFieldService = caseFieldService;
3745
3502
  }
3746
- static ɵfac = function DashPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DashPipe)(); };
3747
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDash", type: DashPipe, pure: true, standalone: false });
3503
+ transform(field) {
3504
+ if (!field || !field.field_type || !field.field_type.type) {
3505
+ return false;
3506
+ }
3507
+ if (this.isCollection(field)) {
3508
+ return false;
3509
+ }
3510
+ return this.caseFieldService.isReadOnly(field);
3511
+ }
3512
+ // CaseField @Expose() doesn't work with the pipe in here, so leaving the manual check
3513
+ isCollection(field) {
3514
+ return field.field_type && field.field_type.type === 'Collection';
3515
+ }
3516
+ static ɵfac = function IsReadOnlyAndNotCollectionPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyAndNotCollectionPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3517
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnlyAndNotCollection", type: IsReadOnlyAndNotCollectionPipe, pure: true, standalone: false });
3748
3518
  }
3749
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DashPipe, [{
3519
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyAndNotCollectionPipe, [{
3750
3520
  type: Pipe,
3751
3521
  args: [{
3752
- name: 'ccdDash',
3522
+ name: 'ccdIsReadOnlyAndNotCollection',
3753
3523
  standalone: false
3754
3524
  }]
3755
- }], null, null); })();
3525
+ }], () => [{ type: CaseFieldService }], null); })();
3756
3526
 
3757
- /*
3758
- Translate a date time format string from the Java format provided by CCD to the format supported by Angular formatDate()
3759
- Very simple translator that maps unsupported chars to the nearest equivalent.
3760
- If there is no equivalent puts ***x*** into the output where x is the unsupported character
3527
+ class PaletteUtilsModule {
3528
+ static ɵfac = function PaletteUtilsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PaletteUtilsModule)(); };
3529
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaletteUtilsModule });
3530
+ static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
3531
+ IsCompoundPipe,
3532
+ RpxTranslatePipe
3533
+ ], imports: [CommonModule,
3534
+ RpxTranslationModule.forChild()] });
3535
+ }
3536
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaletteUtilsModule, [{
3537
+ type: NgModule,
3538
+ args: [{
3539
+ imports: [
3540
+ CommonModule,
3541
+ RpxTranslationModule.forChild()
3542
+ ],
3543
+ declarations: [
3544
+ DatePipe,
3545
+ FieldLabelPipe,
3546
+ FirstErrorPipe,
3547
+ IsCompoundPipe,
3548
+ IsMandatoryPipe,
3549
+ IsReadOnlyPipe,
3550
+ IsReadOnlyAndNotCollectionPipe,
3551
+ DashPipe
3552
+ ],
3553
+ exports: [
3554
+ DatePipe,
3555
+ FieldLabelPipe,
3556
+ FirstErrorPipe,
3557
+ IsCompoundPipe,
3558
+ IsMandatoryPipe,
3559
+ IsReadOnlyPipe,
3560
+ IsReadOnlyAndNotCollectionPipe,
3561
+ DashPipe
3562
+ ],
3563
+ providers: [
3564
+ IsCompoundPipe,
3565
+ RpxTranslatePipe
3566
+ ]
3567
+ }]
3568
+ }], null, null); })();
3569
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaletteUtilsModule, { declarations: [DatePipe,
3570
+ FieldLabelPipe,
3571
+ FirstErrorPipe,
3572
+ IsCompoundPipe,
3573
+ IsMandatoryPipe,
3574
+ IsReadOnlyPipe,
3575
+ IsReadOnlyAndNotCollectionPipe,
3576
+ DashPipe], imports: [CommonModule, i1.RpxTranslationModule], exports: [DatePipe,
3577
+ FieldLabelPipe,
3578
+ FirstErrorPipe,
3579
+ IsCompoundPipe,
3580
+ IsMandatoryPipe,
3581
+ IsReadOnlyPipe,
3582
+ IsReadOnlyAndNotCollectionPipe,
3583
+ DashPipe] }); })();
3761
3584
 
3762
- Java format
3763
- G era text AD; Anno Domini; A
3764
- u year year 2004; 04
3765
- y year-of-era year 2004; 04
3766
- D day-of-year number 189
3767
- M/L month-of-year number/text 7; 07; Jul; July; J
3768
- d day-of-month number 10
3585
+ // tslint:disable:variable-name
3586
+ class AddressModel {
3587
+ AddressLine1 = '';
3588
+ AddressLine2 = '';
3589
+ AddressLine3 = '';
3590
+ PostTown = '';
3591
+ County = '';
3592
+ PostCode = '';
3593
+ Country = '';
3594
+ }
3769
3595
 
3770
- Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter
3771
- Y week-based-year year 1996; 96
3772
- w week-of-week-based-year number 27
3773
- W week-of-month number 4
3774
- E day-of-week text Tue; Tuesday; T
3775
- e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T
3776
- F week-of-month number 3
3596
+ class Alert {
3597
+ level;
3598
+ message;
3599
+ }
3777
3600
 
3778
- a am-pm-of-day text PM
3779
- h clock-hour-of-am-pm (1-12) number 12
3780
- K hour-of-am-pm (0-11) number 0
3781
- k clock-hour-of-am-pm (1-24) number 0
3601
+ // tslint:disable:variable-name
3602
+ class CaseDetails {
3603
+ id;
3604
+ jurisdiction;
3605
+ case_type_id;
3606
+ state;
3607
+ created_date;
3608
+ last_modified;
3609
+ locked_by_user_id;
3610
+ security_level;
3611
+ case_data;
3612
+ }
3782
3613
 
3783
- H hour-of-day (0-23) number 0
3784
- m minute-of-hour number 30
3785
- s second-of-minute number 55
3786
- S fraction-of-second fraction 978
3787
- A milli-of-day number 1234
3788
- n nano-of-second number 987654321
3789
- N nano-of-day number 1234000000
3614
+ // tslint:disable:variable-name
3615
+ class CaseEventData {
3616
+ event;
3617
+ data;
3618
+ event_data; // full event data
3619
+ event_token;
3620
+ ignore_warning;
3621
+ draft_id;
3622
+ case_reference;
3623
+ }
3790
3624
 
3791
- V time-zone ID zone-id America/Los_Angeles; Z; -08:30
3792
- z time-zone name zone-name Pacific Standard Time; PST
3793
- O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00;
3794
- X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15;
3795
- x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15;
3796
- Z zone-offset offset-Z +0000; -0800; -08:00;
3625
+ class WizardPageField {
3626
+ case_field_id;
3627
+ order;
3628
+ page_column_no;
3629
+ complex_field_overrides;
3630
+ }
3797
3631
 
3798
- p pad next pad modifier 1
3632
+ class FixedListItem {
3633
+ code;
3634
+ label;
3635
+ order;
3636
+ }
3799
3637
 
3800
- ' escape for text delimiter
3801
- '' single quote literal '
3802
- [ optional section start
3803
- ] optional section end
3804
- # reserved for future use
3805
- { reserved for future use
3806
- } reserved for future use
3638
+ // @dynamic
3639
+ class FieldType {
3640
+ id;
3641
+ type;
3642
+ min;
3643
+ max;
3644
+ regular_expression;
3645
+ fixed_list_items;
3646
+ complex_fields;
3647
+ collection_field_type;
3648
+ }
3649
+ __decorate([
3650
+ Type(() => FixedListItem),
3651
+ __metadata("design:type", Array)
3652
+ ], FieldType.prototype, "fixed_list_items", void 0);
3653
+ __decorate([
3654
+ Type(() => CaseField),
3655
+ __metadata("design:type", Array)
3656
+ ], FieldType.prototype, "complex_fields", void 0);
3657
+ __decorate([
3658
+ Type(() => FieldType),
3659
+ __metadata("design:type", FieldType)
3660
+ ], FieldType.prototype, "collection_field_type", void 0);
3807
3661
 
3808
- Angular dateFormat characters
3809
- Era G, GG & GGG Abbreviated AD
3810
- GGGG Wide Anno Domini
3811
- GGGGG Narrow A
3812
- Year y Numeric: minimum digits 2, 20, 201, 2017, 20173
3813
- yy Numeric: 2 digits + zero padded 02, 20, 01, 17, 73
3814
- yyy Numeric: 3 digits + zero padded 002, 020, 201, 2017, 20173
3815
- yyyy Numeric: 4 digits or more + zero padded 0002, 0020, 0201, 2017, 20173
3816
- Month M Numeric: 1 digit 9, 12
3817
- MM Numeric: 2 digits + zero padded 09, 12
3818
- MMM Abbreviated Sep
3819
- MMMM Wide September
3820
- MMMMM Narrow S
3821
- Month standalone L Numeric: 1 digit 9, 12
3822
- LL Numeric: 2 digits + zero padded 09, 12
3823
- LLL Abbreviated Sep
3824
- LLLL Wide September
3825
- LLLLL Narrow S
3826
- Week of year w Numeric: minimum digits 1... 53
3827
- ww Numeric: 2 digits + zero padded 01... 53
3828
- Week of month W Numeric: 1 digit 1... 5
3829
- Day of month d Numeric: minimum digits 1
3830
- dd Numeric: 2 digits + zero padded 01
3831
- Week day E, EE & EEE Abbreviated Tue
3832
- EEEE Wide Tuesday
3833
- EEEEE Narrow T
3834
- EEEEEE Short Tu
3835
- Period a, aa & aaa Abbreviated am/pm or AM/PM
3836
- aaaa Wide (fallback to a when missing) ante meridiem/post meridiem
3837
- aaaaa Narrow a/p
3838
- Period* B, BB & BBB Abbreviated mid.
3839
- BBBB Wide am, pm, midnight, noon, morning, afternoon, evening, night
3840
- BBBBB Narrow md
3841
- Period standalone* b, bb & bbb Abbreviated mid.
3842
- bbbb Wide am, pm, midnight, noon, morning, afternoon, evening, night
3843
- bbbbb Narrow md
3844
- Hour 1-12 h Numeric: minimum digits 1, 12
3845
- hh Numeric: 2 digits + zero padded 01, 12
3846
- Hour 0-23 H Numeric: minimum digits 0, 23
3847
- HH Numeric: 2 digits + zero padded 00, 23
3848
- Minute m Numeric: minimum digits 8, 59
3849
- mm Numeric: 2 digits + zero padded 08, 59
3850
- Second s Numeric: minimum digits 0... 59
3851
- ss Numeric: 2 digits + zero padded 00... 59
3852
- Fractional seconds S Numeric: 1 digit 0... 9
3853
- SS Numeric: 2 digits + zero padded 00... 99
3854
- SSS Numeric: 3 digits + zero padded (= milliseconds) 000... 999
3855
- Zone z, zz & zzz Short specific non location format (fallback to O) GMT-8
3856
- zzzz Long specific non location format (fallback to OOOO) GMT-08:00
3857
- Z, ZZ & ZZZ ISO8601 basic format -0800
3858
- ZZZZ Long localized GMT format GMT-8:00
3859
- ZZZZZ ISO8601 extended format + Z indicator for offset 0 (= XXXXX) -08:00
3860
- O, OO & OOO Short localized GMT format GMT-8
3861
- OOOO Long localized GMT format GMT-08:00
3862
- */
3863
- class FormatTranslatorService {
3864
- translate(javaFormat) {
3865
- const result = [];
3866
- let prev = '\0';
3867
- let inQuote = false;
3868
- const maybePush = (target, obj, flag) => {
3869
- if (!flag) {
3870
- target.push(obj);
3871
- }
3872
- };
3873
- for (const c of javaFormat) {
3874
- switch (c) {
3875
- case '\'':
3876
- if (prev === '\'') {
3877
- // literal single quote - ignore
3878
- inQuote = false;
3879
- }
3880
- else {
3881
- inQuote = !inQuote;
3882
- }
3883
- break;
3884
- // Due to formatting constraints on the webapp, all 'd' characters should be replaced with 'D' (for Moment library)
3885
- // This is because we want the date, not the day (this format will need to be converted back)
3886
- case 'd':
3887
- maybePush(result, 'D', inQuote);
3888
- break;
3889
- // moment library defines year as capital y
3890
- case 'y':
3891
- maybePush(result, 'Y', inQuote);
3892
- break;
3893
- case 'e':
3894
- case 'c':
3895
- maybePush(result, 'E', inQuote); // no lower case E
3896
- break;
3897
- case 'F':
3898
- maybePush(result, 'W', inQuote);
3899
- break;
3900
- case 'K':
3901
- maybePush(result, 'H', inQuote);
3902
- break;
3903
- case 'k':
3904
- maybePush(result, 'h', inQuote);
3905
- break;
3906
- // commented out A change to '***' due to use in moment library for AM/PM
3907
- // added 'a' specification to stop discrepancy in am/AM pm/PM formatting
3908
- case 'a':
3909
- maybePush(result, 'A', inQuote);
3910
- break;
3911
- case 'n':
3912
- case 'N':
3913
- maybePush(result, `***${c}***`, inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
3914
- break;
3915
- case 'V':
3916
- case 'O':
3917
- maybePush(result, 'z', inQuote);
3918
- break;
3919
- case 'x':
3920
- case 'X':
3921
- maybePush(result, 'Z', inQuote);
3922
- break;
3923
- default:
3924
- maybePush(result, c, inQuote);
3662
+ // @dynamic
3663
+ class CaseField {
3664
+ static logger = new StructuredLoggerService();
3665
+ id;
3666
+ hidden;
3667
+ hiddenCannotChange;
3668
+ label;
3669
+ originalLabel;
3670
+ noCacheLabel;
3671
+ order;
3672
+ parent;
3673
+ field_type;
3674
+ hint_text;
3675
+ security_label;
3676
+ display_context;
3677
+ display_context_parameter;
3678
+ month_format;
3679
+ show_condition;
3680
+ show_summary_change_option;
3681
+ show_summary_content_option;
3682
+ acls;
3683
+ metadata;
3684
+ formatted_value;
3685
+ retain_hidden_value;
3686
+ wizardProps;
3687
+ _value;
3688
+ _list_items = [];
3689
+ isTranslatedFlag = false;
3690
+ get value() {
3691
+ if (this.field_type && (this.field_type.type === 'DynamicList' || this.field_type.type === 'DynamicRadioList')) {
3692
+ return this._value && this._value.value ? this._value.value.code : this._value;
3693
+ }
3694
+ else if (this.field_type && this.field_type.type === 'DynamicMultiSelectList') {
3695
+ return this._value && this._value.value ? this._value.value : this._value;
3696
+ }
3697
+ else {
3698
+ return this._value;
3699
+ }
3700
+ }
3701
+ set value(value) {
3702
+ if (this.isDynamic()) {
3703
+ if (value && value instanceof Object && value.list_items) {
3704
+ this._list_items = value.list_items;
3705
+ }
3706
+ else if (!this._list_items || this._list_items.length === 0) {
3707
+ // Extract the list items from the current value if that's the only place they exist.
3708
+ this._list_items = this.list_items;
3709
+ if (!value || !value.value) {
3710
+ value = null;
3711
+ }
3925
3712
  }
3926
- prev = c;
3927
3713
  }
3928
- return result.join('');
3714
+ this._value = value;
3929
3715
  }
3930
- showOnlyDates(dateFormat) {
3931
- // replace 'd' character with 'D' for the moment library
3932
- // This ensures only dates allowed
3933
- while (dateFormat.includes('d')) {
3934
- dateFormat = dateFormat.replace('d', 'D');
3716
+ get list_items() {
3717
+ if (this.isDynamic()) {
3718
+ return this._value && this._value.list_items ? this._value.list_items : this._list_items;
3935
3719
  }
3936
- while (dateFormat.includes('y')) {
3937
- dateFormat = dateFormat.replace('y', 'Y');
3720
+ else {
3721
+ return this.field_type.fixed_list_items;
3938
3722
  }
3939
- return dateFormat;
3940
3723
  }
3941
- removeTime(dateFormat) {
3942
- // remove hours irrelevant of whether 12 or 24 hour clock
3943
- while (dateFormat.includes('H') || dateFormat.includes('h')) {
3944
- dateFormat = dateFormat.replace('H', '');
3945
- dateFormat = dateFormat.replace('h', '');
3724
+ set list_items(items) {
3725
+ if ((items && !this._list_items) || (items?.length > this._list_items?.length)) {
3726
+ this._list_items = items;
3946
3727
  }
3947
- // remove minutes
3948
- while (dateFormat.includes('m')) {
3949
- dateFormat = dateFormat.replace('m', '');
3728
+ }
3729
+ get dateTimeEntryFormat() {
3730
+ if (this.isComplexDisplay()) {
3731
+ return null;
3950
3732
  }
3951
- // remove seconds (s) and micro seconds (S)
3952
- while (dateFormat.includes('S') || dateFormat.includes('s')) {
3953
- dateFormat = dateFormat.replace('S', '');
3954
- dateFormat = dateFormat.replace('s', '');
3733
+ if (this.display_context_parameter) {
3734
+ return this.extractBracketValue(this.display_context_parameter, '#DATETIMEENTRY');
3955
3735
  }
3956
- // because there is time removal algorithm can make reasonable assumption to remove colons
3957
- while (dateFormat.includes(':')) {
3958
- dateFormat = dateFormat.replace(':', '');
3736
+ return null;
3737
+ }
3738
+ get dateTimeDisplayFormat() {
3739
+ if (this.isComplexEntry()) {
3740
+ return null;
3959
3741
  }
3960
- return dateFormat.trim();
3742
+ if (this.display_context_parameter) {
3743
+ return this.extractBracketValue(this.display_context_parameter, '#DATETIMEDISPLAY');
3744
+ }
3745
+ return null;
3961
3746
  }
3962
- hasDate(value) {
3963
- return this.translate(value).length &&
3964
- value.toLowerCase().indexOf('d') >= 0 &&
3965
- value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3747
+ isComplexDisplay() {
3748
+ return (this.isComplex() || this.isCollection()) && this.isReadonly();
3966
3749
  }
3967
- is24Hour(value) {
3968
- return this.translate(value).length &&
3969
- value.indexOf('H') >= 0;
3750
+ isComplexEntry() {
3751
+ return (this.isComplex() || this.isCollection()) && (this.isOptional() || this.isMandatory());
3970
3752
  }
3971
- hasNoDay(value) {
3972
- return this.translate(value).length && value.toLowerCase().indexOf('d') === -1 &&
3973
- value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3753
+ isReadonly() {
3754
+ return !_.isEmpty(this.display_context)
3755
+ && this.display_context.toUpperCase() === 'READONLY';
3974
3756
  }
3975
- hasNoDayAndMonth(value) {
3976
- return this.translate(value).length &&
3977
- value.toLowerCase().indexOf('d') === -1 &&
3978
- value.indexOf('M') === -1 &&
3979
- value.toLowerCase().indexOf('y') >= 0;
3757
+ isOptional() {
3758
+ return !_.isEmpty(this.display_context)
3759
+ && this.display_context.toUpperCase() === 'OPTIONAL';
3980
3760
  }
3981
- hasHours(value) {
3982
- return this.translate(value).length && value.toLowerCase().indexOf('h') >= 0 && value.indexOf('m') === -1;
3761
+ isMandatory() {
3762
+ return !_.isEmpty(this.display_context)
3763
+ && this.display_context.toUpperCase() === 'MANDATORY';
3983
3764
  }
3984
- hasMinutes(value) {
3985
- return this.translate(value).length && value.indexOf('m') >= 0 && value.toLowerCase().indexOf('h') >= 0;
3765
+ isCollection() {
3766
+ return this.field_type && this.field_type.type === 'Collection';
3986
3767
  }
3987
- hasSeconds(value) {
3988
- return this.translate(value).length && value.toLowerCase().indexOf('s') >= 0;
3768
+ isComplex() {
3769
+ return this.field_type && this.field_type.type === 'Complex';
3989
3770
  }
3990
- static ɵfac = function FormatTranslatorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormatTranslatorService)(); };
3991
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormatTranslatorService, factory: FormatTranslatorService.ɵfac });
3992
- }
3993
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormatTranslatorService, [{
3994
- type: Injectable
3995
- }], null, null); })();
3996
-
3997
- class DatePipe {
3998
- formatTrans;
3999
- 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)?$');
4000
- // 1 2 3 4 5 6 7 8 9 10 11
4001
- static MONTHS = [
4002
- ['Jan'], ['Feb'], ['Mar'], ['Apr'], ['May'], ['Jun'], ['Jul'], ['Aug'], ['Sep'], ['Oct'], ['Nov'], ['Dec'],
4003
- ];
4004
- /**
4005
- * constructor to allow format translator to be injected
4006
- * @param formatTrans format translator
4007
- */
4008
- constructor(formatTrans) {
4009
- this.formatTrans = formatTrans;
3771
+ isDynamic() {
3772
+ const dynamicFieldTypes = ['DynamicList', 'DynamicRadioList', 'DynamicMultiSelectList'];
3773
+ if (!this.field_type) {
3774
+ return false;
3775
+ }
3776
+ return dynamicFieldTypes.some(t => t === this.field_type.type);
4010
3777
  }
4011
- transform(value, zone, format) {
4012
- let resultDate = null;
4013
- const ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
4014
- if (value) {
4015
- // included to avoid editing the hour twice on second pass through
4016
- // this occurs on case details when datepipe is applied twice
4017
- if (!value.includes('T')) {
4018
- zone = 'utc';
3778
+ isCaseLink() {
3779
+ return this.isComplex()
3780
+ && this.field_type.id === 'CaseLink'
3781
+ && this.field_type.complex_fields.some(cf => cf.id === 'CaseReference');
3782
+ }
3783
+ extractBracketValue(fmt, paramName, leftBracket = '(', rightBracket = ')') {
3784
+ fmt = fmt.split(',')
3785
+ .find(a => a.trim().startsWith(paramName));
3786
+ if (fmt) {
3787
+ const s = fmt.indexOf(leftBracket) + 1;
3788
+ const e = fmt.indexOf(rightBracket, s);
3789
+ if (e > s && s >= 0) {
3790
+ return fmt.substr(s, (e - s));
4019
3791
  }
4020
- const match = value.match(DatePipe.DATE_FORMAT_REGEXP);
4021
- // Make sure we actually have a match.
4022
- if (match) {
4023
- let offsetDate = null;
4024
- const date = this.getDate(match);
4025
- if (zone === 'local') {
4026
- offsetDate = this.getOffsetDate(date);
4027
- }
4028
- else {
4029
- offsetDate = this.getDate(match);
4030
- }
4031
- // 'short' format is meaningful to formatDate, but not the same meaning as in the unit tests
4032
- if (this.formatTrans && format && format !== 'short') {
4033
- // support for java style formatting strings for dates
4034
- format = this.translateDateFormat(format);
4035
- resultDate = moment(offsetDate).format(format);
4036
- }
4037
- else {
4038
- // RDM-1149 changed the pipe logic so that it doesn't add an hour to 'Summer Time' dates on DateTime field type
4039
- resultDate = `${offsetDate.getDate()} ${DatePipe.MONTHS[offsetDate.getMonth()]} ${offsetDate.getFullYear()}`;
4040
- if (match[4] && match[5] && match[6] && format !== 'short') {
4041
- resultDate += ', ';
4042
- resultDate += `${this.getHour(offsetDate.getHours().toString())}:`;
4043
- resultDate += `${this.pad(offsetDate.getMinutes())}:`;
4044
- resultDate += `${this.pad(offsetDate.getSeconds())} `;
4045
- resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
4046
- }
4047
- }
3792
+ }
3793
+ return null;
3794
+ }
3795
+ // Ascend the hierarchy to get the full path of the field
3796
+ getHierachicalId(curr) {
3797
+ const prefix = curr ? curr + "_" : "";
3798
+ if (prefix.length < 1024) {
3799
+ if (this.parent) {
3800
+ return this.parent.getHierachicalId(prefix + this.id);
4048
3801
  }
4049
3802
  else {
4050
- // EUI-2667. See if what we've been given is actually a formatted date that
4051
- // we could attempt to do something with.
4052
- const parsedDate = Date.parse(value);
4053
- // We successfully parsed it so let's use it.
4054
- if (!isNaN(parsedDate)) {
4055
- const d = new Date(parsedDate);
4056
- // If what we received didn't include time, don't include it here either.
4057
- if (value.indexOf(':') < 0) {
4058
- const shortDate = d.toLocaleDateString('en-GB');
4059
- const shortISO = shortDate.split('/').reverse().join('-');
4060
- return this.transform(shortISO, zone, format);
4061
- }
4062
- // If it did include time, we want a full ISO string.
4063
- const thisMoment = moment(d).format(ISO_FORMAT);
4064
- return this.transform(thisMoment, zone, format);
4065
- }
3803
+ return prefix + this.id;
4066
3804
  }
4067
3805
  }
4068
- return resultDate;
4069
- }
4070
- translateDateFormat(format) {
4071
- if (this.formatTrans) {
4072
- return this.formatTrans.translate(format);
4073
- }
4074
3806
  else {
4075
- return format;
3807
+ CaseField.logger.error('Path too long, possible circular reference in case field hierarchy.');
3808
+ return this.id;
4076
3809
  }
4077
3810
  }
4078
- getOffsetDate(date) {
4079
- const localOffset = -date.getTimezoneOffset() / 60;
4080
- return new Date(date.getTime() + localOffset * 3600 * 1000);
3811
+ set isTranslated(val) {
3812
+ this.isTranslatedFlag = val;
4081
3813
  }
4082
- getDate(match) {
4083
- const year = this.toInt(match[1]);
4084
- const month = this.toInt(match[2]) - 1;
4085
- const day = this.toInt(match[3]);
4086
- let resultDate;
4087
- if (match[4] && match[5] && match[6]) {
4088
- const hour = this.toInt(match[4]);
4089
- const minutes = this.toInt(match[5]);
4090
- const seconds = this.toInt(match[6]);
4091
- resultDate = new Date(year, month, day, hour, minutes, seconds, 0);
4092
- }
4093
- else {
4094
- resultDate = new Date(year, month, day);
4095
- }
4096
- return resultDate;
3814
+ get isTranslated() {
3815
+ return this.isTranslatedFlag;
4097
3816
  }
4098
- getHour(hourStr) {
4099
- let hourNum = this.toInt(hourStr);
4100
- if (hourNum > 12) {
4101
- hourNum = hourNum - 12;
4102
- }
4103
- else if (hourNum === 0) {
4104
- hourNum = 12;
4105
- }
4106
- return hourNum;
3817
+ }
3818
+ __decorate([
3819
+ Exclude(),
3820
+ __metadata("design:type", CaseField)
3821
+ ], CaseField.prototype, "parent", void 0);
3822
+ __decorate([
3823
+ Type(() => FieldType),
3824
+ __metadata("design:type", FieldType)
3825
+ ], CaseField.prototype, "field_type", void 0);
3826
+ __decorate([
3827
+ Type(() => WizardPageField),
3828
+ __metadata("design:type", WizardPageField)
3829
+ ], CaseField.prototype, "wizardProps", void 0);
3830
+ __decorate([
3831
+ Expose(),
3832
+ __metadata("design:type", Object),
3833
+ __metadata("design:paramtypes", [Object])
3834
+ ], CaseField.prototype, "value", null);
3835
+ __decorate([
3836
+ Expose(),
3837
+ __metadata("design:type", Object),
3838
+ __metadata("design:paramtypes", [Object])
3839
+ ], CaseField.prototype, "list_items", null);
3840
+ __decorate([
3841
+ Expose(),
3842
+ __metadata("design:type", String),
3843
+ __metadata("design:paramtypes", [])
3844
+ ], CaseField.prototype, "dateTimeEntryFormat", null);
3845
+ __decorate([
3846
+ Expose(),
3847
+ __metadata("design:type", String),
3848
+ __metadata("design:paramtypes", [])
3849
+ ], CaseField.prototype, "dateTimeDisplayFormat", null);
3850
+ __decorate([
3851
+ Expose(),
3852
+ __metadata("design:type", Function),
3853
+ __metadata("design:paramtypes", []),
3854
+ __metadata("design:returntype", void 0)
3855
+ ], CaseField.prototype, "isComplexDisplay", null);
3856
+ __decorate([
3857
+ Expose(),
3858
+ __metadata("design:type", Function),
3859
+ __metadata("design:paramtypes", []),
3860
+ __metadata("design:returntype", void 0)
3861
+ ], CaseField.prototype, "isComplexEntry", null);
3862
+ __decorate([
3863
+ Expose(),
3864
+ __metadata("design:type", Function),
3865
+ __metadata("design:paramtypes", []),
3866
+ __metadata("design:returntype", void 0)
3867
+ ], CaseField.prototype, "isReadonly", null);
3868
+ __decorate([
3869
+ Expose(),
3870
+ __metadata("design:type", Function),
3871
+ __metadata("design:paramtypes", []),
3872
+ __metadata("design:returntype", void 0)
3873
+ ], CaseField.prototype, "isOptional", null);
3874
+ __decorate([
3875
+ Expose(),
3876
+ __metadata("design:type", Function),
3877
+ __metadata("design:paramtypes", []),
3878
+ __metadata("design:returntype", void 0)
3879
+ ], CaseField.prototype, "isMandatory", null);
3880
+ __decorate([
3881
+ Expose(),
3882
+ __metadata("design:type", Function),
3883
+ __metadata("design:paramtypes", []),
3884
+ __metadata("design:returntype", Boolean)
3885
+ ], CaseField.prototype, "isCollection", null);
3886
+ __decorate([
3887
+ Expose(),
3888
+ __metadata("design:type", Function),
3889
+ __metadata("design:paramtypes", []),
3890
+ __metadata("design:returntype", Boolean)
3891
+ ], CaseField.prototype, "isComplex", null);
3892
+ __decorate([
3893
+ Expose(),
3894
+ __metadata("design:type", Function),
3895
+ __metadata("design:paramtypes", []),
3896
+ __metadata("design:returntype", Boolean)
3897
+ ], CaseField.prototype, "isDynamic", null);
3898
+ __decorate([
3899
+ Expose(),
3900
+ __metadata("design:type", Function),
3901
+ __metadata("design:paramtypes", []),
3902
+ __metadata("design:returntype", Boolean)
3903
+ ], CaseField.prototype, "isCaseLink", null);
3904
+ __decorate([
3905
+ Expose(),
3906
+ __metadata("design:type", Function),
3907
+ __metadata("design:paramtypes", [String]),
3908
+ __metadata("design:returntype", String)
3909
+ ], CaseField.prototype, "getHierachicalId", null);
3910
+
3911
+ // @dynamic
3912
+ class WizardPage {
3913
+ id;
3914
+ label;
3915
+ order;
3916
+ wizard_page_fields;
3917
+ case_fields;
3918
+ show_condition;
3919
+ parsedShowCondition;
3920
+ getCol1Fields() {
3921
+ return this.case_fields?.filter(f => !f.wizardProps.page_column_no || f.wizardProps.page_column_no === 1);
4107
3922
  }
4108
- toInt(str) {
4109
- return parseInt(str, 10);
3923
+ getCol2Fields() {
3924
+ return this.case_fields?.filter(f => f.wizardProps.page_column_no === 2);
4110
3925
  }
4111
- pad(num, padNum = 2) {
4112
- const val = num !== undefined ? num.toString() : '';
4113
- return val.length >= padNum ? val : new Array(padNum - val.length + 1).join('0') + val;
3926
+ isMultiColumn() {
3927
+ return this.getCol2Fields()?.length > 0;
4114
3928
  }
4115
- static ɵfac = function DatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(FormatTranslatorService, 16)); };
4116
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDate", type: DatePipe, pure: true, standalone: false });
4117
3929
  }
4118
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{
4119
- type: Pipe,
4120
- args: [{
4121
- name: 'ccdDate',
4122
- standalone: false
4123
- }]
4124
- }], () => [{ type: FormatTranslatorService }], null); })();
3930
+ __decorate([
3931
+ Type(() => WizardPageField),
3932
+ __metadata("design:type", Array)
3933
+ ], WizardPage.prototype, "wizard_page_fields", void 0);
3934
+ __decorate([
3935
+ Type(() => CaseField),
3936
+ __metadata("design:type", Array)
3937
+ ], WizardPage.prototype, "case_fields", void 0);
3938
+
3939
+ // @dynamic
3940
+ class CaseEventTrigger {
3941
+ id;
3942
+ name;
3943
+ description;
3944
+ case_id;
3945
+ case_fields;
3946
+ event_token;
3947
+ wizard_pages;
3948
+ show_summary;
3949
+ show_event_notes;
3950
+ end_button_label;
3951
+ can_save_draft;
3952
+ hasFields() {
3953
+ return this.case_fields && this.case_fields.length !== 0;
3954
+ }
3955
+ hasPages() {
3956
+ return this.wizard_pages && this.wizard_pages.length !== 0;
3957
+ }
3958
+ }
3959
+ __decorate([
3960
+ Type(() => CaseField),
3961
+ __metadata("design:type", Array)
3962
+ ], CaseEventTrigger.prototype, "case_fields", void 0);
3963
+ __decorate([
3964
+ Type(() => WizardPage),
3965
+ __metadata("design:type", Array)
3966
+ ], CaseEventTrigger.prototype, "wizard_pages", void 0);
3967
+
3968
+ // tslint:disable:variable-name
3969
+ class CaseViewEvent {
3970
+ id;
3971
+ timestamp;
3972
+ summary;
3973
+ comment;
3974
+ event_id;
3975
+ event_name;
3976
+ state_id;
3977
+ state_name;
3978
+ user_id;
3979
+ user_last_name;
3980
+ user_first_name;
3981
+ significant_item;
3982
+ }
3983
+
3984
+ class CaseViewTrigger {
3985
+ id;
3986
+ name;
3987
+ description;
3988
+ order;
3989
+ }
3990
+
3991
+ class CaseEvent {
3992
+ id;
3993
+ name;
3994
+ post_state;
3995
+ pre_states;
3996
+ case_fields;
3997
+ description;
3998
+ order;
3999
+ acls;
4000
+ }
4001
+
4002
+ class CaseState {
4003
+ id;
4004
+ name;
4005
+ description;
4006
+ order;
4007
+ }
4008
+
4009
+ // Light clone of CaseType to be used in Jurisdiction class
4010
+ // to avoid cyclic dependency
4011
+ class CaseTypeLite {
4012
+ id;
4013
+ name;
4014
+ events;
4015
+ states;
4016
+ description;
4017
+ }
4018
+
4019
+ // @dynamics
4020
+ class CaseType {
4021
+ id;
4022
+ name;
4023
+ events;
4024
+ states;
4025
+ case_fields;
4026
+ description;
4027
+ jurisdiction;
4028
+ printEnabled;
4029
+ }
4030
+ __decorate([
4031
+ Type(() => CaseField),
4032
+ __metadata("design:type", Array)
4033
+ ], CaseType.prototype, "case_fields", void 0);
4034
+
4035
+ // tslint:disable:variable-name
4036
+ class EventCaseField {
4037
+ case_field_id;
4038
+ showCondition;
4039
+ }
4040
+
4041
+ class Banner {
4042
+ bannerDescription;
4043
+ bannerUrlText;
4044
+ bannerUrl;
4045
+ bannerViewed;
4046
+ bannerEnabled;
4047
+ }
4048
+
4049
+ // @dynamic
4050
+ class CaseTab {
4051
+ id;
4052
+ label;
4053
+ order;
4054
+ fields;
4055
+ show_condition;
4056
+ defaultFocus;
4057
+ }
4058
+ __decorate([
4059
+ Type(() => CaseField),
4060
+ __metadata("design:type", Array)
4061
+ ], CaseTab.prototype, "fields", void 0);
4062
+
4063
+ // @dynamic
4064
+ class CaseView {
4065
+ case_id;
4066
+ case_type;
4067
+ state;
4068
+ channels;
4069
+ tabs;
4070
+ triggers;
4071
+ events;
4072
+ metadataFields;
4073
+ basicFields;
4074
+ case_flag;
4075
+ }
4076
+ __decorate([
4077
+ Type(() => CaseTab),
4078
+ __metadata("design:type", Array)
4079
+ ], CaseView.prototype, "tabs", void 0);
4080
+ __decorate([
4081
+ Type(() => CaseField),
4082
+ __metadata("design:type", Array)
4083
+ ], CaseView.prototype, "metadataFields", void 0);
4125
4084
 
4126
- class FieldLabelPipe {
4127
- rpxTranslationPipe;
4128
- constructor(rpxTranslationPipe) {
4129
- this.rpxTranslationPipe = rpxTranslationPipe;
4130
- }
4131
- transform(field) {
4132
- if (!field || !field.label) {
4133
- return '';
4134
- }
4135
- else if (!field.display_context) {
4136
- return this.getTranslatedLabel(field);
4137
- }
4138
- return this.getTranslatedLabel(field) + (field.display_context.toUpperCase() === 'OPTIONAL' ?
4139
- ' (' + this.rpxTranslationPipe.transform('Optional') + ')' : '');
4140
- }
4141
- getTranslatedLabel(field) {
4142
- if (!field.isTranslated) {
4143
- return this.rpxTranslationPipe.transform(field.label);
4144
- }
4145
- else {
4146
- return field.label;
4147
- }
4148
- }
4149
- getOriginalLabelForYesNoTranslation(field) {
4150
- return field.originalLabel || field.label;
4151
- }
4152
- static ɵfac = function FieldLabelPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FieldLabelPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslatePipe, 16)); };
4153
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFieldLabel", type: FieldLabelPipe, pure: false, standalone: false });
4085
+ class CasePrintDocument {
4086
+ name;
4087
+ type;
4088
+ url;
4154
4089
  }
4155
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldLabelPipe, [{
4156
- type: Pipe,
4157
- args: [{
4158
- name: 'ccdFieldLabel',
4159
- pure: false,
4160
- standalone: false
4161
- }]
4162
- }], () => [{ type: i1.RpxTranslatePipe }], null); })();
4163
4090
 
4164
- class FirstErrorPipe {
4165
- rpxTranslationService;
4166
- injector;
4167
- asyncPipe;
4168
- constructor(rpxTranslationService, injector) {
4169
- this.rpxTranslationService = rpxTranslationService;
4170
- this.injector = injector;
4171
- this.asyncPipe = new AsyncPipe(this.injector.get(ChangeDetectorRef));
4172
- }
4173
- transform(value, args) {
4174
- if (!value) {
4175
- return '';
4176
- }
4177
- if (!args) {
4178
- args = 'Field';
4179
- }
4180
- const keys = Object.keys(value);
4181
- if (!keys.length) {
4182
- return '';
4183
- }
4184
- let errorMessage;
4185
- if (keys[0] === 'required') {
4186
- errorMessage = '%FIELDLABEL% is required';
4187
- }
4188
- else if (keys[0] === 'pattern') {
4189
- errorMessage = 'The data entered is not valid for %FIELDLABEL%';
4091
+ // tslint:disable:variable-name
4092
+ class HRef {
4093
+ href;
4094
+ }
4095
+ class DocumentLinks {
4096
+ self;
4097
+ binary;
4098
+ }
4099
+ class Document {
4100
+ _links;
4101
+ originalDocumentName;
4102
+ hashToken;
4103
+ }
4104
+ class Embedded {
4105
+ documents;
4106
+ }
4107
+ class DocumentData {
4108
+ _embedded;
4109
+ documents;
4110
+ }
4111
+ class FormDocument {
4112
+ document_url;
4113
+ document_binary_url;
4114
+ document_filename;
4115
+ document_hash;
4116
+ upload_timestamp;
4117
+ }
4118
+
4119
+ class OrganisationConverter {
4120
+ static toSimpleAddress(organisationModel) {
4121
+ let simpleAddress = '';
4122
+ if (organisationModel.addressLine1) {
4123
+ simpleAddress += `${organisationModel.addressLine1}<br>`;
4190
4124
  }
4191
- else if (keys[0] === 'markDownPattern') {
4192
- errorMessage = 'The data entered is not valid for %FIELDLABEL%. Link mark up characters are not allowed in this field';
4125
+ if (organisationModel.addressLine2) {
4126
+ simpleAddress += `${organisationModel.addressLine2}<br>`;
4193
4127
  }
4194
- else if (keys[0] === 'unsafeRichText') {
4195
- errorMessage = 'The data entered is not valid for %FIELDLABEL%. Potentially unsafe HTML content is not allowed in this field';
4128
+ if (organisationModel.addressLine3) {
4129
+ simpleAddress += `${organisationModel.addressLine3}<br>`;
4196
4130
  }
4197
- else if (keys[0] === 'minlength') {
4198
- errorMessage = '%FIELDLABEL% is below the minimum length';
4131
+ if (organisationModel.townCity) {
4132
+ simpleAddress += `${organisationModel.townCity}<br>`;
4199
4133
  }
4200
- else if (keys[0] === 'maxlength') {
4201
- errorMessage = '%FIELDLABEL% exceeds the maximum length';
4134
+ if (organisationModel.county) {
4135
+ simpleAddress += `${organisationModel.county}<br>`;
4202
4136
  }
4203
- else if (value.hasOwnProperty('matDatetimePickerParse')) {
4204
- errorMessage = 'The date entered is not valid. Please provide a valid date';
4137
+ if (organisationModel.country) {
4138
+ simpleAddress += `${organisationModel.country}<br>`;
4205
4139
  }
4206
- else {
4207
- errorMessage = value[keys[0]];
4140
+ if (organisationModel.postCode) {
4141
+ simpleAddress += `${organisationModel.postCode}<br>`;
4208
4142
  }
4209
- const o = this.rpxTranslationService.getTranslation$(args).pipe(switchMap(fieldLabel => this.rpxTranslationService.getTranslationWithReplacements$(errorMessage, { FIELDLABEL: fieldLabel })));
4210
- return this.asyncPipe.transform(o);
4143
+ return simpleAddress;
4211
4144
  }
4212
- ngOnDestroy() {
4213
- this.asyncPipe.ngOnDestroy();
4145
+ toSimpleOrganisationModel(organisationModel) {
4146
+ return {
4147
+ organisationIdentifier: organisationModel.organisationIdentifier,
4148
+ name: organisationModel.name,
4149
+ address: OrganisationConverter.toSimpleAddress(organisationModel)
4150
+ };
4214
4151
  }
4215
- static ɵfac = function FirstErrorPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FirstErrorPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslationService, 16), i0.ɵɵdirectiveInject(i0.Injector, 16)); };
4216
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFirstError", type: FirstErrorPipe, pure: false, standalone: false });
4152
+ static ɵfac = function OrganisationConverter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OrganisationConverter)(); };
4153
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: OrganisationConverter, factory: OrganisationConverter.ɵfac });
4217
4154
  }
4218
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FirstErrorPipe, [{
4219
- type: Pipe,
4220
- args: [{
4221
- name: 'ccdFirstError',
4222
- pure: false,
4223
- standalone: false
4224
- }]
4225
- }], () => [{ type: i1.RpxTranslationService }, { type: i0.Injector }], null); })();
4155
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OrganisationConverter, [{
4156
+ type: Injectable
4157
+ }], null, null); })();
4226
4158
 
4227
- class IsCompoundPipe {
4228
- static COMPOUND_TYPES = [
4229
- 'Complex',
4230
- 'Label',
4231
- 'AddressGlobal',
4232
- 'AddressUK',
4233
- 'AddressGlobalUK',
4234
- 'CasePaymentHistoryViewer',
4235
- 'CaseHistoryViewer',
4236
- 'Organisation',
4237
- 'WaysToPay',
4238
- 'ComponentLauncher',
4239
- 'FlagLauncher',
4240
- 'CaseFlag'
4241
- ];
4242
- static EXCLUDE = [
4243
- 'CaseLink',
4244
- 'JudicialUser',
4245
- 'StaffUser'
4246
- ];
4247
- transform(field) {
4248
- if (!field || !field.field_type || !field.field_type.type) {
4249
- return false;
4250
- }
4251
- if (IsCompoundPipe.COMPOUND_TYPES.indexOf(field.field_type.type) !== -1) {
4252
- if (IsCompoundPipe.EXCLUDE.indexOf(field.field_type.id) !== -1) {
4253
- return false;
4254
- }
4255
- return true;
4256
- }
4257
- return false;
4258
- }
4259
- static ɵfac = function IsCompoundPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsCompoundPipe)(); };
4260
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsCompound", type: IsCompoundPipe, pure: true, standalone: false });
4159
+ class PaginationMetadata {
4160
+ totalResultsCount;
4161
+ totalPagesCount;
4261
4162
  }
4262
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsCompoundPipe, [{
4263
- type: Pipe,
4264
- args: [{
4265
- name: 'ccdIsCompound',
4266
- standalone: false
4267
- }]
4268
- }], null, null); })();
4269
4163
 
4270
- class CaseFieldService {
4271
- isOptional(field) {
4272
- if (!field || !field.display_context) {
4273
- return false;
4274
- }
4275
- return field.display_context.toUpperCase() === 'OPTIONAL';
4276
- }
4277
- isReadOnly(field) {
4278
- if (!field || !field.display_context) {
4279
- return false;
4280
- }
4281
- return field.display_context.toUpperCase() === 'READONLY';
4282
- }
4283
- isMandatory(field) {
4284
- if (!field || !field.display_context) {
4285
- return false;
4286
- }
4287
- return field.display_context.toUpperCase() === 'MANDATORY';
4288
- }
4289
- isLabel(field) {
4290
- if (!field || !field.field_type) {
4291
- return false;
4292
- }
4293
- return field.field_type.type === 'Label';
4164
+ class Field {
4165
+ id;
4166
+ field_type;
4167
+ elementPath;
4168
+ value;
4169
+ label;
4170
+ metadata;
4171
+ constructor(id, field_type, elementPath, value, label, metadata) {
4172
+ this.id = id;
4173
+ this.field_type = field_type;
4174
+ this.elementPath = elementPath;
4175
+ this.value = value;
4176
+ this.label = label;
4177
+ this.metadata = metadata;
4294
4178
  }
4295
- static ɵfac = function CaseFieldService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFieldService)(); };
4296
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFieldService, factory: CaseFieldService.ɵfac });
4297
4179
  }
4298
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFieldService, [{
4299
- type: Injectable
4300
- }], null, null); })();
4301
4180
 
4302
- class IsMandatoryPipe {
4303
- caseFieldService;
4304
- constructor(caseFieldService) {
4305
- this.caseFieldService = caseFieldService;
4306
- }
4307
- transform(field) {
4308
- return this.caseFieldService.isMandatory(field);
4309
- }
4310
- static ɵfac = function IsMandatoryPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsMandatoryPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4311
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsMandatory", type: IsMandatoryPipe, pure: true, standalone: false });
4181
+ class SearchResultViewColumn {
4182
+ case_field_id;
4183
+ case_field_type;
4184
+ display_context;
4185
+ display_context_parameter;
4186
+ label;
4187
+ order;
4312
4188
  }
4313
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsMandatoryPipe, [{
4314
- type: Pipe,
4315
- args: [{
4316
- name: 'ccdIsMandatory',
4317
- standalone: false
4318
- }]
4319
- }], () => [{ type: CaseFieldService }], null); })();
4320
4189
 
4321
- class IsReadOnlyPipe {
4322
- caseFieldService;
4323
- constructor(caseFieldService) {
4324
- this.caseFieldService = caseFieldService;
4190
+ // @dynamic
4191
+ class SearchResultViewItem {
4192
+ case_id;
4193
+ case_fields;
4194
+ hydrated_case_fields;
4195
+ columns;
4196
+ supplementary_data;
4197
+ display_context_parameter;
4198
+ }
4199
+ __decorate([
4200
+ Type(() => CaseField),
4201
+ __metadata("design:type", Array)
4202
+ ], SearchResultViewItem.prototype, "hydrated_case_fields", void 0);
4203
+
4204
+ // @dynamic
4205
+ class SearchResultView {
4206
+ columns;
4207
+ results;
4208
+ result_error;
4209
+ hasDrafts() {
4210
+ return this.results[0]
4211
+ && this.results[0].case_id
4212
+ && Draft.isDraft(this.results[0].case_id);
4325
4213
  }
4326
- transform(field) {
4327
- return this.caseFieldService.isReadOnly(field);
4214
+ }
4215
+ __decorate([
4216
+ Type(() => SearchResultViewColumn),
4217
+ __metadata("design:type", Array)
4218
+ ], SearchResultView.prototype, "columns", void 0);
4219
+ __decorate([
4220
+ Type(() => SearchResultViewItem),
4221
+ __metadata("design:type", Array)
4222
+ ], SearchResultView.prototype, "results", void 0);
4223
+
4224
+ class SortParameters {
4225
+ comparator;
4226
+ sortOrder;
4227
+ constructor(comparator, sortOrder) {
4228
+ this.comparator = comparator;
4229
+ this.sortOrder = sortOrder;
4328
4230
  }
4329
- static ɵfac = function IsReadOnlyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4330
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnly", type: IsReadOnlyPipe, pure: true, standalone: false });
4331
4231
  }
4332
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyPipe, [{
4333
- type: Pipe,
4334
- args: [{
4335
- name: 'ccdIsReadOnly',
4336
- standalone: false
4337
- }]
4338
- }], () => [{ type: CaseFieldService }], null); })();
4339
4232
 
4340
- class IsReadOnlyAndNotCollectionPipe {
4341
- caseFieldService;
4342
- constructor(caseFieldService) {
4343
- this.caseFieldService = caseFieldService;
4233
+ var SortOrder$1;
4234
+ (function (SortOrder) {
4235
+ SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
4236
+ SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
4237
+ SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
4238
+ })(SortOrder$1 || (SortOrder$1 = {}));
4239
+
4240
+ const STAFF_CACHE_ROLE_CATEGORIES = new Set([
4241
+ 'ADMIN',
4242
+ 'CTSC',
4243
+ 'LEGAL_OPERATIONS'
4244
+ ]);
4245
+ const SUPPORTED_ROLE_CATEGORIES = new Set([
4246
+ ...STAFF_CACHE_ROLE_CATEGORIES,
4247
+ 'JUDICIAL',
4248
+ ]);
4249
+ // Aliases allow the definition to use the shorter, hyphenated form within #ARGUMENT(...)
4250
+ const ROLE_CATEGORY_ALIASES = {
4251
+ LEGAL_OPS: 'LEGAL_OPERATIONS'
4252
+ };
4253
+ const ARGUMENT_REGEX = /#ARGUMENT\(([^)]*)\)/;
4254
+ const CATEGORY_PREFIX = 'CATEGORY-';
4255
+ const REGION_PREFIX = 'REGION-';
4256
+ /**
4257
+ * Parses the `display_context_parameter` of a StaffUser field to determine the filters to apply
4258
+ * when searching reference data.
4259
+ *
4260
+ * Expected format: `#ARGUMENT(CATEGORY-LEGAL-OPS,CATEGORY-ADMIN,REGION-1235)`
4261
+ */
4262
+ function parseStaffUserSearchConfiguration(displayContextParameter) {
4263
+ if (!displayContextParameter) {
4264
+ return invalidConfiguration();
4344
4265
  }
4345
- transform(field) {
4346
- if (!field || !field.field_type || !field.field_type.type) {
4347
- return false;
4266
+ const match = ARGUMENT_REGEX.exec(displayContextParameter);
4267
+ if (!match?.[1]) {
4268
+ return invalidConfiguration();
4269
+ }
4270
+ const tokens = match[1].split(',').map(token => token.trim());
4271
+ if (tokens.some(token => !token)) {
4272
+ return invalidConfiguration();
4273
+ }
4274
+ const roleCategories = [];
4275
+ for (const token of tokens) {
4276
+ if (token.startsWith(CATEGORY_PREFIX)) {
4277
+ const category = normaliseRoleCategory(token.substring(CATEGORY_PREFIX.length));
4278
+ if (!isStaffUserRoleCategory(category)) {
4279
+ return invalidConfiguration();
4280
+ }
4281
+ if (!roleCategories.includes(category)) {
4282
+ roleCategories.push(category);
4283
+ }
4348
4284
  }
4349
- if (this.isCollection(field)) {
4350
- return false;
4285
+ else if (token.startsWith(REGION_PREFIX)) {
4286
+ // Region filtering is not supported in this version; REGION- tokens are silently ignored
4287
+ }
4288
+ else {
4289
+ return invalidConfiguration();
4351
4290
  }
4352
- return this.caseFieldService.isReadOnly(field);
4353
4291
  }
4354
- // CaseField @Expose() doesn't work with the pipe in here, so leaving the manual check
4355
- isCollection(field) {
4356
- return field.field_type && field.field_type.type === 'Collection';
4292
+ if (!roleCategories.length) {
4293
+ return invalidConfiguration();
4357
4294
  }
4358
- static ɵfac = function IsReadOnlyAndNotCollectionPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyAndNotCollectionPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4359
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnlyAndNotCollection", type: IsReadOnlyAndNotCollectionPipe, pure: true, standalone: false });
4295
+ return {
4296
+ valid: true,
4297
+ configuration: {
4298
+ roleCategories,
4299
+ staffRoleCategories: roleCategories.filter(isStaffCacheRoleCategory),
4300
+ includesJudicial: roleCategories.includes('JUDICIAL')
4301
+ }
4302
+ };
4303
+ }
4304
+ function normaliseRoleCategory(category) {
4305
+ const normalised = category.replaceAll('-', '_');
4306
+ return ROLE_CATEGORY_ALIASES[normalised] || normalised;
4307
+ }
4308
+ function isStaffUserRoleCategory(category) {
4309
+ return SUPPORTED_ROLE_CATEGORIES.has(category);
4310
+ }
4311
+ function isStaffCacheRoleCategory(category) {
4312
+ return STAFF_CACHE_ROLE_CATEGORIES.has(category);
4313
+ }
4314
+ function invalidConfiguration() {
4315
+ return { valid: false, error: 'INVALID_ROLE_CATEGORIES' };
4360
4316
  }
4361
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyAndNotCollectionPipe, [{
4362
- type: Pipe,
4363
- args: [{
4364
- name: 'ccdIsReadOnlyAndNotCollection',
4365
- standalone: false
4366
- }]
4367
- }], () => [{ type: CaseFieldService }], null); })();
4368
4317
 
4369
- class PaletteUtilsModule {
4370
- static ɵfac = function PaletteUtilsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PaletteUtilsModule)(); };
4371
- static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaletteUtilsModule });
4372
- static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
4373
- IsCompoundPipe,
4374
- RpxTranslatePipe
4375
- ], imports: [CommonModule,
4376
- RpxTranslationModule.forChild()] });
4318
+ class WorkbasketInputModel {
4319
+ label;
4320
+ order;
4321
+ field;
4322
+ metadata;
4323
+ display_context_parameter;
4324
+ }
4325
+ class WorkbasketInput {
4326
+ workbasketInputs;
4377
4327
  }
4378
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaletteUtilsModule, [{
4379
- type: NgModule,
4380
- args: [{
4381
- imports: [
4382
- CommonModule,
4383
- RpxTranslationModule.forChild()
4384
- ],
4385
- declarations: [
4386
- DatePipe,
4387
- FieldLabelPipe,
4388
- FirstErrorPipe,
4389
- IsCompoundPipe,
4390
- IsMandatoryPipe,
4391
- IsReadOnlyPipe,
4392
- IsReadOnlyAndNotCollectionPipe,
4393
- DashPipe
4394
- ],
4395
- exports: [
4396
- DatePipe,
4397
- FieldLabelPipe,
4398
- FirstErrorPipe,
4399
- IsCompoundPipe,
4400
- IsMandatoryPipe,
4401
- IsReadOnlyPipe,
4402
- IsReadOnlyAndNotCollectionPipe,
4403
- DashPipe
4404
- ],
4405
- providers: [
4406
- IsCompoundPipe,
4407
- RpxTranslatePipe
4408
- ]
4409
- }]
4410
- }], null, null); })();
4411
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaletteUtilsModule, { declarations: [DatePipe,
4412
- FieldLabelPipe,
4413
- FirstErrorPipe,
4414
- IsCompoundPipe,
4415
- IsMandatoryPipe,
4416
- IsReadOnlyPipe,
4417
- IsReadOnlyAndNotCollectionPipe,
4418
- DashPipe], imports: [CommonModule, i1.RpxTranslationModule], exports: [DatePipe,
4419
- FieldLabelPipe,
4420
- FirstErrorPipe,
4421
- IsCompoundPipe,
4422
- IsMandatoryPipe,
4423
- IsReadOnlyPipe,
4424
- IsReadOnlyAndNotCollectionPipe,
4425
- DashPipe] }); })();
4426
4328
 
4427
4329
  // @dynamic
4428
4330
  class FieldsUtils {
@@ -9825,6 +9727,76 @@ class BrowserService {
9825
9727
  }], null, null); })();
9826
9728
 
9827
9729
  class CaseAccessUtils {
9730
+ // User role mapping
9731
+ static JUDGE_ROLE = 'judge';
9732
+ static JUDGE_ROLE_CATEGORY = 'JUDICIAL';
9733
+ static JUDGE_ROLE_NAME = 'judiciary';
9734
+ static ADMIN_ROLE = 'admin';
9735
+ static ADMIN_ROLE_CATEGORY = 'ADMIN';
9736
+ static ADMIN_ROLE_NAME = 'admin';
9737
+ static PROFESSIONAL_ROLE = 'solicitor';
9738
+ static PROFESSIONAL_ROLE_CATEGORY = 'PROFESSIONAL';
9739
+ static PROFESSIONAL_ROLE_NAME = 'professional';
9740
+ static LEGAL_OPERATIONS_ROLE = 'caseworker';
9741
+ static LEGAL_OPERATIONS_ROLE_CATEGORY = 'LEGAL_OPERATIONS';
9742
+ static LEGAL_OPERATIONS_ROLE_NAME = 'legal-ops';
9743
+ static CITIZEN_ROLE = 'citizen';
9744
+ static CITIZEN_ROLE_CATEGORY = 'CITIZEN';
9745
+ static CITIZEN_ROLE_NAME = 'citizen';
9746
+ static CTSC_ROLE = 'ctsc';
9747
+ static CTSC_ROLE_CATEGORY = 'CTSC';
9748
+ static CTSC_ROLE_NAME = 'ctsc';
9749
+ // fallback purely if roleCategories is not available in
9750
+ getMappedRoleCategories(roles = []) {
9751
+ const roleKeywords = roles.join().split('-').join().split(',');
9752
+ const roleCategoryList = [];
9753
+ if (this.roleHasKeyword(CaseAccessUtils.JUDGE_ROLE, roleKeywords)) {
9754
+ roleCategoryList.push(CaseAccessUtils.JUDGE_ROLE_CATEGORY);
9755
+ }
9756
+ if (this.roleHasKeyword(CaseAccessUtils.PROFESSIONAL_ROLE, roleKeywords)) {
9757
+ roleCategoryList.push(CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY);
9758
+ }
9759
+ if (this.roleHasKeyword(CaseAccessUtils.CITIZEN_ROLE, roleKeywords)) {
9760
+ roleCategoryList.push(CaseAccessUtils.CITIZEN_ROLE_CATEGORY);
9761
+ }
9762
+ if (this.roleHasKeyword(CaseAccessUtils.ADMIN_ROLE, roleKeywords)) {
9763
+ roleCategoryList.push(CaseAccessUtils.ADMIN_ROLE_CATEGORY);
9764
+ }
9765
+ if (this.roleHasKeyword(CaseAccessUtils.CTSC_ROLE, roleKeywords)) {
9766
+ roleCategoryList.push(CaseAccessUtils.CTSC_ROLE_CATEGORY);
9767
+ }
9768
+ if (this.roleHasKeyword(CaseAccessUtils.LEGAL_OPERATIONS_ROLE, roleKeywords)) {
9769
+ roleCategoryList.push(CaseAccessUtils.LEGAL_OPERATIONS_ROLE_CATEGORY);
9770
+ }
9771
+ return roleCategoryList;
9772
+ }
9773
+ roleHasKeyword(keyword, roleWords) {
9774
+ return roleWords.includes(keyword);
9775
+ }
9776
+ getAMRoleName(accessType, aMRole) {
9777
+ let roleName = '';
9778
+ switch (aMRole) {
9779
+ case CaseAccessUtils.JUDGE_ROLE_CATEGORY:
9780
+ roleName = `${accessType}-access-${CaseAccessUtils.JUDGE_ROLE_NAME}`;
9781
+ break;
9782
+ case CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY:
9783
+ roleName = `${accessType}-access-${CaseAccessUtils.PROFESSIONAL_ROLE_NAME}`;
9784
+ break;
9785
+ case CaseAccessUtils.CITIZEN_ROLE_CATEGORY:
9786
+ roleName = `${accessType}-access-${CaseAccessUtils.CITIZEN_ROLE_NAME}`;
9787
+ break;
9788
+ case CaseAccessUtils.ADMIN_ROLE_CATEGORY:
9789
+ roleName = `${accessType}-access-${CaseAccessUtils.ADMIN_ROLE_NAME}`;
9790
+ break;
9791
+ case CaseAccessUtils.CTSC_ROLE_CATEGORY:
9792
+ roleName = `${accessType}-access-${CaseAccessUtils.CTSC_ROLE_NAME}`;
9793
+ break;
9794
+ default:
9795
+ roleName = `${accessType}-access-${CaseAccessUtils.LEGAL_OPERATIONS_ROLE_NAME}`;
9796
+ break;
9797
+ }
9798
+ return roleName;
9799
+ }
9828
9800
  getAMPayload(assignerId, actorId, roleName, roleCategory, grantType, caseId, details, beginTime = null, endTime = null, isNew = false) {
9829
9801
  const process = details.caseReference !== undefined ? 'challenged-access' : 'specific-access';
9830
9802
  const payload = {
@@ -11718,9 +11690,9 @@ class CasesService {
11718
11690
  }
11719
11691
  // EXUI-4758 - getMappedRoleCategories no longer returns a single string, checks all roles to get the most likely roleCategory
11720
11692
  // Unsure whether we should be using mapped role categories any more - should trust the roleCategories from userInfo if they exist
11721
- const roleCategories = userInfo.roleCategories || getMappedRoleCategories(userInfo.roles);
11693
+ const roleCategories = userInfo.roleCategories || camUtils.getMappedRoleCategories(userInfo.roles);
11722
11694
  // If user has no role categories, default to LEGAL_OPERATIONS
11723
- const roleName = getAMRoleName('challenged', roleCategories?.length > 0 ? roleCategories[0] : RoleCategory.LEGAL_OPERATIONS);
11695
+ const roleName = camUtils.getAMRoleName('challenged', roleCategories?.length > 0 ? roleCategories[0] : "LEGAL_OPERATIONS");
11724
11696
  const beginTime = new Date();
11725
11697
  const endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
11726
11698
  const id = userInfo.id ? userInfo.id : userInfo.uid;
@@ -11737,10 +11709,10 @@ class CasesService {
11737
11709
  return throwError(() => new Error('User info not found in session storage'));
11738
11710
  }
11739
11711
  // EXUI-4758 - See above comment
11740
- const roleCategories = userInfo.roleCategories || getMappedRoleCategories(userInfo.roles);
11712
+ const roleCategories = userInfo.roleCategories || camUtils.getMappedRoleCategories(userInfo.roles);
11741
11713
  // EXUI-4758 - Return first roleCategory as the roleCategory for now, unless not present, in which case default to LEGAL_OPERATIONS
11742
- const roleCategory = roleCategories?.length > 0 ? roleCategories[0] : RoleCategory.LEGAL_OPERATIONS;
11743
- const roleName = getAMRoleName('specific', roleCategory);
11714
+ const roleCategory = roleCategories?.length > 0 ? roleCategories[0] : "LEGAL_OPERATIONS";
11715
+ const roleName = camUtils.getAMRoleName('specific', roleCategory);
11744
11716
  const id = userInfo.id ? userInfo.id : userInfo.uid;
11745
11717
  const payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);
11746
11718
  payload.roleRequest = {
@@ -40514,8 +40486,16 @@ class CaseResolver {
40514
40486
  }
40515
40487
  // as discussed for EUI-5456, need functionality to go to default page
40516
40488
  goToDefaultPage() {
40517
- isWorkAllocationUser(this.sessionStorage) ?
40518
- this.router.navigate([CaseResolver.defaultWAPage]) : this.router.navigate([CaseResolver.defaultPage]);
40489
+ const userDetails = safeJsonParse(this.sessionStorage.getItem(USER_DETAILS));
40490
+ userDetails && userDetails.roles
40491
+ && !userDetails.roles.includes(PUI_CASE_MANAGER)
40492
+ &&
40493
+ (userDetails.roles.includes('caseworker-ia-iacjudge')
40494
+ || userDetails.roles.includes('caseworker-ia-caseofficer')
40495
+ || userDetails.roles.includes('caseworker-ia-admofficer')
40496
+ || userDetails.roles.includes('caseworker-civil')
40497
+ || userDetails.roles.includes('caseworker-privatelaw'))
40498
+ ? this.router.navigate([CaseResolver.defaultWAPage]) : this.router.navigate([CaseResolver.defaultPage]);
40519
40499
  }
40520
40500
  static ɵfac = function CaseResolver_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseResolver)(i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(DraftService), i0.ɵɵinject(NavigationNotifierService), i0.ɵɵinject(i1$2.Router), i0.ɵɵinject(SessionStorageService)); };
40521
40501
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseResolver, factory: CaseResolver.ɵfac });
@@ -46661,5 +46641,5 @@ class TestRouteSnapshotBuilder {
46661
46641
  * Generated bundle index. Do not edit.
46662
46642
  */
46663
46643
 
46664
- 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, 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, ProfileResolver, 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, ReadRichTextAreaFieldComponent, ReadStaffUserFieldComponent, 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, WriteRichTextAreaFieldComponent, WriteStaffUserFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, parseStaffUserSearchConfiguration, safeJsonParse, textFieldType, viewerRouting };
46644
+ 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, 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, ProfileResolver, 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, ReadRichTextAreaFieldComponent, ReadStaffUserFieldComponent, 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, WriteRichTextAreaFieldComponent, WriteStaffUserFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, parseStaffUserSearchConfiguration, safeJsonParse, textFieldType, viewerRouting };
46665
46645
  //# sourceMappingURL=hmcts-ccd-case-ui-toolkit.mjs.map