@pega/angular-sdk-overrides 25.1.12 → 26.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/alert/alert.component.html +4 -1
- package/lib/designSystemExtension/alert/alert.component.scss +9 -10
- package/lib/designSystemExtension/alert/alert.component.ts +6 -2
- package/lib/designSystemExtension/field-group/field-group.component.ts +11 -3
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +51 -36
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +12 -0
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +11 -0
- package/lib/designSystemExtension/operator/operator.component.html +5 -3
- package/lib/designSystemExtension/operator/operator.component.scss +7 -0
- package/lib/designSystemExtension/operator/operator.component.ts +2 -1
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.html +100 -10
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +141 -1
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.spec.ts +1 -1
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +240 -72
- package/lib/field/auto-complete/auto-complete.component.html +46 -5
- package/lib/field/auto-complete/auto-complete.component.scss +92 -0
- package/lib/field/auto-complete/auto-complete.component.ts +350 -23
- package/lib/field/cancel-alert/cancel-alert.component.ts +38 -15
- package/lib/field/check-box/check-box.component.html +8 -6
- package/lib/field/check-box/check-box.component.ts +9 -2
- package/lib/field/currency/currency.component.html +2 -1
- package/lib/field/currency/currency.component.ts +10 -1
- package/lib/field/date/date.component.html +2 -1
- package/lib/field/date/date.component.ts +2 -0
- package/lib/field/date-time/date-time.component.html +2 -1
- package/lib/field/date-time/date-time.component.scss +46 -40
- package/lib/field/date-time/date-time.component.ts +29 -0
- package/lib/field/decimal/decimal.component.html +2 -1
- package/lib/field/decimal/decimal.component.ts +2 -0
- package/lib/field/dropdown/dropdown.component.html +4 -1
- package/lib/field/dropdown/dropdown.component.ts +18 -19
- package/lib/field/email/email.component.html +2 -1
- package/lib/field/email/email.component.ts +2 -2
- package/lib/field/embedded-data-multi/embedded-data-multi.component.html +3 -0
- package/lib/field/embedded-data-multi/embedded-data-multi.component.scss +0 -0
- package/lib/field/embedded-data-multi/embedded-data-multi.component.ts +173 -0
- package/lib/field/field.base.ts +27 -1
- package/lib/field/group/group.component.html +1 -1
- package/lib/field/group/group.component.ts +16 -7
- package/lib/field/integer/integer.component.html +2 -1
- package/lib/field/integer/integer.component.ts +4 -2
- package/lib/field/location/location.component.html +2 -1
- package/lib/field/location/location.component.ts +3 -1
- package/lib/field/multiselect/multiselect.component.html +1 -1
- package/lib/field/multiselect/multiselect.component.ts +23 -4
- package/lib/field/multiselect/utils.ts +5 -3
- package/lib/field/object-reference/object-reference.component.html +30 -15
- package/lib/field/object-reference/object-reference.component.ts +818 -94
- package/lib/field/percentage/percentage.component.html +2 -1
- package/lib/field/percentage/percentage.component.ts +10 -1
- package/lib/field/phone/phone.component.html +2 -1
- package/lib/field/phone/phone.component.ts +2 -1
- package/lib/field/radio-buttons/radio-buttons.component.html +2 -1
- package/lib/field/radio-buttons/radio-buttons.component.ts +10 -1
- package/lib/field/rich-text/rich-text.component.scss +1 -166
- package/lib/field/rich-text/rich-text.component.spec.ts +1 -1
- package/lib/field/rich-text/rich-text.component.ts +1 -1
- package/lib/field/selectable-card/selectable-card.component.html +1 -0
- package/lib/field/selectable-card/selectable-card.component.ts +31 -16
- package/lib/field/semantic-link/semantic-link.component.html +1 -1
- package/lib/field/semantic-link/semantic-link.component.scss +4 -0
- package/lib/field/semantic-link/semantic-link.component.ts +13 -7
- package/lib/field/text-area/text-area.component.html +2 -1
- package/lib/field/text-area/text-area.component.ts +2 -1
- package/lib/field/text-input/text-input.component.html +2 -1
- package/lib/field/text-input/text-input.component.ts +2 -1
- package/lib/field/time/time.component.html +2 -1
- package/lib/field/time/time.component.ts +2 -1
- package/lib/field/url/url.component.html +2 -1
- package/lib/field/url/url.component.ts +2 -1
- package/lib/field/user-reference/user-reference.component.html +4 -2
- package/lib/field/user-reference/user-reference.component.ts +11 -6
- package/lib/infra/Containers/flow-container/flow-container.component.html +2 -2
- package/lib/infra/Containers/flow-container/flow-container.component.ts +34 -42
- package/lib/infra/Containers/modal-view-container/data-view-action-buttons/data-view-action-buttons.component.html +12 -0
- package/lib/infra/Containers/modal-view-container/data-view-action-buttons/data-view-action-buttons.component.spec.ts +130 -0
- package/lib/infra/Containers/modal-view-container/data-view-action-buttons/data-view-action-buttons.component.ts +77 -0
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +35 -8
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +185 -196
- package/lib/infra/Containers/view-container/view-container.component.html +1 -1
- package/lib/infra/Containers/view-container/view-container.component.ts +36 -43
- package/lib/infra/assignment/assignment.component.html +2 -1
- package/lib/infra/assignment/assignment.component.ts +44 -22
- package/lib/infra/assignment-card/assignment-card.component.html +1 -0
- package/lib/infra/assignment-card/assignment-card.component.ts +2 -8
- package/lib/infra/defer-load/defer-load.component.ts +7 -5
- package/lib/infra/multi-step/multi-step.component.html +25 -33
- package/lib/infra/multi-step/multi-step.component.scss +67 -125
- package/lib/infra/multi-step/multi-step.component.ts +11 -0
- package/lib/infra/navbar/navbar.component.ts +33 -36
- package/lib/infra/reference/reference.component.html +7 -1
- package/lib/infra/reference/reference.component.ts +63 -109
- package/lib/infra/region/region.component.ts +1 -3
- package/lib/infra/root-container/root-container.component.html +1 -0
- package/lib/infra/root-container/root-container.component.ts +34 -42
- package/lib/infra/view/view.component.ts +22 -46
- package/lib/template/advanced-search/advanced-search.component.ts +0 -1
- package/lib/template/advanced-search/search-groups/search-groups.component.ts +2 -3
- package/lib/template/app-shell/app-shell.component.ts +13 -13
- package/lib/template/banner-page/banner-page.component.ts +1 -2
- package/lib/template/base/details-template-base.ts +41 -14
- package/lib/template/base/form-template-base.ts +0 -2
- package/lib/template/case-summary/case-summary.component.ts +15 -7
- package/lib/template/case-view/case-view.component.html +14 -2
- package/lib/template/case-view/case-view.component.spec.ts +119 -10
- package/lib/template/case-view/case-view.component.ts +52 -3
- package/lib/template/data-reference/data-reference.component.ts +29 -22
- package/lib/template/data-reference/search-form/search-form.component.html +1 -1
- package/lib/template/data-reference/search-form/search-form.component.ts +9 -1
- package/lib/template/data-reference/search-form/tabsData.ts +0 -1
- package/lib/template/default-form/default-form.component.html +20 -4
- package/lib/template/default-form/default-form.component.ts +14 -5
- package/lib/template/default-page/default-page.component.ts +1 -2
- package/lib/template/details/details.component.html +23 -3
- package/lib/template/details/details.component.scss +9 -2
- package/lib/template/details/details.component.ts +3 -70
- package/lib/template/details-narrow-wide/details-narrow-wide.component.html +21 -2
- package/lib/template/details-narrow-wide/details-narrow-wide.component.scss +8 -1
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +3 -39
- package/lib/template/details-one-column/details-one-column.component.html +23 -1
- package/lib/template/details-one-column/details-one-column.component.scss +14 -0
- package/lib/template/details-one-column/details-one-column.component.ts +3 -40
- package/lib/template/details-three-column/details-three-column.component.html +21 -2
- package/lib/template/details-three-column/details-three-column.component.scss +8 -1
- package/lib/template/details-three-column/details-three-column.component.ts +3 -48
- package/lib/template/details-two-column/details-two-column.component.html +21 -2
- package/lib/template/details-two-column/details-two-column.component.scss +8 -1
- package/lib/template/details-two-column/details-two-column.component.ts +3 -46
- package/lib/template/details-wide-narrow/details-wide-narrow.component.html +21 -2
- package/lib/template/details-wide-narrow/details-wide-narrow.component.scss +8 -1
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +3 -43
- package/lib/template/dynamic-tabs/dynamic-tabs.component.html +1 -0
- package/lib/template/field-group-template/field-group-template.component.ts +19 -6
- package/lib/template/field-value-list/field-value-list.component.scss +17 -0
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -10
- package/lib/template/list-view/list-view.component.ts +47 -11
- package/lib/template/one-column/one-column.component.html +3 -0
- package/lib/template/one-column-tab/one-column-tab.component.html +1 -0
- package/lib/template/page/page.component.html +1 -0
- package/lib/template/self-service-case-view/self-service-case-view.component.html +13 -1
- package/lib/template/self-service-case-view/self-service-case-view.component.spec.ts +96 -11
- package/lib/template/self-service-case-view/self-service-case-view.component.ts +52 -3
- package/lib/template/simple-table/simple-table.component.ts +11 -1
- package/lib/template/simple-table-manual/helpers.ts +84 -16
- package/lib/template/simple-table-manual/simple-table-manual.component.html +30 -14
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +8 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +142 -46
- package/lib/template/single-reference-readonly/single-reference-readonly.component.html +0 -0
- package/lib/template/single-reference-readonly/single-reference-readonly.component.scss +2 -3
- package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +7 -8
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +0 -3
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +19 -21
- package/lib/widget/attachment/AttachmentUtils.ts +19 -11
- package/lib/widget/attachment/attachment.component.html +16 -6
- package/lib/widget/attachment/attachment.component.ts +14 -4
- package/lib/widget/case-history/case-history.component.ts +6 -2
- package/lib/widget/feed-container/feed-container.component.ts +1 -199
- package/lib/widget/file-utility/file-utility.component.ts +26 -30
- package/lib/widget/todo/todo.component.ts +7 -2
- package/package.json +2 -2
- package/lib/designSystemExtension/material-details/material-details.component.html +0 -40
- package/lib/designSystemExtension/material-details/material-details.component.scss +0 -116
- package/lib/designSystemExtension/material-details/material-details.component.spec.ts +0 -24
- package/lib/designSystemExtension/material-details/material-details.component.ts +0 -31
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +0 -29
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.scss +0 -34
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.spec.ts +0 -22
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +0 -37
|
File without changes
|
|
@@ -14,7 +14,7 @@ import { getDataRelationshipContextFromKey } from '@pega/angular-sdk-components'
|
|
|
14
14
|
export class SingleReferenceReadonlyComponent implements OnInit, OnDestroy {
|
|
15
15
|
@Input() pConn$: typeof PConnect;
|
|
16
16
|
@Input() formGroup$: FormGroup;
|
|
17
|
-
@Input() dataRelationshipContext
|
|
17
|
+
@Input() dataRelationshipContext: any = null;
|
|
18
18
|
|
|
19
19
|
angularPConnectData: AngularPConnectData = {};
|
|
20
20
|
configProps: any;
|
|
@@ -58,17 +58,16 @@ export class SingleReferenceReadonlyComponent implements OnInit, OnDestroy {
|
|
|
58
58
|
const rawViewMetadata = this.pConn$.getRawMetadata();
|
|
59
59
|
const label = this.configProps.label;
|
|
60
60
|
const showLabel = this.configProps.showLabel;
|
|
61
|
-
const
|
|
62
|
-
const
|
|
61
|
+
const inheritedProps = this.pConn$.getInheritedProps();
|
|
62
|
+
const propsToUse = { label: label || inheritedProps['label'], showLabel: inheritedProps['showLabel'] || showLabel };
|
|
63
|
+
const type = (rawViewMetadata?.config as any)?.componentType ?? rawViewMetadata?.type;
|
|
63
64
|
this.displayMode = this.configProps.displayMode;
|
|
64
65
|
const targetObjectType = this.configProps.targetObjectType;
|
|
65
66
|
const referenceType = targetObjectType === 'case' ? 'Case' : 'Data';
|
|
66
67
|
const hideLabel = this.configProps.hideLabel;
|
|
67
|
-
// const additionalFields = this.configProps.additionalFields;
|
|
68
68
|
const displayAs = this.configProps.displayAs ?? 'readonly';
|
|
69
|
-
const dataRelationshipContext =
|
|
70
|
-
|
|
71
|
-
: this.dataRelationshipContext;
|
|
69
|
+
const dataRelationshipContext =
|
|
70
|
+
this.dataRelationshipContext ?? getDataRelationshipContextFromKey((rawViewMetadata?.config as any)?.displayField ?? '');
|
|
72
71
|
if (propsToUse.showLabel === false) {
|
|
73
72
|
propsToUse.label = '';
|
|
74
73
|
}
|
|
@@ -77,7 +76,7 @@ export class SingleReferenceReadonlyComponent implements OnInit, OnDestroy {
|
|
|
77
76
|
const editableComponents = ['AutoComplete', 'SimpleTableSelect', 'Dropdown', 'RadioButtons'];
|
|
78
77
|
const config: any = {
|
|
79
78
|
...rawViewMetadata?.config,
|
|
80
|
-
primaryField: (rawViewMetadata?.config as any)?.displayField,
|
|
79
|
+
primaryField: (rawViewMetadata?.config as any)?.displayField ?? (rawViewMetadata?.config as any)?.primaryField,
|
|
81
80
|
label: this.label
|
|
82
81
|
};
|
|
83
82
|
|
|
@@ -22,9 +22,6 @@ export class WideNarrowPageComponent implements OnInit, OnDestroy {
|
|
|
22
22
|
constructor(private angularPConnect: AngularPConnectService) {}
|
|
23
23
|
|
|
24
24
|
ngOnInit(): void {
|
|
25
|
-
// normalize the pConn$ in case the incoming pConn$ is a 'reference'
|
|
26
|
-
// this.pConn$ = ReferenceComponent.normalizePConn(this.pConn$);
|
|
27
|
-
|
|
28
25
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
29
26
|
|
|
30
27
|
// this.updateSelf();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectorRef, Component, Input,
|
|
1
|
+
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { MatMenuModule } from '@angular/material/menu';
|
|
4
4
|
import { MatListModule } from '@angular/material/list';
|
|
@@ -27,7 +27,7 @@ export class WssNavBarComponent implements OnInit, OnDestroy {
|
|
|
27
27
|
@Input() pages$: any[];
|
|
28
28
|
@Input() caseTypes$: any[];
|
|
29
29
|
@Input() homePage: any;
|
|
30
|
-
@Input() portalLogoImage$: string;
|
|
30
|
+
@Input() portalLogoImage$: string | Blob | null;
|
|
31
31
|
|
|
32
32
|
// For interaction with AngularPConnect
|
|
33
33
|
angularPConnectData: AngularPConnectData = {};
|
|
@@ -52,7 +52,6 @@ export class WssNavBarComponent implements OnInit, OnDestroy {
|
|
|
52
52
|
private angularPConnect: AngularPConnectService,
|
|
53
53
|
private cdRef: ChangeDetectorRef,
|
|
54
54
|
private psService: ProgressSpinnerService,
|
|
55
|
-
private ngZone: NgZone,
|
|
56
55
|
private utils: Utils
|
|
57
56
|
) {}
|
|
58
57
|
|
|
@@ -102,30 +101,29 @@ export class WssNavBarComponent implements OnInit, OnDestroy {
|
|
|
102
101
|
}
|
|
103
102
|
|
|
104
103
|
initComponent() {
|
|
105
|
-
this.
|
|
106
|
-
|
|
107
|
-
this.navExpandCollapse$ = this.utils.getImageSrc('plus', this.utils.getSDKStaticContentUrl());
|
|
104
|
+
this.navIcon$ = this.utils.getSDKStaticContentUrl().concat('assets/pzpega-logo-mark.svg');
|
|
105
|
+
this.navExpandCollapse$ = this.utils.getImageSrc('plus', this.utils.getSDKStaticContentUrl());
|
|
108
106
|
|
|
109
|
-
|
|
107
|
+
// Then, continue on with other initialization
|
|
110
108
|
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
// making a copy, so can add info
|
|
110
|
+
this.navPages$ = JSON.parse(JSON.stringify(this.pages$));
|
|
113
111
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
this.navPages$.forEach(page => {
|
|
113
|
+
page.iconName = this.utils.getImageSrc(page.pxPageViewIcon, this.utils.getSDKStaticContentUrl());
|
|
114
|
+
});
|
|
117
115
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
this.actionsAPI = this.pConn$.getActionsApi();
|
|
117
|
+
this.createWork = this.actionsAPI.createWork.bind(this.actionsAPI);
|
|
118
|
+
this.showPage = this.actionsAPI.showPage.bind(this.actionsAPI);
|
|
119
|
+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as WssNavBarProps;
|
|
120
|
+
this.logout = this.actionsAPI.logout.bind(this.actionsAPI);
|
|
123
121
|
|
|
124
|
-
|
|
122
|
+
// const oData = this.pConn$.getDataObject();
|
|
125
123
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
this.portalOperator$ = PCore.getEnvironmentInfo().getOperatorName();
|
|
125
|
+
this.portalOperatorInitials$ = this.utils.getInitials(this.portalOperator$ ?? '');
|
|
126
|
+
this.cdRef.markForCheck();
|
|
129
127
|
}
|
|
130
128
|
|
|
131
129
|
navPanelButtonClick(oPageData: any) {
|
|
@@ -49,7 +49,7 @@ export const fileDownloadVar = (content: { data: string; headers: Record<string,
|
|
|
49
49
|
if (!/^(http|https):\/\//.test(data)) {
|
|
50
50
|
data = `//${data}`;
|
|
51
51
|
}
|
|
52
|
-
window.open(
|
|
52
|
+
window.open(data, '_blank');
|
|
53
53
|
} else if (type === 'EMAIL') {
|
|
54
54
|
// Temp Fix: for EMAIL type attachment
|
|
55
55
|
fileDownload(content.data, name, 'html', content.headers);
|
|
@@ -270,18 +270,26 @@ export const onFileDownload = (responseProps, context) => {
|
|
|
270
270
|
|
|
271
271
|
// Prepares new structure as per Cosmos component
|
|
272
272
|
export const transformAttachments = attachments => {
|
|
273
|
-
const transformedFiles = [...attachments];
|
|
274
273
|
let deleteIndex = -1;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
attachment.responseProps.
|
|
280
|
-
|
|
274
|
+
|
|
275
|
+
return attachments.map(attachment => {
|
|
276
|
+
const props = {
|
|
277
|
+
...attachment.props,
|
|
278
|
+
id: attachment.responseProps.ID,
|
|
279
|
+
format: attachment.props.name.split('.').pop()
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
if (!props.error) {
|
|
281
283
|
deleteIndex += 1;
|
|
282
|
-
attachment.responseProps.deleteIndex = deleteIndex;
|
|
283
284
|
}
|
|
284
|
-
});
|
|
285
285
|
|
|
286
|
-
|
|
286
|
+
return {
|
|
287
|
+
...attachment,
|
|
288
|
+
props,
|
|
289
|
+
responseProps: {
|
|
290
|
+
...attachment.responseProps,
|
|
291
|
+
deleteIndex
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
});
|
|
287
295
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="file-upload-container" *ngIf="bVisible$">
|
|
2
2
|
<span class="attachment-label" [ngClass]="{ 'file-label': bRequired$ }">{{ label$ }}</span>
|
|
3
|
-
<div *ngIf="(files.length === 0 && !allowMultiple$) || allowMultiple$">
|
|
3
|
+
<div *ngIf="displayMode !== 'DISPLAY_ONLY' && ((files.length === 0 && !allowMultiple$) || allowMultiple$)">
|
|
4
4
|
<div
|
|
5
5
|
style="margin-bottom: 10px"
|
|
6
6
|
id="attachment-container"
|
|
@@ -36,18 +36,28 @@
|
|
|
36
36
|
<div *ngIf="file.props.meta" [ngStyle]="{ color: file.props.error ? 'red' : null }">{{ file.props.meta }}</div>
|
|
37
37
|
</div>
|
|
38
38
|
<div class="psdk-attachment-action">
|
|
39
|
-
<
|
|
40
|
-
<img class="psdk-utility-card-action-svg-icon" src="{{ deleteIcon }}" />
|
|
41
|
-
</button>
|
|
42
|
-
<div *ngIf="!file.ID">
|
|
39
|
+
<div *ngIf="displayMode === 'DISPLAY_ONLY'; else editableActions">
|
|
43
40
|
<button id="setting-button" mat-icon-button [matMenuTriggerFor]="actionMenu">
|
|
44
41
|
<mat-icon>more_vert</mat-icon>
|
|
45
42
|
</button>
|
|
46
43
|
<mat-menu #actionMenu="matMenu">
|
|
47
44
|
<button mat-menu-item (click)="downloadFile(file.responseProps ? file.responseProps : {})">Download</button>
|
|
48
|
-
<button mat-menu-item (click)="deleteFile(file, i)">Delete</button>
|
|
49
45
|
</mat-menu>
|
|
50
46
|
</div>
|
|
47
|
+
<ng-template #editableActions>
|
|
48
|
+
<button id="delete-attachment" *ngIf="file.ID" class="psdk-utility-button" (click)="deleteFile(file, i)">
|
|
49
|
+
<img class="psdk-utility-card-action-svg-icon" src="{{ deleteIcon }}" />
|
|
50
|
+
</button>
|
|
51
|
+
<div *ngIf="!file.ID">
|
|
52
|
+
<button id="setting-button" mat-icon-button [matMenuTriggerFor]="actionMenu">
|
|
53
|
+
<mat-icon>more_vert</mat-icon>
|
|
54
|
+
</button>
|
|
55
|
+
<mat-menu #actionMenu="matMenu">
|
|
56
|
+
<button mat-menu-item (click)="downloadFile(file.responseProps ? file.responseProps : {})">Download</button>
|
|
57
|
+
<button mat-menu-item (click)="deleteFile(file, i)">Delete</button>
|
|
58
|
+
</mat-menu>
|
|
59
|
+
</div>
|
|
60
|
+
</ng-template>
|
|
51
61
|
</div>
|
|
52
62
|
</div>
|
|
53
63
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, OnInit, Input, OnDestroy, ViewChild, ElementRef } from '@angular/core';
|
|
1
|
+
import { ChangeDetectorRef, Component, OnInit, Input, OnDestroy, ViewChild, ElementRef } from '@angular/core';
|
|
2
2
|
import { FormGroup } from '@angular/forms';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -76,7 +76,8 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
76
76
|
|
|
77
77
|
constructor(
|
|
78
78
|
private angularPConnect: AngularPConnectService,
|
|
79
|
-
private utils: Utils
|
|
79
|
+
private utils: Utils,
|
|
80
|
+
private cdRef: ChangeDetectorRef
|
|
80
81
|
) {}
|
|
81
82
|
|
|
82
83
|
ngOnInit(): void {
|
|
@@ -96,6 +97,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
96
97
|
PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,
|
|
97
98
|
() => {
|
|
98
99
|
this.overrideLocalState = true;
|
|
100
|
+
this.cdRef.markForCheck();
|
|
99
101
|
},
|
|
100
102
|
this.caseID
|
|
101
103
|
);
|
|
@@ -192,8 +194,8 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
192
194
|
error: errorFile.props.error || null
|
|
193
195
|
};
|
|
194
196
|
});
|
|
195
|
-
let key
|
|
196
|
-
let updatedAttachments: any
|
|
197
|
+
let key: string;
|
|
198
|
+
let updatedAttachments: any;
|
|
197
199
|
if (this.allowMultiple$ || this.isOldAttachment) {
|
|
198
200
|
key = this.isOldAttachment ? `${this.valueRef}.pxResults` : this.valueRef;
|
|
199
201
|
const existingAttachments = PCore.getStoreValue(`.${key}`, this.pConn$.getPageReference(), this.pConn$.getContextName()) || [];
|
|
@@ -207,6 +209,13 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
207
209
|
isArrayDeepMerge: false,
|
|
208
210
|
removePropertyFromChangedList: true
|
|
209
211
|
});
|
|
212
|
+
} else if (this.filesWithError.length === 0) {
|
|
213
|
+
const hasActiveUpload = this.files.some(file => file.inProgress);
|
|
214
|
+
if (!hasActiveUpload) {
|
|
215
|
+
this.files = transformAttachments(this.attachments);
|
|
216
|
+
this.attachmentCount = this.attachments.length;
|
|
217
|
+
this.filesWithError = [];
|
|
218
|
+
}
|
|
210
219
|
}
|
|
211
220
|
}
|
|
212
221
|
}
|
|
@@ -336,6 +345,7 @@ export class AttachmentComponent implements OnInit, OnDestroy {
|
|
|
336
345
|
}
|
|
337
346
|
return localFile;
|
|
338
347
|
});
|
|
348
|
+
this.cdRef.markForCheck();
|
|
339
349
|
}
|
|
340
350
|
|
|
341
351
|
populateErrorAndUpdateRedux(file) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, OnInit, Input } from '@angular/core';
|
|
1
|
+
import { ChangeDetectorRef, Component, OnInit, Input } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
4
4
|
import { Utils } from '@pega/angular-sdk-components';
|
|
@@ -23,7 +23,10 @@ export class CaseHistoryComponent implements OnInit {
|
|
|
23
23
|
displayedColumns$ = Array<any>();
|
|
24
24
|
waitingForData = false;
|
|
25
25
|
|
|
26
|
-
constructor(
|
|
26
|
+
constructor(
|
|
27
|
+
private utils: Utils,
|
|
28
|
+
private cdRef: ChangeDetectorRef
|
|
29
|
+
) {}
|
|
27
30
|
|
|
28
31
|
ngOnInit(): void {
|
|
29
32
|
this.configProps$ = this.pConn$.getConfigProps();
|
|
@@ -54,6 +57,7 @@ export class CaseHistoryComponent implements OnInit {
|
|
|
54
57
|
this.repeatList$ = new MatTableDataSource(tableDataResults);
|
|
55
58
|
|
|
56
59
|
this.waitingForData = false;
|
|
60
|
+
this.cdRef.markForCheck();
|
|
57
61
|
});
|
|
58
62
|
}
|
|
59
63
|
// This method isn't being used anywhere, keeping it as a reference for now
|
|
@@ -156,204 +156,6 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
|
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
/*
|
|
160
|
-
|
|
161
|
-
const { getPConnect, messageIDs } = props;
|
|
162
|
-
const [mentionResults, setMentionResults] = useState([]);
|
|
163
|
-
const [tagResults, setTagResults] = useState([]);
|
|
164
|
-
const [attachments, setAttachments] = useState([]);
|
|
165
|
-
const [feedFilters, setFeedFilters] = useState();
|
|
166
|
-
const {
|
|
167
|
-
fetchMessages,
|
|
168
|
-
postMessage,
|
|
169
|
-
getMentionSuggestions,
|
|
170
|
-
getTagSuggestions
|
|
171
|
-
} = FeedApi(getPConnect());
|
|
172
|
-
const appName = PCore.getEnvironmentInfo().getApplicationName();
|
|
173
|
-
let value = "";
|
|
174
|
-
let feedID = "";
|
|
175
|
-
let feedClass = "";
|
|
176
|
-
if (getPConnect().getCaseSummary().ID) {
|
|
177
|
-
value = getPConnect().getCaseSummary().ID;
|
|
178
|
-
feedID = "pyCaseFeed";
|
|
179
|
-
feedClass = getPConnect().getCaseSummary().content.classID;
|
|
180
|
-
} else {
|
|
181
|
-
value = `DATA-PORTAL $${appName}`;
|
|
182
|
-
feedID = "pyDashboardFeed";
|
|
183
|
-
feedClass = "@baseclass";
|
|
184
|
-
}
|
|
185
|
-
// For cancelling fetchrequest for filetrs
|
|
186
|
-
const fetchMessagesCancelTokenSource = useRef([]);
|
|
187
|
-
|
|
188
|
-
useEffect(() => {
|
|
189
|
-
fetchMessages(
|
|
190
|
-
value,
|
|
191
|
-
feedID,
|
|
192
|
-
feedClass,
|
|
193
|
-
null,
|
|
194
|
-
fetchMessagesCancelTokenSource.current
|
|
195
|
-
).then((res) => {
|
|
196
|
-
setFeedFilters(res);
|
|
197
|
-
});
|
|
198
|
-
PCore.getAssetLoader().getLoader("component-loader")(["Activity"]);
|
|
199
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
200
|
-
}, []);
|
|
201
|
-
|
|
202
|
-
const onUploadProgress = useCallback((file) => {
|
|
203
|
-
return ({ loaded, total }) => {
|
|
204
|
-
file.progress = Math.floor((loaded / total) * 100);
|
|
205
|
-
setAttachments((current) => {
|
|
206
|
-
return current.map((currFile) => {
|
|
207
|
-
return currFile.name === file.name ? file : currFile;
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
};
|
|
211
|
-
}, []);
|
|
212
|
-
|
|
213
|
-
const errorHandler = useCallback((isFetchCanceled, file) => {
|
|
214
|
-
return (error) => {
|
|
215
|
-
if (!isFetchCanceled(error)) {
|
|
216
|
-
let localizedValue = "Upload failed";
|
|
217
|
-
if (
|
|
218
|
-
error.response &&
|
|
219
|
-
error.response.data &&
|
|
220
|
-
error.response.data.errorDetails
|
|
221
|
-
) {
|
|
222
|
-
localizedValue = error.response.data.errorDetails[0].localizedValue;
|
|
223
|
-
}
|
|
224
|
-
delete file.progress;
|
|
225
|
-
setAttachments((current) => {
|
|
226
|
-
return current.map((currFile) => {
|
|
227
|
-
if (currFile.name === file.name) {
|
|
228
|
-
currFile.meta = localizedValue;
|
|
229
|
-
currFile.error = true;
|
|
230
|
-
}
|
|
231
|
-
return currFile;
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
error.isHandled = true;
|
|
235
|
-
}
|
|
236
|
-
throw error;
|
|
237
|
-
};
|
|
238
|
-
}, []);
|
|
239
|
-
|
|
240
|
-
const postComment = ({ value: message, clear }) => {
|
|
241
|
-
const attachmentIDs = [];
|
|
242
|
-
const attachmentUtils = PCore.getAttachmentUtils();
|
|
243
|
-
if (attachments && !!attachments.length) {
|
|
244
|
-
attachments
|
|
245
|
-
.filter((file) => !file.error)
|
|
246
|
-
.map((file) => {
|
|
247
|
-
return attachmentUtils
|
|
248
|
-
.uploadAttachment(file, onUploadProgress, errorHandler)
|
|
249
|
-
.then((fileResponse) => {
|
|
250
|
-
const fileConfig = {
|
|
251
|
-
type: "File",
|
|
252
|
-
category: "File",
|
|
253
|
-
fileName: file.name,
|
|
254
|
-
ID: fileResponse.data.ID
|
|
255
|
-
};
|
|
256
|
-
attachmentIDs.push(fileConfig);
|
|
257
|
-
if (attachments.length === attachmentIDs.length) {
|
|
258
|
-
postMessage(
|
|
259
|
-
value,
|
|
260
|
-
transformMarkdownToMsg(message),
|
|
261
|
-
attachmentIDs
|
|
262
|
-
);
|
|
263
|
-
clear();
|
|
264
|
-
setAttachments([]);
|
|
265
|
-
}
|
|
266
|
-
})
|
|
267
|
-
|
|
268
|
-
.catch(console.error);
|
|
269
|
-
});
|
|
270
|
-
} else {
|
|
271
|
-
postMessage(value, transformMarkdownToMsg(message));
|
|
272
|
-
clear();
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
*/
|
|
277
|
-
|
|
278
|
-
/* On search is called when @ character is entered and will display the mention */
|
|
279
|
-
|
|
280
|
-
/*
|
|
281
|
-
const onSearch = debounce((event) => {
|
|
282
|
-
if (event.type === "mention") {
|
|
283
|
-
getMentionSuggestions({
|
|
284
|
-
pulseContext: value,
|
|
285
|
-
searchFor: event.search
|
|
286
|
-
}).then((res) => {
|
|
287
|
-
setMentionResults(res);
|
|
288
|
-
});
|
|
289
|
-
} else {
|
|
290
|
-
getTagSuggestions({
|
|
291
|
-
searchFor: event.search
|
|
292
|
-
}).then((res) => {
|
|
293
|
-
setTagResults(res);
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
}, 150);
|
|
297
|
-
|
|
298
|
-
const userName = getPConnect().getEnvironmentInfo().getOperatorName();
|
|
299
|
-
const imageKey = getPConnect().getEnvironmentInfo().getOperatorImageInsKey();
|
|
300
|
-
|
|
301
|
-
const onFilesAdded = useCallback((newlyAddedFiles) => {
|
|
302
|
-
setAttachments((current) => [
|
|
303
|
-
...newlyAddedFiles.map((file) => {
|
|
304
|
-
if (!validateMaxSize(file, 5)) {
|
|
305
|
-
file.error = true;
|
|
306
|
-
file.meta = "File is too big. Max allowed size is 5MB.";
|
|
307
|
-
}
|
|
308
|
-
file.icon = getIconFromFileType(file.type);
|
|
309
|
-
file.onDelete = () => {
|
|
310
|
-
setAttachments((c) => c.filter((f) => f.name !== file.name));
|
|
311
|
-
};
|
|
312
|
-
return file;
|
|
313
|
-
}),
|
|
314
|
-
...current
|
|
315
|
-
]);
|
|
316
|
-
}, []);
|
|
317
|
-
|
|
318
|
-
const onFilterChange = useCallback(
|
|
319
|
-
(filterID) => {
|
|
320
|
-
const updatedFilters = [...feedFilters];
|
|
321
|
-
const filterToUpdate = updatedFilters.find(
|
|
322
|
-
(feedItem) => feedItem.id === filterID
|
|
323
|
-
);
|
|
324
|
-
filterToUpdate.on = !filterToUpdate.on;
|
|
325
|
-
if (filterID === "All")
|
|
326
|
-
updatedFilters.forEach((feedFilter) => {
|
|
327
|
-
feedFilter.on = filterToUpdate.on;
|
|
328
|
-
});
|
|
329
|
-
else if (
|
|
330
|
-
updatedFilters.find(
|
|
331
|
-
(feedItem) => feedItem.on === false && feedItem.id !== "All"
|
|
332
|
-
)
|
|
333
|
-
)
|
|
334
|
-
updatedFilters.find((feedItem) => feedItem.id === "All").on = false;
|
|
335
|
-
else updatedFilters.find((feedItem) => feedItem.id === "All").on = true;
|
|
336
|
-
setFeedFilters(updatedFilters);
|
|
337
|
-
fetchMessages(
|
|
338
|
-
value,
|
|
339
|
-
feedID,
|
|
340
|
-
feedClass,
|
|
341
|
-
feedFilters,
|
|
342
|
-
fetchMessagesCancelTokenSource.current
|
|
343
|
-
);
|
|
344
|
-
},
|
|
345
|
-
[
|
|
346
|
-
value,
|
|
347
|
-
feedID,
|
|
348
|
-
feedClass,
|
|
349
|
-
feedFilters,
|
|
350
|
-
fetchMessagesCancelTokenSource,
|
|
351
|
-
fetchMessages
|
|
352
|
-
]
|
|
353
|
-
);
|
|
354
|
-
|
|
355
|
-
*/
|
|
356
|
-
|
|
357
159
|
// set up svg images
|
|
358
160
|
this.svgComment$ = this.utils.getImageSrc('chat', this.utils.getSDKStaticContentUrl());
|
|
359
161
|
this.svgLike$ = this.utils.getImageSrc('thumbs-up', this.utils.getSDKStaticContentUrl());
|
|
@@ -545,7 +347,7 @@ export class FeedContainerComponent implements OnInit, OnDestroy {
|
|
|
545
347
|
}
|
|
546
348
|
|
|
547
349
|
likeClick(messageID: string, rMessageID: string, bLikedByMe: boolean, level: string) {
|
|
548
|
-
let pulseMessage
|
|
350
|
+
let pulseMessage: object;
|
|
549
351
|
|
|
550
352
|
if (level === 'top') {
|
|
551
353
|
pulseMessage = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, OnInit, Input,
|
|
1
|
+
import { ChangeDetectorRef, Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { MatButtonModule } from '@angular/material/button';
|
|
4
4
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -74,7 +74,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
|
|
|
74
74
|
constructor(
|
|
75
75
|
private angularPConnect: AngularPConnectService,
|
|
76
76
|
private utils: Utils,
|
|
77
|
-
private
|
|
77
|
+
private cdRef: ChangeDetectorRef
|
|
78
78
|
) {}
|
|
79
79
|
|
|
80
80
|
ngOnInit(): void {
|
|
@@ -273,9 +273,8 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
|
|
|
273
273
|
for (let fileIndex = 0; fileIndex < arFileList.length; fileIndex++) {
|
|
274
274
|
if (arFileList[fileIndex].id == itemId) {
|
|
275
275
|
// remove the file from the list and redraw
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
});
|
|
276
|
+
arFileList.splice(fileIndex, 1);
|
|
277
|
+
this.cdRef.markForCheck();
|
|
279
278
|
break;
|
|
280
279
|
}
|
|
281
280
|
}
|
|
@@ -293,9 +292,8 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
|
|
|
293
292
|
// remove the file from the list and redraw
|
|
294
293
|
localLinksList.splice(linkIndex, 1);
|
|
295
294
|
|
|
296
|
-
this.
|
|
297
|
-
|
|
298
|
-
});
|
|
295
|
+
this.arLinksList$ = localLinksList.slice();
|
|
296
|
+
this.cdRef.markForCheck();
|
|
299
297
|
|
|
300
298
|
break;
|
|
301
299
|
}
|
|
@@ -482,24 +480,23 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
|
|
|
482
480
|
oLink.primary.icon = 'open';
|
|
483
481
|
oLink.secondary.text = url;
|
|
484
482
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
this.arLinksList$.push(oLink);
|
|
483
|
+
// need to create a new array or summary list won't detect changes
|
|
484
|
+
this.arLinksList$ = localList.slice();
|
|
485
|
+
this.arLinksList$.push(oLink);
|
|
489
486
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
487
|
+
// list for actually attachments
|
|
488
|
+
const link: any = {};
|
|
489
|
+
link.id = oLink.id;
|
|
490
|
+
link.linkTitle = this.link_title$;
|
|
491
|
+
link.type = oLink.type;
|
|
492
|
+
link.url = url;
|
|
496
493
|
|
|
497
|
-
|
|
494
|
+
this.arLinks$.push(link);
|
|
498
495
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
496
|
+
// clear values
|
|
497
|
+
this.link_title$ = '';
|
|
498
|
+
this.link_url$ = '';
|
|
499
|
+
this.cdRef.markForCheck();
|
|
503
500
|
}
|
|
504
501
|
|
|
505
502
|
_changeTitle(event: any) {
|
|
@@ -526,7 +523,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
|
|
|
526
523
|
if (!/^(http|https):\/\//.test(data)) {
|
|
527
524
|
data = `//${data}`;
|
|
528
525
|
}
|
|
529
|
-
window.open(
|
|
526
|
+
window.open(data, '_blank');
|
|
530
527
|
}
|
|
531
528
|
})
|
|
532
529
|
.catch(console.error);
|
|
@@ -575,15 +572,13 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
|
|
|
575
572
|
createModal(modalType: string) {
|
|
576
573
|
switch (modalType) {
|
|
577
574
|
case 'addLocalFile':
|
|
578
|
-
this.
|
|
579
|
-
|
|
580
|
-
});
|
|
575
|
+
this.bShowFileModal$ = true;
|
|
576
|
+
this.cdRef.markForCheck();
|
|
581
577
|
|
|
582
578
|
break;
|
|
583
579
|
case 'addLocalLink':
|
|
584
|
-
this.
|
|
585
|
-
|
|
586
|
-
});
|
|
580
|
+
this.bShowLinkModal$ = true;
|
|
581
|
+
this.cdRef.markForCheck();
|
|
587
582
|
break;
|
|
588
583
|
default:
|
|
589
584
|
break;
|
|
@@ -716,6 +711,7 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
|
|
|
716
711
|
})
|
|
717
712
|
.finally(() => {
|
|
718
713
|
this.lu_bLoading$ = false;
|
|
714
|
+
this.cdRef.markForCheck();
|
|
719
715
|
});
|
|
720
716
|
}
|
|
721
717
|
}
|