@pega/angular-sdk-overrides 23.1.10 → 24.1.10
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/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +7 -4
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +3 -1
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +1 -1
- package/lib/designSystemExtension/operator/operator.component.ts +10 -5
- package/lib/field/auto-complete/auto-complete.component.ts +1 -1
- package/lib/field/cancel-alert/cancel-alert.component.ts +0 -2
- package/lib/field/check-box/check-box.component.html +16 -15
- package/lib/field/check-box/check-box.component.scss +14 -1
- package/lib/field/check-box/check-box.component.ts +126 -44
- package/lib/field/currency/currency.component.html +15 -6
- package/lib/field/currency/currency.component.ts +36 -18
- package/lib/field/date-time/date-time.component.html +5 -5
- package/lib/field/date-time/date-time.component.ts +15 -37
- package/lib/field/decimal/decimal.component.html +14 -4
- package/lib/field/decimal/decimal.component.ts +42 -5
- package/lib/field/dropdown/dropdown.component.ts +0 -3
- package/lib/field/group/group.component.html +1 -1
- package/lib/field/group/group.component.ts +4 -0
- package/lib/field/multiselect/multiselect.component.html +33 -0
- package/lib/field/multiselect/multiselect.component.scss +7 -0
- package/lib/field/multiselect/multiselect.component.spec.ts +21 -0
- package/lib/field/multiselect/multiselect.component.ts +359 -0
- package/lib/field/multiselect/utils.ts +209 -0
- package/lib/field/percentage/percentage.component.html +15 -4
- package/lib/field/percentage/percentage.component.ts +29 -5
- package/lib/field/radio-buttons/radio-buttons.component.ts +0 -3
- package/lib/field/rich-text/config-ext.json +10 -0
- package/lib/field/rich-text/rich-text.component.html +1 -1
- package/lib/field/scalar-list/scalar-list.component.ts +2 -1
- package/lib/field/text-area/text-area.component.ts +0 -2
- package/lib/field/time/time.component.html +1 -0
- package/lib/field/time/time.component.ts +2 -0
- package/lib/field/url/url.component.html +1 -0
- package/lib/field/url/url.component.ts +2 -0
- package/lib/field/user-reference/user-reference.component.html +50 -45
- package/lib/field/user-reference/user-reference.component.ts +33 -15
- package/lib/infra/Containers/base-components/flow-container-base.component.ts +22 -0
- package/lib/infra/Containers/base-components/helper.ts +89 -0
- package/lib/infra/Containers/flow-container/flow-container.component.html +8 -3
- package/lib/infra/Containers/flow-container/flow-container.component.ts +30 -29
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +40 -8
- package/lib/infra/Containers/view-container/view-container.component.ts +0 -1
- package/lib/infra/assignment/assignment.component.ts +38 -39
- package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
- package/lib/infra/defer-load/defer-load.component.ts +5 -8
- package/lib/infra/multi-step/multi-step.component.html +1 -1
- package/lib/infra/multi-step/multi-step.component.scss +1 -0
- package/lib/infra/navbar/navbar.component.html +4 -4
- package/lib/infra/navbar/navbar.component.ts +6 -3
- package/lib/infra/view/view.component.ts +1 -1
- package/lib/template/banner-page/config-ext.json +9 -0
- package/lib/template/case-summary/case-summary.component.ts +37 -3
- package/lib/template/case-view/case-view.component.html +3 -3
- package/lib/template/case-view/case-view.component.scss +2 -0
- package/lib/template/case-view/case-view.component.ts +0 -6
- package/lib/template/data-reference/data-reference.component.ts +1 -3
- package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +0 -1
- package/lib/template/field-group-template/field-group-template.component.ts +4 -12
- package/lib/template/field-value-list/field-value-list.component.html +7 -2
- package/lib/template/field-value-list/field-value-list.component.ts +1 -0
- package/lib/template/inline-dashboard-page/config-ext.json +9 -0
- package/lib/template/list-view/list-view.component.html +6 -6
- package/lib/template/list-view/list-view.component.ts +36 -28
- package/lib/template/list-view/listViewHelpers.ts +0 -1
- package/lib/template/repeating-structures/repeating-structures.component.ts +1 -2
- package/lib/template/simple-table/simple-table.component.ts +0 -2
- package/lib/template/simple-table-manual/helpers.ts +1 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -1
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +49 -19
- package/lib/template/simple-table-select/simple-table-select.component.ts +2 -4
- package/lib/template/wss-nav-bar/wss-nav-bar.component.html +1 -1
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +2 -1
- package/lib/widget/attachment/attachment.component.html +50 -26
- package/lib/widget/attachment/attachment.component.scss +118 -0
- package/lib/widget/attachment/attachment.component.ts +256 -501
- package/lib/widget/case-history/case-history.component.ts +1 -2
- package/lib/widget/feed-container/feed-container.component.ts +0 -4
- package/lib/widget/file-utility/file-utility.component.html +2 -2
- package/lib/widget/file-utility/file-utility.component.ts +13 -17
- package/lib/widget/list-utility/list-utility.component.html +1 -1
- package/lib/widget/quick-create/config-ext.json +9 -0
- package/lib/widget/quick-create/quick-create.component.ts +1 -1
- package/lib/widget/todo/todo.component.html +6 -5
- package/lib/widget/todo/todo.component.ts +7 -6
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Component, OnInit, Input, ChangeDetectorRef, NgZone, forwardRef, OnDestroy } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, Input, ChangeDetectorRef, NgZone, forwardRef, OnDestroy, Injector } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
4
4
|
import { MatCardModule } from '@angular/material/card';
|
|
5
5
|
import { publicConstants } from '@pega/pcore-pconnect-typedefs/constants';
|
|
6
|
-
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
7
6
|
import { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
8
7
|
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
9
8
|
import { Utils } from '@pega/angular-sdk-components';
|
|
10
9
|
import { getToDoAssignments, showBanner } from './helpers';
|
|
11
10
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
11
|
+
import { FlowContainerBaseComponent } from '@pega/angular-sdk-components';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
@@ -32,11 +32,9 @@ interface FlowContainerProps {
|
|
|
32
32
|
standalone: true,
|
|
33
33
|
imports: [CommonModule, MatCardModule, forwardRef(() => ComponentMapperComponent)]
|
|
34
34
|
})
|
|
35
|
-
export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
35
|
+
export class FlowContainerComponent extends FlowContainerBaseComponent implements OnInit, OnDestroy {
|
|
36
36
|
@Input() pConn$: typeof PConnect;
|
|
37
37
|
|
|
38
|
-
// For interaction with AngularPConnect
|
|
39
|
-
angularPConnectData: AngularPConnectData = {};
|
|
40
38
|
pCoreConstants: typeof publicConstants;
|
|
41
39
|
configProps$: FlowContainerProps;
|
|
42
40
|
|
|
@@ -72,14 +70,17 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
72
70
|
banners: any[];
|
|
73
71
|
// itemKey: string = ""; // JA - this is what Nebula/Constellation uses to pass to finishAssignment, navigateToStep
|
|
74
72
|
|
|
73
|
+
pConnectOfActiveContainerItem;
|
|
74
|
+
|
|
75
75
|
constructor(
|
|
76
|
-
|
|
76
|
+
injector: Injector,
|
|
77
77
|
private cdRef: ChangeDetectorRef,
|
|
78
78
|
private psService: ProgressSpinnerService,
|
|
79
79
|
private fb: FormBuilder,
|
|
80
80
|
private ngZone: NgZone,
|
|
81
81
|
private utils: Utils
|
|
82
82
|
) {
|
|
83
|
+
super(injector);
|
|
83
84
|
// create the formGroup
|
|
84
85
|
this.formGroup$ = this.fb.group({ hideRequired: false });
|
|
85
86
|
}
|
|
@@ -148,10 +149,14 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
148
149
|
// Should always check the bridge to see if the component should update itself (re-render)
|
|
149
150
|
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
150
151
|
|
|
152
|
+
const pConn = this.pConnectOfActiveContainerItem || this.pConn$;
|
|
153
|
+
const caseViewModeFromProps = this.angularPConnect.getComponentProp(this, 'caseViewMode');
|
|
154
|
+
const caseViewModeFromRedux = pConn.getValue('context_data.caseViewMode', '');
|
|
155
|
+
|
|
151
156
|
// ONLY call updateSelf when the component should update
|
|
152
157
|
// AND removing the "gate" that was put there since shouldComponentUpdate
|
|
153
158
|
// should be the real "gate"
|
|
154
|
-
if (bUpdateSelf) {
|
|
159
|
+
if (bUpdateSelf || caseViewModeFromProps !== caseViewModeFromRedux) {
|
|
155
160
|
// don't want to redraw the flow container when there are page messages, because
|
|
156
161
|
// the redraw causes us to loose the errors on the elements
|
|
157
162
|
const completeProps = this.angularPConnect.getCurrentCompleteProps(this) as FlowContainerProps;
|
|
@@ -179,7 +184,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
getTodoVisibilty() {
|
|
182
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
183
187
|
const caseViewMode = this.pConn$.getValue('context_data.caseViewMode');
|
|
184
188
|
if (caseViewMode && caseViewMode === 'review') {
|
|
185
189
|
const kid = this.pConn$.getChildren()[0];
|
|
@@ -273,25 +277,30 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
273
277
|
|
|
274
278
|
hasAssignments() {
|
|
275
279
|
let hasAssignments = false;
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
280
|
+
const assignmentsList: any[] = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
|
|
281
|
+
// const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
279
282
|
// 8.7 includes assignments in Assignments List that may be assigned to
|
|
280
283
|
// a different operator. So, see if there are any assignments for
|
|
281
284
|
// the current operator
|
|
285
|
+
const isEmbedded = window.location.href.includes('embedded');
|
|
282
286
|
let bAssignmentsForThisOperator = false;
|
|
283
287
|
|
|
288
|
+
if (isEmbedded) {
|
|
289
|
+
const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
290
|
+
for (const assignment of assignmentsList) {
|
|
291
|
+
if (assignment.assigneeInfo.ID === thisOperator) {
|
|
292
|
+
bAssignmentsForThisOperator = true;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
} else {
|
|
296
|
+
bAssignmentsForThisOperator = true;
|
|
297
|
+
}
|
|
298
|
+
|
|
284
299
|
// Bail if there is no assignmentsList
|
|
285
300
|
if (!assignmentsList) {
|
|
286
301
|
return hasAssignments;
|
|
287
302
|
}
|
|
288
303
|
|
|
289
|
-
for (const assignment of assignmentsList) {
|
|
290
|
-
if ((assignment as any).assigneeInfo.ID === thisOperator) {
|
|
291
|
-
bAssignmentsForThisOperator = true;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
304
|
const hasChildCaseAssignments = this.hasChildCaseAssignments();
|
|
296
305
|
|
|
297
306
|
if (bAssignmentsForThisOperator || hasChildCaseAssignments || this.isCaseWideLocalAction()) {
|
|
@@ -302,9 +311,7 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
302
311
|
}
|
|
303
312
|
|
|
304
313
|
isCaseWideLocalAction() {
|
|
305
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
306
314
|
const actionID = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID);
|
|
307
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
308
315
|
const caseActions = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.AVAILABLEACTIONS) as any[];
|
|
309
316
|
let bCaseWideAction = false;
|
|
310
317
|
if (caseActions && actionID) {
|
|
@@ -317,7 +324,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
317
324
|
}
|
|
318
325
|
|
|
319
326
|
hasChildCaseAssignments() {
|
|
320
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
321
327
|
const childCases = this.pConn$.getValue(this.pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS);
|
|
322
328
|
|
|
323
329
|
return childCases && childCases.length > 0;
|
|
@@ -328,9 +334,7 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
328
334
|
|
|
329
335
|
const { CASE_INFO: CASE_CONSTS } = PCore.getConstants();
|
|
330
336
|
|
|
331
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
332
337
|
const caseActions = this.pConn$.getValue(CASE_CONSTS.CASE_INFO_ACTIONS) as any[];
|
|
333
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
334
338
|
const activeActionID = this.pConn$.getValue(CASE_CONSTS.ACTIVE_ACTION_ID);
|
|
335
339
|
const activeAction = caseActions?.find(action => action.ID === activeActionID);
|
|
336
340
|
if (activeAction) {
|
|
@@ -370,8 +374,9 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
370
374
|
// const { getPConnect } = this.arChildren$[0].getPConnect();
|
|
371
375
|
const localPConn = this.arChildren$[0].getPConnect();
|
|
372
376
|
|
|
373
|
-
|
|
374
|
-
|
|
377
|
+
this.pConnectOfActiveContainerItem = this.getPConnectOfActiveContainerItem(this.pConn$) || this.pConn$;
|
|
378
|
+
|
|
379
|
+
const caseViewMode = this.pConnectOfActiveContainerItem.getValue('context_data.caseViewMode');
|
|
375
380
|
this.bShowBanner = showBanner(this.pConn$);
|
|
376
381
|
|
|
377
382
|
if (caseViewMode && caseViewMode == 'review') {
|
|
@@ -424,7 +429,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
424
429
|
const todoAssignments = getToDoAssignments(this.pConn$);
|
|
425
430
|
|
|
426
431
|
if (todoAssignments && todoAssignments.length > 0) {
|
|
427
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
428
432
|
this.todo_caseInfoID$ = this.pConn$.getValue(CASE_CONSTS.CASE_INFO_ID);
|
|
429
433
|
this.todo_datasource$ = { source: todoAssignments };
|
|
430
434
|
}
|
|
@@ -452,7 +456,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
452
456
|
}
|
|
453
457
|
|
|
454
458
|
showCaseMessages() {
|
|
455
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
456
459
|
this.caseMessages$ = this.localizedVal(this.pConn$.getValue('caseMessages'), this.localeCategory);
|
|
457
460
|
if (this.caseMessages$ || !this.hasAssignments()) {
|
|
458
461
|
this.bHasCaseMessages$ = true;
|
|
@@ -465,11 +468,10 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
465
468
|
}
|
|
466
469
|
|
|
467
470
|
// publish this "assignmentFinished" for mashup, need to get approved as a standard
|
|
468
|
-
// @ts-ignore - second parameter “payload” for publish method should be optional
|
|
469
471
|
PCore.getPubSubUtils().publish('assignmentFinished');
|
|
470
472
|
|
|
471
473
|
this.psService.sendMessage(false);
|
|
472
|
-
} else
|
|
474
|
+
} else {
|
|
473
475
|
this.bHasCaseMessages$ = false;
|
|
474
476
|
this.bShowConfirm = false;
|
|
475
477
|
}
|
|
@@ -565,7 +567,6 @@ export class FlowContainerComponent implements OnInit, OnDestroy {
|
|
|
565
567
|
this.psService.sendMessage(false);
|
|
566
568
|
|
|
567
569
|
const oWorkItem = configObject.getPConnect();
|
|
568
|
-
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
|
|
569
570
|
const oWorkData: any = oWorkItem.getDataObject();
|
|
570
571
|
|
|
571
572
|
this.containerName$ = this.localizedVal(this.getActiveViewLabel() || oWorkData.caseInfo.assignments?.[0].name, undefined, this.localeReference);
|
|
@@ -6,6 +6,7 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
6
6
|
import { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
7
7
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
8
8
|
import { getBanners } from '@pega/angular-sdk-components';
|
|
9
|
+
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
@@ -200,10 +201,9 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
|
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
createView(routingInfo, currentItem, latestItem, key) {
|
|
203
|
-
const configObject = this.getConfigObject(currentItem,
|
|
204
|
+
const configObject = this.getConfigObject(currentItem, null, false);
|
|
204
205
|
const newComp = configObject?.getPConnect();
|
|
205
206
|
// const newCompName = newComp.getComponentName();
|
|
206
|
-
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
|
|
207
207
|
const caseInfo = newComp && newComp.getDataObject() && newComp.getDataObject().caseInfo ? newComp.getDataObject().caseInfo : null;
|
|
208
208
|
// The metadata for pyDetails changed such that the "template": "CaseView"
|
|
209
209
|
// is no longer a child of the created View but is in the created View's
|
|
@@ -248,8 +248,17 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
|
|
|
248
248
|
ID,
|
|
249
249
|
`${theNewCaseInfo?.getClassName()}!CASE!${theNewCaseInfo.getName()}`.toUpperCase()
|
|
250
250
|
);
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
|
|
252
|
+
const bIsRefComponent = this.checkIfRefComponent(newComp);
|
|
253
|
+
|
|
254
|
+
if (bIsRefComponent) {
|
|
255
|
+
const newPConn = ReferenceComponent.normalizePConn(newComp);
|
|
256
|
+
this.arChildren$ = ReferenceComponent.normalizePConnArray(newPConn.getChildren());
|
|
257
|
+
} else {
|
|
258
|
+
// update children with new view's children
|
|
259
|
+
this.arChildren$ = newComp.getChildren();
|
|
260
|
+
}
|
|
261
|
+
|
|
253
262
|
this.bShowModal$ = true;
|
|
254
263
|
|
|
255
264
|
// for when non modal
|
|
@@ -280,16 +289,30 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
|
|
|
280
289
|
});
|
|
281
290
|
}
|
|
282
291
|
|
|
283
|
-
getConfigObject(item, pConnect) {
|
|
292
|
+
getConfigObject(item, pConnect, isReverseCoexistence = false) {
|
|
293
|
+
let config;
|
|
294
|
+
if (isReverseCoexistence) {
|
|
295
|
+
config = {
|
|
296
|
+
options: {
|
|
297
|
+
pageReference: pConnect?.getPageReference(),
|
|
298
|
+
hasForm: true,
|
|
299
|
+
containerName: pConnect?.getContainerName() || PCore.getConstants().MODAL
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
return PCore.createPConnect(config);
|
|
303
|
+
}
|
|
284
304
|
if (item) {
|
|
285
|
-
const { context, view } = item;
|
|
286
|
-
const
|
|
305
|
+
const { context, view, isBulkAction } = item;
|
|
306
|
+
const target = PCore.getContainerUtils().getTargetFromContainerItemID(context);
|
|
307
|
+
config = {
|
|
287
308
|
meta: view,
|
|
288
309
|
options: {
|
|
289
310
|
context,
|
|
290
311
|
pageReference: view.config.context || pConnect.getPageReference(),
|
|
291
312
|
hasForm: true,
|
|
292
|
-
|
|
313
|
+
...(isBulkAction && { isBulkAction }),
|
|
314
|
+
containerName: pConnect?.getContainerName() || PCore.getConstants().MODAL,
|
|
315
|
+
target
|
|
293
316
|
}
|
|
294
317
|
};
|
|
295
318
|
return PCore.createPConnect(config);
|
|
@@ -297,6 +320,15 @@ export class ModalViewContainerComponent implements OnInit, OnDestroy {
|
|
|
297
320
|
return null;
|
|
298
321
|
}
|
|
299
322
|
|
|
323
|
+
checkIfRefComponent(thePConn: any): boolean {
|
|
324
|
+
let bReturn = false;
|
|
325
|
+
if (thePConn && thePConn.getComponentName() == 'reference') {
|
|
326
|
+
bReturn = true;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return bReturn;
|
|
330
|
+
}
|
|
331
|
+
|
|
300
332
|
onAlertState(bData: boolean) {
|
|
301
333
|
this.bAlertState = bData;
|
|
302
334
|
this.bShowCancelAlert$ = false;
|
|
@@ -121,7 +121,6 @@ export class ViewContainerComponent implements OnInit, OnDestroy {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
if (sessionStorage.getItem('hasViewContainer') == 'false') {
|
|
124
|
-
// @ts-ignore - Property 'getMetadata' is private and only accessible within class
|
|
125
124
|
if (this.pConn$.getMetadata().children) {
|
|
126
125
|
containerMgr.addContainerItem(this.dispatchObject);
|
|
127
126
|
}
|
|
@@ -38,7 +38,6 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
38
38
|
newPConn$: any;
|
|
39
39
|
containerName$: string;
|
|
40
40
|
|
|
41
|
-
bIsRefComponent = false;
|
|
42
41
|
bInitialized = false;
|
|
43
42
|
|
|
44
43
|
templateName$: string;
|
|
@@ -60,6 +59,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
60
59
|
cancelAssignment: any;
|
|
61
60
|
cancelCreateStageAssignment: any;
|
|
62
61
|
showPage: any;
|
|
62
|
+
approveCase: any;
|
|
63
|
+
rejectCase: any;
|
|
63
64
|
|
|
64
65
|
// itemKey: string = ""; // JA - this is what Nebula/Constellation uses to pass to finishAssignment, navigateToStep
|
|
65
66
|
|
|
@@ -127,45 +128,19 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
updateChanges() {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.ngZone.run(() => {
|
|
133
|
-
// pConn$ may be a 'reference' component, so normalize it
|
|
134
|
-
// this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
135
|
-
this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
136
|
-
|
|
137
|
-
// If 'reference' so we need to get the children of the normalized pConn
|
|
138
|
-
if (this.bIsRefComponent) {
|
|
139
|
-
// this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
140
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.newPConn$.getChildren());
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
this.createButtons();
|
|
145
|
-
}
|
|
131
|
+
// pConn$ may be a 'reference' component, so normalize it
|
|
132
|
+
this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
146
133
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (thePConn && thePConn.getComponentName() == 'reference') {
|
|
150
|
-
bReturn = true;
|
|
134
|
+
if (this.arChildren$) {
|
|
135
|
+
this.createButtons();
|
|
151
136
|
}
|
|
152
|
-
|
|
153
|
-
return bReturn;
|
|
154
137
|
}
|
|
155
138
|
|
|
156
139
|
initComponent() {
|
|
157
|
-
this.bIsRefComponent = this.checkIfRefComponent(this.pConn$);
|
|
158
|
-
|
|
159
140
|
// pConn$ may be a 'reference' component, so normalize it
|
|
160
141
|
// this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
161
142
|
this.newPConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
162
143
|
|
|
163
|
-
// If 'reference' so we need to get the children of the normalized pConn
|
|
164
|
-
if (this.bIsRefComponent) {
|
|
165
|
-
// this.arChildren$ = ReferenceComponent.normalizePConnArray(this.pConn$.getChildren());
|
|
166
|
-
this.arChildren$ = ReferenceComponent.normalizePConnArray(this.newPConn$.getChildren());
|
|
167
|
-
}
|
|
168
|
-
|
|
169
144
|
// prevent re-intializing with flowContainer update unless an action is taken
|
|
170
145
|
this.bReInit = false;
|
|
171
146
|
this.bHasNavigation$ = false;
|
|
@@ -205,8 +180,12 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
205
180
|
this.showPage = actionsAPI.showPage.bind(actionsAPI);
|
|
206
181
|
|
|
207
182
|
this.cancelCreateStageAssignment = actionsAPI.cancelCreateStageAssignment.bind(actionsAPI);
|
|
183
|
+
this.approveCase = actionsAPI.approveCase?.bind(actionsAPI);
|
|
184
|
+
this.rejectCase = actionsAPI.rejectCase?.bind(actionsAPI);
|
|
208
185
|
|
|
209
|
-
this.
|
|
186
|
+
if (this.arChildren$) {
|
|
187
|
+
this.createButtons();
|
|
188
|
+
}
|
|
210
189
|
}
|
|
211
190
|
|
|
212
191
|
createButtons() {
|
|
@@ -353,8 +332,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
353
332
|
|
|
354
333
|
savePromise
|
|
355
334
|
.then(() => {
|
|
335
|
+
// @ts-ignore - Property 'c11nEnv' is private and only accessible within class 'CaseInfo'.
|
|
356
336
|
const caseType = this.pConn$.getCaseInfo().c11nEnv.getValue(PCore.getConstants().CASE_INFO.CASE_TYPE_ID);
|
|
357
|
-
// @ts-ignore - second parameter “payload” for publish method should be optional
|
|
358
337
|
PCore.getPubSubUtils().publish('cancelPressed');
|
|
359
338
|
this.onSaveActionSuccess({ caseType, caseID, assignmentID });
|
|
360
339
|
})
|
|
@@ -369,12 +348,9 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
369
348
|
case 'cancelAssignment':
|
|
370
349
|
this.bReInit = true;
|
|
371
350
|
this.erService.sendMessage('dismiss', '');
|
|
372
|
-
// @ts-ignore - Property 'isAssignmentInCreateStage' is private and only accessible within class 'CaseInfo'
|
|
373
351
|
const isAssignmentInCreateStage = this.pConn$.getCaseInfo().isAssignmentInCreateStage();
|
|
374
352
|
const isLocalAction =
|
|
375
|
-
// @ts-ignore - Property 'isLocalAction' is private and only accessible within class 'CaseInfo'.
|
|
376
353
|
this.pConn$.getCaseInfo().isLocalAction() ||
|
|
377
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
378
354
|
(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION && this.pConn$.getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION));
|
|
379
355
|
// check if create stage (modal)
|
|
380
356
|
if (isAssignmentInCreateStage && this.isInModal$ && !isLocalAction) {
|
|
@@ -394,14 +370,12 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
394
370
|
|
|
395
371
|
// publish before cancel pressed, because
|
|
396
372
|
// cancel assignment happens "after" cancel assignment happens
|
|
397
|
-
// @ts-ignore - second parameter “payload” for publish method should be optional
|
|
398
373
|
PCore.getPubSubUtils().publish('cancelPressed');
|
|
399
374
|
|
|
400
375
|
const cancelPromise = this.cancelAssignment(this.itemKey$);
|
|
401
376
|
cancelPromise
|
|
402
377
|
.then(() => {
|
|
403
378
|
this.psService.sendMessage(false);
|
|
404
|
-
// @ts-ignore - second parameter “payload” for publish method should be optional
|
|
405
379
|
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
|
|
406
380
|
})
|
|
407
381
|
.catch(() => {
|
|
@@ -411,11 +385,23 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
411
385
|
}
|
|
412
386
|
break;
|
|
413
387
|
|
|
388
|
+
case 'rejectCase': {
|
|
389
|
+
const rejectPromise = this.rejectCase(this.itemKey$);
|
|
390
|
+
|
|
391
|
+
rejectPromise
|
|
392
|
+
.then(() => {})
|
|
393
|
+
.catch(() => {
|
|
394
|
+
this.psService.sendMessage(false);
|
|
395
|
+
this.snackBar.open(`${this.localizedVal('Rejection failed!', this.localeCategory)}`, 'Ok');
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
|
|
414
401
|
default:
|
|
415
402
|
break;
|
|
416
403
|
}
|
|
417
404
|
} else if (sButtonType == 'primary') {
|
|
418
|
-
// eslint-disable-next-line sonarjs/no-small-switch
|
|
419
405
|
switch (sAction) {
|
|
420
406
|
case 'finishAssignment':
|
|
421
407
|
this.erService.sendMessage('publish', '');
|
|
@@ -437,6 +423,19 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
437
423
|
this.erService.sendMessage('show', this.localizedVal('Please fix errors on form.', this.localeCategory));
|
|
438
424
|
}
|
|
439
425
|
break;
|
|
426
|
+
|
|
427
|
+
case 'approveCase': {
|
|
428
|
+
const approvePromise = this.approveCase(this.itemKey$);
|
|
429
|
+
|
|
430
|
+
approvePromise
|
|
431
|
+
.then(() => {})
|
|
432
|
+
.catch(() => {
|
|
433
|
+
this.psService.sendMessage(false);
|
|
434
|
+
this.snackBar.open(`${this.localizedVal('Approve failed!', this.localeCategory)}`, 'Ok');
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
440
439
|
default:
|
|
441
440
|
break;
|
|
442
441
|
}
|
|
@@ -47,7 +47,6 @@ export class DashboardFilterComponent implements OnInit {
|
|
|
47
47
|
|
|
48
48
|
clearFilters() {
|
|
49
49
|
this.filtersFormGroup$.reset();
|
|
50
|
-
// @ts-ignore - second parameter “payload” for publish method should be optional
|
|
51
50
|
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CLEAR_ALL);
|
|
52
51
|
}
|
|
53
52
|
|
|
@@ -44,7 +44,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
44
44
|
|
|
45
45
|
ngOnInit(): void {
|
|
46
46
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
47
|
-
|
|
47
|
+
// The below call is causing an error while creating/opening a case, hence commenting it out
|
|
48
|
+
// this.loadActiveTab();
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
ngOnDestroy(): void {
|
|
@@ -56,7 +57,6 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
56
57
|
onStateChange() {
|
|
57
58
|
// Should always check the bridge to see if the component should
|
|
58
59
|
// update itself (re-render)
|
|
59
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
60
60
|
const theRequestedAssignment = this.pConn$.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENT_LABEL);
|
|
61
61
|
if (theRequestedAssignment !== this.currentLoadedAssignment) {
|
|
62
62
|
this.currentLoadedAssignment = theRequestedAssignment;
|
|
@@ -65,7 +65,6 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
ngOnChanges() {
|
|
68
|
-
// @ts-ignore - second parameter pageReference for getValue method should be optional
|
|
69
68
|
this.loadViewCaseID = this.pConn$.getValue(this.constants.PZINSKEY) || this.pConn$.getValue(this.constants.CASE_INFO.CASE_INFO_ID);
|
|
70
69
|
let containerItemData;
|
|
71
70
|
const targetName = this.pConn$.getTarget();
|
|
@@ -91,7 +90,6 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
91
90
|
|
|
92
91
|
getViewOptions = () => ({
|
|
93
92
|
viewContext: this.resourceType,
|
|
94
|
-
// @ts-ignore - parameter “contextName” for getDataObject method should be optional
|
|
95
93
|
pageClass: this.loadViewCaseID ? '' : this.pConn$.getDataObject().pyPortal.classID,
|
|
96
94
|
container: this.isContainerPreview ? 'preview' : null,
|
|
97
95
|
containerName: this.isContainerPreview ? 'preview' : null,
|
|
@@ -138,9 +136,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
138
136
|
this.pConn$
|
|
139
137
|
.getActionsApi()
|
|
140
138
|
.showData(this.name, dataContext, dataContextParameters, {
|
|
141
|
-
// @ts-ignore - skipSemanticUrl should be boolean type
|
|
142
139
|
skipSemanticUrl: true,
|
|
143
|
-
// @ts-ignore
|
|
140
|
+
// @ts-ignore - Object literal may only specify known properties, and 'isDeferLoaded' does not exist in type '{ containerName: string; skipSemanticUrl: boolean; }'
|
|
144
141
|
isDeferLoaded: true
|
|
145
142
|
})
|
|
146
143
|
.then(data => {
|
|
@@ -160,8 +157,8 @@ export class DeferLoadComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
160
157
|
} else {
|
|
161
158
|
this.pConn$
|
|
162
159
|
.getActionsApi()
|
|
163
|
-
.refreshCaseView(encodeURI(this.loadViewCaseID), this.name,
|
|
164
|
-
.then(data => {
|
|
160
|
+
.refreshCaseView(encodeURI(this.loadViewCaseID), this.name, '')
|
|
161
|
+
.then((data: any) => {
|
|
165
162
|
this.onResponse(data.root);
|
|
166
163
|
});
|
|
167
164
|
}
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<span>{{ i + 1 }}</span>
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
57
|
-
<div class="{{ _getHLabelClass(mainStep.visited_status) }}">
|
|
57
|
+
<div id="multi-step-label" class="{{ _getHLabelClass(mainStep.visited_status) }}">
|
|
58
58
|
<div class="psdk-horizontal-step-text-label">
|
|
59
59
|
{{ mainStep.name }}
|
|
60
60
|
</div>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*ngFor="let caseType of caseTypes$"
|
|
23
23
|
(click)="navPanelCreateCaseType(caseType.pyClassName, caseType.pyFlowType)"
|
|
24
24
|
>
|
|
25
|
-
<span class="psdk-nav-button-span">{{ caseType.pyLabel }}</span>
|
|
25
|
+
<span class="psdk-nav-button-span">{{ localeUtils.getLocaleValue(caseType.pyLabel, '', localeReference) }}</span>
|
|
26
26
|
</mat-list-item>
|
|
27
27
|
</mat-list>
|
|
28
28
|
</mat-list>
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
<mat-list-item (click)="navPanelButtonClick(page)">
|
|
33
33
|
<div class="flex-box">
|
|
34
34
|
<img class="psdk-nav-svg-icon" src="{{ page.iconName }}" />
|
|
35
|
-
<span class="psdk-nav-button-span">{{
|
|
35
|
+
<span class="psdk-nav-button-span">{{ localeUtils.getLocaleValue(page.pyLabel, '', localeReference) }}</span>
|
|
36
36
|
</div>
|
|
37
37
|
</mat-list-item>
|
|
38
38
|
</mat-list>
|
|
39
39
|
</div>
|
|
40
40
|
<div class="psdk-nav-divider"></div>
|
|
41
41
|
<div>
|
|
42
|
-
<mat-list>
|
|
42
|
+
<mat-list id="profile">
|
|
43
43
|
<mat-list-item [matMenuTriggerFor]="menu" class="psdk-profile-list-item">
|
|
44
44
|
<div class="flex-box">
|
|
45
45
|
<div class="psdk-nav-oper-avatar">{{ portalOperatorInitials$ }}</div>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
</mat-list-item>
|
|
49
49
|
<mat-menu #menu="matMenu">
|
|
50
50
|
<button mat-menu-item>Profile</button>
|
|
51
|
-
<button mat-menu-item (click)="navPanelLogoutClick()">{{ localizedVal('
|
|
51
|
+
<button mat-menu-item (click)="navPanelLogoutClick()">{{ localizedVal('Log off', localeCategory) }}</button>
|
|
52
52
|
</mat-menu>
|
|
53
53
|
</mat-list>
|
|
54
54
|
</div>
|
|
@@ -51,7 +51,8 @@ export class NavbarComponent implements OnInit, OnDestroy {
|
|
|
51
51
|
navIcon$: string;
|
|
52
52
|
localizedVal: any;
|
|
53
53
|
localeCategory = 'AppShell';
|
|
54
|
-
|
|
54
|
+
localeUtils = PCore.getLocaleUtils();
|
|
55
|
+
localeReference: any;
|
|
55
56
|
constructor(
|
|
56
57
|
private angularPConnect: AngularPConnectService,
|
|
57
58
|
private chRef: ChangeDetectorRef,
|
|
@@ -119,7 +120,7 @@ export class NavbarComponent implements OnInit, OnDestroy {
|
|
|
119
120
|
this.navPages$.forEach(page => {
|
|
120
121
|
page.iconName = this.utils.getImageSrc(page.pxPageViewIcon, this.utils.getSDKStaticContentUrl());
|
|
121
122
|
});
|
|
122
|
-
|
|
123
|
+
this.localeReference = this.pConn$.getValue('.pyLocaleReference');
|
|
123
124
|
this.actionsAPI = this.pConn$.getActionsApi();
|
|
124
125
|
this.createWork = this.actionsAPI.createWork.bind(this.actionsAPI);
|
|
125
126
|
this.showPage = this.actionsAPI.showPage.bind(this.actionsAPI);
|
|
@@ -163,7 +164,9 @@ export class NavbarComponent implements OnInit, OnDestroy {
|
|
|
163
164
|
containerName: 'primary',
|
|
164
165
|
flowType: sFlowType || 'pyStartCase'
|
|
165
166
|
};
|
|
166
|
-
this.createWork(sCaseType, actionInfo)
|
|
167
|
+
this.createWork(sCaseType, actionInfo).then(() => {
|
|
168
|
+
console.log('createWork completed');
|
|
169
|
+
});
|
|
167
170
|
}
|
|
168
171
|
|
|
169
172
|
navPanelLogoutClick() {
|
|
@@ -159,7 +159,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
159
159
|
* The resolution lies in transferring this responsibility to the Reference component, eliminating the need for this code when Reference
|
|
160
160
|
* component is able to handle it.
|
|
161
161
|
*/
|
|
162
|
-
if (this.pConn$.getPageReference().length > 'caseInfo.content'.length) {
|
|
162
|
+
if (!this.configProps$.visibility && this.pConn$.getPageReference().length > 'caseInfo.content'.length) {
|
|
163
163
|
this.visibility$ = evaluateVisibility(this.pConn$);
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -92,9 +92,43 @@ export class CaseSummaryComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
92
92
|
this.primaryFields$.push(kid.resolveConfigProps(kid.getRawMetadata()));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
const secondarySummaryFields = this.prepareCaseSummaryData(this.arChildren$[1].getPConnect());
|
|
96
|
+
const secondaryChildren = this.arChildren$[1].getPConnect().getChildren();
|
|
97
|
+
secondaryChildren.forEach((oField, index) => {
|
|
96
98
|
const kid = oField.getPConnect();
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
const displayLabel = secondarySummaryFields[index].value.getPConnect().getConfigProps().label;
|
|
100
|
+
this.secondaryFields$.push({ ...kid.resolveConfigProps(kid.getRawMetadata()), kid, displayLabel });
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
prepareComponentInCaseSummary(pConnectMeta, getPConnect) {
|
|
105
|
+
const { config, children } = pConnectMeta;
|
|
106
|
+
const pConnect = getPConnect();
|
|
107
|
+
|
|
108
|
+
const caseSummaryComponentObject: any = {};
|
|
109
|
+
|
|
110
|
+
const { type } = pConnectMeta;
|
|
111
|
+
const createdComponent = pConnect.createComponent({
|
|
112
|
+
type,
|
|
113
|
+
children: children ? [...children] : [],
|
|
114
|
+
config: {
|
|
115
|
+
...config
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
caseSummaryComponentObject.value = createdComponent;
|
|
120
|
+
return caseSummaryComponentObject;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
prepareCaseSummaryData(summaryFieldChildren) {
|
|
124
|
+
const convertChildrenToSummaryData = kid => {
|
|
125
|
+
return kid?.map((childItem, index) => {
|
|
126
|
+
const childMeta = childItem.getPConnect().meta;
|
|
127
|
+
const caseSummaryComponentObject = this.prepareComponentInCaseSummary(childMeta, childItem.getPConnect);
|
|
128
|
+
caseSummaryComponentObject.id = index + 1;
|
|
129
|
+
return caseSummaryComponentObject;
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
return summaryFieldChildren ? convertChildrenToSummaryData(summaryFieldChildren?.getChildren()) : undefined;
|
|
99
133
|
}
|
|
100
134
|
}
|