@hmcts/ccd-case-ui-toolkit 7.3.3-3859 → 7.3.3-exui-3824-rc1

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.
@@ -5099,10 +5099,15 @@ class FormValidatorsService {
5099
5099
  return validator;
5100
5100
  }
5101
5101
  static markDownPatternValidator() {
5102
- const pattern = /(\[[^\]]{0,500}\]\([^)]{0,500}\)|!\[[^\]]{0,500}\]\([^)]{0,500}\)|<img[^>]{0,500}>|<a[^>]{0,500}>.*?<\/a>)/;
5102
+ // Matches: [text](url), ![alt](url), <img ...>, <a ...>...</a>
5103
+ const inlineMarkdownPattern = /(?:!?\[[^\]]{0,500}\]\([^)]{0,500}\)|<(?:img\b[^>]{0,500}>|a\b[^>]{0,500}>[\s\S]*?<\/a>))/i;
5104
+ // Matches: [text][id], ![alt][id], and the collapsed form [text][]
5105
+ const referenceBoxPattern = /(!)?\[((?:[^[\]\\]|\\.){0,500})\]\s*\[([^\]]{0,100})\]/;
5106
+ // Matches: autolinks such as <http://example.com>
5107
+ const autolinkPattern = /<(?:[A-Za-z][A-Za-z0-9+.-]*:[^ <>\n]*|[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+)>/;
5103
5108
  return (control) => {
5104
5109
  const value = control?.value?.toString().trim();
5105
- return (value && pattern.test(value)) ? { markDownPattern: {} } : null;
5110
+ return (value && (inlineMarkdownPattern.test(value) || referenceBoxPattern.test(value) || this.matchesReferenceUrlDef(value) || autolinkPattern.test(value) || this.hasMultiBracket(value))) ? { markDownPattern: {} } : null;
5106
5111
  };
5107
5112
  }
5108
5113
  // TODO: Strip this out as it's only here for the moment because
@@ -5120,6 +5125,74 @@ class FormValidatorsService {
5120
5125
  }
5121
5126
  return control;
5122
5127
  }
5128
+ // Check for multi-bracket markdown links and validate destination URL
5129
+ static hasMultiBracket(value) {
5130
+ // Sonar-friendly detector: opening-run + text + first closing ']'
5131
+ const openingTextClosePattern = /\[{1,10}[^[\]\n]{1,60}\]/;
5132
+ // Can add an additional RegEx for additional URL validation rules if needed here
5133
+ let scanIndex = 0;
5134
+ const totalLength = value.length;
5135
+ while (scanIndex < totalLength) {
5136
+ const seg = this.findOpeningTextClose(value, scanIndex, openingTextClosePattern);
5137
+ if (!seg) {
5138
+ return false; // no candidate -> no match
5139
+ }
5140
+ const runs = this.extendClosingRunAndRequireParen(value, seg.absStart, seg.afterFirstClose);
5141
+ // if there is more than one opening '[' and there is at least a matching number of closing ']'
5142
+ if (runs && runs.openingRunCount > 1 && runs.openingRunCount === runs.closingRunCount) {
5143
+ // If there were additional validation rules, they would be applied here
5144
+ return true;
5145
+ }
5146
+ // Advance to avoid stalling on overlaps
5147
+ scanIndex = seg.absStart + 1;
5148
+ }
5149
+ return false;
5150
+ }
5151
+ // Find opening '[' run, text, and first closing ']'
5152
+ static findOpeningTextClose(source, fromIndex, pattern) {
5153
+ const slice = source.slice(fromIndex);
5154
+ const match = pattern.exec(slice);
5155
+ if (!match) {
5156
+ return null;
5157
+ }
5158
+ const absStart = fromIndex + match.index;
5159
+ const afterFirstClose = absStart + match[0].length; // index just after the first ']'
5160
+ return { absStart, afterFirstClose };
5161
+ }
5162
+ // Count opening '[' run, extend the ']' run, and require '(' right after the full ']' run
5163
+ static extendClosingRunAndRequireParen(source, absStart, afterFirstClose) {
5164
+ const n = source.length;
5165
+ // Count opening '[' run (e.g., '[[[')
5166
+ let openingRunCount = 0;
5167
+ for (let i = absStart; i < n && source[i] === '['; i++) {
5168
+ openingRunCount++;
5169
+ }
5170
+ // Extend closing ']' run forward from the first one
5171
+ let closingRunCount = 1;
5172
+ let afterClosingRun = afterFirstClose;
5173
+ while (afterClosingRun < n && source[afterClosingRun] === ']') {
5174
+ closingRunCount++;
5175
+ afterClosingRun++;
5176
+ }
5177
+ return { openingRunCount, closingRunCount, afterOpenParen: afterClosingRun + 1 };
5178
+ }
5179
+ static isValidReferenceUrlTitleTail(tail) {
5180
+ const possibleTitle = tail.trim();
5181
+ // Accept exactly one of: "title", 'title', (title) — bounded and single-line.
5182
+ if (!possibleTitle || /^"[^"\r\n]{0,300}"$/.test(possibleTitle) || /^'[^'\r\n]{0,300}'$/.test(possibleTitle) || /^\([^)\r\n]{0,300}\)$/.test(possibleTitle)) {
5183
+ return true;
5184
+ }
5185
+ return false;
5186
+ }
5187
+ static matchesReferenceUrlDef(line) {
5188
+ // Single-line, pragmatic CommonMark-style reference definition e.g. [text]: http://example.com
5189
+ const baseReferenceUrlPattern = /^[ \t]{0,3}\[([^\]]{1,100})\]:[ \t]*<?([^\s>]{1,2048})>?[ \t]*([^ \t\r\n].*)?$/m;
5190
+ const mainRegEx = baseReferenceUrlPattern.exec(line);
5191
+ if (!mainRegEx)
5192
+ return false;
5193
+ const tail = mainRegEx[3] ?? "";
5194
+ return this.isValidReferenceUrlTitleTail(tail);
5195
+ }
5123
5196
  static ɵfac = function FormValidatorsService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormValidatorsService)(); };
5124
5197
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormValidatorsService, factory: FormValidatorsService.ɵfac });
5125
5198
  }
@@ -6215,6 +6288,60 @@ class FormValueService {
6215
6288
  }
6216
6289
  }
6217
6290
  }
6291
+ // exui-3582 When a form field becomes hidden based on user’s input in the event journey,
6292
+ // its stored value must be cleared and it must not be submitted or persisted.
6293
+ removeHiddenField(data, caseFields, clearNonCase, formControls) {
6294
+ if (clearNonCase && data && caseFields && caseFields.length > 0) {
6295
+ for (const field of caseFields) {
6296
+ if (!FormValueService.isLabel(field) && FormValueService.isReadOnly(field)) {
6297
+ // Retain anything that is readonly and not a label.
6298
+ continue;
6299
+ }
6300
+ // Check if formControls[field.id] exists before accessing its properties
6301
+ const caseField = formControls[field.id] ? formControls[field.id]['caseField'] : undefined;
6302
+ if (caseField === undefined || field.hidden === true) {
6303
+ continue;
6304
+ }
6305
+ const hasValue = data.hasOwnProperty(field.id) && data[field.id] != null &&
6306
+ (typeof data[field.id] !== 'object' || Object.keys(data[field.id]).length > 0);
6307
+ if (caseField?.hidden === true &&
6308
+ field.display_context !== 'HIDDEN' &&
6309
+ field.display_context !== 'HIDDEN_TEMP' &&
6310
+ !field.retain_hidden_value &&
6311
+ field.id !== 'caseLinks' &&
6312
+ hasValue) {
6313
+ data[field.id] = null;
6314
+ continue; // If field is now hidden, skip checking its children
6315
+ }
6316
+ if (field.field_type) {
6317
+ switch (field.field_type.type) {
6318
+ case 'Complex':
6319
+ const complexData = data[field.id] ?? data['value'];
6320
+ if (complexData && formControls[field.id] && formControls[field.id]['controls']) {
6321
+ this.removeHiddenField(complexData, field.field_type.complex_fields, clearNonCase, formControls[field.id]['controls']);
6322
+ }
6323
+ break;
6324
+ case 'Collection':
6325
+ const collection = data[field.id];
6326
+ if (collection && Array.isArray(collection) && field.field_type.collection_field_type.type === 'Complex') {
6327
+ collection.forEach((item, index) => {
6328
+ if (formControls[field.id] && formControls[field.id]['controls'] && formControls[field.id]['controls'][index]) {
6329
+ const itemControls = formControls[field.id]?.['controls']?.[index]?.['controls']?.['value'];
6330
+ const collectionData = item['value'] ?? item;
6331
+ if (collectionData && itemControls?.['controls']) {
6332
+ this.removeHiddenField(collectionData, field.field_type.collection_field_type.complex_fields, clearNonCase, itemControls['controls']);
6333
+ }
6334
+ }
6335
+ });
6336
+ }
6337
+ break;
6338
+ default:
6339
+ break;
6340
+ }
6341
+ }
6342
+ }
6343
+ }
6344
+ }
6218
6345
  /**
6219
6346
  * Remove any empty collection fields where a value of greater than zero is specified in the field's {@link FieldType}
6220
6347
  * `min` attribute.
@@ -7148,7 +7275,6 @@ class ReadCookieService {
7148
7275
  class DocumentManagementService {
7149
7276
  http;
7150
7277
  appConfig;
7151
- sessionStorageService;
7152
7278
  static PDF = 'pdf';
7153
7279
  static IMAGE = 'image';
7154
7280
  static WORD = 'word';
@@ -7163,22 +7289,29 @@ class DocumentManagementService {
7163
7289
  static wordList = ['DOC', 'DOCX', 'doc', 'docx'];
7164
7290
  static excelList = ['XLS', 'XLSX', 'xls', 'xlsx'];
7165
7291
  static powerpointList = ['PPT', 'PPTX', 'ppt', 'pptx'];
7166
- caseTypeId;
7167
- caseId;
7168
- constructor(http, appConfig, sessionStorageService) {
7292
+ caseTypeId = '';
7293
+ constructor(http, appConfig) {
7169
7294
  this.http = http;
7170
7295
  this.appConfig = appConfig;
7171
- this.sessionStorageService = sessionStorageService;
7172
- const caseInfo = this.parseCaseInfo(this.sessionStorageService.getItem('caseInfo'));
7173
- const currUrl = this.getCurrentPathname();
7174
- this.caseTypeId = this.resolveCaseTypeId(caseInfo, currUrl);
7296
+ const currUrl = window.location.pathname;
7297
+ if (currUrl.includes('/case-details/')) {
7298
+ this.caseTypeId = currUrl.split('/')[4];
7299
+ }
7300
+ console.log(this.caseTypeId);
7301
+ //if the user refreshes on the case creation page the above logic will not work, we can get the caseTypeId from the URL
7302
+ if (!this.caseTypeId) {
7303
+ if (currUrl.indexOf('/case-create/') > -1) {
7304
+ const parts = currUrl.split('/');
7305
+ this.caseTypeId = parts[parts.indexOf('case-create') + 2];
7306
+ }
7307
+ }
7175
7308
  }
7176
7309
  uploadFile(formData) {
7177
7310
  const url = this.getDocStoreUrl();
7178
7311
  // Do not set any headers, such as "Accept" or "Content-Type", with null values; this is not permitted with the
7179
7312
  // Angular HttpClient in @angular/common/http. Just create and pass a new HttpHeaders object. Angular will add the
7180
7313
  // correct headers and values automatically
7181
- this.appConfig.logMessage(`DMS:: Uploading document for case type: ${this.caseTypeId}, with url: ${url}, and case id: ${this.caseId}`);
7314
+ this.appConfig.logMessage(`Uploading document for case type: ${this.caseTypeId}, with url: ${url}`);
7182
7315
  const headers = new HttpHeaders();
7183
7316
  return this.http
7184
7317
  .post(url, formData, { headers, observe: 'body' })
@@ -7243,40 +7376,6 @@ class DocumentManagementService {
7243
7376
  isPowerpoint(powerpointType) {
7244
7377
  return DocumentManagementService.powerpointList.find(e => e === powerpointType) !== undefined;
7245
7378
  }
7246
- parseCaseInfo(caseInfo) {
7247
- if (!caseInfo) {
7248
- return null;
7249
- }
7250
- try {
7251
- return JSON.parse(caseInfo);
7252
- }
7253
- catch (error) {
7254
- this.appConfig.logMessage('Failed to parse caseInfo from session storage');
7255
- return null;
7256
- }
7257
- }
7258
- getCurrentPathname() {
7259
- if (typeof window === 'undefined' || !window.location) {
7260
- return '';
7261
- }
7262
- return window.location.pathname || '';
7263
- }
7264
- resolveCaseTypeId(caseInfo, currUrl) {
7265
- const caseTypeIdFromSession = caseInfo?.caseType;
7266
- if (caseTypeIdFromSession) {
7267
- this.caseId = caseInfo?.caseId;
7268
- return caseTypeIdFromSession;
7269
- }
7270
- const parts = currUrl.split('/');
7271
- if (currUrl.includes('/case-details/') && parts.length > 4) {
7272
- return parts[4];
7273
- }
7274
- const caseCreateIndex = parts.indexOf('case-create');
7275
- if (currUrl.includes('/case-create/') && caseCreateIndex > -1 && parts.length > caseCreateIndex + 2) {
7276
- return parts[caseCreateIndex + 2];
7277
- }
7278
- return '';
7279
- }
7280
7379
  transformDocumentUrl(documentBinaryUrl) {
7281
7380
  const remoteHrsPattern = new RegExp(this.appConfig.getRemoteHrsUrl());
7282
7381
  documentBinaryUrl = documentBinaryUrl.replace(remoteHrsPattern, this.appConfig.getHrsUrl());
@@ -7300,12 +7399,12 @@ class DocumentManagementService {
7300
7399
  // if documentSecureModeEnabled is true, and case is in the exclusion list, return false
7301
7400
  return false;
7302
7401
  }
7303
- static ɵfac = function DocumentManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DocumentManagementService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(SessionStorageService)); };
7402
+ static ɵfac = function DocumentManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DocumentManagementService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig)); };
7304
7403
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DocumentManagementService, factory: DocumentManagementService.ɵfac });
7305
7404
  }
7306
7405
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DocumentManagementService, [{
7307
7406
  type: Injectable
7308
- }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: SessionStorageService }], null); })();
7407
+ }], () => [{ type: HttpService }, { type: AbstractAppConfig }], null); })();
7309
7408
 
7310
7409
  class ErrorNotifierService {
7311
7410
  errorSource = new BehaviorSubject(null);
@@ -8723,6 +8822,7 @@ var EventCompletionTaskStates;
8723
8822
 
8724
8823
  const EVENT_COMPLETION_STATE_MACHINE = 'EVENT COMPLETION STATE MACHINE';
8725
8824
  class EventCompletionStateMachineService {
8825
+ abstractConfig;
8726
8826
  stateCheckTasksCanBeCompleted;
8727
8827
  stateCompleteEventAndTask;
8728
8828
  stateCancelEvent;
@@ -8733,6 +8833,9 @@ class EventCompletionStateMachineService {
8733
8833
  stateTaskAssignToUser;
8734
8834
  stateTaskUnassigned;
8735
8835
  stateFinal;
8836
+ constructor(abstractConfig) {
8837
+ this.abstractConfig = abstractConfig;
8838
+ }
8736
8839
  initialiseStateMachine(context) {
8737
8840
  return new StateMachine(EVENT_COMPLETION_STATE_MACHINE, context);
8738
8841
  }
@@ -8757,9 +8860,10 @@ class EventCompletionStateMachineService {
8757
8860
  this.addTransitionsForStateTaskAssignedToAnotherUser();
8758
8861
  this.addTransitionsForStateTaskUnassigned();
8759
8862
  }
8760
- entryActionForStateCheckTasksCanBeCompleted(state, context) {
8863
+ entryActionForStateCheckTasksCanBeCompleted = (state, context) => {
8761
8864
  const assignNeeded = context.sessionStorageService.getItem('assignNeeded');
8762
8865
  context.workAllocationService.getTask(context.task.id).subscribe(taskResponse => {
8866
+ this.abstractConfig?.logMessage?.(`entryActionForStateCheckTasksCanBeCompleted: task_state ${taskResponse?.task?.task_state} for task id ${context?.task?.id}`);
8763
8867
  if (taskResponse?.task?.task_state) {
8764
8868
  switch (taskResponse.task.task_state.toUpperCase()) {
8765
8869
  case TaskState.Unassigned:
@@ -8798,27 +8902,30 @@ class EventCompletionStateMachineService {
8798
8902
  else if (!taskResponse?.task) {
8799
8903
  context.alertService.setPreserveAlerts(true);
8800
8904
  context.alertService.warning({ phrase: 'Task statecheck : no task available for completion', replacements: {} });
8905
+ this.abstractConfig?.logMessage?.(`Task statecheck : no task available for completion`);
8801
8906
  }
8802
8907
  else {
8803
8908
  context.alertService.setPreserveAlerts(true);
8804
8909
  context.alertService.warning({ phrase: 'Task statecheck : no task state available for completion', replacements: {} });
8910
+ this.abstractConfig?.logMessage?.(`Task statecheck : no task state available for completion`);
8805
8911
  }
8806
8912
  }, error => {
8807
8913
  context.alertService.error(error.message);
8808
8914
  return throwError(error);
8809
8915
  });
8810
- }
8916
+ };
8811
8917
  entryActionForStateTaskCompletedOrCancelled(state, context) {
8812
8918
  // Trigger final state to complete processing of state machine
8813
8919
  state.trigger(EventCompletionStates.Final);
8814
8920
  // Load case event completion task cancelled component
8815
8921
  context.component.setTaskState(EventCompletionTaskStates.TaskCancelled);
8816
8922
  }
8817
- entryActionForStateCompleteEventAndTask(state, context) {
8923
+ entryActionForStateCompleteEventAndTask = (state, context) => {
8818
8924
  // Trigger final state to complete processing of state machine
8819
8925
  state.trigger(EventCompletionStates.Final);
8820
8926
  const clientContextStr = context.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
8821
8927
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8928
+ this.abstractConfig?.logMessage?.(`entryActionForStateCompleteEventAndTask: userTask task_data ${JSON.stringify(userTask?.task_data?.id)}`);
8822
8929
  if (userTask?.task_data) {
8823
8930
  context.sessionStorageService.setItem('assignNeeded', 'false');
8824
8931
  // just set event can be completed
@@ -8830,7 +8937,7 @@ class EventCompletionStateMachineService {
8830
8937
  // Emit event cannot be completed event
8831
8938
  context.component.eventCanBeCompleted.emit(false);
8832
8939
  }
8833
- }
8940
+ };
8834
8941
  entryActionForStateTaskAssignedToAnotherUser(state, context) {
8835
8942
  // Trigger final state to complete processing of state machine
8836
8943
  state.trigger(EventCompletionStates.Final);
@@ -8884,12 +8991,12 @@ class EventCompletionStateMachineService {
8884
8991
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8885
8992
  return !!userTask.task_data;
8886
8993
  }
8887
- static ɵfac = function EventCompletionStateMachineService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventCompletionStateMachineService)(); };
8994
+ static ɵfac = function EventCompletionStateMachineService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventCompletionStateMachineService)(i0.ɵɵinject(AbstractAppConfig)); };
8888
8995
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventCompletionStateMachineService, factory: EventCompletionStateMachineService.ɵfac });
8889
8996
  }
8890
8997
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventCompletionStateMachineService, [{
8891
8998
  type: Injectable
8892
- }], null, null); })();
8999
+ }], () => [{ type: AbstractAppConfig }], null); })();
8893
9000
 
8894
9001
  class JudicialworkerService {
8895
9002
  http;
@@ -9220,6 +9327,27 @@ class ValidPageListCaseFieldsService {
9220
9327
  type: Injectable
9221
9328
  }], () => [{ type: FieldsUtils }], null); })();
9222
9329
 
9330
+ function CaseEditComponent_div_1_Template(rf, ctx) { if (rf & 1) {
9331
+ const _r1 = i0.ɵɵgetCurrentView();
9332
+ i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h2", 3);
9333
+ i0.ɵɵtext(3, "Page refreshed");
9334
+ i0.ɵɵelementEnd();
9335
+ i0.ɵɵelementStart(4, "p");
9336
+ i0.ɵɵtext(5);
9337
+ i0.ɵɵelementEnd();
9338
+ i0.ɵɵelementStart(6, "p");
9339
+ i0.ɵɵtext(7);
9340
+ i0.ɵɵelementEnd();
9341
+ i0.ɵɵelementStart(8, "button", 4);
9342
+ i0.ɵɵlistener("click", function CaseEditComponent_div_1_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onRefreshModalOk()); });
9343
+ i0.ɵɵtext(9, "Ok");
9344
+ i0.ɵɵelementEnd()()();
9345
+ } if (rf & 2) {
9346
+ i0.ɵɵadvance(5);
9347
+ i0.ɵɵtextInterpolate("As the page has been refreshed mandatory data is now missing. You will be redirected to the first page of this event.");
9348
+ i0.ɵɵadvance(2);
9349
+ i0.ɵɵtextInterpolate("Please select Ok to continue.");
9350
+ } }
9223
9351
  class CaseEditComponent {
9224
9352
  fb;
9225
9353
  caseNotifier;
@@ -9266,6 +9394,7 @@ class CaseEditComponent {
9266
9394
  error;
9267
9395
  callbackErrorsSubject = new Subject();
9268
9396
  validPageList = [];
9397
+ isRefreshModalVisible = false;
9269
9398
  constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService, abstractConfig, cookieService) {
9270
9399
  this.fb = fb;
9271
9400
  this.caseNotifier = caseNotifier;
@@ -9312,12 +9441,25 @@ class CaseEditComponent {
9312
9441
  checkPageRefresh() {
9313
9442
  if (this.isPageRefreshed && this.initialUrl) {
9314
9443
  this.sessionStorageService.removeItem('eventUrl');
9315
- this.windowsService.alert(CaseEditComponent.ALERT_MESSAGE);
9444
+ this.isRefreshModalVisible = true;
9316
9445
  this.router.navigate([this.initialUrl], { relativeTo: this.route });
9317
9446
  return true;
9318
9447
  }
9448
+ // if the url contains /submit there is the potential that the user has gone straight to the submit page
9449
+ // we should try and work out if they have been through the journey or not and prevent them submitting directly
9450
+ if (this.router.url.includes('/submit') && !this.initialUrl) {
9451
+ // we only want to check if the user has done this if there is a multi-page journey
9452
+ if (this.eventTrigger.wizard_pages && this.eventTrigger.wizard_pages.length > 0) {
9453
+ const firstPage = this.eventTrigger.wizard_pages.reduce((min, page) => page.order < min.order ? page : min, this.eventTrigger.wizard_pages[0]);
9454
+ this.isRefreshModalVisible = true;
9455
+ this.router.navigate([firstPage ? firstPage.id : 'submit'], { relativeTo: this.route });
9456
+ }
9457
+ }
9319
9458
  return false;
9320
9459
  }
9460
+ onRefreshModalOk() {
9461
+ this.isRefreshModalVisible = false;
9462
+ }
9321
9463
  getPage(pageId) {
9322
9464
  return this.wizard.getPage(pageId, this.fieldsUtils.buildCanShowPredicate(this.eventTrigger, this.form));
9323
9465
  }
@@ -9410,7 +9552,7 @@ class CaseEditComponent {
9410
9552
  const userId = userInfo.id ? userInfo.id : userInfo.uid;
9411
9553
  const eventDetails = { eventId, caseId, userId, assignNeeded };
9412
9554
  if (this.taskExistsForThisEvent(taskInSessionStorage, taskEventCompletionInfo, eventDetails)) {
9413
- this.abstractConfig.logMessage(`task exist for this event for caseId and eventId as ${caseId} ${eventId}`);
9555
+ this.abstractConfig.logMessage(`task ${taskInSessionStorage?.id} exist for this event for caseId and eventId as ${caseId} ${eventId}`);
9414
9556
  // Show event completion component to perform event completion checks
9415
9557
  this.eventCompletionParams = ({
9416
9558
  caseId,
@@ -9430,6 +9572,7 @@ class CaseEditComponent {
9430
9572
  this.isEventCompletionChecksRequired = true;
9431
9573
  }
9432
9574
  else {
9575
+ this.abstractConfig.logMessage(`task does not exist for caseId and eventId as ${caseId} ${eventId}`);
9433
9576
  // Task not in session storage, proceed to submit
9434
9577
  const caseEventData = this.generateCaseEventData({
9435
9578
  eventTrigger,
@@ -9472,6 +9615,11 @@ class CaseEditComponent {
9472
9615
  if (!this.isCaseFlagSubmission) {
9473
9616
  this.formValueService.removeUnnecessaryFields(caseEventData.data, pageListCaseFields, true, true);
9474
9617
  }
9618
+ // removeHiddenFields while are hidden in the UI
9619
+ // Only remove hidden fields if editForm and its controls are available
9620
+ if (form?.controls?.['data']?.['controls']) {
9621
+ this.formValueService.removeHiddenField(caseEventData.data, pageListCaseFields, true, form.controls['data']['controls']);
9622
+ }
9475
9623
  caseEventData.event_token = eventTrigger.event_token;
9476
9624
  caseEventData.ignore_warning = this.ignoreWarning;
9477
9625
  if (this.confirmation) {
@@ -9594,11 +9742,13 @@ class CaseEditComponent {
9594
9742
  this.sessionStorageService.setItem('taskCompletionError', 'false');
9595
9743
  submit(caseEventData).pipe(switchMap((response) => {
9596
9744
  eventResponse = response;
9745
+ this.abstractConfig.logMessage(`Event ${this.eventCompletionParams?.eventId} of case Id ${this.eventCompletionParams?.caseId} and taskId ${this.eventCompletionParams?.task?.id}`);
9597
9746
  return this.postCompleteTaskIfRequired();
9598
9747
  }), finalize(() => {
9599
9748
  this.loadingService.unregister(loadingSpinnerToken);
9600
9749
  // on event completion ensure the previous event clientContext/taskEventCompletionInfo removed
9601
9750
  // Note - Not removeTaskFromClientContext because could interfere with other logic
9751
+ this.abstractConfig.logMessage(`Clearing client context and task event completion info after event ${this.eventCompletionParams?.eventId} submission of case Id ${this.eventCompletionParams?.caseId} and task Id ${this.eventCompletionParams?.task?.id}`);
9602
9752
  this.sessionStorageService.removeItem(CaseEditComponent.CLIENT_CONTEXT);
9603
9753
  this.sessionStorageService.removeItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO);
9604
9754
  this.isSubmitting = false;
@@ -9606,6 +9756,7 @@ class CaseEditComponent {
9606
9756
  .subscribe(() => {
9607
9757
  this.finishEventCompletionLogic(eventResponse);
9608
9758
  }, error => {
9759
+ this.abstractConfig.logMessage(`An error occurred while submission of event ${this.eventCompletionParams?.eventId} and case Id ${this.eventCompletionParams?.caseId} and taskId ${this.eventCompletionParams?.task?.id}`);
9609
9760
  if (!eventResponse) {
9610
9761
  // event submission error
9611
9762
  this.error = error;
@@ -9633,13 +9784,14 @@ class CaseEditComponent {
9633
9784
  const [task, taskToBeCompleted] = userTask ? [userTask.task_data, userTask.complete_task] : [null, false];
9634
9785
  const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
9635
9786
  if (task && assignNeeded && taskToBeCompleted) {
9636
- this.abstractConfig.logMessage(`postCompleteTaskIfRequired with assignNeeded: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9787
+ this.abstractConfig.logMessage(`postCompleteTaskIfRequired with assignNeeded: taskId ${task.id} and event name ${this.eventTrigger?.name}`);
9637
9788
  return this.workAllocationService.assignAndCompleteTask(task.id, this.eventTrigger.name);
9638
9789
  }
9639
9790
  else if (task && taskToBeCompleted) {
9640
- this.abstractConfig.logMessage(`postCompleteTaskIfRequired: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9791
+ this.abstractConfig.logMessage(`postCompleteTaskIfRequired: taskId ${task.id} and event name ${this.eventTrigger?.name}`);
9641
9792
  return this.workAllocationService.completeTask(task.id, this.eventTrigger.name);
9642
9793
  }
9794
+ this.abstractConfig.logMessage(`postCompleteTaskIfRequired: no task to complete for event name ${this.eventTrigger?.name} and caseId ${this.caseDetails?.case_id}`);
9643
9795
  return of(true);
9644
9796
  }
9645
9797
  finishEventCompletionLogic(eventResponse) {
@@ -9738,13 +9890,17 @@ class CaseEditComponent {
9738
9890
  return task.case_id === eventDetails.caseId && (task.description?.includes(eventDetails.eventId));
9739
9891
  }
9740
9892
  static ɵfac = function CaseEditComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseEditComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(ReadCookieService)); };
9741
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditComponent, selectors: [["ccd-case-edit"]], inputs: { eventTrigger: "eventTrigger", submit: "submit", validate: "validate", saveDraft: "saveDraft", caseDetails: "caseDetails" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, standalone: false, features: [i0.ɵɵProvidersFeature([GreyBarService])], decls: 1, vars: 0, template: function CaseEditComponent_Template(rf, ctx) { if (rf & 1) {
9893
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditComponent, selectors: [["ccd-case-edit"]], inputs: { eventTrigger: "eventTrigger", submit: "submit", validate: "validate", saveDraft: "saveDraft", caseDetails: "caseDetails" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, standalone: false, features: [i0.ɵɵProvidersFeature([GreyBarService])], decls: 2, vars: 1, consts: [["class", "refresh-modal-backdrop", 4, "ngIf"], [1, "refresh-modal-backdrop"], [1, "refresh-modal"], [1, "heading-h2"], [1, "button", 3, "click"]], template: function CaseEditComponent_Template(rf, ctx) { if (rf & 1) {
9742
9894
  i0.ɵɵelement(0, "router-outlet");
9743
- } }, dependencies: [i1$1.RouterOutlet], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
9895
+ i0.ɵɵtemplate(1, CaseEditComponent_div_1_Template, 10, 2, "div", 0);
9896
+ } if (rf & 2) {
9897
+ i0.ɵɵadvance();
9898
+ i0.ɵɵproperty("ngIf", ctx.isRefreshModalVisible);
9899
+ } }, dependencies: [i5.NgIf, i1$1.RouterOutlet], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}.refresh-modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.refresh-modal[_ngcontent-%COMP%]{background:#fff;padding:24px;max-width:520px;width:90%;box-shadow:0 8px 24px #0003;border-radius:4px;text-align:center}.refresh-modal[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{margin-top:12px}"] });
9744
9900
  }
9745
9901
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditComponent, [{
9746
9902
  type: Component,
9747
- args: [{ selector: 'ccd-case-edit', providers: [GreyBarService], standalone: false, template: "<router-outlet></router-outlet>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
9903
+ args: [{ selector: 'ccd-case-edit', providers: [GreyBarService], standalone: false, template: "<router-outlet></router-outlet>\n<!-- Simple centered modal shown on refresh -->\n<div *ngIf=\"isRefreshModalVisible\" class=\"refresh-modal-backdrop\">\n <div class=\"refresh-modal\">\n <h2 class=\"heading-h2\">Page refreshed</h2>\n <p>{{ 'As the page has been refreshed mandatory data is now missing. You will be redirected to the first page of this event.' }}</p>\n <p>{{ 'Please select Ok to continue.' }}</p>\n <button class=\"button\" (click)=\"onRefreshModalOk()\">Ok</button>\n </div>\n</div>", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}.refresh-modal-backdrop{position:fixed;inset:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.refresh-modal{background:#fff;padding:24px;max-width:520px;width:90%;box-shadow:0 8px 24px #0003;border-radius:4px;text-align:center}.refresh-modal .button{margin-top:12px}\n"] }]
9748
9904
  }], () => [{ type: i4.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }, { type: AbstractAppConfig }, { type: ReadCookieService }], { eventTrigger: [{
9749
9905
  type: Input
9750
9906
  }], submit: [{
@@ -10322,11 +10478,11 @@ class CaseEditConfirmComponent {
10322
10478
  i0.ɵɵproperty("ngIf", ctx.confirmation.getBody());
10323
10479
  i0.ɵɵadvance(2);
10324
10480
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 10, ctx.triggerText));
10325
- } }, styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
10481
+ } }, styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}.refresh-modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.refresh-modal[_ngcontent-%COMP%]{background:#fff;padding:24px;max-width:520px;width:90%;box-shadow:0 8px 24px #0003;border-radius:4px;text-align:center}.refresh-modal[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{margin-top:12px}"] });
10326
10482
  }
10327
10483
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditConfirmComponent, [{
10328
10484
  type: Component,
10329
- args: [{ standalone: false, template: "<!-- Current Page && Event trigger name -->\n<h1 class=\"heading-h1\">{{ eventTrigger.name | rpxTranslate}}</h1>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<form [formGroup]=\"formGroup\" (submit)=\"submit()\">\n <div id=\"confirmation-header\" *ngIf=\"confirmation.getHeader()\">\n <ccd-markdown [content]=\"confirmation.getHeader() | rpxTranslate\"></ccd-markdown>\n </div>\n <div id=\"confirmation-body\" *ngIf=\"confirmation.getBody()\">\n <ccd-markdown [content]=\"confirmation.getBody() | rpxTranslate\"></ccd-markdown>\n </div>\n <button type=\"submit\" class=\"button\" data-ng-click=\"submit()\">{{triggerText | rpxTranslate}}</button>\n</form>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
10485
+ args: [{ standalone: false, template: "<!-- Current Page && Event trigger name -->\n<h1 class=\"heading-h1\">{{ eventTrigger.name | rpxTranslate}}</h1>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<form [formGroup]=\"formGroup\" (submit)=\"submit()\">\n <div id=\"confirmation-header\" *ngIf=\"confirmation.getHeader()\">\n <ccd-markdown [content]=\"confirmation.getHeader() | rpxTranslate\"></ccd-markdown>\n </div>\n <div id=\"confirmation-body\" *ngIf=\"confirmation.getBody()\">\n <ccd-markdown [content]=\"confirmation.getBody() | rpxTranslate\"></ccd-markdown>\n </div>\n <button type=\"submit\" class=\"button\" data-ng-click=\"submit()\">{{triggerText | rpxTranslate}}</button>\n</form>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}.refresh-modal-backdrop{position:fixed;inset:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.refresh-modal{background:#fff;padding:24px;max-width:520px;width:90%;box-shadow:0 8px 24px #0003;border-radius:4px;text-align:center}.refresh-modal .button{margin-top:12px}\n"] }]
10330
10486
  }], () => [{ type: CaseEditComponent }, { type: i1$1.Router }], null); })();
10331
10487
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditConfirmComponent, { className: "CaseEditConfirmComponent", filePath: "lib/shared/components/case-editor/case-edit-confirm/case-edit-confirm.component.ts", lineNumber: 16 }); })();
10332
10488
 
@@ -11608,6 +11764,11 @@ class CaseEditPageComponent {
11608
11764
  this.validPageListCaseFieldsService.deleteNonValidatedFields(this.caseEdit.validPageList, caseEventData.data, this.eventTrigger.case_fields, fromPreviousPage, this.editForm.controls['data'].value);
11609
11765
  // Tidy it up before we return it.
11610
11766
  this.formValueService.removeUnnecessaryFields(caseEventData.data, caseFields, clearEmpty, clearNonCase, fromPreviousPage, this.currentPage.case_fields);
11767
+ // removeHiddenFields while are hidden in the UI
11768
+ // Only remove hidden fields if editForm and its controls are available
11769
+ if (this.editForm?.controls?.['data']?.['controls']) {
11770
+ this.formValueService.removeHiddenField(caseEventData.data, caseFields, clearNonCase, this.editForm.controls['data']['controls']);
11771
+ }
11611
11772
  return caseEventData;
11612
11773
  }
11613
11774
  syncCaseEditDataService() {
@@ -15254,7 +15415,6 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15254
15415
  dialog;
15255
15416
  fileUploadStateService;
15256
15417
  jurisdictionService;
15257
- sessionStorageService;
15258
15418
  static DOCUMENT_URL = 'document_url';
15259
15419
  static DOCUMENT_BINARY_URL = 'document_binary_url';
15260
15420
  static DOCUMENT_FILENAME = 'document_filename';
@@ -15284,8 +15444,7 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15284
15444
  caseId;
15285
15445
  // Should the file upload use CDAM
15286
15446
  fileSecureModeOn = false;
15287
- gotFromCaseInfo = false;
15288
- constructor(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService, jurisdictionService, sessionStorageService) {
15447
+ constructor(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService, jurisdictionService) {
15289
15448
  super();
15290
15449
  this.appConfig = appConfig;
15291
15450
  this.caseNotifier = caseNotifier;
@@ -15293,20 +15452,12 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15293
15452
  this.dialog = dialog;
15294
15453
  this.fileUploadStateService = fileUploadStateService;
15295
15454
  this.jurisdictionService = jurisdictionService;
15296
- this.sessionStorageService = sessionStorageService;
15297
15455
  }
15298
15456
  ngOnInit() {
15299
15457
  // Wait for both observables to emit at least once
15300
- const caseInfo = this.documentManagement.parseCaseInfo(this.sessionStorageService.getItem('caseInfo'));
15301
15458
  const currUrl = window.location.pathname;
15302
- if (caseInfo) {
15303
- this.gotFromCaseInfo = true;
15304
- this.caseTypeId = caseInfo.caseType;
15305
- }
15306
- else {
15307
- if (currUrl.includes('/case-details/')) {
15308
- this.caseTypeId = currUrl.split('/')[4];
15309
- }
15459
+ if (currUrl.includes('/case-details/')) {
15460
+ this.caseTypeId = currUrl.split('/')[4];
15310
15461
  }
15311
15462
  this.caseNotifierSubscription = combineLatest([
15312
15463
  this.caseNotifier.caseView.pipe(take(1)),
@@ -15567,10 +15718,10 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15567
15718
  handleDocumentUploadResult(result) {
15568
15719
  // use the documentManagement service to check if the document upload should use CDAM
15569
15720
  if (this.documentManagement.isDocumentSecureModeEnabled()) {
15570
- this.appConfig.logMessage(`WDF:: CDAM is enabled for case with case ref:: ${this.caseId}, case type:: ${this.caseTypeId}, gotFromCaseInfo:: ${this.gotFromCaseInfo}`);
15721
+ this.appConfig.logMessage(`CDAM is enabled for case with case ref:: ${this.caseId}`);
15571
15722
  }
15572
15723
  else {
15573
- this.appConfig.logMessage(`WDF:: CDAM is disabled for case with case ref:: ${this.caseId}, case type:: ${this.caseTypeId}, gotFromCaseInfo:: ${this.gotFromCaseInfo}`);
15724
+ this.appConfig.logMessage(`CDAM is disabled for case with case ref:: ${this.caseId}`);
15574
15725
  }
15575
15726
  if (!this.uploadedDocument) {
15576
15727
  if (this.fileSecureModeOn) {
@@ -15604,7 +15755,7 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15604
15755
  this.valid = false;
15605
15756
  this.fileUploadStateService.setUploadInProgress(false);
15606
15757
  }
15607
- static ɵfac = function WriteDocumentFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || WriteDocumentFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(FileUploadStateService), i0.ɵɵdirectiveInject(JurisdictionService), i0.ɵɵdirectiveInject(SessionStorageService)); };
15758
+ static ɵfac = function WriteDocumentFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || WriteDocumentFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(FileUploadStateService), i0.ɵɵdirectiveInject(JurisdictionService)); };
15608
15759
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteDocumentFieldComponent, selectors: [["ccd-write-document-field"]], viewQuery: function WriteDocumentFieldComponent_Query(rf, ctx) { if (rf & 1) {
15609
15760
  i0.ɵɵviewQuery(_c0$S, 5);
15610
15761
  } if (rf & 2) {
@@ -15665,11 +15816,11 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15665
15816
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteDocumentFieldComponent, [{
15666
15817
  type: Component,
15667
15818
  args: [{ selector: 'ccd-write-document-field', standalone: false, template: "<div class=\"form-group\" [ngClass]=\"{'form-group-error bottom-30': !valid}\">\n <label [for]=\"id()\">\n <span class=\"form-label\" attr.aria-label=\"{{caseField | ccdFieldLabel}}\">{{(caseField | ccdFieldLabel)}}</span>\n </label>\n <span class=\"form-hint\" *ngIf=\"caseField.hint_text\">\n <markdown [data]=\"caseField.hint_text | rpxTranslate\"></markdown>\n </span>\n <span class=\"error-message\"\n role=\"alert\"\n tabindex=\"0\"\n [hidden]=\"!(fileUploadMessages && !valid)\">\n {{ fileUploadMessages | rpxTranslate }}\n </span>\n <div>\n <!--<span *ngIf=\"getUploadedFileName()\" class=\"text-16\">File name: {{getUploadedFileName()}}</span>-->\n <ccd-read-document-field *ngIf=\"caseField\" [caseField]=\"caseField\"></ccd-read-document-field>\n </div>\n\n <div style='position:relative'>\n <div [id]=\"createElementId('fileInputWrapper')\" (click)=\"fileSelectEvent()\" (keyup)=\"fileSelectEvent()\"></div>\n <input class=\"form-control bottom-30\" [id]=\"id()\" type=\"file\" (keydown.Tab)=\"fileValidationsOnTab()\" (change)=\"fileChangeEvent($event, caseField.field_type.regular_expression)\"\n accept=\"{{caseField.field_type.regular_expression}}\" #fileInput/>\n </div>\n</div>\n<div class=\"form-group bottom-30\">\n <button class=\"button button-secondary\" type=\"button\" aria-label=\"Cancel upload\" (click)=\"cancelUpload()\" [disabled]=\"!isUploadInProgress()\">{{'Cancel upload' | rpxTranslate}}</button>\n</div>\n" }]
15668
- }], () => [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1$3.MatLegacyDialog }, { type: FileUploadStateService }, { type: JurisdictionService }, { type: SessionStorageService }], { fileInput: [{
15819
+ }], () => [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1$3.MatLegacyDialog }, { type: FileUploadStateService }, { type: JurisdictionService }], { fileInput: [{
15669
15820
  type: ViewChild,
15670
15821
  args: ['fileInput', { static: false }]
15671
15822
  }] }); })();
15672
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteDocumentFieldComponent, { className: "WriteDocumentFieldComponent", filePath: "lib/shared/components/palette/document/write-document-field.component.ts", lineNumber: 26 }); })();
15823
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteDocumentFieldComponent, { className: "WriteDocumentFieldComponent", filePath: "lib/shared/components/palette/document/write-document-field.component.ts", lineNumber: 25 }); })();
15673
15824
 
15674
15825
  class DynamicListPipe {
15675
15826
  static EMPTY = '';
@@ -30171,7 +30322,7 @@ class ReadFieldsFilterPipe {
30171
30322
  else if (field.show_condition) {
30172
30323
  let cond;
30173
30324
  if (fieldId && field.show_condition.indexOf(`${fieldId}.`) > -1 && !formGroupAvailable && !!Object.keys(formValue).length) {
30174
- const search = `${fieldId}.`;
30325
+ const search = `/.*${fieldId}./`;
30175
30326
  const searchRegExp = new RegExp(search, 'g');
30176
30327
  const replaceWith = '';
30177
30328
  cond = ShowCondition.getInstance(field.show_condition.replace(searchRegExp, replaceWith));
@@ -32227,11 +32378,11 @@ class CaseEditSubmitComponent {
32227
32378
  i0.ɵɵclassProp("disabled", ctx.caseEdit.isSubmitting);
32228
32379
  i0.ɵɵadvance();
32229
32380
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(24, 22, ctx.getCancelText()));
32230
- } }, styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
32381
+ } }, styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}.refresh-modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.refresh-modal[_ngcontent-%COMP%]{background:#fff;padding:24px;max-width:520px;width:90%;box-shadow:0 8px 24px #0003;border-radius:4px;text-align:center}.refresh-modal[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{margin-top:12px}"] });
32231
32382
  }
32232
32383
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditSubmitComponent, [{
32233
32384
  type: Component,
32234
- args: [{ selector: 'ccd-case-edit-submit', standalone: false, template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data'] | rpxTranslate\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content text-16\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id); $event.preventDefault()\"\n href=\"#\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel(); $event.preventDefault()\" href=\"#\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
32385
+ args: [{ selector: 'ccd-case-edit-submit', standalone: false, template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data'] | rpxTranslate\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content text-16\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id); $event.preventDefault()\"\n href=\"#\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel(); $event.preventDefault()\" href=\"#\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}.refresh-modal-backdrop{position:fixed;inset:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.refresh-modal{background:#fff;padding:24px;max-width:520px;width:90%;box-shadow:0 8px 24px #0003;border-radius:4px;text-align:center}.refresh-modal .button{margin-top:12px}\n"] }]
32235
32386
  }], () => [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$1.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }, { type: MultipageComponentStateService }, { type: FormValidatorsService }, { type: CaseFlagStateService }, { type: LinkedCasesService }], null); })();
32236
32387
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditSubmitComponent, { className: "CaseEditSubmitComponent", filePath: "lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.ts", lineNumber: 31 }); })();
32237
32388
 
@@ -32413,11 +32564,11 @@ class CaseEditGenericErrorsComponent {
32413
32564
  i0.ɵɵproperty("ngIf", ctx.error && (!(ctx.error.callbackErrors || ctx.error.callbackWarnings || ctx.error.details) && !ctx.error.message));
32414
32565
  i0.ɵɵadvance();
32415
32566
  i0.ɵɵproperty("ngIf", ctx.error && (ctx.error.details || ctx.error.message));
32416
- } }, dependencies: [i5.NgForOf, i5.NgIf], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
32567
+ } }, dependencies: [i5.NgForOf, i5.NgIf], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}.refresh-modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.refresh-modal[_ngcontent-%COMP%]{background:#fff;padding:24px;max-width:520px;width:90%;box-shadow:0 8px 24px #0003;border-radius:4px;text-align:center}.refresh-modal[_ngcontent-%COMP%] .button[_ngcontent-%COMP%]{margin-top:12px}"] });
32417
32568
  }
32418
32569
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditGenericErrorsComponent, [{
32419
32570
  type: Component,
32420
- args: [{ selector: 'ccd-case-edit-generic-errors', providers: [], standalone: false, template: "<!-- Generic error heading and error message to be displayed only if there are no specific callback errors or warnings, or no error details -->\n<div *ngIf=\"error && (!(error.callbackErrors || error.callbackWarnings || error.details) && !error.message)\" class=\"error-summary\" role=\"group\" aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h1 class=\"heading-h1 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n Something went wrong\n </h1>\n <div class=\"govuk-error-summary__body\" id=\"edit-case-event_error-summary-body\">\n <p>We're working to fix the problem. Try again shortly.</p>\n <p><a href=\"get-help\" target=\"_blank\">Contact us</a> if you're still having problems.</p>\n </div>\n </div>\n <!-- Event error heading and error message to be displayed if there are specific error details -->\n <div *ngIf=\"error && (error.details || error.message)\" class=\"error-summary\" role=\"group\" aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h3 class=\"heading-h3 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n The event could not be created\n </h3>\n <p>{{error.message}}</p>\n <ul *ngIf=\"error.details?.field_errors\" class=\"error-summary-list\">\n <li *ngFor=\"let fieldError of error.details.field_errors\" class=\"ccd-error-summary-li\">{{fieldError.message}}</li>\n </ul>\n </div>\n ", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
32571
+ args: [{ selector: 'ccd-case-edit-generic-errors', providers: [], standalone: false, template: "<!-- Generic error heading and error message to be displayed only if there are no specific callback errors or warnings, or no error details -->\n<div *ngIf=\"error && (!(error.callbackErrors || error.callbackWarnings || error.details) && !error.message)\" class=\"error-summary\" role=\"group\" aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h1 class=\"heading-h1 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n Something went wrong\n </h1>\n <div class=\"govuk-error-summary__body\" id=\"edit-case-event_error-summary-body\">\n <p>We're working to fix the problem. Try again shortly.</p>\n <p><a href=\"get-help\" target=\"_blank\">Contact us</a> if you're still having problems.</p>\n </div>\n </div>\n <!-- Event error heading and error message to be displayed if there are specific error details -->\n <div *ngIf=\"error && (error.details || error.message)\" class=\"error-summary\" role=\"group\" aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h3 class=\"heading-h3 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n The event could not be created\n </h3>\n <p>{{error.message}}</p>\n <ul *ngIf=\"error.details?.field_errors\" class=\"error-summary-list\">\n <li *ngFor=\"let fieldError of error.details.field_errors\" class=\"ccd-error-summary-li\">{{fieldError.message}}</li>\n </ul>\n </div>\n ", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}.refresh-modal-backdrop{position:fixed;inset:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.refresh-modal{background:#fff;padding:24px;max-width:520px;width:90%;box-shadow:0 8px 24px #0003;border-radius:4px;text-align:center}.refresh-modal .button{margin-top:12px}\n"] }]
32421
32572
  }], null, { error: [{
32422
32573
  type: Input
32423
32574
  }] }); })();
@@ -34586,18 +34737,9 @@ class CaseResolver {
34586
34737
  this.navigateToCaseList();
34587
34738
  }
34588
34739
  else {
34589
- const resultPromise = this.isRootCaseViewRoute(route) ? this.getAndCacheCaseView(cid)
34740
+ return this.isRootCaseViewRoute(route) ? this.getAndCacheCaseView(cid)
34590
34741
  : this.caseNotifier.cachedCaseView ? Promise.resolve(this.caseNotifier.cachedCaseView)
34591
34742
  : this.getAndCacheCaseView(cid);
34592
- return resultPromise.then((caseView) => {
34593
- const newCaseInfo = {
34594
- caseId: caseView.case_id,
34595
- jurisdiction: caseView.case_type.jurisdiction.id,
34596
- caseType: caseView.case_type.id
34597
- };
34598
- this.sessionStorage.setItem('caseInfo', JSON.stringify(newCaseInfo));
34599
- return caseView;
34600
- });
34601
34743
  }
34602
34744
  }
34603
34745
  navigateToCaseList() {
@@ -34780,8 +34922,10 @@ class EventTriggerResolver {
34780
34922
  this.alertService.setPreserveAlerts(true);
34781
34923
  this.alertService.error(error.message);
34782
34924
  this.errorNotifier.announceError(error);
34783
- caseTypeId = route.parent.paramMap.get('caseType');
34784
- this.router.navigate([`/cases/case-details/${jurisdiction}/${caseType}/${cid}/tasks`]);
34925
+ if (!this.router.url?.includes('/cases/case-details/')) {
34926
+ caseTypeId = route.parent.paramMap.get('caseType');
34927
+ this.router.navigate([`/cases/case-details/${jurisdiction}/${caseType}/${cid}/tasks`]);
34928
+ }
34785
34929
  return throwError(error);
34786
34930
  })).toPromise();
34787
34931
  }
@@ -35712,6 +35856,7 @@ class CaseFullAccessViewComponent {
35712
35856
  });
35713
35857
  }
35714
35858
  this.checkRouteAndSetCaseViewTab();
35859
+ this.setCaseInfo();
35715
35860
  // Check for active Case Flags
35716
35861
  this.activeCaseFlags = this.hasActiveCaseFlags();
35717
35862
  this.linkedCasesService.resetLinkedCaseData();
@@ -35724,6 +35869,18 @@ class CaseFullAccessViewComponent {
35724
35869
  this.organiseTabPosition();
35725
35870
  }
35726
35871
  }
35872
+ setCaseInfo() {
35873
+ const caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo') || '{}');
35874
+ console.log('Case Info from session storage: ', caseInfo);
35875
+ if (caseInfo?.caseId !== this.caseDetails.case_id) {
35876
+ const newCaseInfo = {
35877
+ caseId: this.caseDetails.case_id,
35878
+ jurisdiction: this.caseDetails.case_type.jurisdiction.id,
35879
+ caseType: this.caseDetails.case_type.id
35880
+ };
35881
+ this.sessionStorageService.setItem('caseInfo', JSON.stringify(newCaseInfo));
35882
+ }
35883
+ }
35727
35884
  isPrintEnabled() {
35728
35885
  return this.caseDetails.case_type.printEnabled;
35729
35886
  }
@@ -36982,6 +37139,7 @@ class EventStartGuard {
36982
37139
  }
36983
37140
  }
36984
37141
  checkForTasks(payload, caseId, eventId, taskId, userId) {
37142
+ this.abstractConfig.logMessage(`checkForTasks: for caseId ${caseId} and eventId ${eventId} and taskId ${taskId} and userId ${userId}`);
36985
37143
  if (taskId && payload?.tasks?.length > 0) {
36986
37144
  const task = payload.tasks.find((t) => t.id == taskId);
36987
37145
  if (task) {
@@ -37030,6 +37188,7 @@ class EventStartGuard {
37030
37188
  };
37031
37189
  this.sessionStorageService.setItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO, JSON.stringify(taskEventCompletionInfo));
37032
37190
  this.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
37191
+ this.abstractConfig.logMessage(`EventStartGuard:setClientContextStorage: set task ${task?.id} in client context for caseId ${caseId} and eventId ${eventId}`);
37033
37192
  }
37034
37193
  static ɵfac = function EventStartGuard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventStartGuard)(i0.ɵɵinject(WorkAllocationService), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(ReadCookieService), i0.ɵɵinject(CaseNotifier)); };
37035
37194
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventStartGuard, factory: EventStartGuard.ɵfac });
@@ -37056,6 +37215,7 @@ var EventStartStates;
37056
37215
 
37057
37216
  const EVENT_STATE_MACHINE = 'EVENT STATE MACHINE';
37058
37217
  class EventStartStateMachineService {
37218
+ abstractConfig;
37059
37219
  stateCheckForMatchingTasks;
37060
37220
  stateNoTask;
37061
37221
  stateOneTask;
@@ -37065,6 +37225,9 @@ class EventStartStateMachineService {
37065
37225
  stateMultipleTasksAssignedToUser;
37066
37226
  stateTaskUnassigned;
37067
37227
  stateFinal;
37228
+ constructor(abstractConfig) {
37229
+ this.abstractConfig = abstractConfig;
37230
+ }
37068
37231
  initialiseStateMachine(context) {
37069
37232
  return new StateMachine(EVENT_STATE_MACHINE, context);
37070
37233
  }
@@ -37169,7 +37332,7 @@ class EventStartStateMachineService {
37169
37332
  // Navigate
37170
37333
  context.router.navigate([`${navigationURL}`], { queryParams: theQueryParams, relativeTo: context.route });
37171
37334
  }
37172
- entryActionForStateOneTaskAssignedToUser(state, context) {
37335
+ entryActionForStateOneTaskAssignedToUser = (state, context) => {
37173
37336
  // Trigger final state to complete processing of state machine
37174
37337
  state.trigger(EventStartStates.FINAL);
37175
37338
  // Get task assigned to user
@@ -37178,6 +37341,7 @@ class EventStartStateMachineService {
37178
37341
  task = context.tasks[0];
37179
37342
  }
37180
37343
  const taskStr = JSON.stringify(task);
37344
+ this.abstractConfig?.logMessage?.(`entryActionForStateOneTaskAssignedToUser: task_state ${task?.task_state} for task id ${task?.id}`);
37181
37345
  console.log('entryActionForStateOneTaskAssignedToUser: setting client context task_data to ' + taskStr);
37182
37346
  // Store task to session
37183
37347
  const currentLanguage = context.cookieService.getCookie('exui-preferred-language');
@@ -37210,7 +37374,7 @@ class EventStartStateMachineService {
37210
37374
  context.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(clientContext));
37211
37375
  // Allow user to perform the event
37212
37376
  context.router.navigate([`/cases/case-details/${task.jurisdiction}/${task.case_type_id}/${context.caseId}/trigger/${context.eventId}`], { relativeTo: context.route });
37213
- }
37377
+ };
37214
37378
  entryActionForStateMultipleTasksAssignedToUser(state, context) {
37215
37379
  // Trigger final state to complete processing of state machine
37216
37380
  state.trigger(EventStartStates.FINAL);
@@ -37249,12 +37413,12 @@ class EventStartStateMachineService {
37249
37413
  addTransitionsForStateMultipleTasksAssignedToUser() {
37250
37414
  this.stateMultipleTasksAssignedToUser.addTransition(EventStartStates.FINAL, this.stateFinal);
37251
37415
  }
37252
- static ɵfac = function EventStartStateMachineService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventStartStateMachineService)(); };
37416
+ static ɵfac = function EventStartStateMachineService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventStartStateMachineService)(i0.ɵɵinject(AbstractAppConfig)); };
37253
37417
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventStartStateMachineService, factory: EventStartStateMachineService.ɵfac });
37254
37418
  }
37255
37419
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventStartStateMachineService, [{
37256
37420
  type: Injectable
37257
- }], null, null); })();
37421
+ }], () => [{ type: AbstractAppConfig }], null); })();
37258
37422
 
37259
37423
  class EventStartComponent {
37260
37424
  service;
@@ -37262,14 +37426,16 @@ class EventStartComponent {
37262
37426
  route;
37263
37427
  sessionStorageService;
37264
37428
  cookieService;
37429
+ abstractConfig;
37265
37430
  stateMachine;
37266
37431
  context;
37267
- constructor(service, router, route, sessionStorageService, cookieService) {
37432
+ constructor(service, router, route, sessionStorageService, cookieService, abstractConfig) {
37268
37433
  this.service = service;
37269
37434
  this.router = router;
37270
37435
  this.route = route;
37271
37436
  this.sessionStorageService = sessionStorageService;
37272
37437
  this.cookieService = cookieService;
37438
+ this.abstractConfig = abstractConfig;
37273
37439
  }
37274
37440
  ngOnInit() {
37275
37441
  // Get task and case id payload from route data
@@ -37289,7 +37455,7 @@ class EventStartComponent {
37289
37455
  cookieService: this.cookieService
37290
37456
  };
37291
37457
  // Initialise state machine
37292
- this.service = new EventStartStateMachineService();
37458
+ this.service = new EventStartStateMachineService(this.abstractConfig);
37293
37459
  this.stateMachine = this.service.initialiseStateMachine(this.context);
37294
37460
  // Create states
37295
37461
  this.service.createStates(this.stateMachine);
@@ -37298,14 +37464,14 @@ class EventStartComponent {
37298
37464
  // Start state machine
37299
37465
  this.service.startStateMachine(this.stateMachine);
37300
37466
  }
37301
- static ɵfac = function EventStartComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventStartComponent)(i0.ɵɵdirectiveInject(EventStartStateMachineService), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(ReadCookieService)); };
37467
+ static ɵfac = function EventStartComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventStartComponent)(i0.ɵɵdirectiveInject(EventStartStateMachineService), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(ReadCookieService), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
37302
37468
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EventStartComponent, selectors: [["ccd-event-start"]], standalone: false, decls: 0, vars: 0, template: function EventStartComponent_Template(rf, ctx) { }, encapsulation: 2 });
37303
37469
  }
37304
37470
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventStartComponent, [{
37305
37471
  type: Component,
37306
37472
  args: [{ selector: 'ccd-event-start', standalone: false, template: "" }]
37307
- }], () => [{ type: EventStartStateMachineService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: ReadCookieService }], null); })();
37308
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EventStartComponent, { className: "EventStartComponent", filePath: "lib/shared/components/event-start/event-start.component.ts", lineNumber: 15 }); })();
37473
+ }], () => [{ type: EventStartStateMachineService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: ReadCookieService }, { type: AbstractAppConfig }], null); })();
37474
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EventStartComponent, { className: "EventStartComponent", filePath: "lib/shared/components/event-start/event-start.component.ts", lineNumber: 16 }); })();
37309
37475
 
37310
37476
  class EventTasksResolverService {
37311
37477
  service;