@hmcts/ccd-case-ui-toolkit 7.0.42 → 7.0.43-client-context
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.
- package/esm2022/lib/shared/components/case-editor/case-edit/case-edit.component.mjs +12 -12
- package/esm2022/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.mjs +17 -15
- package/esm2022/lib/shared/components/case-editor/services/cases.service.mjs +53 -27
- package/esm2022/lib/shared/components/case-editor/services/event-completion-state-machine.service.mjs +14 -6
- package/esm2022/lib/shared/components/event-start/event-guard/event-start.guard.mjs +13 -5
- package/esm2022/lib/shared/components/event-start/services/event-start-state-machine.service.mjs +11 -3
- package/esm2022/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.mjs +4 -3
- package/esm2022/lib/shared/domain/work-allocation/Task.mjs +1 -1
- package/esm2022/lib/shared/services/fields/fields.utils.mjs +8 -1
- package/esm2022/lib/shared/services/profile/profile.service.mjs +2 -1
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +114 -52
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts +1 -2
- package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts.map +1 -1
- package/lib/shared/components/case-editor/services/cases.service.d.ts +2 -1
- package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
- package/lib/shared/components/case-editor/services/event-completion-state-machine.service.d.ts +1 -0
- package/lib/shared/components/case-editor/services/event-completion-state-machine.service.d.ts.map +1 -1
- package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts +1 -1
- package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts.map +1 -1
- package/lib/shared/components/event-start/services/event-start-state-machine.service.d.ts.map +1 -1
- package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.d.ts.map +1 -1
- package/lib/shared/domain/work-allocation/Task.d.ts +4 -0
- package/lib/shared/domain/work-allocation/Task.d.ts.map +1 -1
- package/lib/shared/services/fields/fields.utils.d.ts +2 -0
- package/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4340,6 +4340,13 @@ class FieldsUtils {
|
|
|
4340
4340
|
return '';
|
|
4341
4341
|
}
|
|
4342
4342
|
}
|
|
4343
|
+
static getUserTaskFromClientContext(clientContextStr) {
|
|
4344
|
+
if (clientContextStr) {
|
|
4345
|
+
let clientContext = JSON.parse(clientContextStr);
|
|
4346
|
+
return clientContext.client_context.user_task;
|
|
4347
|
+
}
|
|
4348
|
+
return null;
|
|
4349
|
+
}
|
|
4343
4350
|
buildCanShowPredicate(eventTrigger, form) {
|
|
4344
4351
|
const currentState = this.getCurrentEventState(eventTrigger, form);
|
|
4345
4352
|
return (page) => {
|
|
@@ -7177,6 +7184,7 @@ class ProfileService {
|
|
|
7177
7184
|
.set('experimental', 'true')
|
|
7178
7185
|
.set('Accept', ProfileService.V2_MEDIATYPE_USER_PROFILE)
|
|
7179
7186
|
.set('Content-Type', 'application/json');
|
|
7187
|
+
// Not adding client context header because header is added to call immediately afterwards
|
|
7180
7188
|
return this.httpService
|
|
7181
7189
|
.get(url, { headers, observe: 'body' })
|
|
7182
7190
|
.pipe(map((p) => plainToClass(Profile, p)));
|
|
@@ -8073,6 +8081,7 @@ class CasesService {
|
|
|
8073
8081
|
let headers = new HttpHeaders();
|
|
8074
8082
|
headers = headers.set('experimental', 'true');
|
|
8075
8083
|
headers = headers.set('Content-Type', 'application/json');
|
|
8084
|
+
headers = this.addClientContextHeader(headers);
|
|
8076
8085
|
if (Draft.isDraft(caseId)) {
|
|
8077
8086
|
headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_DRAFT_TRIGGER);
|
|
8078
8087
|
}
|
|
@@ -8083,9 +8092,10 @@ class CasesService {
|
|
|
8083
8092
|
headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_CASE_TRIGGER);
|
|
8084
8093
|
}
|
|
8085
8094
|
return this.http
|
|
8086
|
-
.get(url, { headers, observe: '
|
|
8087
|
-
.pipe(map(
|
|
8088
|
-
|
|
8095
|
+
.get(url, { headers, observe: 'response' })
|
|
8096
|
+
.pipe(map((response) => {
|
|
8097
|
+
this.updateClientContextStorage(response.headers);
|
|
8098
|
+
return FieldsUtils.handleNestedDynamicLists(response.body);
|
|
8089
8099
|
}), catchError(error => {
|
|
8090
8100
|
this.errorService.setError(error);
|
|
8091
8101
|
return throwError(error);
|
|
@@ -8094,13 +8104,17 @@ class CasesService {
|
|
|
8094
8104
|
createEvent(caseDetails, eventData) {
|
|
8095
8105
|
const caseId = caseDetails.case_id;
|
|
8096
8106
|
const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/events`;
|
|
8097
|
-
|
|
8107
|
+
let headers = new HttpHeaders()
|
|
8098
8108
|
.set('experimental', 'true')
|
|
8099
8109
|
.set('Accept', CasesService.V2_MEDIATYPE_CREATE_EVENT)
|
|
8100
8110
|
.set('Content-Type', 'application/json');
|
|
8111
|
+
headers = this.addClientContextHeader(headers);
|
|
8101
8112
|
return this.http
|
|
8102
|
-
.post(url, eventData, { headers, observe: '
|
|
8103
|
-
.pipe(
|
|
8113
|
+
.post(url, eventData, { headers, observe: 'response' })
|
|
8114
|
+
.pipe(map((response) => {
|
|
8115
|
+
this.updateClientContextStorage(response.headers);
|
|
8116
|
+
return response.body;
|
|
8117
|
+
}), catchError(error => {
|
|
8104
8118
|
this.errorService.setError(error);
|
|
8105
8119
|
return throwError(error);
|
|
8106
8120
|
}));
|
|
@@ -8108,13 +8122,17 @@ class CasesService {
|
|
|
8108
8122
|
validateCase(ctid, eventData, pageId) {
|
|
8109
8123
|
const pageIdString = pageId ? `?pageId=${pageId}` : '';
|
|
8110
8124
|
const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/validate${pageIdString}`;
|
|
8111
|
-
|
|
8125
|
+
let headers = new HttpHeaders()
|
|
8112
8126
|
.set('experimental', 'true')
|
|
8113
8127
|
.set('Accept', CasesService.V2_MEDIATYPE_CASE_DATA_VALIDATE)
|
|
8114
8128
|
.set('Content-Type', 'application/json');
|
|
8129
|
+
headers = this.addClientContextHeader(headers);
|
|
8115
8130
|
return this.http
|
|
8116
|
-
.post(url, eventData, { headers, observe: '
|
|
8117
|
-
.pipe(
|
|
8131
|
+
.post(url, eventData, { headers, observe: 'response' })
|
|
8132
|
+
.pipe(map((response) => {
|
|
8133
|
+
this.updateClientContextStorage(response.headers);
|
|
8134
|
+
return response.body;
|
|
8135
|
+
}), catchError(error => {
|
|
8118
8136
|
this.errorService.setError(error);
|
|
8119
8137
|
return throwError(error);
|
|
8120
8138
|
}));
|
|
@@ -8125,26 +8143,34 @@ class CasesService {
|
|
|
8125
8143
|
ignoreWarning = 'true';
|
|
8126
8144
|
}
|
|
8127
8145
|
const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/cases?ignore-warning=${ignoreWarning}`;
|
|
8128
|
-
|
|
8146
|
+
let headers = new HttpHeaders()
|
|
8129
8147
|
.set('experimental', 'true')
|
|
8130
8148
|
.set('Accept', CasesService.V2_MEDIATYPE_CREATE_CASE)
|
|
8131
8149
|
.set('Content-Type', 'application/json');
|
|
8150
|
+
headers = this.addClientContextHeader(headers);
|
|
8132
8151
|
return this.http
|
|
8133
|
-
.post(url, eventData, { headers, observe: '
|
|
8134
|
-
.pipe(
|
|
8152
|
+
.post(url, eventData, { headers, observe: 'response' })
|
|
8153
|
+
.pipe(map((response) => {
|
|
8154
|
+
this.updateClientContextStorage(response.headers);
|
|
8155
|
+
return response.body;
|
|
8156
|
+
}), catchError(error => {
|
|
8135
8157
|
this.errorService.setError(error);
|
|
8136
8158
|
return throwError(error);
|
|
8137
8159
|
}));
|
|
8138
8160
|
}
|
|
8139
8161
|
getPrintDocuments(caseId) {
|
|
8140
8162
|
const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/documents`;
|
|
8141
|
-
|
|
8163
|
+
let headers = new HttpHeaders()
|
|
8142
8164
|
.set('experimental', 'true')
|
|
8143
8165
|
.set('Accept', CasesService.V2_MEDIATYPE_CASE_DOCUMENTS)
|
|
8144
8166
|
.set('Content-Type', 'application/json');
|
|
8167
|
+
headers = this.addClientContextHeader(headers);
|
|
8145
8168
|
return this.http
|
|
8146
|
-
.get(url, { headers, observe: '
|
|
8147
|
-
.pipe(map(
|
|
8169
|
+
.get(url, { headers, observe: 'response' })
|
|
8170
|
+
.pipe(map((response) => {
|
|
8171
|
+
this.updateClientContextStorage(response.headers);
|
|
8172
|
+
return response.body.documentResources;
|
|
8173
|
+
}), catchError(error => {
|
|
8148
8174
|
this.errorService.setError(error);
|
|
8149
8175
|
return throwError(error);
|
|
8150
8176
|
}));
|
|
@@ -8177,17 +8203,6 @@ class CasesService {
|
|
|
8177
8203
|
wizardPage.case_fields = this.orderService.sort(this.wizardPageFieldToCaseFieldMapper.mapAll(wizardPage.wizard_page_fields, eventTrigger.case_fields));
|
|
8178
8204
|
});
|
|
8179
8205
|
}
|
|
8180
|
-
/*
|
|
8181
|
-
Checks if the user has role of pui-case-manager and returns true or false
|
|
8182
|
-
*/
|
|
8183
|
-
isPuiCaseManager() {
|
|
8184
|
-
const userInfoStr = this.sessionStorageService.getItem('userDetails');
|
|
8185
|
-
if (userInfoStr) {
|
|
8186
|
-
const userInfo = JSON.parse(userInfoStr);
|
|
8187
|
-
return userInfo && userInfo.roles && (userInfo.roles.indexOf(CasesService.PUI_CASE_MANAGER) !== -1);
|
|
8188
|
-
}
|
|
8189
|
-
return false;
|
|
8190
|
-
}
|
|
8191
8206
|
getCourtOrHearingCentreName(locationId) {
|
|
8192
8207
|
return this.http.post(`/api/locations/getLocationsById`, { locations: [{ locationId }] });
|
|
8193
8208
|
}
|
|
@@ -8254,6 +8269,25 @@ class CasesService {
|
|
|
8254
8269
|
.get(url)
|
|
8255
8270
|
.pipe(catchError(error => throwError(error)));
|
|
8256
8271
|
}
|
|
8272
|
+
addClientContextHeader(headers) {
|
|
8273
|
+
const clientContextDetails = this.sessionStorageService.getItem('clientContext');
|
|
8274
|
+
if (clientContextDetails) {
|
|
8275
|
+
// may require URI encoding in certain circumstances
|
|
8276
|
+
const clientContext = window.btoa(clientContextDetails);
|
|
8277
|
+
if (clientContext) {
|
|
8278
|
+
headers = headers.set('Client-Context', clientContext);
|
|
8279
|
+
}
|
|
8280
|
+
}
|
|
8281
|
+
return headers;
|
|
8282
|
+
}
|
|
8283
|
+
updateClientContextStorage(headers) {
|
|
8284
|
+
// for mocking - TODO: Kasi Remove/Uncomment for testing
|
|
8285
|
+
// headers = this.setMockClientContextHeader(headers);
|
|
8286
|
+
if (headers && headers.get('Client-Context')) {
|
|
8287
|
+
const clientContextString = window.atob(headers.get('Client-Context'));
|
|
8288
|
+
this.sessionStorageService.setItem('clientContext', clientContextString);
|
|
8289
|
+
}
|
|
8290
|
+
}
|
|
8257
8291
|
static ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(OrderService), i0.ɵɵinject(HttpErrorService), i0.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0.ɵɵinject(LoadingService), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(RetryUtil)); };
|
|
8258
8292
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
|
|
8259
8293
|
}
|
|
@@ -8766,8 +8800,9 @@ class EventCompletionStateMachineService {
|
|
|
8766
8800
|
entryActionForStateCompleteEventAndTask(state, context) {
|
|
8767
8801
|
// Trigger final state to complete processing of state machine
|
|
8768
8802
|
state.trigger(EventCompletionStates.Final);
|
|
8769
|
-
const
|
|
8770
|
-
|
|
8803
|
+
const clientContextStr = context.sessionStorageService.getItem('clientContext');
|
|
8804
|
+
const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
|
|
8805
|
+
if (userTask?.task_data) {
|
|
8771
8806
|
context.sessionStorageService.setItem('assignNeeded', 'false');
|
|
8772
8807
|
// just set event can be completed
|
|
8773
8808
|
context.component.eventCanBeCompleted.emit(true);
|
|
@@ -8786,9 +8821,9 @@ class EventCompletionStateMachineService {
|
|
|
8786
8821
|
entryActionForStateTaskUnassigned(state, context) {
|
|
8787
8822
|
// Trigger final state to complete processing of state machine
|
|
8788
8823
|
state.trigger(EventCompletionStates.Final);
|
|
8789
|
-
|
|
8790
|
-
const
|
|
8791
|
-
if (
|
|
8824
|
+
const clientContextStr = context.sessionStorageService.getItem('clientContext');
|
|
8825
|
+
const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
|
|
8826
|
+
if (userTask?.task_data) {
|
|
8792
8827
|
context.sessionStorageService.setItem('assignNeeded', 'true');
|
|
8793
8828
|
context.component.eventCanBeCompleted.emit(true);
|
|
8794
8829
|
}
|
|
@@ -8823,6 +8858,12 @@ class EventCompletionStateMachineService {
|
|
|
8823
8858
|
addTransitionsForStateTaskUnassigned() {
|
|
8824
8859
|
this.stateTaskUnassigned.addTransition(EventCompletionStates.Final, this.stateFinal);
|
|
8825
8860
|
}
|
|
8861
|
+
taskPresentInSessionStorage(context) {
|
|
8862
|
+
const clientContextStr = context.sessionStorageService.getItem('clientContext');
|
|
8863
|
+
console.log('clienht cintedt ', clientContextStr);
|
|
8864
|
+
const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
|
|
8865
|
+
return !!userTask.task_data;
|
|
8866
|
+
}
|
|
8826
8867
|
static ɵfac = function EventCompletionStateMachineService_Factory(t) { return new (t || EventCompletionStateMachineService)(); };
|
|
8827
8868
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventCompletionStateMachineService, factory: EventCompletionStateMachineService.ɵfac });
|
|
8828
8869
|
}
|
|
@@ -9325,11 +9366,9 @@ class CaseEditComponent {
|
|
|
9325
9366
|
this.isSubmitting = true;
|
|
9326
9367
|
// We have to run the event completion checks if task in session storage
|
|
9327
9368
|
// and if the task is in session storage, then is it associated to the case
|
|
9328
|
-
|
|
9329
|
-
const
|
|
9330
|
-
|
|
9331
|
-
taskInSessionStorage = JSON.parse(taskStr);
|
|
9332
|
-
}
|
|
9369
|
+
const clientContextStr = this.sessionStorageService.getItem('clientContext');
|
|
9370
|
+
const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
|
|
9371
|
+
const taskInSessionStorage = userTask ? userTask.task_data : null;
|
|
9333
9372
|
if (taskInSessionStorage && taskInSessionStorage.case_id === this.getCaseId(caseDetails)) {
|
|
9334
9373
|
// Show event completion component to perform event completion checks
|
|
9335
9374
|
this.eventCompletionParams = ({
|
|
@@ -9528,14 +9567,16 @@ class CaseEditComponent {
|
|
|
9528
9567
|
});
|
|
9529
9568
|
}
|
|
9530
9569
|
postCompleteTaskIfRequired() {
|
|
9531
|
-
const
|
|
9570
|
+
const clientContextStr = this.sessionStorageService.getItem('clientContext');
|
|
9571
|
+
const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
|
|
9572
|
+
const [task, taskToBeCompleted] = userTask ? [userTask.task_data, userTask.complete_task] : [null, false];
|
|
9532
9573
|
const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
|
|
9533
|
-
if (
|
|
9534
|
-
const task = JSON.parse(taskStr);
|
|
9574
|
+
if (task && assignNeeded && taskToBeCompleted) {
|
|
9575
|
+
// const task: Task = JSON.parse(taskStr);
|
|
9535
9576
|
return this.workAllocationService.assignAndCompleteTask(task.id);
|
|
9536
9577
|
}
|
|
9537
|
-
else if (
|
|
9538
|
-
const task = JSON.parse(taskStr);
|
|
9578
|
+
else if (task && taskToBeCompleted) {
|
|
9579
|
+
// const task: Task = JSON.parse(taskStr);
|
|
9539
9580
|
return this.workAllocationService.completeTask(task.id);
|
|
9540
9581
|
}
|
|
9541
9582
|
return of(true);
|
|
@@ -9599,7 +9640,7 @@ class CaseEditComponent {
|
|
|
9599
9640
|
}], submitted: [{
|
|
9600
9641
|
type: Output
|
|
9601
9642
|
}] }); })();
|
|
9602
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber:
|
|
9643
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 32 }); })();
|
|
9603
9644
|
|
|
9604
9645
|
function CaseEditConfirmComponent_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
9605
9646
|
i0.ɵɵelement(0, "div");
|
|
@@ -11115,8 +11156,12 @@ class CaseEventCompletionTaskReassignedComponent {
|
|
|
11115
11156
|
}
|
|
11116
11157
|
onContinue() {
|
|
11117
11158
|
// Get task details
|
|
11118
|
-
const
|
|
11119
|
-
|
|
11159
|
+
const clientContextStr = this.sessionStorageService.getItem('clientContext');
|
|
11160
|
+
const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
|
|
11161
|
+
const task = userTask ? userTask.task_data : null;
|
|
11162
|
+
// not complete_task not utilised here as related to event completion
|
|
11163
|
+
// service wanting task associated with event to not be completed not directly relevant
|
|
11164
|
+
if (task) {
|
|
11120
11165
|
this.sessionStorageService.setItem('assignNeeded', 'true');
|
|
11121
11166
|
// set event can be completed to true
|
|
11122
11167
|
this.parentComponent.eventCanBeCompleted.emit(true);
|
|
@@ -11140,7 +11185,7 @@ class CaseEventCompletionTaskReassignedComponent {
|
|
|
11140
11185
|
type: Inject,
|
|
11141
11186
|
args: [COMPONENT_PORTAL_INJECTION_TOKEN]
|
|
11142
11187
|
}] }, { type: i1$1.ActivatedRoute }, { type: WorkAllocationService }, { type: SessionStorageService }, { type: JudicialworkerService }, { type: CaseworkerService }, { type: AlertService }], null); })();
|
|
11143
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskReassignedComponent, { className: "CaseEventCompletionTaskReassignedComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.ts", lineNumber:
|
|
11188
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskReassignedComponent, { className: "CaseEventCompletionTaskReassignedComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.ts", lineNumber: 19 }); })();
|
|
11144
11189
|
|
|
11145
11190
|
function CaseEventCompletionComponent_ng_template_0_Template(rf, ctx) { }
|
|
11146
11191
|
const COMPONENT_PORTAL_INJECTION_TOKEN = new InjectionToken('');
|
|
@@ -22473,6 +22518,7 @@ class CaseFileViewFolderComponent {
|
|
|
22473
22518
|
// Initialise cdk tree with generated data
|
|
22474
22519
|
this.nestedDataSource = this.documentTreeData;
|
|
22475
22520
|
this.nestedTreeControl.dataNodes = this.documentTreeData;
|
|
22521
|
+
this.sortDataSourceDescending(CaseFileViewSortColumns.DOCUMENT_UPLOAD_TIMESTAMP);
|
|
22476
22522
|
});
|
|
22477
22523
|
}
|
|
22478
22524
|
generateTreeData(categories) {
|
|
@@ -22661,7 +22707,7 @@ class CaseFileViewFolderComponent {
|
|
|
22661
22707
|
}], moveDocument: [{
|
|
22662
22708
|
type: Output
|
|
22663
22709
|
}] }); })();
|
|
22664
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFileViewFolderComponent, { className: "CaseFileViewFolderComponent", filePath: "lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.ts", lineNumber:
|
|
22710
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFileViewFolderComponent, { className: "CaseFileViewFolderComponent", filePath: "lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.ts", lineNumber: 28 }); })();
|
|
22665
22711
|
|
|
22666
22712
|
const _c0$s = a0 => ({ "form-group-error": a0 });
|
|
22667
22713
|
function AddCommentsComponent_span_7_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -33506,7 +33552,7 @@ class EventStartGuard {
|
|
|
33506
33552
|
workAllocationService;
|
|
33507
33553
|
router;
|
|
33508
33554
|
sessionStorageService;
|
|
33509
|
-
static
|
|
33555
|
+
static CLIENT_CONTEXT = 'clientContext';
|
|
33510
33556
|
constructor(workAllocationService, router, sessionStorageService) {
|
|
33511
33557
|
this.workAllocationService = workAllocationService;
|
|
33512
33558
|
this.router = router;
|
|
@@ -33557,18 +33603,26 @@ class EventStartGuard {
|
|
|
33557
33603
|
task = tasksAssignedToUser[0];
|
|
33558
33604
|
}
|
|
33559
33605
|
// if one task assigned to user, allow user to complete event
|
|
33560
|
-
|
|
33606
|
+
const storeClientContext = {
|
|
33607
|
+
client_context: {
|
|
33608
|
+
user_task: {
|
|
33609
|
+
task_data: task,
|
|
33610
|
+
complete_task: true
|
|
33611
|
+
}
|
|
33612
|
+
}
|
|
33613
|
+
};
|
|
33614
|
+
this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
|
|
33561
33615
|
return true;
|
|
33562
33616
|
}
|
|
33563
33617
|
}
|
|
33564
33618
|
removeTaskFromSessionStorage() {
|
|
33565
|
-
this.sessionStorageService.removeItem(EventStartGuard.
|
|
33619
|
+
this.sessionStorageService.removeItem(EventStartGuard.CLIENT_CONTEXT);
|
|
33566
33620
|
}
|
|
33567
33621
|
checkForTasks(payload, caseId, eventId, taskId) {
|
|
33568
33622
|
if (taskId && payload?.tasks?.length > 0) {
|
|
33569
33623
|
const task = payload.tasks.find((t) => t.id == taskId);
|
|
33570
33624
|
if (task) {
|
|
33571
|
-
this.sessionStorageService.setItem(EventStartGuard.
|
|
33625
|
+
this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(task));
|
|
33572
33626
|
}
|
|
33573
33627
|
else {
|
|
33574
33628
|
this.removeTaskFromSessionStorage();
|
|
@@ -33736,9 +33790,17 @@ class EventStartStateMachineService {
|
|
|
33736
33790
|
task = context.tasks[0];
|
|
33737
33791
|
}
|
|
33738
33792
|
const taskStr = JSON.stringify(task);
|
|
33739
|
-
console.log('entryActionForStateOneTaskAssignedToUser: setting
|
|
33793
|
+
console.log('entryActionForStateOneTaskAssignedToUser: setting client context task_data to ' + taskStr);
|
|
33740
33794
|
// Store task to session
|
|
33741
|
-
|
|
33795
|
+
const clientContext = {
|
|
33796
|
+
client_context: {
|
|
33797
|
+
user_task: {
|
|
33798
|
+
task_data: task,
|
|
33799
|
+
complete_task: true
|
|
33800
|
+
}
|
|
33801
|
+
}
|
|
33802
|
+
};
|
|
33803
|
+
context.sessionStorageService.setItem('clientContext', JSON.stringify(clientContext));
|
|
33742
33804
|
// Allow user to perform the event
|
|
33743
33805
|
context.router.navigate([`/cases/case-details/${context.caseId}/trigger/${context.eventId}`], { relativeTo: context.route });
|
|
33744
33806
|
}
|