@pega/dx-component-builder-sdk 0.242.17 → 0.242.18
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/package.json +1 -1
- package/src/tasks/create/templates/Constellation/template/PAGE/demo.stories.tsx.mustache +1 -0
- package/tests/assets/sdk-a/components/create/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/create/custom-sdk/field/pega-dxil-my-test-text/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/create/override-sdk/field/user-reference/user-reference.component.html +2 -10
- package/tests/assets/sdk-a/components/create/override-sdk/field/user-reference/user-reference.component.ts +34 -12
- package/tests/assets/sdk-a/components/create/override-sdk/infra/view/view.component.ts +15 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyDate/demo.stories.tsx +0 -16
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyDateTime/demo.stories.tsx +0 -17
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyEmail/mock.ts +1 -0
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +9 -20
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyParagraph/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/mock.ts +1 -0
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyPhone/demo.stories.tsx +1 -2
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyRadioButtons/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyText/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyTextInput/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/field/Pega_DXIL_MyURL/demo.stories.tsx +0 -1
- package/tests/assets/sdk-a/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/demo.stories.tsx +10 -0
- package/tests/assets/sdk-a/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/demo.stories.tsx +1 -13
- package/tests/assets/sdk-a/components/createAll/custom-constellation/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +10 -32
- package/tests/assets/sdk-a/components/createAll/custom-constellation/widget/Pega_DXIL_MyCaseWidget/index.tsx +2 -2
- package/tests/assets/sdk-a/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +10 -22
- package/tests/assets/sdk-a/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +10 -21
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-boolean/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-currency/demo.stories.tsx +1 -15
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date/demo.stories.tsx +1 -11
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date/pega-dxil-my-date.component.spec.ts +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date-time/demo.stories.tsx +1 -12
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-decimal/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-decimal/pega-dxil-my-decimal.component.spec.ts +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-email/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-icon-button-url/demo.stories.tsx +10 -21
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-integer/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-paragraph/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-percentage/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-percentage/pega-dxil-my-percentage.component.spec.ts +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-phone/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-picklist/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-radiobuttons/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-searchbox/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-text/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-text-input/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-time-of-day/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-url/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-details/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-form/demo.stories.tsx +9 -17
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-form/mock.ts +19 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-page/demo.stories.tsx +35 -47
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-two-column-details/demo.stories.tsx +1 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-two-column-form/demo.stories.tsx +7 -16
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-two-column-form/mock.ts +19 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/widget/pega-dxil-my-case-widget/demo.stories.tsx +7 -17
- package/tests/assets/sdk-a/components/createAll/custom-sdk/widget/pega-dxil-my-page-case-widget/demo.stories.tsx +9 -17
- package/tests/assets/sdk-a/components/createAll/custom-sdk/widget/pega-dxil-my-page-widget/demo.stories.tsx +7 -10
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/user-reference/user-reference.component.html +2 -10
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/user-reference/user-reference.component.ts +34 -12
- package/tests/assets/sdk-a/components/createAll/override-sdk/infra/view/view.component.ts +15 -1
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ const meta: Meta<PegaDxilMyTestTextComponent> = {
|
|
|
9
9
|
title: 'PegaDxilMyTestText',
|
|
10
10
|
component: PegaDxilMyTestTextComponent,
|
|
11
11
|
excludeStories: /.*Data$/,
|
|
12
|
-
render: (args
|
|
12
|
+
render: (args) => ({
|
|
13
13
|
props: {
|
|
14
14
|
...args,
|
|
15
15
|
pConn$: {
|
|
@@ -8,13 +8,7 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div [formGroup]="formGroup$" *ngIf="type === 'dropdown'">
|
|
10
10
|
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText">
|
|
11
|
-
<mat-select
|
|
12
|
-
[value]="value$"
|
|
13
|
-
[required]="bRequired$"
|
|
14
|
-
[formControl]="fieldControl"
|
|
15
|
-
[attr.data-test-id]="testId"
|
|
16
|
-
(selectionChange)="fieldOnChange($event)"
|
|
17
|
-
>
|
|
11
|
+
<mat-select [required]="bRequired$" [formControl]="fieldControl" [attr.data-test-id]="testId" (selectionChange)="fieldOnChange($event)">
|
|
18
12
|
<mat-option *ngFor="let opt of options$" [value]="opt.key">
|
|
19
13
|
{{ opt.value }}
|
|
20
14
|
</mat-option>
|
|
@@ -32,14 +26,12 @@
|
|
|
32
26
|
matInput
|
|
33
27
|
[placeholder]="placeholder"
|
|
34
28
|
[formControl]="fieldControl"
|
|
35
|
-
[value]="value$"
|
|
36
29
|
[required]="bRequired$"
|
|
37
30
|
[matAutocomplete]="auto"
|
|
38
31
|
[attr.data-test-id]="testId"
|
|
39
|
-
(change)="fieldOnChange($event)"
|
|
40
32
|
(blur)="fieldOnBlur($event)"
|
|
41
33
|
/>
|
|
42
|
-
<mat-autocomplete #auto="matAutocomplete">
|
|
34
|
+
<mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption (optionSelected)="optionChanged($event)">
|
|
43
35
|
<mat-option *ngFor="let opt of filteredOptions | async" [value]="opt.value">
|
|
44
36
|
<span>{{ opt.value }}</span>
|
|
45
37
|
</mat-option>
|
|
@@ -23,6 +23,7 @@ interface UserReferenceProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
23
23
|
value?: any;
|
|
24
24
|
showAsFormattedText?: boolean;
|
|
25
25
|
additionalProps?: object;
|
|
26
|
+
onRecordChange?: any;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
@Component({
|
|
@@ -66,6 +67,7 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
66
67
|
fieldControl = new FormControl('', null);
|
|
67
68
|
actionsApi: Object;
|
|
68
69
|
propName: string;
|
|
70
|
+
onRecordChange: any;
|
|
69
71
|
|
|
70
72
|
constructor(
|
|
71
73
|
private angularPConnect: AngularPConnectService,
|
|
@@ -83,11 +85,11 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
83
85
|
if (this.formGroup$) {
|
|
84
86
|
// add control to formGroup
|
|
85
87
|
this.formGroup$.addControl(this.controlName$, this.fieldControl);
|
|
86
|
-
this.fieldControl.setValue(this.value$);
|
|
88
|
+
this.fieldControl.setValue(this.getValue(this.value$));
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
this.filteredOptions = this.fieldControl.valueChanges.pipe(
|
|
90
|
-
startWith(''),
|
|
92
|
+
startWith(this.getValue(this.value$) || ''),
|
|
91
93
|
map(value => this._filter(value || ''))
|
|
92
94
|
);
|
|
93
95
|
}
|
|
@@ -126,6 +128,21 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
126
128
|
return this.options$?.filter(option => option.value?.toLowerCase().includes(filterVal));
|
|
127
129
|
}
|
|
128
130
|
|
|
131
|
+
isUserNameAvailable = user => {
|
|
132
|
+
return typeof user === 'object' && user !== null && user.userName;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
getUserName = user => {
|
|
136
|
+
return user.userName;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
getValue = user => {
|
|
140
|
+
if (this.displayAs$ === DROPDOWN_LIST) {
|
|
141
|
+
return this.utils.getUserId(user) || this.getUserName(user);
|
|
142
|
+
}
|
|
143
|
+
return this.isUserNameAvailable(user) ? this.getUserName(user) : this.utils.getUserId(user);
|
|
144
|
+
};
|
|
145
|
+
|
|
129
146
|
async checkAndUpdate() {
|
|
130
147
|
// Should always check the bridge to see if the component should
|
|
131
148
|
// update itself (re-render)
|
|
@@ -140,6 +157,7 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
140
157
|
async updateSelf() {
|
|
141
158
|
const props = this.pConn$.getConfigProps() as UserReferenceProps;
|
|
142
159
|
this.testId = props.testId;
|
|
160
|
+
this.onRecordChange = props?.onRecordChange;
|
|
143
161
|
|
|
144
162
|
const { label, displayAs, value, showAsFormattedText, helperText, placeholder, displayMode } = props;
|
|
145
163
|
|
|
@@ -150,20 +168,18 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
150
168
|
this.placeholder = placeholder || '';
|
|
151
169
|
this.displayMode$ = displayMode;
|
|
152
170
|
|
|
171
|
+
this.value$ = this.pConn$.getConfigProps()?.value;
|
|
172
|
+
|
|
153
173
|
const { readOnly, required } = props;
|
|
154
174
|
[this.bReadonly$, this.bRequired$] = [readOnly, required].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
|
|
155
175
|
|
|
156
176
|
this.actionsApi = this.pConn$.getActionsApi();
|
|
157
177
|
this.propName = this.pConn$.getStateProps().value;
|
|
158
178
|
|
|
159
|
-
const isUserNameAvailable = user => {
|
|
160
|
-
return typeof user === 'object' && user !== null && user.userName;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
179
|
this.userID$ = this.utils.getUserId(value);
|
|
164
180
|
|
|
165
181
|
if (this.userID$ && this.bReadonly$ && this.showAsFormattedText$) {
|
|
166
|
-
if (isUserNameAvailable(value)) {
|
|
182
|
+
if (this.isUserNameAvailable(value)) {
|
|
167
183
|
this.userName$ = value.userName;
|
|
168
184
|
} else {
|
|
169
185
|
// if same user ref field is referred in view as editable & readonly formatted text
|
|
@@ -201,7 +217,12 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
201
217
|
if (event?.target) {
|
|
202
218
|
this.filterValue = (event.target as HTMLInputElement).value;
|
|
203
219
|
}
|
|
204
|
-
const value = event?.
|
|
220
|
+
const value = event?.value;
|
|
221
|
+
handleEvent(this.actionsApi, 'change', this.propName, value);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
optionChanged(event: any) {
|
|
225
|
+
const value = event?.option?.value;
|
|
205
226
|
handleEvent(this.actionsApi, 'change', this.propName, value);
|
|
206
227
|
}
|
|
207
228
|
|
|
@@ -211,11 +232,12 @@ export class UserReferenceComponent implements OnInit, OnDestroy {
|
|
|
211
232
|
const index = this.options$?.findIndex(element => element.value === event.target.value);
|
|
212
233
|
key = index > -1 ? (key = this.options$[index].key) : event.target.value;
|
|
213
234
|
}
|
|
214
|
-
|
|
215
|
-
const value = {
|
|
216
|
-
value: key
|
|
217
|
-
};
|
|
235
|
+
const value = key;
|
|
218
236
|
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
237
|
+
if (this.onRecordChange) {
|
|
238
|
+
event.target.value = value;
|
|
239
|
+
this.onRecordChange(event);
|
|
240
|
+
}
|
|
219
241
|
}
|
|
220
242
|
|
|
221
243
|
getErrorMessage() {
|
|
@@ -8,6 +8,20 @@ import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
|
8
8
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
9
9
|
|
|
10
10
|
const NO_HEADER_TEMPLATES = ['SubTabs', 'SimpleTable', 'Confirmation', 'DynamicTabs', 'DetailsSubTabs'];
|
|
11
|
+
const DETAILS_TEMPLATES = [
|
|
12
|
+
'Details',
|
|
13
|
+
'DetailsFields',
|
|
14
|
+
'DetailsOneColumn',
|
|
15
|
+
'DetailsSubTabs',
|
|
16
|
+
'DetailsThreeColumn',
|
|
17
|
+
'DetailsTwoColumn',
|
|
18
|
+
'NarrowWideDetails',
|
|
19
|
+
'WideNarrowDetails'
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
function isDetailsTemplate(template) {
|
|
23
|
+
return DETAILS_TEMPLATES.includes(template);
|
|
24
|
+
}
|
|
11
25
|
|
|
12
26
|
/**
|
|
13
27
|
* WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with
|
|
@@ -146,7 +160,7 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
146
160
|
this.templateName$ = this.configProps$.template || '';
|
|
147
161
|
this.title$ = this.configProps$.title || '';
|
|
148
162
|
this.label$ = this.configProps$.label || '';
|
|
149
|
-
this.showLabel$ = this.configProps$.showLabel || this.showLabel$;
|
|
163
|
+
this.showLabel$ = this.configProps$.showLabel || isDetailsTemplate(this.templateName$) || this.showLabel$;
|
|
150
164
|
// label & showLabel within inheritedProps takes precedence over configProps
|
|
151
165
|
this.label$ = this.inheritedProps$.label || this.label$;
|
|
152
166
|
this.showLabel$ = this.inheritedProps$.showLabel || this.showLabel$;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
-
// @ts-nocheck
|
|
4
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
4
|
import { configProps, stateProps } from './mock';
|
|
6
5
|
import PegaDxilMyDate from './index';
|
|
@@ -14,21 +13,6 @@ const meta: Meta<typeof PegaDxilMyDate> = {
|
|
|
14
13
|
export default meta;
|
|
15
14
|
type Story = StoryObj<typeof PegaDxilMyDate>;
|
|
16
15
|
|
|
17
|
-
if (!window.PCore) {
|
|
18
|
-
window.PCore = {};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
window.PCore.getEnvironmentInfo = () => {
|
|
22
|
-
return {
|
|
23
|
-
getTimeZone: () => {
|
|
24
|
-
return '';
|
|
25
|
-
},
|
|
26
|
-
getLocale: () => {
|
|
27
|
-
return 'en-GB';
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
16
|
export const BasePegaDxilMyDate: Story = args => {
|
|
33
17
|
const props = {
|
|
34
18
|
value: configProps.value,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
2
|
-
// @ts-nocheck
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
3
|
import { configProps, stateProps } from './mock';
|
|
5
4
|
import PegaDxilMyDateTime from './index';
|
|
@@ -13,22 +12,6 @@ const meta: Meta<typeof PegaDxilMyDateTime> = {
|
|
|
13
12
|
export default meta;
|
|
14
13
|
type Story = StoryObj<typeof PegaDxilMyDateTime>;
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
if (!window.PCore) {
|
|
18
|
-
window.PCore = {};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
window.PCore.getEnvironmentInfo = () => {
|
|
22
|
-
return {
|
|
23
|
-
getTimeZone: () => {
|
|
24
|
-
return '';
|
|
25
|
-
},
|
|
26
|
-
getLocale: () => {
|
|
27
|
-
return 'en-GB';
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
15
|
export const BasePegaDxilMyDateTime: Story = args => {
|
|
33
16
|
const props = {
|
|
34
17
|
value: configProps.value,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
-
// @ts-nocheck
|
|
4
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
4
|
|
|
6
5
|
import PegaDxilMyIconButtonUrl from './index';
|
|
@@ -15,10 +14,6 @@ const meta: Meta<typeof PegaDxilMyIconButtonUrl> = {
|
|
|
15
14
|
export default meta;
|
|
16
15
|
type Story = StoryObj<typeof PegaDxilMyIconButtonUrl>;
|
|
17
16
|
|
|
18
|
-
if (!window.PCore) {
|
|
19
|
-
window.PCore = {};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
17
|
const statelistData = {
|
|
23
18
|
data: [
|
|
24
19
|
{
|
|
@@ -36,23 +31,17 @@ const statelistData = {
|
|
|
36
31
|
]
|
|
37
32
|
};
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
getDataAsync: () => {
|
|
49
|
-
return new Promise(resolve => {
|
|
50
|
-
resolve(statelistData);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
};
|
|
34
|
+
window.PCore.getDataPageUtils = (): any => {
|
|
35
|
+
return {
|
|
36
|
+
getDataAsync: () => {
|
|
37
|
+
return new Promise(resolve => {
|
|
38
|
+
resolve(statelistData);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
54
41
|
};
|
|
42
|
+
};
|
|
55
43
|
|
|
44
|
+
export const BasePegaDxilMyIconButtonUrl: Story = args => {
|
|
56
45
|
const props = {
|
|
57
46
|
countryCode: configProps.countryCode,
|
|
58
47
|
getPConnect: () => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
-
// @ts-nocheck
|
|
4
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
4
|
|
|
6
5
|
import PegaDxilMyPhone from './index';
|
|
@@ -47,7 +46,7 @@ export const BasePegaDxilMyPhone: Story = args => {
|
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
BasePegaDxilMyPhone.args = {
|
|
50
|
-
datasource: configProps.datasource,
|
|
49
|
+
datasource: configProps.datasource as any,
|
|
51
50
|
label: configProps.label,
|
|
52
51
|
helperText: configProps.helperText,
|
|
53
52
|
placeholder: configProps.placeholder,
|
|
@@ -8,6 +8,16 @@ import { pyReviewRaw, pyReviewResolved, regionChildrenResolved, operatorDetails,
|
|
|
8
8
|
import StatusWorkRenderer from './StatusWork';
|
|
9
9
|
import Operator from './Operator';
|
|
10
10
|
|
|
11
|
+
window.PCore.getUserApi = (): any => {
|
|
12
|
+
return {
|
|
13
|
+
getOperatorDetails: () => {
|
|
14
|
+
return new Promise(resolve => {
|
|
15
|
+
resolve(operatorDetails);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
11
21
|
const meta: Meta<typeof PegaDxilMyDetails> = {
|
|
12
22
|
title: 'PegaDxilMyDetails',
|
|
13
23
|
component: PegaDxilMyDetails,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
3
|
/* eslint-disable react/no-unstable-nested-components */
|
|
4
|
-
// @ts-nocheck
|
|
5
4
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
5
|
|
|
7
6
|
import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
|
|
@@ -19,18 +18,6 @@ export default meta;
|
|
|
19
18
|
type Story = StoryObj<typeof PegaDxilMyPage>;
|
|
20
19
|
|
|
21
20
|
export const BasePegaDxilMyPage: Story = args => {
|
|
22
|
-
if (!window.PCore) {
|
|
23
|
-
window.PCore = {};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
window.PCore.getLocaleUtils = () => {
|
|
27
|
-
return {
|
|
28
|
-
getLocaleValue: val => {
|
|
29
|
-
return val;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
21
|
const configProps = pyHome1Resolved.children[0].children[0].config;
|
|
35
22
|
|
|
36
23
|
const props = {
|
|
@@ -86,6 +73,7 @@ export const BasePegaDxilMyPage: Story = args => {
|
|
|
86
73
|
/>
|
|
87
74
|
);
|
|
88
75
|
}
|
|
76
|
+
return <></>;
|
|
89
77
|
},
|
|
90
78
|
ignoreSuggestion: () => {/* nothing */},
|
|
91
79
|
acceptSuggestion: () => {/* nothing */},
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
-
// @ts-nocheck
|
|
4
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
4
|
|
|
6
5
|
import PegaDxilMyCaseWidget from './index';
|
|
7
6
|
|
|
8
7
|
import historyData from './mock';
|
|
9
8
|
|
|
9
|
+
window.PCore.getDataApiUtils = (): any => {
|
|
10
|
+
return {
|
|
11
|
+
getData: () => {
|
|
12
|
+
return new Promise(resolve => {
|
|
13
|
+
resolve(historyData);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
10
19
|
const meta: Meta<typeof PegaDxilMyCaseWidget> = {
|
|
11
20
|
title: 'PegaDxilMyCaseWidget',
|
|
12
21
|
component: PegaDxilMyCaseWidget,
|
|
@@ -16,38 +25,7 @@ const meta: Meta<typeof PegaDxilMyCaseWidget> = {
|
|
|
16
25
|
export default meta;
|
|
17
26
|
type Story = StoryObj<typeof PegaDxilMyCaseWidget>;
|
|
18
27
|
|
|
19
|
-
if (!window.PCore) {
|
|
20
|
-
window.PCore = {};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
28
|
export const BasePegaDxilMyCaseWidget: Story = args => {
|
|
24
|
-
|
|
25
|
-
window.PCore.getConstants = () => {
|
|
26
|
-
return {
|
|
27
|
-
CASE_INFO: {
|
|
28
|
-
CASE_INFO_ID: 'caseInfo.ID'
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
window.PCore.getLocaleUtils = () => {
|
|
34
|
-
return {
|
|
35
|
-
getLocaleValue: value => {
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
window.PCore.getDataApiUtils = () => {
|
|
42
|
-
return {
|
|
43
|
-
getData: () => {
|
|
44
|
-
return new Promise(resolve => {
|
|
45
|
-
resolve(historyData);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
|
|
51
29
|
const props = {
|
|
52
30
|
|
|
53
31
|
getPConnect: () => {
|
|
@@ -48,8 +48,8 @@ function PegaDxilMyCaseWidget(props: PegaDxilMyCaseWidgetProps) {
|
|
|
48
48
|
description: <Text style={{ wordBreak: 'break-word' }}>{entry.pyMessageKey}</Text>,
|
|
49
49
|
user: entry.pyPerformer,
|
|
50
50
|
id: index
|
|
51
|
-
};
|
|
52
|
-
})
|
|
51
|
+
} as any;
|
|
52
|
+
}) as any
|
|
53
53
|
);
|
|
54
54
|
} else {
|
|
55
55
|
setHistory([]);
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
2
|
-
// @ts-nocheck
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
3
|
|
|
5
4
|
import PegaDxilMyPageCaseWidget from './index';
|
|
6
5
|
|
|
7
6
|
import { configProps, operatorDetails } from './mock';
|
|
8
7
|
|
|
8
|
+
window.PCore.getUserApi = (): any => {
|
|
9
|
+
return {
|
|
10
|
+
getOperatorDetails: () => {
|
|
11
|
+
return new Promise(resolve => {
|
|
12
|
+
resolve(operatorDetails);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
9
18
|
const meta: Meta<typeof PegaDxilMyPageCaseWidget> = {
|
|
10
19
|
title: 'PegaDxilMyPageCaseWidget',
|
|
11
20
|
component: PegaDxilMyPageCaseWidget,
|
|
@@ -15,27 +24,6 @@ const meta: Meta<typeof PegaDxilMyPageCaseWidget> = {
|
|
|
15
24
|
export default meta;
|
|
16
25
|
type Story = StoryObj<typeof PegaDxilMyPageCaseWidget>;
|
|
17
26
|
|
|
18
|
-
if (!window.PCore) {
|
|
19
|
-
window.PCore = {};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
window.PCore.getLocaleUtils = () => {
|
|
23
|
-
return {
|
|
24
|
-
getLocaleValue: value => {
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
window.PCore.getUserApi = () => {
|
|
31
|
-
return {
|
|
32
|
-
getOperatorDetails: () => {
|
|
33
|
-
return new Promise(resolve => {
|
|
34
|
-
resolve(operatorDetails);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
27
|
|
|
40
28
|
export const BasePegaDxilMyPageCaseWidget: Story = args => {
|
|
41
29
|
|