@pega/angular-sdk-overrides 24.1.10 → 24.2.12
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/alert-banner/alert-banner.component.ts +1 -1
- package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -1
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +2 -1
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +2 -2
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +10 -1
- package/lib/designSystemExtension/operator/operator.component.html +1 -1
- package/lib/designSystemExtension/operator/operator.component.scss +10 -2
- package/lib/designSystemExtension/operator/operator.component.ts +5 -4
- package/lib/designSystemExtension/pulse/pulse.component.ts +7 -7
- package/lib/field/auto-complete/auto-complete.component.html +0 -1
- package/lib/field/auto-complete/auto-complete.component.ts +31 -15
- package/lib/field/check-box/check-box.component.html +4 -0
- package/lib/field/check-box/check-box.component.ts +11 -10
- package/lib/field/currency/currency.component.html +4 -4
- package/lib/field/currency/currency.component.ts +42 -19
- package/lib/field/date/date.component.html +3 -7
- package/lib/field/date/date.component.ts +22 -39
- package/lib/field/date-time/date-time.component.html +3 -4
- package/lib/field/date-time/date-time.component.ts +35 -16
- package/lib/field/decimal/decimal.component.html +4 -3
- package/lib/field/decimal/decimal.component.ts +47 -21
- package/lib/field/dropdown/dropdown.component.html +1 -0
- package/lib/field/dropdown/dropdown.component.ts +146 -18
- package/lib/field/email/email.component.ts +24 -4
- package/lib/field/group/group.component.ts +2 -2
- package/lib/field/integer/integer.component.ts +22 -4
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -2
- package/lib/field/multiselect/multiselect.component.ts +15 -5
- package/lib/field/percentage/percentage.component.html +3 -3
- package/lib/field/percentage/percentage.component.ts +45 -20
- package/lib/field/phone/config-ext.json +1 -1
- package/lib/field/phone/phone.component.html +4 -2
- package/lib/field/phone/phone.component.ts +16 -26
- package/lib/field/radio-buttons/radio-buttons.component.html +3 -6
- package/lib/field/radio-buttons/radio-buttons.component.ts +9 -9
- package/lib/field/rich-text/rich-text.component.ts +19 -8
- package/lib/field/scalar-list/scalar-list.component.ts +3 -4
- package/lib/field/text/text.component.ts +8 -4
- package/lib/field/text-area/text-area.component.html +4 -1
- package/lib/field/text-area/text-area.component.ts +22 -5
- package/lib/field/text-input/text-input.component.ts +22 -4
- package/lib/field/time/time.component.html +2 -2
- package/lib/field/time/time.component.ts +35 -6
- package/lib/field/url/url.component.ts +22 -4
- package/lib/field/user-reference/user-reference.component.html +40 -46
- package/lib/field/user-reference/user-reference.component.ts +111 -20
- package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
- package/lib/infra/Containers/flow-container/flow-container.component.ts +25 -47
- package/lib/infra/Containers/flow-container/helpers.ts +2 -2
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +1 -8
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
- package/lib/infra/Containers/view-container/helper.ts +22 -0
- package/lib/infra/Containers/view-container/view-container.component.ts +5 -17
- package/lib/infra/action-buttons/action-buttons.component.html +1 -1
- package/lib/infra/assignment/assignment.component.html +1 -1
- package/lib/infra/assignment/assignment.component.ts +82 -40
- package/lib/infra/assignment-card/assignment-card.component.html +1 -0
- package/lib/infra/defer-load/defer-load.component.ts +8 -5
- package/lib/infra/navbar/navbar.component.ts +3 -5
- package/lib/infra/reference/reference.component.ts +77 -90
- package/lib/infra/root-container/root-container.component.html +2 -15
- package/lib/infra/root-container/root-container.component.ts +27 -30
- package/lib/infra/stages/stages.component.scss +2 -2
- package/lib/infra/view/view.component.html +7 -20
- package/lib/infra/view/view.component.ts +20 -2
- package/lib/template/app-shell/app-shell.component.ts +20 -2
- package/lib/template/base/details-template-base.ts +67 -0
- package/lib/template/base/form-template-base.ts +16 -0
- package/lib/template/case-summary/case-summary.component.ts +1 -1
- package/lib/template/case-view/case-view.component.html +4 -4
- package/lib/template/case-view/case-view.component.ts +8 -13
- package/lib/template/confirmation/confirmation.component.html +1 -1
- package/lib/template/confirmation/confirmation.component.ts +1 -1
- package/lib/template/data-reference/data-reference.component.ts +36 -40
- package/lib/template/default-form/default-form.component.html +0 -4
- package/lib/template/default-form/default-form.component.ts +41 -24
- package/lib/template/details/details.component.ts +7 -41
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -39
- package/lib/template/details-one-column/details-one-column.component.ts +7 -42
- package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
- package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
- package/lib/template/details-three-column/details-three-column.component.ts +7 -43
- package/lib/template/details-two-column/details-two-column.component.ts +8 -44
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -42
- package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -3
- package/lib/template/field-group-template/field-group-template.component.html +7 -7
- package/lib/template/field-group-template/field-group-template.component.scss +8 -0
- package/lib/template/field-group-template/field-group-template.component.ts +68 -47
- package/lib/template/field-value-list/field-value-list.component.html +2 -2
- package/lib/template/field-value-list/field-value-list.component.scss +6 -1
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -2
- package/lib/template/list-view/list-view.component.html +6 -1
- package/lib/template/list-view/list-view.component.scss +11 -0
- package/lib/template/list-view/list-view.component.ts +25 -7
- package/lib/template/list-view/listViewHelpers.ts +3 -6
- package/lib/template/list-view/utils.ts +2 -5
- package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -1
- package/lib/template/one-column/one-column.component.ts +4 -3
- package/lib/template/one-column-tab/one-column-tab.component.ts +1 -1
- package/lib/template/page/page.component.ts +1 -1
- package/lib/template/promoted-filters/promoted-filters.component.ts +1 -1
- package/lib/template/repeating-structures/repeating-structures.component.ts +1 -1
- package/lib/template/simple-table-manual/helpers.ts +10 -8
- package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +12 -3
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +77 -37
- package/lib/template/simple-table-select/simple-table-select.component.ts +3 -3
- package/lib/template/three-column/three-column.component.ts +4 -3
- package/lib/template/two-column/two-column.component.ts +4 -3
- package/lib/template/two-column-tab/two-column-tab.component.ts +1 -1
- package/lib/template/utils.ts +16 -0
- package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -3
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -1
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -3
- package/lib/widget/attachment/attachment.component.ts +7 -9
- package/lib/widget/feed-container/feed-container.component.ts +7 -9
- package/lib/widget/file-utility/file-utility.component.ts +2 -5
- package/lib/widget/todo/todo.component.html +5 -6
- package/lib/widget/todo/todo.component.scss +9 -0
- package/lib/widget/todo/todo.component.ts +95 -84
- package/package.json +1 -1
|
@@ -57,7 +57,7 @@ export class SimpleTableSelectComponent implements OnInit, OnDestroy {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
updateSelf() {
|
|
60
|
-
const theConfigProps
|
|
60
|
+
const theConfigProps = this.pConn$.getConfigProps();
|
|
61
61
|
this.label = theConfigProps.label;
|
|
62
62
|
this.renderMode = theConfigProps.renderMode;
|
|
63
63
|
this.showLabel = theConfigProps.showLabel;
|
|
@@ -71,7 +71,7 @@ export class SimpleTableSelectComponent implements OnInit, OnDestroy {
|
|
|
71
71
|
this.propsToUse.label = '';
|
|
72
72
|
}
|
|
73
73
|
const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
|
|
74
|
-
const { selectionMode, selectionList }
|
|
74
|
+
const { selectionMode, selectionList } = this.pConn$.getConfigProps();
|
|
75
75
|
const isMultiSelectMode = selectionMode === MULTI;
|
|
76
76
|
if (isMultiSelectMode && this.renderMode === 'ReadOnly') {
|
|
77
77
|
this.showSimpleTableManual = true;
|
|
@@ -137,7 +137,7 @@ export class SimpleTableSelectComponent implements OnInit, OnDestroy {
|
|
|
137
137
|
parameters: this.parameters
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
this.filters = (this.pConn$.getRawMetadata() as any).
|
|
140
|
+
this.filters = (this.pConn$.getRawMetadata()?.config as any).promotedFilters ?? [];
|
|
141
141
|
|
|
142
142
|
this.isSearchable = this.filters.length > 0;
|
|
143
143
|
}
|
|
@@ -2,6 +2,7 @@ import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '
|
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
5
|
+
import { FormTemplateBase } from '@pega/angular-sdk-components';
|
|
5
6
|
|
|
6
7
|
@Component({
|
|
7
8
|
selector: 'app-three-column',
|
|
@@ -10,8 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
10
11
|
standalone: true,
|
|
11
12
|
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
12
13
|
})
|
|
13
|
-
export class ThreeColumnComponent implements OnInit, OnChanges {
|
|
14
|
-
@Input() pConn$: typeof PConnect;
|
|
14
|
+
export class ThreeColumnComponent extends FormTemplateBase implements OnInit, OnChanges {
|
|
15
|
+
@Input() override pConn$: typeof PConnect;
|
|
15
16
|
@Input() formGroup$: FormGroup;
|
|
16
17
|
|
|
17
18
|
arChildren$: any[];
|
|
@@ -29,6 +30,6 @@ export class ThreeColumnComponent implements OnInit, OnChanges {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
updateSelf() {
|
|
32
|
-
this.arChildren$ = this.pConn$.getChildren()
|
|
33
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -2,6 +2,7 @@ import { Component, OnInit, Input, forwardRef, SimpleChanges, OnChanges } from '
|
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
5
|
+
import { FormTemplateBase } from '@pega/angular-sdk-components';
|
|
5
6
|
|
|
6
7
|
@Component({
|
|
7
8
|
selector: 'app-two-column',
|
|
@@ -10,8 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
10
11
|
standalone: true,
|
|
11
12
|
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
12
13
|
})
|
|
13
|
-
export class TwoColumnComponent implements OnInit, OnChanges {
|
|
14
|
-
@Input() pConn$: typeof PConnect;
|
|
14
|
+
export class TwoColumnComponent extends FormTemplateBase implements OnInit, OnChanges {
|
|
15
|
+
@Input() override pConn$: typeof PConnect;
|
|
15
16
|
@Input() formGroup$: FormGroup;
|
|
16
17
|
|
|
17
18
|
arChildren$: any[];
|
|
@@ -29,6 +30,6 @@ export class TwoColumnComponent implements OnInit, OnChanges {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
updateSelf() {
|
|
32
|
-
this.arChildren$ = this.pConn$.getChildren()
|
|
33
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
33
34
|
}
|
|
34
35
|
}
|
package/lib/template/utils.ts
CHANGED
|
@@ -21,3 +21,19 @@ export function filterForFieldValueList(fields: any) {
|
|
|
21
21
|
value
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* This method evaluates whether a row action is allowed based on the provided conditions.
|
|
27
|
+
* @param {string|boolean|undefined} allowRowDelete - The condition for allowing row deletion.
|
|
28
|
+
* @param {object} rowData - The data of the row being evaluated.
|
|
29
|
+
* @returns {boolean} - Returns true if the row action is allowed, false otherwise.
|
|
30
|
+
*/
|
|
31
|
+
export const evaluateAllowRowAction = (allowRowDelete, rowData) => {
|
|
32
|
+
if (allowRowDelete === undefined || allowRowDelete === true) return true;
|
|
33
|
+
if (allowRowDelete.startsWith?.('@E ')) {
|
|
34
|
+
const expression = allowRowDelete.replace('@E ', '');
|
|
35
|
+
// @ts-ignore - Expected 3 arguments, but got 2
|
|
36
|
+
return PCore.getExpressionEngine().evaluate(expression, rowData);
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
@@ -2,6 +2,7 @@ import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '
|
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
5
|
+
import { FormTemplateBase } from '@pega/angular-sdk-components';
|
|
5
6
|
|
|
6
7
|
@Component({
|
|
7
8
|
selector: 'app-wide-narrow-form',
|
|
@@ -10,8 +11,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
10
11
|
standalone: true,
|
|
11
12
|
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
12
13
|
})
|
|
13
|
-
export class WideNarrowFormComponent implements OnInit, OnChanges {
|
|
14
|
-
@Input() pConn$: typeof PConnect;
|
|
14
|
+
export class WideNarrowFormComponent extends FormTemplateBase implements OnInit, OnChanges {
|
|
15
|
+
@Input() override pConn$: typeof PConnect;
|
|
15
16
|
@Input() formGroup$: FormGroup;
|
|
16
17
|
|
|
17
18
|
arChildren$: any[];
|
|
@@ -29,6 +30,6 @@ export class WideNarrowFormComponent implements OnInit, OnChanges {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
updateSelf() {
|
|
32
|
-
this.arChildren$ = this.pConn$.getChildren()
|
|
33
|
+
this.arChildren$ = this.pConn$.getChildren();
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -15,7 +15,7 @@ export class WideNarrowPageComponent implements OnInit, OnDestroy {
|
|
|
15
15
|
@Input() pConn$: typeof PConnect;
|
|
16
16
|
@Input() formGroup$: FormGroup;
|
|
17
17
|
|
|
18
|
-
thePConnType = '';
|
|
18
|
+
thePConnType: string | undefined = '';
|
|
19
19
|
|
|
20
20
|
// Used with AngularPConnect
|
|
21
21
|
angularPConnectData: AngularPConnectData = {};
|
|
@@ -37,11 +37,11 @@ export class WssNavBarComponent implements OnInit, OnDestroy {
|
|
|
37
37
|
navExpandCollapse$: string;
|
|
38
38
|
bShowCaseTypes$ = false;
|
|
39
39
|
|
|
40
|
-
portalApp
|
|
40
|
+
portalApp$: string | undefined = '';
|
|
41
41
|
portalLogoImage$: string;
|
|
42
42
|
showAppName$ = false;
|
|
43
43
|
|
|
44
|
-
portalOperator$: string;
|
|
44
|
+
portalOperator$: string | undefined;
|
|
45
45
|
portalOperatorInitials$: string;
|
|
46
46
|
|
|
47
47
|
actionsAPI: any;
|
|
@@ -129,7 +129,7 @@ export class WssNavBarComponent implements OnInit, OnDestroy {
|
|
|
129
129
|
|
|
130
130
|
this.portalLogoImage$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');
|
|
131
131
|
this.portalOperator$ = PCore.getEnvironmentInfo().getOperatorName();
|
|
132
|
-
this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$);
|
|
132
|
+
this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$ ?? '');
|
|
133
133
|
this.showAppName$ = this.configProps$.showAppName;
|
|
134
134
|
|
|
135
135
|
this.portalApp$ = PCore.getEnvironmentInfo().getApplicationLabel();
|
|
@@ -120,7 +120,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
120
120
|
|
|
121
121
|
updateSelf() {
|
|
122
122
|
const configProps: AttachmentProps = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as AttachmentProps;
|
|
123
|
-
const stateProps
|
|
123
|
+
const stateProps = this.pConn$.getStateProps();
|
|
124
124
|
const { value, label, extensions, displayMode } = configProps;
|
|
125
125
|
|
|
126
126
|
if (configProps.required != null) {
|
|
@@ -149,7 +149,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
149
149
|
|
|
150
150
|
this.validateMessage = this.angularPConnectData.validateMessage;
|
|
151
151
|
this.extensions$ = extensions;
|
|
152
|
-
this.valueRef =
|
|
152
|
+
this.valueRef = this.pConn$.getStateProps().value;
|
|
153
153
|
this.valueRef = this.valueRef.startsWith('.') ? this.valueRef.substring(1) : this.valueRef;
|
|
154
154
|
this.displayMode = displayMode;
|
|
155
155
|
/* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */
|
|
@@ -277,7 +277,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
277
277
|
this.updateAttachmentState(this.pConn$, this.getAttachmentKey(this.valueRef), [...currentAttachmentList, ...attachmentsList]);
|
|
278
278
|
if (file.inProgress) {
|
|
279
279
|
// @ts-ignore - 3rd parameter "responseEncoding" should be optional
|
|
280
|
-
PCore.getAttachmentUtils().cancelRequest(file.ID, pConn
|
|
280
|
+
PCore.getAttachmentUtils().cancelRequest(file.ID, this.pConn$.getContextName());
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
|
|
@@ -317,14 +317,13 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
317
317
|
)} ${this.extensions$.replaceAll('.', '')}`;
|
|
318
318
|
}
|
|
319
319
|
if (f.props.error) {
|
|
320
|
-
const fieldName =
|
|
320
|
+
const fieldName = this.pConn$.getStateProps().value;
|
|
321
321
|
const context = this.pConn$.getContextName();
|
|
322
322
|
PCore.getMessageManager().addMessages({
|
|
323
323
|
messages: [
|
|
324
324
|
{
|
|
325
325
|
type: 'error',
|
|
326
|
-
|
|
327
|
-
message: pConn.getLocalizedValue('Error with one or more files', '', '')
|
|
326
|
+
message: this.pConn$.getLocalizedValue('Error with one or more files', '', '')
|
|
328
327
|
}
|
|
329
328
|
],
|
|
330
329
|
property: fieldName,
|
|
@@ -348,7 +347,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
348
347
|
}
|
|
349
348
|
|
|
350
349
|
clearFieldErrorMessages() {
|
|
351
|
-
const fieldName =
|
|
350
|
+
const fieldName = this.pConn$.getStateProps().value;
|
|
352
351
|
const context = this.pConn$.getContextName();
|
|
353
352
|
PCore.getMessageManager().clearMessages({
|
|
354
353
|
type: PCore.getConstants().MESSAGES.MESSAGES_TYPE_ERROR,
|
|
@@ -376,14 +375,13 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
376
375
|
f.props.icon = this.utils.getIconFromFileType(f.type);
|
|
377
376
|
f.props.name = this.pConn$.getLocalizedValue('Unable to upload file', '', '');
|
|
378
377
|
f.inProgress = false;
|
|
379
|
-
const fieldName =
|
|
378
|
+
const fieldName = this.pConn$.getStateProps().value;
|
|
380
379
|
const context = this.pConn$.getContextName();
|
|
381
380
|
// set errors to property to block submit even on errors in file upload
|
|
382
381
|
PCore.getMessageManager().addMessages({
|
|
383
382
|
messages: [
|
|
384
383
|
{
|
|
385
384
|
type: 'error',
|
|
386
|
-
// @ts-ignore - Type '{ type: string; message: string; }' is not assignable to type 'MessagesConfigObject'.
|
|
387
385
|
message: this.pConn$.getLocalizedValue('Error with one or more files', '', '')
|
|
388
386
|
}
|
|
389
387
|
],
|
|
@@ -9,8 +9,6 @@ import isEqual from 'fast-deep-equal';
|
|
|
9
9
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
10
10
|
import { Utils } from '@pega/angular-sdk-components';
|
|
11
11
|
|
|
12
|
-
declare const window: any;
|
|
13
|
-
|
|
14
12
|
@Component({
|
|
15
13
|
selector: 'app-feed-container',
|
|
16
14
|
templateUrl: './feed-container.component.html',
|
|
@@ -25,8 +23,8 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
|
|
|
25
23
|
// Used with AngularPConnect
|
|
26
24
|
angularPConnectData: AngularPConnectData = {};
|
|
27
25
|
|
|
28
|
-
userName$: string;
|
|
29
|
-
imageKey$: string;
|
|
26
|
+
userName$: string | undefined;
|
|
27
|
+
imageKey$: string | undefined;
|
|
30
28
|
|
|
31
29
|
currentUserInitials$: string;
|
|
32
30
|
currentUserName$: string;
|
|
@@ -65,7 +63,7 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
|
|
|
65
63
|
ngOnInit(): void {
|
|
66
64
|
this.userName$ = PCore.getEnvironmentInfo().getOperatorName();
|
|
67
65
|
this.imageKey$ = PCore.getEnvironmentInfo().getOperatorImageInsKey();
|
|
68
|
-
this.updateCurrentUserName(this.userName$);
|
|
66
|
+
this.updateCurrentUserName(this.userName$ ?? '');
|
|
69
67
|
|
|
70
68
|
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
71
69
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
@@ -402,11 +400,11 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
|
|
|
402
400
|
}
|
|
403
401
|
|
|
404
402
|
getMessageData() {
|
|
405
|
-
const messageIDs =
|
|
406
|
-
const userName =
|
|
403
|
+
const messageIDs = this.pConn$.getConfigProps().messageIDs;
|
|
404
|
+
const userName = this.pConn$.getConfigProps().currentUser;
|
|
407
405
|
const imageKey = this.pConn$.getValue('OperatorID.pyImageInsKey');
|
|
408
406
|
|
|
409
|
-
const oData
|
|
407
|
+
const oData = this.pConn$.getDataObject();
|
|
410
408
|
|
|
411
409
|
if (messageIDs && messageIDs.length > 0) {
|
|
412
410
|
this.pulseMessages$ = JSON.parse(JSON.stringify(oData.pulse.messages));
|
|
@@ -532,7 +530,7 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
|
|
|
532
530
|
|
|
533
531
|
// If feedAPI is defined then only post message
|
|
534
532
|
if (this.feedAPI) {
|
|
535
|
-
this./* feedAPI. */ postMessage(
|
|
533
|
+
this./* feedAPI. */ postMessage(this.pConn$.getConfigProps().value, this.pulseConversation);
|
|
536
534
|
} else {
|
|
537
535
|
console.log("We don't support Pulse yet");
|
|
538
536
|
}
|
|
@@ -106,7 +106,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
|
|
|
106
106
|
this.createModalButtons();
|
|
107
107
|
|
|
108
108
|
PCore.getPubSubUtils().subscribe(
|
|
109
|
-
|
|
109
|
+
PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
|
|
110
110
|
this.updateSelf.bind(this),
|
|
111
111
|
'caseAttachmentsUpdateFromCaseview'
|
|
112
112
|
);
|
|
@@ -117,10 +117,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
|
|
|
117
117
|
this.angularPConnectData.unsubscribeFn();
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
PCore.getPubSubUtils().unsubscribe(
|
|
121
|
-
(PCore.getEvents().getCaseEvent() as any).CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW,
|
|
122
|
-
'caseAttachmentsUpdateFromCaseview'
|
|
123
|
-
);
|
|
120
|
+
PCore.getPubSubUtils().unsubscribe(PCore.getEvents().getCaseEvent().CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW, 'caseAttachmentsUpdateFromCaseview');
|
|
124
121
|
}
|
|
125
122
|
|
|
126
123
|
// Callback passed when subscribing to store change
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<div class="psdk-todo">
|
|
2
|
-
<div class="psdk-todo-header">
|
|
3
|
-
<div
|
|
2
|
+
<div *ngIf="showTodoList$" class="psdk-todo-header">
|
|
3
|
+
<div class="psdk-avatar">{{ this.currentUserInitials$ }}</div>
|
|
4
4
|
<div id="worklist" class="psdk-todo-text">{{ headerText$ }}</div>
|
|
5
|
-
<div
|
|
5
|
+
<div class="psdk-assignment-count">{{ count }}</div>
|
|
6
6
|
</div>
|
|
7
|
-
<br /><br />
|
|
8
7
|
<div *ngIf="showTodoList$" class="psdk-display-divider"></div>
|
|
9
8
|
|
|
10
9
|
<div class="psdk-todo-assignments">
|
|
@@ -27,7 +26,7 @@
|
|
|
27
26
|
</div>
|
|
28
27
|
</div>
|
|
29
28
|
</div>
|
|
30
|
-
<div class="psdk-todo-assignment-action"
|
|
29
|
+
<div *ngIf="!isConfirm || canPerform" class="psdk-todo-assignment-action">
|
|
31
30
|
<button mat-flat-button color="primary" (click)="clickGo(assignment)">{{ localizedVal('Go', localeCategory) }}</button>
|
|
32
31
|
</div>
|
|
33
32
|
</div>
|
|
@@ -36,7 +35,7 @@
|
|
|
36
35
|
</div>
|
|
37
36
|
</div>
|
|
38
37
|
|
|
39
|
-
<div *ngIf="
|
|
38
|
+
<div *ngIf="count > 3">
|
|
40
39
|
<div *ngIf="bShowMore$; else showLess" class="psdk-todo-show-more">
|
|
41
40
|
<button mat-stroked-button (click)="_showMore()">{{ showMoreLocalizedValue === 'show_more' ? 'Show more' : showMoreLocalizedValue }}</button>
|
|
42
41
|
</div>
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
.psdk-todo-assignments > *:last-child {
|
|
2
|
+
.psdk-display-divider {
|
|
3
|
+
display: none;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.psdk-display-divider {
|
|
2
8
|
border-bottom: 0.0625rem solid var(--app-neutral-light-color);
|
|
9
|
+
margin-block: 0.5rem;
|
|
3
10
|
}
|
|
4
11
|
|
|
5
12
|
.psdk-todo {
|
|
@@ -12,6 +19,7 @@
|
|
|
12
19
|
|
|
13
20
|
.psdk-todo-header {
|
|
14
21
|
display: inline-flex;
|
|
22
|
+
margin-bottom: 1rem;
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
.psdk-todo-text {
|
|
@@ -58,6 +66,7 @@
|
|
|
58
66
|
display: inline-flex;
|
|
59
67
|
width: 100%;
|
|
60
68
|
padding: 0.625rem 0rem;
|
|
69
|
+
align-items: center;
|
|
61
70
|
}
|
|
62
71
|
|
|
63
72
|
.psdk-todo-assignment-data {
|
|
@@ -1,10 +1,54 @@
|
|
|
1
|
-
import { Component, OnInit, Input,
|
|
1
|
+
import { Component, OnInit, Input, OnDestroy } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { MatButtonModule } from '@angular/material/button';
|
|
4
4
|
import { publicConstants } from '@pega/pcore-pconnect-typedefs/constants';
|
|
5
5
|
import { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
6
6
|
import { ErrorMessagesService } from '@pega/angular-sdk-components';
|
|
7
7
|
import { Utils } from '@pega/angular-sdk-components';
|
|
8
|
+
import { updateWorkList } from '@pega/angular-sdk-components';
|
|
9
|
+
|
|
10
|
+
const fetchMyWorkList = (datapage, fields, numberOfRecords, includeTotalCount, context) => {
|
|
11
|
+
return PCore.getDataPageUtils()
|
|
12
|
+
.getDataAsync(
|
|
13
|
+
datapage,
|
|
14
|
+
context,
|
|
15
|
+
{},
|
|
16
|
+
{
|
|
17
|
+
pageNumber: 1,
|
|
18
|
+
pageSize: numberOfRecords
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
select: Object.keys(fields).map(key => ({ field: PCore.getAnnotationUtils().getPropertyName(fields[key]) })),
|
|
22
|
+
sortBy: [
|
|
23
|
+
{ field: 'pxUrgencyAssign', type: 'DESC' },
|
|
24
|
+
{ field: 'pxDeadlineTime', type: 'ASC' },
|
|
25
|
+
{ field: 'pxCreateDateTime', type: 'DESC' }
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
invalidateCache: true,
|
|
30
|
+
additionalApiParams: {
|
|
31
|
+
includeTotalCount
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
.then(response => {
|
|
36
|
+
return {
|
|
37
|
+
...response,
|
|
38
|
+
data: (Array.isArray(response?.data) ? response.data : []).map(row =>
|
|
39
|
+
Object.keys(fields).reduce((obj, key) => {
|
|
40
|
+
obj[key] = row[PCore.getAnnotationUtils().getPropertyName(fields[key])];
|
|
41
|
+
return obj;
|
|
42
|
+
}, {})
|
|
43
|
+
)
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getMappedValue = value => {
|
|
49
|
+
const mappedValue = PCore.getEnvironmentInfo().getKeyMapping(value);
|
|
50
|
+
return mappedValue === null ? value : mappedValue;
|
|
51
|
+
};
|
|
8
52
|
|
|
9
53
|
interface ToDoProps {
|
|
10
54
|
// If any, enter additional props that only exist on this component
|
|
@@ -23,7 +67,7 @@ interface ToDoProps {
|
|
|
23
67
|
standalone: true,
|
|
24
68
|
imports: [CommonModule, MatButtonModule]
|
|
25
69
|
})
|
|
26
|
-
export class TodoComponent implements OnInit, OnDestroy
|
|
70
|
+
export class TodoComponent implements OnInit, OnDestroy {
|
|
27
71
|
@Input() pConn$: typeof PConnect;
|
|
28
72
|
@Input() caseInfoID$: string;
|
|
29
73
|
@Input() datasource$: any;
|
|
@@ -36,9 +80,8 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
36
80
|
@Input() isConfirm;
|
|
37
81
|
|
|
38
82
|
configProps$: ToDoProps;
|
|
39
|
-
currentUser$: string;
|
|
83
|
+
currentUser$: string | undefined;
|
|
40
84
|
currentUserInitials$ = '--';
|
|
41
|
-
assignmentCount$: number;
|
|
42
85
|
bShowMore$ = true;
|
|
43
86
|
arAssignments$: any[];
|
|
44
87
|
assignmentsSource$: any;
|
|
@@ -48,100 +91,66 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
48
91
|
localeCategory = 'Todo';
|
|
49
92
|
showlessLocalizedValue = this.localizedVal('show_less', 'CosmosFields');
|
|
50
93
|
showMoreLocalizedValue = this.localizedVal('show_more', 'CosmosFields');
|
|
51
|
-
|
|
94
|
+
count: number;
|
|
52
95
|
|
|
53
96
|
constructor(
|
|
54
97
|
private psService: ProgressSpinnerService,
|
|
55
98
|
private erService: ErrorMessagesService,
|
|
56
|
-
private ngZone: NgZone,
|
|
57
99
|
private utils: Utils
|
|
58
100
|
) {}
|
|
59
101
|
|
|
60
102
|
ngOnInit() {
|
|
61
103
|
this.CONSTS = PCore.getConstants();
|
|
62
|
-
const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED }
|
|
63
|
-
|
|
64
|
-
PCore.getPubSubUtils().subscribe(
|
|
65
|
-
PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL,
|
|
66
|
-
() => {
|
|
67
|
-
this.updateToDo();
|
|
68
|
-
},
|
|
69
|
-
'updateToDo'
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
PCore.getPubSubUtils().subscribe(
|
|
73
|
-
CREATE_STAGE_SAVED,
|
|
74
|
-
() => {
|
|
75
|
-
this.updateList();
|
|
76
|
-
},
|
|
77
|
-
CREATE_STAGE_SAVED
|
|
78
|
-
);
|
|
104
|
+
const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED } = PCore.getEvents().getCaseEvent();
|
|
79
105
|
|
|
80
|
-
PCore.getPubSubUtils().subscribe(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.updateList();
|
|
84
|
-
},
|
|
85
|
-
CREATE_STAGE_DELETED
|
|
86
|
-
);
|
|
106
|
+
PCore.getPubSubUtils().subscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, () => this.updateToDo(), 'updateToDo');
|
|
107
|
+
PCore.getPubSubUtils().subscribe(CREATE_STAGE_SAVED, () => this.updateList(), CREATE_STAGE_SAVED);
|
|
108
|
+
PCore.getPubSubUtils().subscribe(CREATE_STAGE_DELETED, () => this.updateList(), CREATE_STAGE_DELETED);
|
|
87
109
|
|
|
88
110
|
this.updateToDo();
|
|
89
111
|
}
|
|
90
112
|
|
|
91
113
|
ngOnDestroy() {
|
|
92
|
-
const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED }
|
|
114
|
+
const { CREATE_STAGE_SAVED, CREATE_STAGE_DELETED } = PCore.getEvents().getCaseEvent();
|
|
93
115
|
|
|
94
116
|
PCore.getPubSubUtils().unsubscribe(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL, 'updateToDo');
|
|
95
|
-
|
|
96
117
|
PCore.getPubSubUtils().unsubscribe(CREATE_STAGE_SAVED, CREATE_STAGE_SAVED);
|
|
97
|
-
|
|
98
118
|
PCore.getPubSubUtils().unsubscribe(CREATE_STAGE_DELETED, CREATE_STAGE_DELETED);
|
|
99
119
|
}
|
|
100
120
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (PCore) {
|
|
104
|
-
this.updateToDo();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
updateWorkList(key) {
|
|
109
|
-
PCore.getDataApiUtils()
|
|
110
|
-
// @ts-ignore - 2nd parameter "payload" and 3rd parameter "context" should be optional in getData method
|
|
111
|
-
.getData(key)
|
|
112
|
-
.then(responseData => {
|
|
113
|
-
const dataObject = {};
|
|
114
|
-
dataObject[key] = {
|
|
115
|
-
pxResults: responseData.data.data
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
this.pConn$.updateState(dataObject);
|
|
119
|
-
this.updateToDo();
|
|
120
|
-
})
|
|
121
|
-
.catch(err => {
|
|
122
|
-
console.error(err?.stack);
|
|
123
|
-
});
|
|
121
|
+
get canPerform() {
|
|
122
|
+
return this.assignmentsSource$?.[0]?.canPerform === 'true' || this.assignmentsSource$?.[0]?.canPerform === true;
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
updateList() {
|
|
127
|
-
|
|
126
|
+
const {
|
|
127
|
+
WORK_BASKET: {
|
|
128
|
+
DATA_PAGES: { D__PY_MY_WORK_LIST }
|
|
129
|
+
}
|
|
130
|
+
} = PCore.getConstants();
|
|
131
|
+
updateWorkList(getPConnect, getMappedValue(D__PY_MY_WORK_LIST));
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
updateToDo() {
|
|
131
135
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ToDoProps;
|
|
132
136
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
this.datasource$ = this.configProps$.datasource ? this.configProps$.datasource : this.datasource$;
|
|
138
|
-
this.myWorkList$ = this.configProps$.myWorkList ? this.configProps$.myWorkList : this.myWorkList$;
|
|
137
|
+
this.headerText$ = this.headerText$ || this.configProps$.headerText;
|
|
138
|
+
this.datasource$ = this.datasource$ || this.configProps$.datasource;
|
|
139
|
+
this.myWorkList$ = this.myWorkList$ || this.configProps$.myWorkList;
|
|
139
140
|
|
|
140
141
|
this.assignmentsSource$ = this.datasource$?.source || this.myWorkList$?.source;
|
|
141
142
|
|
|
142
143
|
if (this.showTodoList$) {
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
if (this.assignmentsSource$) {
|
|
145
|
+
this.count = this.assignmentsSource$ ? this.assignmentsSource$.length : 0;
|
|
146
|
+
this.arAssignments$ = this.topThreeAssignments(this.assignmentsSource$);
|
|
147
|
+
} else if (this.myWorkList$.datapage) {
|
|
148
|
+
fetchMyWorkList(this.myWorkList$.datapage, this.pConn$.getComponentConfig()?.myWorkList.fields, 3, true, this.context$).then(responseData => {
|
|
149
|
+
this.deferLoadWorklistItems(responseData);
|
|
150
|
+
});
|
|
151
|
+
} else {
|
|
152
|
+
this.arAssignments$ = [];
|
|
153
|
+
}
|
|
145
154
|
} else {
|
|
146
155
|
// get caseInfoId assignment.
|
|
147
156
|
// eslint-disable-next-line no-lonely-if
|
|
@@ -150,10 +159,13 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
150
159
|
}
|
|
151
160
|
}
|
|
152
161
|
|
|
153
|
-
this.canPerform = this.arAssignments$?.[0]?.canPerform === 'true' || this.arAssignments$?.[0]?.canPerform === true;
|
|
154
|
-
|
|
155
162
|
this.currentUser$ = PCore.getEnvironmentInfo().getOperatorName();
|
|
156
|
-
this.currentUserInitials$ = this.utils.getInitials(this.currentUser$);
|
|
163
|
+
this.currentUserInitials$ = this.utils.getInitials(this.currentUser$ ?? '');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
deferLoadWorklistItems(responseData) {
|
|
167
|
+
this.count = responseData.totalCount;
|
|
168
|
+
this.arAssignments$ = responseData.data;
|
|
157
169
|
}
|
|
158
170
|
|
|
159
171
|
getID(assignment: any) {
|
|
@@ -182,15 +194,6 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
182
194
|
return this.type$ === this.CONSTS.TODO ? assignment.name : assignment.stepName;
|
|
183
195
|
}
|
|
184
196
|
|
|
185
|
-
initAssignments(): any[] {
|
|
186
|
-
if (this.assignmentsSource$) {
|
|
187
|
-
this.assignmentCount$ = this.assignmentsSource$.length;
|
|
188
|
-
return this.topThreeAssignments(this.assignmentsSource$);
|
|
189
|
-
}
|
|
190
|
-
// turn off todolist
|
|
191
|
-
return [];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
197
|
getCaseInfoAssignment(assignmentsSource: any[], caseInfoID: string) {
|
|
195
198
|
const result: any[] = [];
|
|
196
199
|
for (const source of assignmentsSource) {
|
|
@@ -207,18 +210,26 @@ export class TodoComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
207
210
|
}
|
|
208
211
|
|
|
209
212
|
_showMore() {
|
|
210
|
-
this.
|
|
211
|
-
|
|
213
|
+
this.bShowMore$ = false;
|
|
214
|
+
|
|
215
|
+
const { WORKLIST } = PCore.getConstants();
|
|
216
|
+
|
|
217
|
+
if (this.type$ === WORKLIST && this.count && this.count > this.arAssignments$.length && !this.assignmentsSource$) {
|
|
218
|
+
fetchMyWorkList(this.myWorkList$.datapage, this.pConn$.getComponentConfig()?.myWorkList.fields, this.count, false, this.context$).then(
|
|
219
|
+
response => {
|
|
220
|
+
this.arAssignments$ = response.data;
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
} else {
|
|
212
224
|
this.arAssignments$ = this.assignmentsSource$;
|
|
213
|
-
}
|
|
225
|
+
}
|
|
214
226
|
}
|
|
215
227
|
|
|
216
228
|
_showLess() {
|
|
217
|
-
this.
|
|
218
|
-
|
|
229
|
+
this.bShowMore$ = true;
|
|
230
|
+
const { WORKLIST } = PCore.getConstants();
|
|
219
231
|
|
|
220
|
-
|
|
221
|
-
});
|
|
232
|
+
this.arAssignments$ = this.type$ === WORKLIST ? this.arAssignments$.slice(0, 3) : this.topThreeAssignments(this.assignmentsSource$);
|
|
222
233
|
}
|
|
223
234
|
|
|
224
235
|
isChildCase(assignment) {
|