@pega/custom-dx-components 0.23.49 → 0.23.50
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/cli.js +9 -3
- package/src/constants.js +5 -0
- package/src/tasks/build-all/helper.js +1 -1
- package/src/tasks/build-comp/helper.js +4 -2
- package/src/tasks/build-comp/index.js +8 -2
- package/src/tasks/build-jest-assets/index.js +171 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +3 -1
- package/src/tasks/create/templates/Constellation/Field/Date/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Integer/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Input/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Text-URL/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/FORM-region/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Widget/CASE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +1 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/create-nonce.ts.mustache +6 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +1 -0
- package/src/tasks/delete/helper.js +75 -50
- package/src/tasks/index.js +1 -0
- package/src/tasks/init/helper.js +5 -5
- package/src/tasks/init/template/package.json.mustache +5 -4
- package/src/tasks/list/helper.js +5 -2
- package/src/tasks/publish/helper.js +53 -45
- package/src/tasks/publish/index.js +8 -2
- package/src/tasks/publish-all/helper.js +6 -0
- package/src/tasks/rename/index.js +9 -2
- package/src/tasks/revert-webpack/index.js +8 -26
- package/src/util.js +51 -72
- package/tests/assets/components/create/Pega_DXIL_MyTestText/create-nonce.ts +6 -0
- package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +1 -0
- package/tests/assets/components/create/_components.md +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +3 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.tsx +1 -0
- package/tests/assets/components/createAll/Constellation/_components.md +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +3 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/create-nonce.ts +6 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.tsx +1 -0
- package/tests/assets/components/createAll/Launchpad/_components.md +1 -0
|
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
import { TimeInput, FieldValueList, DateTimeDisplay, Text, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
|
|
4
4
|
import type { PConnFieldProps } from './PConnProps';
|
|
5
|
+
import './create-nonce';
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
// includes in bundle
|
|
@@ -140,7 +141,7 @@ function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
140
141
|
);
|
|
141
142
|
switch (displayMode) {
|
|
142
143
|
case 'DISPLAY_ONLY': {
|
|
143
|
-
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
144
|
+
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
144
145
|
}
|
|
145
146
|
case 'LABELS_LEFT': {
|
|
146
147
|
return (
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
2
|
import { Grid, Flex, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import './create-nonce';
|
|
4
5
|
|
|
5
6
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
2
|
import { Grid, Flex, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import './create-nonce';
|
|
4
5
|
|
|
5
6
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
7
|
|
|
@@ -3,7 +3,7 @@ import { OneColumnPage as OneColumn, withConfiguration } from '@pega/cosmos-reac
|
|
|
3
3
|
import { ConfigurableLayout } from '@pega/cosmos-react-work'
|
|
4
4
|
// import { registerIcon } from '@pega/cosmos-react-core';
|
|
5
5
|
import type { PConnFieldProps } from './PConnProps';
|
|
6
|
-
|
|
6
|
+
import './create-nonce';
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
// temp
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import { Table, Text, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import './create-nonce';
|
|
4
5
|
|
|
5
6
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { withConfiguration } from '@pega/cosmos-react-core';
|
|
2
2
|
import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import './create-nonce';
|
|
4
5
|
|
|
5
6
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
7
|
|
|
@@ -4,6 +4,7 @@ import { Fragment } from 'react';
|
|
|
4
4
|
import { DateTimeDisplay, Card, CardHeader, CardContent, Flex, withConfiguration } from '@pega/cosmos-react-core';
|
|
5
5
|
|
|
6
6
|
import type { PConnFieldProps } from './PConnProps';
|
|
7
|
+
import './create-nonce';
|
|
7
8
|
|
|
8
9
|
// includes in bundle
|
|
9
10
|
import Operator from './Operator';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import { Table, Text, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import './create-nonce';
|
|
4
5
|
|
|
5
6
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
2
|
import { DateTimeDisplay, Card, CardHeader, CardContent, Flex, withConfiguration } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import './create-nonce';
|
|
4
5
|
|
|
5
6
|
// includes in bundle
|
|
6
7
|
import Operator from './Operator';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
+
import path, { join } from 'path';
|
|
3
|
+
|
|
2
4
|
import chalk from 'chalk';
|
|
3
5
|
import inquirer from 'inquirer';
|
|
4
6
|
import ora from 'ora';
|
|
5
7
|
|
|
6
|
-
import path from 'path';
|
|
7
|
-
import { join } from 'path';
|
|
8
|
-
|
|
9
8
|
import {
|
|
10
9
|
deleteLocalComponent,
|
|
11
10
|
deleteInfinityServerComponent,
|
|
@@ -16,8 +15,11 @@ import {
|
|
|
16
15
|
sanitize
|
|
17
16
|
} from '../../util.js';
|
|
18
17
|
import { getComponentsFromServer } from '../list/helper.js';
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
import {
|
|
19
|
+
TASKS_CONFIG_JSON_FILENAME,
|
|
20
|
+
COMPONENTS_DIRECTORY_PATH,
|
|
21
|
+
COMPONENTS_PATH
|
|
22
|
+
} from '../../constants.js';
|
|
21
23
|
|
|
22
24
|
export const SOURCE_OF_COMPONENT_TYPES = {
|
|
23
25
|
SERVER: 'Server',
|
|
@@ -27,8 +29,7 @@ export const SOURCE_OF_COMPONENT_TYPES = {
|
|
|
27
29
|
let library;
|
|
28
30
|
let organization;
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
export const getDeleteComponentsQuestions = async (options) => {
|
|
32
|
+
export const getDeleteComponentsQuestions = async options => {
|
|
32
33
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
33
34
|
|
|
34
35
|
return [
|
|
@@ -63,34 +64,34 @@ export const getLaunchPadFilterQuestions = async () => {
|
|
|
63
64
|
|
|
64
65
|
const componentData = data[COMPONENTS_PATH];
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
({ library } = componentData);
|
|
68
|
+
({ organization } = JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')));
|
|
68
69
|
|
|
69
70
|
return [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
{
|
|
72
|
+
name: 'organization',
|
|
73
|
+
message: 'Enter component organization (required)',
|
|
74
|
+
default: organization,
|
|
75
|
+
validate: value => {
|
|
76
|
+
if (value) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
return 'Please provide value for organization';
|
|
77
80
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'library',
|
|
84
|
+
message: 'Enter library name (required)',
|
|
85
|
+
default: library,
|
|
86
|
+
validate: value => {
|
|
87
|
+
if (value) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return 'Please provide value for library';
|
|
88
91
|
}
|
|
89
|
-
return 'Please provide value for library';
|
|
90
92
|
}
|
|
91
|
-
}
|
|
92
93
|
];
|
|
93
|
-
}
|
|
94
|
+
};
|
|
94
95
|
|
|
95
96
|
export const deleteLocalComponents = async (sourceOfComponents, options) => {
|
|
96
97
|
const localComponents = await getComponents();
|
|
@@ -99,7 +100,8 @@ export const deleteLocalComponents = async (sourceOfComponents, options) => {
|
|
|
99
100
|
if (options.params.length >= 6) {
|
|
100
101
|
const componentKey = options.params[4];
|
|
101
102
|
const sDeletion = options.params[5];
|
|
102
|
-
const confirmDeletion =
|
|
103
|
+
const confirmDeletion =
|
|
104
|
+
sDeletion === 'Y' || sDeletion === 'y' || sDeletion === true || sDeletion === 'true';
|
|
103
105
|
if (confirmDeletion) {
|
|
104
106
|
await deleteLocalComponent(componentKey);
|
|
105
107
|
}
|
|
@@ -128,27 +130,41 @@ export const deleteLocalComponents = async (sourceOfComponents, options) => {
|
|
|
128
130
|
};
|
|
129
131
|
|
|
130
132
|
export const deleteServerComponents = async (sourceOfComponents, answers) => {
|
|
131
|
-
|
|
132
133
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
133
134
|
const isLaunchpad = defaultPegaServerConfig.serverType === 'launchpad';
|
|
134
135
|
|
|
135
|
-
|
|
136
136
|
if (isLaunchpad) {
|
|
137
137
|
const questions = await getLaunchPadFilterQuestions();
|
|
138
138
|
const lpAnswers = await inquirer.prompt(questions);
|
|
139
139
|
|
|
140
|
-
({library, organization} = lpAnswers);
|
|
140
|
+
({ library, organization } = lpAnswers);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
let spinner;
|
|
144
|
+
let data;
|
|
145
|
+
try {
|
|
146
|
+
spinner = ora('Fetching components from server').start();
|
|
147
|
+
data = await getComponentsFromServer(library, organization);
|
|
148
|
+
spinner.stop();
|
|
149
|
+
} catch (error) {
|
|
150
|
+
spinner.stop();
|
|
151
|
+
if (error.indexOf('ECONNREFUSED') >= 0) {
|
|
152
|
+
console.log(
|
|
153
|
+
`\n${chalk.bold.red(
|
|
154
|
+
'Error occurred in authentication. Please regenerate using authenticate'
|
|
155
|
+
)}`
|
|
156
|
+
);
|
|
157
|
+
} else {
|
|
158
|
+
console.log(`${chalk.bold.red(error)}`);
|
|
159
|
+
}
|
|
146
160
|
|
|
161
|
+
// spinner.stop();
|
|
162
|
+
process.exit(1);
|
|
163
|
+
}
|
|
147
164
|
|
|
148
165
|
let serverComponents;
|
|
149
166
|
if (isLaunchpad) {
|
|
150
167
|
serverComponents = data;
|
|
151
|
-
|
|
152
168
|
} else {
|
|
153
169
|
try {
|
|
154
170
|
if (typeof data === 'object') {
|
|
@@ -161,14 +177,18 @@ export const deleteServerComponents = async (sourceOfComponents, answers) => {
|
|
|
161
177
|
}
|
|
162
178
|
}
|
|
163
179
|
|
|
164
|
-
|
|
165
180
|
if (serverComponents && serverComponents?.length > 0) {
|
|
166
181
|
if (isLaunchpad) {
|
|
167
182
|
const choicesArr = serverComponents.map(({ name: componentName, type, version }) => {
|
|
168
|
-
const name = `${standardizeStr(componentName, 45)} ${standardizeStr(
|
|
183
|
+
const name = `${standardizeStr(componentName, 45)} ${standardizeStr(
|
|
184
|
+
type,
|
|
185
|
+
20
|
|
186
|
+
)} ${standardizeStr(version, 20)}`;
|
|
169
187
|
|
|
170
188
|
const value = `${componentName}~|~${type}~|~${version}`;
|
|
171
|
-
const short = `\n Selected component : ${chalk.redBright(
|
|
189
|
+
const short = `\n Selected component : ${chalk.redBright(
|
|
190
|
+
`${componentName} ${type} : ${version}`
|
|
191
|
+
)}`;
|
|
172
192
|
|
|
173
193
|
return { name, value, short };
|
|
174
194
|
});
|
|
@@ -177,20 +197,25 @@ export const deleteServerComponents = async (sourceOfComponents, answers) => {
|
|
|
177
197
|
name: 'componentToDelete',
|
|
178
198
|
type: 'rawlist',
|
|
179
199
|
pageSize: 10,
|
|
180
|
-
message: `Select component to delete \n ${standardizeStr(
|
|
181
|
-
'
|
|
182
|
-
|
|
183
|
-
)}`,
|
|
200
|
+
message: `Select component to delete \n ${standardizeStr(
|
|
201
|
+
'Component Name',
|
|
202
|
+
48
|
|
203
|
+
)} ${standardizeStr('Type', 20)} ${standardizeStr('Version', 22)}`,
|
|
184
204
|
choices: choicesArr
|
|
185
205
|
});
|
|
186
206
|
await deleteLaunchpadServerComponent(launchpadAnswers.componentToDelete);
|
|
187
207
|
} else {
|
|
188
208
|
// logic for Infinity
|
|
189
209
|
const choicesArr = serverComponents.map(({ label, pyRuleSet, pyRuleSetVersion }) => {
|
|
190
|
-
const name = `${standardizeStr(label, 45)} ${standardizeStr(
|
|
210
|
+
const name = `${standardizeStr(label, 45)} ${standardizeStr(
|
|
211
|
+
pyRuleSet,
|
|
212
|
+
30
|
|
213
|
+
)} ${standardizeStr(pyRuleSetVersion, 20)}`;
|
|
191
214
|
|
|
192
215
|
const value = `${label}~|~${pyRuleSet}~|~${pyRuleSetVersion}`;
|
|
193
|
-
const short = `\n Selected component : ${chalk.redBright(
|
|
216
|
+
const short = `\n Selected component : ${chalk.redBright(
|
|
217
|
+
`${label} ${pyRuleSet} : ${pyRuleSetVersion}`
|
|
218
|
+
)}`;
|
|
194
219
|
|
|
195
220
|
return { name, value, short };
|
|
196
221
|
});
|
|
@@ -198,10 +223,10 @@ export const deleteServerComponents = async (sourceOfComponents, answers) => {
|
|
|
198
223
|
name: 'componentToDelete',
|
|
199
224
|
type: 'rawlist',
|
|
200
225
|
pageSize: 10,
|
|
201
|
-
message: `Select component to delete \n ${standardizeStr(
|
|
202
|
-
'
|
|
203
|
-
|
|
204
|
-
)}`,
|
|
226
|
+
message: `Select component to delete \n ${standardizeStr(
|
|
227
|
+
'Rule name',
|
|
228
|
+
48
|
|
229
|
+
)} ${standardizeStr('Ruleset name', 30)} ${standardizeStr('Ruleset version', 22)}`,
|
|
205
230
|
choices: choicesArr
|
|
206
231
|
});
|
|
207
232
|
await deleteInfinityServerComponent(infinityAnswers.componentToDelete);
|
package/src/tasks/index.js
CHANGED
|
@@ -15,3 +15,4 @@ export { default as authenticate } from './authenticate/index.js';
|
|
|
15
15
|
export { default as upgrade } from './upgrade/index.js';
|
|
16
16
|
export { default as buildComponent } from './build-comp/index.js';
|
|
17
17
|
export { default as buildAllComponents } from './build-all/index.js';
|
|
18
|
+
export { default as buildJestAssets } from './build-jest-assets/index.js';
|
package/src/tasks/init/helper.js
CHANGED
|
@@ -48,11 +48,11 @@ export const getInitProjectQuestions = () => {
|
|
|
48
48
|
message: 'Description',
|
|
49
49
|
default: ''
|
|
50
50
|
},
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
51
|
+
// {
|
|
52
|
+
// name: 'gitRepositoryUrl',
|
|
53
|
+
// message: 'Git repository url (optional)',
|
|
54
|
+
// default: ''
|
|
55
|
+
// },
|
|
56
56
|
{
|
|
57
57
|
name: 'author',
|
|
58
58
|
message: 'Author',
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"_internal-test-full": "npm run _internal-test-functional && npm run _internal-test-unit",
|
|
29
29
|
"_internal-test-functional": "npm run test:functional:local --prefix node_modules/@pega/custom-dx-components",
|
|
30
30
|
"_internal-test-unit": "npm run test:unit:local --prefix node_modules/@pega/custom-dx-components",
|
|
31
|
+
"_internal-build-jest-assets": "custom-dx-components buildJestAssets",
|
|
31
32
|
"_lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
|
|
32
33
|
"_lint:format": "prettier -c .",
|
|
33
34
|
"_lint:spelling": "cspell --no-progress **/*",
|
|
@@ -50,9 +51,9 @@
|
|
|
50
51
|
"license": "Enter License",
|
|
51
52
|
"sideEffects": false,
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"@pega/cosmos-react-condition-builder": "^4.
|
|
54
|
-
"@pega/cosmos-react-core": "^4.
|
|
55
|
-
"@pega/cosmos-react-work": "^4.
|
|
54
|
+
"@pega/cosmos-react-condition-builder": "^4.3.1",
|
|
55
|
+
"@pega/cosmos-react-core": "^4.3.1",
|
|
56
|
+
"@pega/cosmos-react-work": "^4.3.1",
|
|
56
57
|
"dayjs": "^1.11.10",
|
|
57
58
|
"lodash.get": "^4.4.2",
|
|
58
59
|
"polished": "^4.2.2",
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@pega/configs": "^0.6.0",
|
|
71
|
-
"@pega/custom-dx-components": "0.23.
|
|
72
|
+
"@pega/custom-dx-components": "0.23.50",
|
|
72
73
|
"@pega/pcore-pconnect-typedefs": "~2.1.1",
|
|
73
74
|
"@storybook/addon-actions": "^7.6.7",
|
|
74
75
|
"@storybook/addon-essentials": "^7.6.7",
|
package/src/tasks/list/helper.js
CHANGED
|
@@ -102,7 +102,10 @@ async function fetchComponentsFromInfinity(apiUrl, headers) {
|
|
|
102
102
|
})
|
|
103
103
|
.then((response) => {
|
|
104
104
|
status = response.status;
|
|
105
|
-
if (status ===
|
|
105
|
+
if (status === 401) {
|
|
106
|
+
throw new Error('Error occurred in authentication. Please regenerate using authenticate');
|
|
107
|
+
}
|
|
108
|
+
else if (status === 404){
|
|
106
109
|
throw new Error('404: Server resource not found');
|
|
107
110
|
}
|
|
108
111
|
else if (status === 405){
|
|
@@ -186,7 +189,7 @@ export const getComponentsFromServer = async (library, organization) => {
|
|
|
186
189
|
fs.readFile(TOKEN_PATH, 'utf8', (err, data) => {
|
|
187
190
|
if (err) {
|
|
188
191
|
// eslint-disable-next-line prefer-promise-reject-errors
|
|
189
|
-
reject(`\n${chalk.bold.red('
|
|
192
|
+
reject(`\n${chalk.bold.red('\nError occurred in authentication. Please regenerate using authenticate')}`);
|
|
190
193
|
}
|
|
191
194
|
if (data) {
|
|
192
195
|
const { access_token: accessToken, token_type: tokenType } = JSON.parse(data);
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
TOKEN_PATH
|
|
20
20
|
} from '../../constants.js';
|
|
21
21
|
|
|
22
|
-
export const getPublishComponentQuestions = async
|
|
22
|
+
export const getPublishComponentQuestions = async componentKey => {
|
|
23
23
|
const components = await getComponents();
|
|
24
24
|
|
|
25
25
|
if (components.length === 0) {
|
|
@@ -34,7 +34,9 @@ export const getPublishComponentQuestions = async () => {
|
|
|
34
34
|
name: 'componentKey',
|
|
35
35
|
type: 'rawlist',
|
|
36
36
|
message: 'Select component to publish',
|
|
37
|
-
choices: components
|
|
37
|
+
choices: components,
|
|
38
|
+
default: componentKey,
|
|
39
|
+
when: () => !componentKey
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
42
|
name: 'rulesetName',
|
|
@@ -84,11 +86,17 @@ export const zipComponent = async componentKey => {
|
|
|
84
86
|
const srcDirectory = await getComponentDirectoryPath(componentKey);
|
|
85
87
|
const buildDirectory = await path.join(path.resolve(), 'dist/components', componentKey);
|
|
86
88
|
const configJson = `${srcDirectory}/config.json`;
|
|
89
|
+
const localizationJson = `${srcDirectory}/localizations.json`;
|
|
87
90
|
|
|
88
91
|
const zip = new AdmZip();
|
|
89
92
|
|
|
90
93
|
zip.addLocalFolder(srcDirectory, 'src/');
|
|
91
94
|
zip.addLocalFile(configJson);
|
|
95
|
+
|
|
96
|
+
if (fs.existsSync(localizationJson)) {
|
|
97
|
+
zip.addLocalFile(localizationJson);
|
|
98
|
+
}
|
|
99
|
+
|
|
92
100
|
zip.addLocalFolder(buildDirectory);
|
|
93
101
|
const zipContent = zip.toBuffer().toString('base64');
|
|
94
102
|
|
|
@@ -151,63 +159,63 @@ export const publishComponentToServer = async (data, doFetch) => {
|
|
|
151
159
|
// refresh_token: refreshToken
|
|
152
160
|
} = JSON.parse(OauthData);
|
|
153
161
|
let status = 500;
|
|
154
|
-
const headers = {
|
|
155
|
-
Authorization: `${tokenType} ${accessToken}`
|
|
156
|
-
};
|
|
162
|
+
const headers = {};
|
|
157
163
|
|
|
158
164
|
if (isLaunchpad) {
|
|
159
165
|
headers.cookie = `Pega-AAT=${accessToken}`;
|
|
160
166
|
headers['Content-Type'] = 'application/json';
|
|
167
|
+
} else {
|
|
168
|
+
headers.Authorization = `${tokenType} ${accessToken}`;
|
|
161
169
|
}
|
|
162
170
|
|
|
163
|
-
fetch(url, {
|
|
171
|
+
const response = await fetch(url, {
|
|
164
172
|
method: 'POST',
|
|
165
173
|
agent: getHttpsAgent(defaultPegaConfig),
|
|
166
174
|
headers,
|
|
167
175
|
body: JSON.stringify(apiBody)
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
status = response.status;
|
|
179
|
+
if (!response.ok) {
|
|
180
|
+
if (status === 401) {
|
|
181
|
+
throw new Error(
|
|
182
|
+
'Error occurred in authentication. Please regenerate using authenticate'
|
|
183
|
+
);
|
|
184
|
+
// console.log(accessTokenUri, refreshToken);
|
|
185
|
+
/* TODO - Handle refresh_token */
|
|
186
|
+
} else if (status === 404) {
|
|
187
|
+
throw new Error('404: Server resource not found');
|
|
188
|
+
} else if (status === 405) {
|
|
189
|
+
throw new Error('405: Server method not allowed');
|
|
190
|
+
} else if (status === 408) {
|
|
191
|
+
throw new Error('408: Server timed out');
|
|
192
|
+
} else if (response.status === 403) {
|
|
193
|
+
throw new Error('Error forbidden: User does not have privileges to Publish.');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
try {
|
|
198
|
+
const respData = isLaunchpad ? await response.text() : await response.json();
|
|
199
|
+
console.log(chalk.bold.green(`Success : ${isLaunchpad ? respData : respData.message}`));
|
|
200
|
+
|
|
201
|
+
if (status === 500) {
|
|
202
|
+
status = 999;
|
|
203
|
+
throw new Error(respData.message);
|
|
204
|
+
}
|
|
205
|
+
} catch (err) {
|
|
206
|
+
if (status === 500) {
|
|
207
|
+
throw new Error(
|
|
208
|
+
`Error occurred in authentication. Please regenerate using authenticate`
|
|
209
|
+
);
|
|
210
|
+
} else if (status === 999) {
|
|
211
|
+
throw new Error(err);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
207
214
|
} else {
|
|
208
215
|
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
209
216
|
}
|
|
210
217
|
} catch (err) {
|
|
218
|
+
// throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
211
219
|
throw new Error(`Error occurred in authentication. Please regenerate using authenticate`);
|
|
212
220
|
}
|
|
213
221
|
}
|