@pega/angular-sdk-overrides 0.26.2 → 0.26.4
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/field-group/field-group.component.ts +11 -3
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +12 -3
- package/lib/field/auto-complete/auto-complete.component.html +44 -4
- package/lib/field/auto-complete/auto-complete.component.scss +92 -0
- package/lib/field/auto-complete/auto-complete.component.ts +341 -16
- package/lib/field/cancel-alert/cancel-alert.component.ts +38 -15
- package/lib/field/group/group.component.html +1 -1
- package/lib/field/group/group.component.ts +1 -3
- package/lib/field/semantic-link/semantic-link.component.html +1 -1
- package/lib/field/semantic-link/semantic-link.component.scss +4 -0
- package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
- 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 +179 -184
- package/lib/infra/assignment/assignment.component.html +2 -1
- package/lib/infra/assignment/assignment.component.ts +30 -13
- package/lib/infra/defer-load/defer-load.component.ts +6 -3
- package/lib/infra/multi-step/multi-step.component.html +25 -33
- package/lib/infra/multi-step/multi-step.component.scss +48 -0
- package/lib/infra/multi-step/multi-step.component.ts +11 -0
- package/lib/infra/view/view.component.ts +17 -39
- package/lib/template/base/details-template-base.ts +35 -54
- package/lib/template/case-summary/case-summary.component.ts +15 -1
- package/lib/template/case-view/case-view.component.html +13 -1
- 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 +27 -18
- package/lib/template/data-reference/search-form/search-form.component.html +1 -1
- package/lib/template/data-reference/search-form/search-form.component.ts +2 -0
- 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 -32
- 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 -37
- 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 -38
- 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 -46
- 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 -44
- 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 -41
- package/lib/template/field-value-list/field-value-list.component.scss +17 -0
- package/lib/template/list-view/list-view.component.ts +39 -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-manual/helpers.ts +27 -6
- package/lib/template/simple-table-manual/simple-table-manual.component.html +1 -3
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +4 -0
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +51 -20
- package/lib/template/single-reference-readonly/single-reference-readonly.component.scss +0 -4
- package/package.json +1 -1
- 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 -50
- 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 -61
|
@@ -14,6 +14,9 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
|
14
14
|
export class CancelAlertComponent implements OnChanges {
|
|
15
15
|
@Input() pConn$: typeof PConnect;
|
|
16
16
|
@Input() bShowAlert$: boolean;
|
|
17
|
+
@Input() hideDelete: boolean;
|
|
18
|
+
@Input() isDataObject: boolean;
|
|
19
|
+
@Input() skipReleaseLockRequest: any;
|
|
17
20
|
@Output() onAlertState$: EventEmitter<boolean> = new EventEmitter<boolean>();
|
|
18
21
|
|
|
19
22
|
itemKey: string;
|
|
@@ -61,7 +64,6 @@ export class CancelAlertComponent implements OnChanges {
|
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
buttonClick({ action }) {
|
|
64
|
-
const actionsAPI = this.pConn$.getActionsApi();
|
|
65
67
|
this.localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
66
68
|
|
|
67
69
|
switch (action) {
|
|
@@ -70,23 +72,44 @@ export class CancelAlertComponent implements OnChanges {
|
|
|
70
72
|
break;
|
|
71
73
|
case 'discard':
|
|
72
74
|
this.psService.sendMessage(true);
|
|
73
|
-
|
|
74
|
-
// eslint-disable-next-line no-case-declarations
|
|
75
|
-
const deletePromise = actionsAPI.deleteCaseInCreateStage(this.itemKey);
|
|
76
|
-
|
|
77
|
-
deletePromise
|
|
78
|
-
.then(() => {
|
|
79
|
-
this.psService.sendMessage(false);
|
|
80
|
-
this.dismissAlert();
|
|
81
|
-
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
|
|
82
|
-
})
|
|
83
|
-
.catch(() => {
|
|
84
|
-
this.psService.sendMessage(false);
|
|
85
|
-
this.sendMessage(this.localizedVal('Delete failed.', this.localeCategory));
|
|
86
|
-
});
|
|
75
|
+
this.handleDiscard();
|
|
87
76
|
break;
|
|
88
77
|
default:
|
|
89
78
|
break;
|
|
90
79
|
}
|
|
91
80
|
}
|
|
81
|
+
|
|
82
|
+
// Data objects and local/bulk actions don't have a create-stage case to delete, so each needs its own engine API
|
|
83
|
+
handleDiscard() {
|
|
84
|
+
const actionsAPI = this.pConn$.getActionsApi();
|
|
85
|
+
// @ts-ignore - Property 'options' is private and only accessible within class 'C11nEnv'.
|
|
86
|
+
const isBulkAction = (this.pConn$ as any)?.options?.isBulkAction;
|
|
87
|
+
const isLocalAction = this.pConn$.getValue(PCore.getConstants().CASE_INFO.IS_LOCAL_ACTION);
|
|
88
|
+
|
|
89
|
+
if (!this.isDataObject && !isLocalAction && !isBulkAction) {
|
|
90
|
+
actionsAPI
|
|
91
|
+
.deleteCaseInCreateStage(this.itemKey, this.hideDelete)
|
|
92
|
+
.then(() => {
|
|
93
|
+
this.psService.sendMessage(false);
|
|
94
|
+
this.dismissAlert();
|
|
95
|
+
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
|
|
96
|
+
})
|
|
97
|
+
.catch(() => {
|
|
98
|
+
this.psService.sendMessage(false);
|
|
99
|
+
this.sendMessage(this.localizedVal('Delete failed.', this.localeCategory));
|
|
100
|
+
});
|
|
101
|
+
} else if (isLocalAction) {
|
|
102
|
+
this.psService.sendMessage(false);
|
|
103
|
+
this.dismissAlert();
|
|
104
|
+
actionsAPI.cancelAssignment(this.itemKey, false);
|
|
105
|
+
} else if (isBulkAction) {
|
|
106
|
+
this.psService.sendMessage(false);
|
|
107
|
+
this.dismissAlert();
|
|
108
|
+
actionsAPI.cancelBulkAction(this.itemKey);
|
|
109
|
+
} else {
|
|
110
|
+
this.psService.sendMessage(false);
|
|
111
|
+
this.dismissAlert();
|
|
112
|
+
this.pConn$.getContainerManager().removeContainerItem({ containerItemID: this.itemKey, skipReleaseLockRequest: this.skipReleaseLockRequest });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
92
115
|
}
|
|
@@ -10,7 +10,7 @@ interface GroupProps extends PConnFieldProps {
|
|
|
10
10
|
showHeading: boolean;
|
|
11
11
|
heading: string;
|
|
12
12
|
instructions: string;
|
|
13
|
-
|
|
13
|
+
collapseOnLoad?: 'none' | 'expanded' | 'collapsed';
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
@Component({
|
|
@@ -32,7 +32,6 @@ export class GroupComponent implements OnInit, OnDestroy {
|
|
|
32
32
|
showHeading$?: boolean;
|
|
33
33
|
heading$: string;
|
|
34
34
|
instructions$: string;
|
|
35
|
-
collapsible$: boolean;
|
|
36
35
|
|
|
37
36
|
constructor(private angularPConnect: AngularPConnectService) {}
|
|
38
37
|
|
|
@@ -74,7 +73,6 @@ export class GroupComponent implements OnInit, OnDestroy {
|
|
|
74
73
|
this.showHeading$ = this.configProps$.showHeading;
|
|
75
74
|
this.heading$ = this.configProps$.heading;
|
|
76
75
|
this.instructions$ = this.configProps$.instructions;
|
|
77
|
-
this.collapsible$ = this.configProps$.collapsible;
|
|
78
76
|
|
|
79
77
|
if (this.configProps$.visibility === undefined) {
|
|
80
78
|
this.visibility$ = this.pConn$.getComputedVisibility();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div *ngIf="bVisible$ !== false">
|
|
2
|
-
<a *ngIf="!isLinkTextEmpty; else noLink" class="psdk-value" href="#" (click)="openLinkClick($event)">{{ value$ || '---' }}</a>
|
|
2
|
+
<a *ngIf="!isLinkTextEmpty; else noLink" class="psdk-value psdk-semantic-link" href="#" (click)="openLinkClick($event)">{{ value$ || '---' }}</a>
|
|
3
3
|
</div>
|
|
4
4
|
<ng-template #noLink>
|
|
5
5
|
<div class="psdk-value">{{ value$ || '---' }}</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div style="text-align: left" class="psdk-flow-container-top">
|
|
2
2
|
<div *ngIf="!bShowConfirm">
|
|
3
3
|
<div *ngIf="!todo_showTodo$">
|
|
4
|
-
<h2 *ngIf="
|
|
4
|
+
<h2 *ngIf="containerName$">{{ containerName$ }}</h2>
|
|
5
5
|
<div *ngIf="banners.length">
|
|
6
6
|
<component-mapper name="AlertBanner" [props]="{ banners }"></component-mapper>
|
|
7
7
|
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<mat-grid-list cols="2" rowHeight="4.25rem">
|
|
2
|
+
<mat-grid-tile>
|
|
3
|
+
<button mat-raised-button variant="contained" color="secondary" [disabled]="bDisabled$" (click)="onCancel()">
|
|
4
|
+
{{ localizedVal('Cancel', localeCategory) }}
|
|
5
|
+
</button>
|
|
6
|
+
</mat-grid-tile>
|
|
7
|
+
<mat-grid-tile>
|
|
8
|
+
<button mat-raised-button variant="contained" color="primary" [disabled]="bDisabled$" (click)="onSubmit()">
|
|
9
|
+
{{ localizedVal(primaryLabel$, localeCategory) }}
|
|
10
|
+
</button>
|
|
11
|
+
</mat-grid-tile>
|
|
12
|
+
</mat-grid-list>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { provideZonelessChangeDetection } from '@angular/core';
|
|
2
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
+
|
|
4
|
+
import { DataViewActionButtonsComponent } from './data-view-action-buttons.component';
|
|
5
|
+
|
|
6
|
+
const RESOURCE_STATUS = { CREATE: 'CREATE', UPDATE: 'UPDATE', OPEN_FLOW_ACTION: 'OPEN_FLOW_ACTION' };
|
|
7
|
+
const DATA_EVENTS = { DATA_OBJECT_CREATED: 'DataObjectCreated', DATA_OBJECT_UPDATED: 'DataObjectUpdated' };
|
|
8
|
+
|
|
9
|
+
describe('DataViewActionButtonsComponent', () => {
|
|
10
|
+
let component: DataViewActionButtonsComponent;
|
|
11
|
+
let fixture: ComponentFixture<DataViewActionButtonsComponent>;
|
|
12
|
+
let actionsApi: {
|
|
13
|
+
createDataObject: jasmine.Spy;
|
|
14
|
+
updateDataObject: jasmine.Spy;
|
|
15
|
+
submitDataObjectAction: jasmine.Spy;
|
|
16
|
+
cancelDataObject: jasmine.Spy;
|
|
17
|
+
};
|
|
18
|
+
let publishSpy: jasmine.Spy;
|
|
19
|
+
|
|
20
|
+
beforeEach(async () => {
|
|
21
|
+
publishSpy = jasmine.createSpy('publish');
|
|
22
|
+
// PCore is read in a field initializer, so it must exist before the component is created.
|
|
23
|
+
(globalThis as any).PCore = {
|
|
24
|
+
getLocaleUtils: () => ({ getLocaleValue: (value: string) => value }),
|
|
25
|
+
getConstants: () => ({ RESOURCE_STATUS, PUB_SUB_EVENTS: { DATA_EVENTS } }),
|
|
26
|
+
getPubSubUtils: () => ({ publish: publishSpy })
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
await TestBed.configureTestingModule({
|
|
30
|
+
imports: [DataViewActionButtonsComponent],
|
|
31
|
+
providers: [provideZonelessChangeDetection()]
|
|
32
|
+
}).compileComponents();
|
|
33
|
+
|
|
34
|
+
fixture = TestBed.createComponent(DataViewActionButtonsComponent);
|
|
35
|
+
component = fixture.componentInstance;
|
|
36
|
+
|
|
37
|
+
actionsApi = {
|
|
38
|
+
createDataObject: jasmine.createSpy('createDataObject').and.returnValue(Promise.resolve()),
|
|
39
|
+
updateDataObject: jasmine.createSpy('updateDataObject').and.returnValue(Promise.resolve()),
|
|
40
|
+
submitDataObjectAction: jasmine.createSpy('submitDataObjectAction').and.returnValue(Promise.resolve()),
|
|
41
|
+
cancelDataObject: jasmine.createSpy('cancelDataObject').and.returnValue({})
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
component.pConn$ = { getActionsApi: () => actionsApi } as any;
|
|
45
|
+
component.context$ = 'app/modal_1';
|
|
46
|
+
component.dataRecordKeys$ = '{"pyGUID":"abc-123"}';
|
|
47
|
+
component.classID$ = 'My-Data-Class';
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should create', () => {
|
|
51
|
+
expect(component).toBeTruthy();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('labels the primary button "Update" when editing an existing record', () => {
|
|
55
|
+
component.dataObjectAction$ = RESOURCE_STATUS.UPDATE;
|
|
56
|
+
expect(component.primaryLabel$).toBe('Update');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('labels the primary button "Submit" when creating a record', () => {
|
|
60
|
+
component.dataObjectAction$ = RESOURCE_STATUS.CREATE;
|
|
61
|
+
expect(component.primaryLabel$).toBe('Submit');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('labels the primary button "Submit" for a record action', () => {
|
|
65
|
+
component.dataObjectAction$ = RESOURCE_STATUS.OPEN_FLOW_ACTION;
|
|
66
|
+
expect(component.primaryLabel$).toBe('Submit');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('creates the record and publishes the created event', async () => {
|
|
70
|
+
component.dataObjectAction$ = RESOURCE_STATUS.CREATE;
|
|
71
|
+
|
|
72
|
+
component.onSubmit();
|
|
73
|
+
await fixture.whenStable();
|
|
74
|
+
|
|
75
|
+
expect(actionsApi.createDataObject).toHaveBeenCalledWith('app/modal_1');
|
|
76
|
+
expect(publishSpy).toHaveBeenCalledWith(DATA_EVENTS.DATA_OBJECT_CREATED, { classId: 'My-Data-Class', data: undefined });
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('parses the serialised record keys before updating', async () => {
|
|
80
|
+
component.dataObjectAction$ = RESOURCE_STATUS.UPDATE;
|
|
81
|
+
|
|
82
|
+
component.onSubmit();
|
|
83
|
+
await fixture.whenStable();
|
|
84
|
+
|
|
85
|
+
expect(actionsApi.updateDataObject).toHaveBeenCalledWith('app/modal_1', { pyGUID: 'abc-123' });
|
|
86
|
+
expect(publishSpy).toHaveBeenCalledWith(DATA_EVENTS.DATA_OBJECT_UPDATED, { classId: 'My-Data-Class' });
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('submits a record action with its parsed keys and action ID', async () => {
|
|
90
|
+
component.dataObjectAction$ = RESOURCE_STATUS.OPEN_FLOW_ACTION;
|
|
91
|
+
component.actionID$ = 'updateCVV';
|
|
92
|
+
|
|
93
|
+
component.onSubmit();
|
|
94
|
+
await fixture.whenStable();
|
|
95
|
+
|
|
96
|
+
expect(actionsApi.submitDataObjectAction).toHaveBeenCalledWith('app/modal_1', { pyGUID: 'abc-123' }, 'updateCVV');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('disables both buttons while a save is in flight', () => {
|
|
100
|
+
let resolveSave: () => void = () => {};
|
|
101
|
+
actionsApi.createDataObject.and.returnValue(
|
|
102
|
+
new Promise<void>(resolve => {
|
|
103
|
+
resolveSave = resolve;
|
|
104
|
+
})
|
|
105
|
+
);
|
|
106
|
+
component.dataObjectAction$ = RESOURCE_STATUS.CREATE;
|
|
107
|
+
|
|
108
|
+
component.onSubmit();
|
|
109
|
+
|
|
110
|
+
expect(component.bDisabled$).toBeTrue();
|
|
111
|
+
resolveSave();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('re-enables the buttons and publishes nothing when the save is rejected', async () => {
|
|
115
|
+
actionsApi.createDataObject.and.returnValue(Promise.reject(new Error('rejected')));
|
|
116
|
+
component.dataObjectAction$ = RESOURCE_STATUS.CREATE;
|
|
117
|
+
|
|
118
|
+
component.onSubmit();
|
|
119
|
+
await fixture.whenStable();
|
|
120
|
+
|
|
121
|
+
expect(publishSpy).not.toHaveBeenCalled();
|
|
122
|
+
expect(component.bDisabled$).toBeFalse();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('discards the edit through the engine on cancel', () => {
|
|
126
|
+
component.onCancel();
|
|
127
|
+
|
|
128
|
+
expect(actionsApi.cancelDataObject).toHaveBeenCalledWith('app/modal_1');
|
|
129
|
+
});
|
|
130
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ChangeDetectorRef, Component, Input } from '@angular/core';
|
|
3
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
4
|
+
import { MatGridListModule } from '@angular/material/grid-list';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-data-view-action-buttons',
|
|
8
|
+
templateUrl: './data-view-action-buttons.component.html',
|
|
9
|
+
imports: [CommonModule, MatGridListModule, MatButtonModule]
|
|
10
|
+
})
|
|
11
|
+
export class DataViewActionButtonsComponent {
|
|
12
|
+
@Input() pConn$: typeof PConnect;
|
|
13
|
+
@Input() context$: string;
|
|
14
|
+
@Input() dataObjectAction$: string;
|
|
15
|
+
@Input() actionID$ = '';
|
|
16
|
+
// The container item publishes the record keys JSON-serialised.
|
|
17
|
+
@Input() dataRecordKeys$ = '';
|
|
18
|
+
@Input() classID$ = '';
|
|
19
|
+
|
|
20
|
+
localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
21
|
+
localeCategory = 'Data Object';
|
|
22
|
+
bDisabled$ = false;
|
|
23
|
+
|
|
24
|
+
constructor(private cdRef: ChangeDetectorRef) {}
|
|
25
|
+
|
|
26
|
+
get primaryLabel$(): string {
|
|
27
|
+
return this.dataObjectAction$ === PCore.getConstants().RESOURCE_STATUS.UPDATE ? 'Update' : 'Submit';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
onCancel() {
|
|
31
|
+
// The engine drops the container item, which collapses the modal.
|
|
32
|
+
this.pConn$.getActionsApi().cancelDataObject(this.context$);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
onSubmit() {
|
|
36
|
+
const { RESOURCE_STATUS, PUB_SUB_EVENTS } = PCore.getConstants();
|
|
37
|
+
const { DATA_OBJECT_CREATED, DATA_OBJECT_UPDATED } = PUB_SUB_EVENTS.DATA_EVENTS;
|
|
38
|
+
const actionsApi = this.pConn$.getActionsApi();
|
|
39
|
+
const { publish } = PCore.getPubSubUtils();
|
|
40
|
+
|
|
41
|
+
let submitAction: Promise<any>;
|
|
42
|
+
let publishCompleted: (data?: any) => void;
|
|
43
|
+
|
|
44
|
+
switch (this.dataObjectAction$) {
|
|
45
|
+
case RESOURCE_STATUS.UPDATE:
|
|
46
|
+
submitAction = actionsApi.updateDataObject(this.context$, this.getRecordKeys());
|
|
47
|
+
publishCompleted = () => publish(DATA_OBJECT_UPDATED, { classId: this.classID$ });
|
|
48
|
+
break;
|
|
49
|
+
case RESOURCE_STATUS.OPEN_FLOW_ACTION:
|
|
50
|
+
submitAction = actionsApi.submitDataObjectAction(this.context$, this.getRecordKeys(), this.actionID$);
|
|
51
|
+
publishCompleted = () => publish(DATA_OBJECT_UPDATED, { classId: this.classID$, actionID: this.actionID$ });
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
submitAction = actionsApi.createDataObject(this.context$);
|
|
55
|
+
publishCompleted = data => publish(DATA_OBJECT_CREATED, { classId: this.classID$, data });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
this.bDisabled$ = true;
|
|
59
|
+
|
|
60
|
+
submitAction
|
|
61
|
+
.then(data => {
|
|
62
|
+
publishCompleted(data);
|
|
63
|
+
})
|
|
64
|
+
.catch(() => {
|
|
65
|
+
// Keep the modal open so the server error banner is visible and the edit can be corrected.
|
|
66
|
+
})
|
|
67
|
+
.finally(() => {
|
|
68
|
+
this.bDisabled$ = false;
|
|
69
|
+
// Change detection is zoneless, so this async reset needs to be flagged explicitly.
|
|
70
|
+
this.cdRef.markForCheck();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private getRecordKeys(): Record<string, any> {
|
|
75
|
+
return this.dataRecordKeys$ ? JSON.parse(this.dataRecordKeys$) : {};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -1,15 +1,36 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<div class="psdk-modal-view-container-top" id="{{
|
|
3
|
-
<h3 *ngIf="title
|
|
1
|
+
<div *ngFor="let modal of modalStack; trackBy: trackByModalKey" id="dialog" class="psdk-dialog-background">
|
|
2
|
+
<div class="psdk-modal-view-container-top" id="{{ modal.key }}">
|
|
3
|
+
<h3 *ngIf="modal.title != ''">{{ modal.title }}</h3>
|
|
4
4
|
<component-mapper
|
|
5
5
|
name="Assignment"
|
|
6
|
-
[props]="{
|
|
6
|
+
[props]="{
|
|
7
|
+
pConn$: modal.createdViewPConn$,
|
|
8
|
+
formGroup$,
|
|
9
|
+
arChildren$: modal.arChildren$,
|
|
10
|
+
itemKey$: modal.key,
|
|
11
|
+
isCreateStage$: true,
|
|
12
|
+
updateToken$: modal.updateToken,
|
|
13
|
+
isInModal$: true
|
|
14
|
+
}"
|
|
7
15
|
></component-mapper>
|
|
8
|
-
<div *ngIf="
|
|
16
|
+
<div *ngIf="modal.isMultiRecordData">
|
|
9
17
|
<component-mapper
|
|
10
18
|
name="ListViewActionButtons"
|
|
11
|
-
[props]="{ pConn$: createdViewPConn$, context
|
|
12
|
-
[outputEvents]="{ closeActionsDialog:
|
|
19
|
+
[props]="{ pConn$: modal.createdViewPConn$, context$: modal.context }"
|
|
20
|
+
[outputEvents]="{ closeActionsDialog: closeModalFor(modal.key) }"
|
|
21
|
+
></component-mapper>
|
|
22
|
+
</div>
|
|
23
|
+
<div *ngIf="modal.isDataObjectModal">
|
|
24
|
+
<component-mapper
|
|
25
|
+
name="DataViewActionButtons"
|
|
26
|
+
[props]="{
|
|
27
|
+
pConn$: modal.createdViewPConn$,
|
|
28
|
+
context$: modal.context,
|
|
29
|
+
classID$: modal.dataObjectClassId,
|
|
30
|
+
dataObjectAction$: modal.dataObjectAction,
|
|
31
|
+
dataRecordKeys$: modal.dataRecordKeys,
|
|
32
|
+
actionID$: modal.dataObjectActionID
|
|
33
|
+
}"
|
|
13
34
|
></component-mapper>
|
|
14
35
|
</div>
|
|
15
36
|
</div>
|
|
@@ -18,7 +39,13 @@
|
|
|
18
39
|
<div *ngIf="bShowCancelAlert$">
|
|
19
40
|
<component-mapper
|
|
20
41
|
name="CancelAlert"
|
|
21
|
-
[props]="{
|
|
42
|
+
[props]="{
|
|
43
|
+
bShowAlert$: bShowCancelAlert$,
|
|
44
|
+
pConn$: cancelPConn$,
|
|
45
|
+
hideDelete: cancelHideDelete$,
|
|
46
|
+
isDataObject: cancelIsDataObject$,
|
|
47
|
+
skipReleaseLockRequest: cancelSkipReleaseLockRequest$
|
|
48
|
+
}"
|
|
22
49
|
[parent]="this"
|
|
23
50
|
[outputEvents]="{ onAlertState$: onAlertState }"
|
|
24
51
|
></component-mapper>
|