@pega/dx-component-builder-sdk 0.24.2 → 0.24.3
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/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +94 -4
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/config.json +1 -1
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -1
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
- package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +36 -26
- package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +33 -19
- package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +33 -18
- package/tests/assets/sdk-r/components/create/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +11 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +2 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +2 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +2 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/utils/index.ts +2 -7
- package/tests/assets/sdk-r/components/create/override-sdk/template/Details/Details.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +4 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +3 -2
- package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +99 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/index.tsx +201 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/date.ts +15 -37
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +11 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +3 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/index.tsx +94 -4
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Operator.tsx +215 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/demo.stories.tsx +77 -23
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/index.tsx +48 -37
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/mock.ts +78 -20
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/styles.ts +16 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/index.tsx +28 -5
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/localizations.json +4 -2
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +95 -26
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
- package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +87 -6
- package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/index.tsx +67 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/mock.ts +8 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +44 -34
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/mock.ts +7 -7
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +2 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/mock.ts +6 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +48 -32
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/config.json +64 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +91 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +157 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/mock.ts +4 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/styles.js +7 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +16 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +1 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +34 -19
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +23 -23
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/mock.ts +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +4 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +0 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/mock.ts +6 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.tsx +1 -7
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +4 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/mock.ts +181 -165
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/demo.stories.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +11 -13
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/utils.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/OneColumn.tsx +12 -13
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/index.tsx +3 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/mock.ts +8 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +207 -163
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +0 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/mock.ts +121 -122
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/config.json +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/mock.ts +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/config.json +43 -43
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +36 -26
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +33 -19
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +33 -18
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +11 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/DataReference.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/utils/index.ts +2 -7
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/Details/Details.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +4 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +3 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* eslint-disable no-nested-ternary */
|
|
2
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
-
import { Text, FieldValueList,
|
|
5
|
+
import { Text, FieldValueList, DateTimeDisplay, useTheme } from '@pega/cosmos-react-core';
|
|
6
6
|
import PegaDxilMyTwoColumnDetails from './index';
|
|
7
|
-
import { pyReviewRaw, pyReviewResolved, regionChildrenResolved } from './mock';
|
|
7
|
+
import { pyReviewRaw, pyReviewResolved, regionChildrenResolved, operatorDetails, configProps } from './mock';
|
|
8
8
|
import StatusWorkRenderer from './StatusWork';
|
|
9
|
+
import Operator from './Operator';
|
|
9
10
|
|
|
10
11
|
const meta: Meta<typeof PegaDxilMyTwoColumnDetails> = {
|
|
11
12
|
title: 'PegaDxilMyTwoColumnDetails',
|
|
@@ -18,6 +19,33 @@ const meta: Meta<typeof PegaDxilMyTwoColumnDetails> = {
|
|
|
18
19
|
|
|
19
20
|
export default meta;
|
|
20
21
|
type Story = StoryObj<typeof PegaDxilMyTwoColumnDetails>;
|
|
22
|
+
|
|
23
|
+
if (!window.PCore) {
|
|
24
|
+
window.PCore = {};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
window.PCore.getLocaleUtils = () => {
|
|
28
|
+
return {
|
|
29
|
+
getLocaleValue: value => {
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
window.PCore.getUserApi = () => {
|
|
36
|
+
return {
|
|
37
|
+
getOperatorDetails: () => {
|
|
38
|
+
return new Promise(resolve => {
|
|
39
|
+
resolve(operatorDetails);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const Region = () => {
|
|
46
|
+
return <></>;
|
|
47
|
+
};
|
|
48
|
+
|
|
21
49
|
const renderField = resolvedProps => {
|
|
22
50
|
const {
|
|
23
51
|
displayAsStatus = false,
|
|
@@ -25,7 +53,7 @@ const renderField = resolvedProps => {
|
|
|
25
53
|
value = '',
|
|
26
54
|
label = '',
|
|
27
55
|
key,
|
|
28
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
56
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks, @typescript-eslint/no-unused-vars
|
|
29
57
|
theme = useTheme()
|
|
30
58
|
} = resolvedProps;
|
|
31
59
|
|
|
@@ -53,19 +81,30 @@ const renderField = resolvedProps => {
|
|
|
53
81
|
|
|
54
82
|
if (displayAsStatus === true) val = <StatusWorkRenderer value={value} key={key} />;
|
|
55
83
|
|
|
84
|
+
const [_label] =
|
|
85
|
+
label === 'Create operator'
|
|
86
|
+
? [configProps.createLabel, configProps.createOperator, configProps.createDateTime]
|
|
87
|
+
: label === 'Update operator'
|
|
88
|
+
? [configProps.updateLabel, configProps.updateOperator, configProps.updateDateTime]
|
|
89
|
+
: [configProps.resolveLabel, configProps.resolveOperator, configProps.resolveDateTime];
|
|
90
|
+
|
|
56
91
|
if (label === 'Create Operator')
|
|
57
92
|
val = (
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
|
|
93
|
+
<Operator
|
|
94
|
+
label={configProps.hideLabel ? '' : _label}
|
|
95
|
+
name={configProps.createOperator.userName}
|
|
96
|
+
id={configProps.createOperator.userId}
|
|
97
|
+
value={undefined}
|
|
98
|
+
validatemessage=''
|
|
99
|
+
hideLabel={false}
|
|
100
|
+
readOnly={false}
|
|
101
|
+
required={false}
|
|
102
|
+
disabled={false}
|
|
103
|
+
externalUser={undefined}
|
|
104
|
+
metaObj={undefined}
|
|
105
|
+
testId=''
|
|
106
|
+
helperText=''
|
|
107
|
+
/>
|
|
69
108
|
);
|
|
70
109
|
|
|
71
110
|
if (variant === 'inline') {
|
|
@@ -122,24 +161,54 @@ export const BasePegaDxilMyTwoColumnDetails: Story = args => {
|
|
|
122
161
|
setInheritedProp: () => {
|
|
123
162
|
/* nothing */
|
|
124
163
|
},
|
|
125
|
-
resolveConfigProps:
|
|
126
|
-
|
|
164
|
+
resolveConfigProps: config => {
|
|
165
|
+
return config;
|
|
127
166
|
}
|
|
128
167
|
};
|
|
129
168
|
}
|
|
130
169
|
};
|
|
131
170
|
|
|
132
|
-
const regionAChildren = pyReviewRaw.children[0].children.map(child => {
|
|
133
|
-
return props.getPConnect().createComponent(child);
|
|
134
|
-
});
|
|
135
|
-
const regionBChildren = pyReviewRaw.children[1].children.map(child => {
|
|
136
|
-
return props.getPConnect().createComponent(child);
|
|
137
|
-
});
|
|
138
171
|
|
|
139
172
|
return (
|
|
140
173
|
<PegaDxilMyTwoColumnDetails {...props} {...args}>
|
|
141
|
-
|
|
142
|
-
|
|
174
|
+
<Region
|
|
175
|
+
{...{
|
|
176
|
+
getPConnect: () => ({
|
|
177
|
+
setInheritedProp: () => {},
|
|
178
|
+
getChildren: () =>
|
|
179
|
+
pyReviewRaw.children[0].children.map((child, index) => {
|
|
180
|
+
return {
|
|
181
|
+
getPConnect: () => ({
|
|
182
|
+
getRawMetadata: () => pyReviewRaw.children[0].children[index],
|
|
183
|
+
getConfigProps: () => {},
|
|
184
|
+
resolveConfigProps: () => regionChildrenResolved[index],
|
|
185
|
+
getComponent: () =>
|
|
186
|
+
props.getPConnect().createComponent(pyReviewRaw.children[0].children[index])
|
|
187
|
+
})
|
|
188
|
+
};
|
|
189
|
+
})
|
|
190
|
+
})
|
|
191
|
+
}}
|
|
192
|
+
/>
|
|
193
|
+
<Region
|
|
194
|
+
{...{
|
|
195
|
+
getPConnect: () => ({
|
|
196
|
+
setInheritedProp: () => {},
|
|
197
|
+
getChildren: () =>
|
|
198
|
+
pyReviewRaw.children[1].children.map((child, index) => {
|
|
199
|
+
return {
|
|
200
|
+
getPConnect: () => ({
|
|
201
|
+
getRawMetadata: () => pyReviewRaw.children[1].children[index],
|
|
202
|
+
getConfigProps: () => {},
|
|
203
|
+
resolveConfigProps: () => regionChildrenResolved[index],
|
|
204
|
+
getComponent: () =>
|
|
205
|
+
props.getPConnect().createComponent(pyReviewRaw.children[1].children[index])
|
|
206
|
+
})
|
|
207
|
+
};
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
}}
|
|
211
|
+
/>
|
|
143
212
|
</PegaDxilMyTwoColumnDetails>
|
|
144
213
|
);
|
|
145
214
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { Fragment } from 'react';
|
|
2
|
-
import { Grid, Flex, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
|
|
1
|
+
import { Fragment, Children, ReactElement } from 'react';
|
|
2
|
+
import { Grid, Flex, FieldGroup, withConfiguration, GridContainerProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import DetailsRender from './DetailsRender';
|
|
5
|
+
import HighlightRender from './HighlightRender';
|
|
4
6
|
|
|
5
|
-
import StyledPegaDxilMyTwoColumnDetailsWrapper from './styles';
|
|
7
|
+
import StyledPegaDxilMyTwoColumnDetailsWrapper, { StyledDetailsGridContainer, StyledHighlightedFieldsHrLine } from './styles';
|
|
6
8
|
|
|
7
9
|
// includes in bundle
|
|
8
10
|
import { getAllFields } from './utils';
|
|
@@ -12,34 +14,31 @@ interface PegaDxilMyTwoColumnDetailsProps extends PConnFieldProps {
|
|
|
12
14
|
// If any, enter additional props that only exist on TextInput here
|
|
13
15
|
showLabel: boolean;
|
|
14
16
|
showHighlightedData: boolean;
|
|
15
|
-
children:
|
|
17
|
+
children: ReactElement[];
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
// Duplicated runtime code from Constellation Design System Component
|
|
19
|
-
|
|
20
20
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
21
21
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
22
22
|
function PegaDxilMyTwoColumnDetails(props: PegaDxilMyTwoColumnDetailsProps) {
|
|
23
23
|
|
|
24
|
-
const { getPConnect,
|
|
24
|
+
const { getPConnect, label, children, showLabel = true, showHighlightedData = false } = props;
|
|
25
25
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
26
26
|
|
|
27
|
+
// update children with readonly
|
|
28
|
+
Children.toArray(children).forEach(child => {
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
child.props.getPConnect().setInheritedProp('readOnly', true);
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
child.props.getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
33
|
+
});
|
|
34
|
+
|
|
27
35
|
const numRegions = getAllFields(getPConnect)?.length;
|
|
28
36
|
const gridRepeat = "repeat(".concat(numRegions.toString()).concat(", 1fr)");
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
|
|
38
|
+
const gridContainer: GridContainerProps = { colGap: 6 };
|
|
31
39
|
gridContainer.cols = gridRepeat;
|
|
32
|
-
// @ts-ignore
|
|
33
40
|
gridContainer.alignItems = 'start';
|
|
34
41
|
|
|
35
|
-
const gridHighlightContainer = { "gap": 2};
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
gridHighlightContainer.cols = gridRepeat;
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
gridHighlightContainer.alignItems = 'start';
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
gridHighlightContainer.pad = [0, 0, 2, 0];
|
|
42
|
-
|
|
43
42
|
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
44
43
|
let highlightedDataArr = [];
|
|
45
44
|
if (showHighlightedData) {
|
|
@@ -47,15 +46,7 @@ function PegaDxilMyTwoColumnDetails(props: PegaDxilMyTwoColumnDetailsProps) {
|
|
|
47
46
|
const { highlightedData = [] } = getPConnect().getRawMetadata().config;
|
|
48
47
|
// @ts-ignore
|
|
49
48
|
highlightedDataArr = highlightedData.map((field) => {
|
|
50
|
-
field
|
|
51
|
-
|
|
52
|
-
// Mark as status display when using pyStatusWork
|
|
53
|
-
if (field.config.value === '@P .pyStatusWork') {
|
|
54
|
-
field.type = 'TextInput';
|
|
55
|
-
field.config.displayAsStatus = true;
|
|
56
|
-
}
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
return getPConnect().createComponent(field);
|
|
49
|
+
return <HighlightRender field={field} getPConnect={props.getPConnect} />;
|
|
59
50
|
});
|
|
60
51
|
}
|
|
61
52
|
|
|
@@ -63,17 +54,29 @@ function PegaDxilMyTwoColumnDetails(props: PegaDxilMyTwoColumnDetailsProps) {
|
|
|
63
54
|
<StyledPegaDxilMyTwoColumnDetailsWrapper>
|
|
64
55
|
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
65
56
|
{showHighlightedData && highlightedDataArr.length > 0 && (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
<>
|
|
58
|
+
<Flex
|
|
59
|
+
container={{ direction: 'row', alignItems: 'start', colGap: 10 }}
|
|
60
|
+
data-testid={`highlighted-column-count-${numRegions}`}
|
|
61
|
+
>
|
|
62
|
+
{highlightedDataArr.map((child: any, i: number) => (
|
|
63
|
+
<Fragment key={`hf-${i + 1}`}>{child}</Fragment>
|
|
64
|
+
))}
|
|
65
|
+
</Flex>
|
|
66
|
+
<StyledHighlightedFieldsHrLine />
|
|
67
|
+
</>
|
|
72
68
|
)}
|
|
73
|
-
<Grid
|
|
69
|
+
<Grid
|
|
70
|
+
as={StyledDetailsGridContainer}
|
|
71
|
+
container={gridContainer}
|
|
72
|
+
data-testid={`column-count-${numRegions}`} >
|
|
74
73
|
{children.map((child: any, i: number) => (
|
|
75
|
-
<Flex
|
|
76
|
-
|
|
74
|
+
<Flex
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
container={{ direction: 'column', alignItems: 'normal', colGap: 1, rowGap: 1.5 }}
|
|
77
|
+
key={`r-${i + 1}`}
|
|
78
|
+
>
|
|
79
|
+
<DetailsRender child={child} />
|
|
77
80
|
</Flex>
|
|
78
81
|
))}
|
|
79
82
|
</Grid>
|
|
@@ -16,6 +16,7 @@ export const pyReviewRaw = {
|
|
|
16
16
|
config: {
|
|
17
17
|
value: '@P .pyStatusWork',
|
|
18
18
|
label: '@L Work Status',
|
|
19
|
+
hideLabel: true,
|
|
19
20
|
displayMode: 'STACKED_LARGE_VAL',
|
|
20
21
|
displayAsStatus: true,
|
|
21
22
|
key: 'pyStatusWork'
|
|
@@ -26,6 +27,7 @@ export const pyReviewRaw = {
|
|
|
26
27
|
config: {
|
|
27
28
|
value: '@P .pyID',
|
|
28
29
|
label: '@L Case ID',
|
|
30
|
+
hideLabel: true,
|
|
29
31
|
displayMode: 'STACKED_LARGE_VAL',
|
|
30
32
|
key: 'pyID'
|
|
31
33
|
}
|
|
@@ -35,6 +37,7 @@ export const pyReviewRaw = {
|
|
|
35
37
|
config: {
|
|
36
38
|
value: '@P .pxCreateDateTime',
|
|
37
39
|
label: '@L Create date/time',
|
|
40
|
+
hideLabel: true,
|
|
38
41
|
displayMode: 'STACKED_LARGE_VAL',
|
|
39
42
|
key: 'pxCreateDateTime'
|
|
40
43
|
}
|
|
@@ -43,6 +46,7 @@ export const pyReviewRaw = {
|
|
|
43
46
|
type: 'UserReference',
|
|
44
47
|
config: {
|
|
45
48
|
label: '@L Create Operator',
|
|
49
|
+
hideLabel: true,
|
|
46
50
|
value: '@USER .pxCreateOperator',
|
|
47
51
|
placeholder: 'Select...',
|
|
48
52
|
displayMode: 'STACKED_LARGE_VAL',
|
|
@@ -160,7 +164,6 @@ export const pyReviewResolved = {
|
|
|
160
164
|
config: {
|
|
161
165
|
value: 'New',
|
|
162
166
|
label: 'Work Status',
|
|
163
|
-
displayMode: 'STACKED_LARGE_VAL',
|
|
164
167
|
displayAsStatus: true
|
|
165
168
|
}
|
|
166
169
|
},
|
|
@@ -168,16 +171,14 @@ export const pyReviewResolved = {
|
|
|
168
171
|
type: 'TextInput',
|
|
169
172
|
config: {
|
|
170
173
|
value: 'M-1002',
|
|
171
|
-
label: 'Case ID'
|
|
172
|
-
displayMode: 'STACKED_LARGE_VAL'
|
|
174
|
+
label: 'Case ID'
|
|
173
175
|
}
|
|
174
176
|
},
|
|
175
177
|
{
|
|
176
178
|
type: 'DateTime',
|
|
177
179
|
config: {
|
|
178
180
|
value: '2022-12-11T20:06:27.232Z',
|
|
179
|
-
label: 'Create date/time'
|
|
180
|
-
displayMode: 'STACKED_LARGE_VAL'
|
|
181
|
+
label: 'Create date/time'
|
|
181
182
|
}
|
|
182
183
|
},
|
|
183
184
|
{
|
|
@@ -188,8 +189,7 @@ export const pyReviewResolved = {
|
|
|
188
189
|
userId: 'conns',
|
|
189
190
|
userName: 'Sara Connor'
|
|
190
191
|
},
|
|
191
|
-
placeholder: 'Select...'
|
|
192
|
-
displayMode: 'STACKED_LARGE_VAL'
|
|
192
|
+
placeholder: 'Select...'
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
],
|
|
@@ -199,22 +199,25 @@ export const pyReviewResolved = {
|
|
|
199
199
|
export const regionChildrenResolved = [
|
|
200
200
|
{
|
|
201
201
|
readOnly: true,
|
|
202
|
-
value: '',
|
|
202
|
+
value: 'Deadline',
|
|
203
203
|
label: 'SLA Deadline',
|
|
204
|
+
hideLabel: true,
|
|
204
205
|
displayMode: 'LABELS_LEFT',
|
|
205
206
|
key: 'SLA Deadline'
|
|
206
207
|
},
|
|
207
208
|
{
|
|
208
209
|
readOnly: true,
|
|
209
|
-
value: '',
|
|
210
|
+
value: 'Goal',
|
|
210
211
|
label: 'SLA Goal',
|
|
212
|
+
hideLabel: true,
|
|
211
213
|
displayMode: 'LABELS_LEFT',
|
|
212
214
|
key: 'SLA Goal'
|
|
213
215
|
},
|
|
214
216
|
{
|
|
215
217
|
readOnly: true,
|
|
216
|
-
value: '',
|
|
218
|
+
value: 'Start Time',
|
|
217
219
|
label: 'SLA Start Time',
|
|
220
|
+
hideLabel: true,
|
|
218
221
|
listType: 'associated',
|
|
219
222
|
datasource: [
|
|
220
223
|
{
|
|
@@ -230,3 +233,58 @@ export const regionChildrenResolved = [
|
|
|
230
233
|
key: 'SLA Start Time'
|
|
231
234
|
}
|
|
232
235
|
];
|
|
236
|
+
|
|
237
|
+
export const operatorDetails = {
|
|
238
|
+
data: {
|
|
239
|
+
pzLoadTime: 'January 18, 2023 10:33:19 AM EST',
|
|
240
|
+
pzPageNameHash: '_pa1519192551088960pz',
|
|
241
|
+
pyOperatorInfo: {
|
|
242
|
+
pyUserName: 'french DigV2',
|
|
243
|
+
pyPosition: '',
|
|
244
|
+
pyImageInsKey: '',
|
|
245
|
+
pySkills: [
|
|
246
|
+
{
|
|
247
|
+
pySkillName: '',
|
|
248
|
+
pzIndexOwnerKey: 'DATA-ADMIN-OPERATOR-ID FRENCHTEST.DIGV2',
|
|
249
|
+
pySkillRating: 0
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
pyReportToUserName: '',
|
|
253
|
+
pyReportTo: '',
|
|
254
|
+
pyOrganization: 'DXIL',
|
|
255
|
+
pyTitle: '',
|
|
256
|
+
pyLabel: 'frenchTest.DigV2',
|
|
257
|
+
pyEmailAddress: 'User@DigV2',
|
|
258
|
+
pyTelephone: ''
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
status: 200,
|
|
262
|
+
statusText: '',
|
|
263
|
+
headers: {
|
|
264
|
+
'content-length': '435',
|
|
265
|
+
'content-type': 'application/json;charset=UTF-8'
|
|
266
|
+
},
|
|
267
|
+
request: {}
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const configProps = {
|
|
271
|
+
label: 'Create operator',
|
|
272
|
+
createLabel: 'Created',
|
|
273
|
+
updateLabel: 'Updated',
|
|
274
|
+
updateDateTime: '2023-01-16T14:53:33.280Z',
|
|
275
|
+
createDateTime: '2023-01-16T14:53:33.198Z',
|
|
276
|
+
updateOperator: {
|
|
277
|
+
userId: 'admin@mediaco',
|
|
278
|
+
userName: 'admin'
|
|
279
|
+
},
|
|
280
|
+
createOperator: {
|
|
281
|
+
userId: 'admin@mediaco',
|
|
282
|
+
userName: 'admin'
|
|
283
|
+
},
|
|
284
|
+
resolveLabel: '',
|
|
285
|
+
resolveOperator: '',
|
|
286
|
+
resolveDateTime: '',
|
|
287
|
+
hideLabel: true,
|
|
288
|
+
key: '_532zx1dah',
|
|
289
|
+
displayMode: 'LABELS_LEFT'
|
|
290
|
+
};
|
|
@@ -6,3 +6,18 @@ export default styled.div(() => {
|
|
|
6
6
|
margin: 0px 0;
|
|
7
7
|
`;
|
|
8
8
|
});
|
|
9
|
+
|
|
10
|
+
export const StyledDetailsGridContainer = styled.div(() => {
|
|
11
|
+
return css`
|
|
12
|
+
margin-line-start: 1;
|
|
13
|
+
`;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const StyledHighlightedFieldsHrLine = styled.hr(() => {
|
|
17
|
+
return css`
|
|
18
|
+
line: {
|
|
19
|
+
margin: '0.75rem 0';
|
|
20
|
+
opacity: '50%'
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Fragment, ReactElement } from 'react';
|
|
2
|
+
import { FieldValueList } from '@pega/cosmos-react-core';
|
|
3
|
+
|
|
4
|
+
interface DetailsRenderProps {
|
|
5
|
+
children?: never;
|
|
6
|
+
child: NonNullable<ReactElement>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const DetailsRender = (props: DetailsRenderProps) => {
|
|
10
|
+
const { child } = props;
|
|
11
|
+
|
|
12
|
+
const kids = child.props.getPConnect().getChildren();
|
|
13
|
+
|
|
14
|
+
const displayCompArr: ReactElement[] = [];
|
|
15
|
+
|
|
16
|
+
Object.values(kids).forEach((value: any) => {
|
|
17
|
+
const { type } = value.getPConnect().getRawMetadata();
|
|
18
|
+
const { hideLabel, variant, testId, label } = value
|
|
19
|
+
.getPConnect()
|
|
20
|
+
.resolveConfigProps(value.getPConnect().getConfigProps());
|
|
21
|
+
|
|
22
|
+
let displayComp;
|
|
23
|
+
const key = JSON.stringify(value.getPConnect());
|
|
24
|
+
|
|
25
|
+
if (type === 'reference') {
|
|
26
|
+
const refElement = value.getPConnect().getComponent();
|
|
27
|
+
|
|
28
|
+
displayCompArr.push(refElement);
|
|
29
|
+
} else {
|
|
30
|
+
const element = value.getPConnect().getComponent();
|
|
31
|
+
const displayEl = <Fragment key={key}>{element}</Fragment>;
|
|
32
|
+
|
|
33
|
+
const fvlStyle = {
|
|
34
|
+
myColGap: {
|
|
35
|
+
columnGap: '0',
|
|
36
|
+
marginLineStart: 0
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// const myEl = <div>boo</div>;
|
|
41
|
+
displayComp = (
|
|
42
|
+
<Fragment key={key}>
|
|
43
|
+
<FieldValueList
|
|
44
|
+
style={fvlStyle.myColGap}
|
|
45
|
+
variant={hideLabel ? 'stacked' : variant}
|
|
46
|
+
data-testid={testId}
|
|
47
|
+
fields={[{ id: '1', name: hideLabel ? '' : label, value: displayEl }]}
|
|
48
|
+
/>
|
|
49
|
+
</Fragment>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
displayCompArr.push(displayComp);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return <>{displayCompArr}</>;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default DetailsRender;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Grid, Flex, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
|
|
2
2
|
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import DetailsRender from './DetailsRender';
|
|
4
5
|
|
|
5
6
|
import StyledPegaDxilMyTwoColumnFormWrapper from './styles';
|
|
6
7
|
|
|
@@ -11,19 +12,17 @@ interface PegaDxilMyTwoColumnFormProps extends PConnFieldProps {
|
|
|
11
12
|
children: any;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
// Duplicated runtime code from Constellation Design System Component
|
|
15
|
-
|
|
16
15
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
17
16
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
18
17
|
function PegaDxilMyTwoColumnForm(props: PegaDxilMyTwoColumnFormProps) {
|
|
19
18
|
|
|
20
19
|
|
|
21
|
-
const { children = [], label, showLabel, getPConnect } = props;
|
|
20
|
+
const { children = [], label, showLabel, getPConnect, readOnly, displayMode } = props;
|
|
22
21
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
23
22
|
|
|
24
23
|
const numRegions = children?.length;
|
|
25
24
|
const gridRepeat = "repeat(".concat(numRegions).concat(", 1fr)");
|
|
26
|
-
const gridContainer = {"colGap" :
|
|
25
|
+
const gridContainer = {"colGap" : 6};
|
|
27
26
|
// @ts-ignore
|
|
28
27
|
gridContainer.cols = gridRepeat;
|
|
29
28
|
// @ts-ignore
|
|
@@ -33,6 +32,26 @@ function PegaDxilMyTwoColumnForm(props: PegaDxilMyTwoColumnFormProps) {
|
|
|
33
32
|
// @ts-ignore
|
|
34
33
|
flexContainer.gap = 2;
|
|
35
34
|
|
|
35
|
+
if (readOnly && readOnly === true && displayMode && displayMode === 'DISPLAY_ONLY') {
|
|
36
|
+
return (
|
|
37
|
+
<StyledPegaDxilMyTwoColumnFormWrapper>
|
|
38
|
+
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
39
|
+
<Grid container={gridContainer} data-testid={`column-count-${numRegions}`}>
|
|
40
|
+
{children.map((child: any, i: number) => (
|
|
41
|
+
<Flex
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
container={{ direction: 'column', alignItems: 'normal', colGap: 1, rowGap: 1.5 }}
|
|
44
|
+
key={`r-${i + 1}`}
|
|
45
|
+
>
|
|
46
|
+
<DetailsRender child={child} />
|
|
47
|
+
</Flex>
|
|
48
|
+
))}
|
|
49
|
+
</Grid>
|
|
50
|
+
</FieldGroup>
|
|
51
|
+
</StyledPegaDxilMyTwoColumnFormWrapper>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
36
55
|
return (
|
|
37
56
|
<StyledPegaDxilMyTwoColumnFormWrapper>
|
|
38
57
|
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
@@ -17,17 +17,98 @@ const meta: Meta<typeof PegaDxilMyPageWidget> = {
|
|
|
17
17
|
export default meta;
|
|
18
18
|
type Story = StoryObj<typeof PegaDxilMyPageWidget>;
|
|
19
19
|
|
|
20
|
+
if (!window.PCore) {
|
|
21
|
+
window.PCore = {};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const worklistData = {
|
|
25
|
+
data: {
|
|
26
|
+
data: [
|
|
27
|
+
{
|
|
28
|
+
pxProcessName: 'Loan',
|
|
29
|
+
pxRefObjectInsName: ' A-8002',
|
|
30
|
+
pyAssignmentStatus: 'New',
|
|
31
|
+
pxTaskLabel: 'Details'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
pxProcessName: 'Loan',
|
|
35
|
+
pxRefObjectInsName: ' A-7001',
|
|
36
|
+
pyAssignmentStatus: 'Open',
|
|
37
|
+
pxTaskLabel: 'Info'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
pxProcessName: 'Loan',
|
|
41
|
+
pxRefObjectInsName: ' A-9000',
|
|
42
|
+
pyAssignmentStatus: 'Open',
|
|
43
|
+
pxTaskLabel: 'Amount'
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
window.PCore.getDataApiUtils = () => {
|
|
50
|
+
return {
|
|
51
|
+
getData: () => {
|
|
52
|
+
return new Promise(resolve => {
|
|
53
|
+
resolve(worklistData);
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
getDataAsync: () => {
|
|
57
|
+
return new Promise(resolve => {
|
|
58
|
+
resolve(worklistData);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
20
66
|
export const BasePegaDxilMyPageWidget: Story = args => {
|
|
21
67
|
|
|
22
68
|
const props = {
|
|
23
|
-
|
|
69
|
+
...configProps,
|
|
70
|
+
getPConnect: () => {
|
|
71
|
+
return {
|
|
72
|
+
getValue: value => {
|
|
73
|
+
return value;
|
|
74
|
+
},
|
|
75
|
+
getContextName: () => {
|
|
76
|
+
return 'app/primary_1';
|
|
77
|
+
},
|
|
78
|
+
getLocalizedValue: value => {
|
|
79
|
+
return value;
|
|
80
|
+
},
|
|
81
|
+
getActionsApi: () => {
|
|
82
|
+
return {
|
|
83
|
+
updateFieldValue: () => {
|
|
84
|
+
/* nothing */
|
|
85
|
+
},
|
|
86
|
+
triggerFieldChange: () => {
|
|
87
|
+
/* nothing */
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
ignoreSuggestion: () => {
|
|
92
|
+
/* nothing */
|
|
93
|
+
},
|
|
94
|
+
acceptSuggestion: () => {
|
|
95
|
+
/* nothing */
|
|
96
|
+
},
|
|
97
|
+
setInheritedProps: () => {
|
|
98
|
+
/* nothing */
|
|
99
|
+
},
|
|
100
|
+
resolveConfigProps: () => {
|
|
101
|
+
/* nothing */
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
24
105
|
};
|
|
25
106
|
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
107
|
+
return (
|
|
108
|
+
<>
|
|
109
|
+
<PegaDxilMyPageWidget {...props} {...args} />
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
31
112
|
};
|
|
32
113
|
|
|
33
114
|
BasePegaDxilMyPageWidget.args = {
|