@pega/dx-component-builder-sdk 0.242.9 → 0.242.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +6 -0
  3. package/src/constants.js +3 -0
  4. package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +3 -3
  5. package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +3 -3
  6. package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.ts.mustache +3 -2
  7. package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +3 -3
  8. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.ts.mustache +3 -3
  9. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/demo.stories.tsx.mustache +10 -0
  10. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +2 -2
  11. package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/demo.stories.tsx.mustache +10 -0
  12. package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.ts.mustache +1 -1
  13. package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.ts.mustache +3 -3
  14. package/src/tasks/create/templates/SDK-Angular/field/Picklist-Autocomplete/picklist-autocomplete.component.ts.mustache +3 -3
  15. package/src/tasks/create/templates/SDK-Angular/field/Picklist-RadioButtons/picklist-radio-buttons.component.ts.mustache +2 -2
  16. package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.ts.mustache +4 -2
  17. package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.ts.mustache +1 -1
  18. package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.ts.mustache +1 -1
  19. package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.ts.mustache +1 -1
  20. package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.ts.mustache +1 -1
  21. package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +1 -1
  22. package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +1 -1
  23. package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +1 -1
  24. package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.ts.mustache +1 -1
  25. package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.ts.mustache +1 -1
  26. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +1 -1
  27. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.ts.mustache +1 -1
  28. package/src/tasks/create/templates/SDK-Angular/template/FORM-region/mock.ts.mustache +1 -1
  29. package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.ts.mustache +1 -1
  30. package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.ts.mustache +1 -1
  31. package/src/tasks/index.js +1 -0
  32. package/src/tasks/quarantine/index.js +81 -0
  33. package/src/util.js +29 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/dx-component-builder-sdk",
3
- "version": "0.242.9",
3
+ "version": "0.242.10",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
package/src/cli.js CHANGED
@@ -19,6 +19,7 @@ import {
19
19
  publishComponent,
20
20
  publishAllComponents,
21
21
  renameComponent,
22
+ quarantine,
22
23
  updateComponent,
23
24
  validate,
24
25
  upgrade
@@ -37,6 +38,7 @@ const TASKS = {
37
38
  PUBLISH: 'publish',
38
39
  PUBLISH_ALL: 'publishAll',
39
40
  RENAME: 'rename',
41
+ QUARANTINE: 'quarantine',
40
42
  LIST: 'list',
41
43
  VALIDATE_SCHEMA: 'validateSchema',
42
44
  UPDATE: 'update',
@@ -106,6 +108,10 @@ export default async (args = []) => {
106
108
  renameComponent(options);
107
109
  break;
108
110
  }
111
+ case TASKS.QUARANTINE: {
112
+ quarantine(options);
113
+ break;
114
+ }
109
115
  case TASKS.BUILD: {
110
116
  buildComponent(options);
111
117
  break;
package/src/constants.js CHANGED
@@ -59,6 +59,9 @@ export const JEST_ASSETS_SDK_A = 'sdk-a/components';
59
59
  export const JEST_ASSETS_SDK_R = 'sdk-r/components';
60
60
  export const JEST_CREATE_PATH = 'create/';
61
61
  export const JEST_CREATE_ALL_PATH = 'createAll/';
62
+ export const JEST_TESTS_FUNCTIONAL_PATH = 'node_modules/@pega/dx-component-builder-sdk/tests/functional/';
63
+
64
+
62
65
 
63
66
  /* dxcbConfig.componentDefaults LINT setting/value constants */
64
67
  export const LINT_SETTING_KEY = 'lintAction'; // LINT_SETTING_KEY is expected to be in sdk-config's dxcbConfig.componentDefaults
@@ -146,7 +146,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
146
146
  }
147
147
 
148
148
  this.actionsApi = this.pConn$.getActionsApi();
149
- this.propName = (this.pConn$.getStateProps() as any).value;
149
+ this.propName = this.pConn$.getStateProps().value;
150
150
 
151
151
  // multi case
152
152
  this.selectionMode = this.configProps$.selectionMode;
@@ -159,7 +159,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
159
159
  this.datasource = this.configProps$.datasource;
160
160
  this.selectionKey = this.configProps$.selectionKey;
161
161
  const listSourceItems = this.datasource?.source ?? [];
162
- const dataField: any = this.selectionKey?.split?.('.')[1];
162
+ const dataField = this.selectionKey?.split?.('.')[1] ?? '';
163
163
  const listToDisplay: any[] = [];
164
164
  listSourceItems.forEach(element => {
165
165
  element.selected = this.selectedvalues?.some?.(data => data[dataField] === element.key);
@@ -203,7 +203,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
203
203
  this.fieldControl.enable();
204
204
  }
205
205
 
206
- this.componentReference = (this.pConn$.getStateProps() as any).value;
206
+ this.componentReference = this.pConn$.getStateProps().value;
207
207
 
208
208
  // eslint-disable-next-line sonarjs/no-redundant-boolean
209
209
  if (this.value$ === 'true' || this.value$ == true) {
@@ -21,7 +21,7 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
21
21
  }
22
22
 
23
23
  class MyFormat {
24
- theDateFormat: any = getDateFormatInfo();
24
+ theDateFormat = getDateFormatInfo();
25
25
 
26
26
  get display() {
27
27
  return {
@@ -83,7 +83,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
83
83
  // Start with default dateFormatInfo
84
84
  dateFormatInfo = dateFormatInfoDefault;
85
85
  // and then update, as needed, based on locale, etc.
86
- theDateFormat: any = getDateFormatInfo();
86
+ theDateFormat = getDateFormatInfo();
87
87
 
88
88
  constructor(
89
89
  private angularPConnect: AngularPConnectService,
@@ -194,7 +194,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
194
194
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
195
195
  }
196
196
 
197
- this.componentReference = (this.pConn$.getStateProps() as any).value;
197
+ this.componentReference = this.pConn$.getStateProps().value;
198
198
 
199
199
  // trigger display of error message with field control
200
200
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -61,7 +61,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
61
61
  // Start with default dateFormatInfo
62
62
  dateFormatInfo = dateFormatInfoDefault;
63
63
  // and then update, as needed, based on locale, etc.
64
- theDateFormat: any = getDateFormatInfo();
64
+ theDateFormat = getDateFormatInfo();
65
65
  placeholder: string;
66
66
 
67
67
  constructor(
@@ -155,7 +155,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
155
155
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
156
156
  }
157
157
 
158
- this.componentReference = (this.pConn$.getStateProps() as any).value;
158
+ this.componentReference = this.pConn$.getStateProps().value;
159
159
 
160
160
  // trigger display of error message with field control
161
161
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -169,6 +169,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
169
169
  }
170
170
 
171
171
  fieldOnDateChange(event: any) {
172
+ // this comes from the date pop up
172
173
  if (typeof event.value === 'object') {
173
174
  // convert date to pega "date" format
174
175
  event.value = event.value?.toISOString();
@@ -140,7 +140,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
140
140
  this.helperText = this.configProps$.helperText;
141
141
  this.placeholder = this.configProps$.placeholder || '';
142
142
  const showGroupSeparators = this.configProps$.showGroupSeparators;
143
- const currencyISOCode: any = this.configProps$?.currencyISOCode;
143
+ const currencyISOCode = this.configProps$?.currencyISOCode ?? '';
144
144
 
145
145
  const theSymbols = getCurrencyCharacters(currencyISOCode);
146
146
  this.currDec = theSymbols.theDecimalIndicator;
@@ -189,12 +189,12 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
189
189
  }
190
190
  this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2;
191
191
 
192
- this.componentReference = (this.pConn$.getStateProps() as any).value;
192
+ this.componentReference = this.pConn$.getStateProps().value;
193
193
  }
194
194
 
195
195
  fieldOnBlur(event: any) {
196
196
  const actionsApi = this.pConn$?.getActionsApi();
197
- const propName = (this.pConn$?.getStateProps() as any).value;
197
+ const propName = this.pConn$?.getStateProps().value;
198
198
  let value = event?.target?.value;
199
199
  if (this.currSep === ',') {
200
200
  value = value.replace(/,/g, '');
@@ -129,7 +129,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
129
129
  }
130
130
  this.helperText = this.configProps$.helperText;
131
131
  this.placeholder = this.configProps$.placeholder || '';
132
- const currencyISOCode: any = this.configProps$?.currencyISOCode;
132
+ const currencyISOCode = this.configProps$?.currencyISOCode ?? '';
133
133
 
134
134
  const theSymbols = getCurrencyCharacters(currencyISOCode);
135
135
  this.currSym = theSymbols.theCurrencySymbol;
@@ -169,7 +169,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
169
169
 
170
170
  this.decimalPrecision = this.configProps$?.allowDecimals ? 2 : 0;
171
171
 
172
- this.componentReference = (this.pConn$.getStateProps() as any).value;
172
+ this.componentReference = this.pConn$.getStateProps().value;
173
173
 
174
174
  // trigger display of error message with field control
175
175
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -184,7 +184,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
184
184
 
185
185
  fieldOnBlur(event: any) {
186
186
  const actionsApi = this.pConn$?.getActionsApi();
187
- const propName = (this.pConn$?.getStateProps() as any).value;
187
+ const propName = this.pConn$?.getStateProps().value;
188
188
  let value = event?.target?.value;
189
189
  value = value?.substring(1);
190
190
  if (this.currSep === ',') {
@@ -33,6 +33,16 @@ const meta: Meta<{{COMPONENT_CLASS_NAME}}Component> = {
33
33
  },
34
34
  getStateProps: () => {
35
35
  return stateProps;
36
+ },
37
+ getActionsApi: () => {
38
+ return {
39
+ updateFieldValue: () => {
40
+ /* nothing */
41
+ },
42
+ triggerFieldChange: () => {
43
+ /* nothing */
44
+ }
45
+ };
36
46
  }
37
47
  } as any,
38
48
  formGroup$: new FormBuilder().group({})
@@ -157,7 +157,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
157
157
 
158
158
  this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2;
159
159
 
160
- this.componentReference = (this.pConn$.getStateProps() as any).value;
160
+ this.componentReference = this.pConn$.getStateProps().value;
161
161
 
162
162
  // trigger display of error message with field control
163
163
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -175,7 +175,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
175
175
 
176
176
  fieldOnBlur(event: any) {
177
177
  const actionsApi = this.pConn$?.getActionsApi();
178
- const propName = (this.pConn$?.getStateProps() as any).value;
178
+ const propName = this.pConn$?.getStateProps()?.value;
179
179
  let value = event?.target?.value;
180
180
  value = value ? value.replace(/%/g, '') : '';
181
181
  if (this.currSep === ',') {
@@ -19,6 +19,16 @@ const meta: Meta<{{COMPONENT_CLASS_NAME}}Component> = {
19
19
  },
20
20
  getStateProps: () => {
21
21
  return stateProps;
22
+ },
23
+ getActionsApi: () => {
24
+ return {
25
+ updateFieldValue: () => {
26
+ /* nothing */
27
+ },
28
+ triggerFieldChange: () => {
29
+ /* nothing */
30
+ }
31
+ };
22
32
  }
23
33
  } as any,
24
34
  formGroup$: new FormBuilder().group({})
@@ -142,7 +142,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
142
142
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
143
143
  }
144
144
 
145
- this.componentReference = (this.pConn$.getStateProps() as any).value;
145
+ this.componentReference = this.pConn$.getStateProps().value;
146
146
 
147
147
  // trigger display of error message with field control
148
148
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -157,7 +157,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
157
157
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
158
158
  }
159
159
 
160
- this.componentReference = (this.pConn$.getStateProps() as any).value;
160
+ this.componentReference = this.pConn$.getStateProps().value;
161
161
 
162
162
  const optionsList = [...this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject())];
163
163
  optionsList?.unshift({ key: 'Select', value: this.pConn$.getLocalizedValue('Select...', '', '') });
@@ -166,7 +166,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
166
166
  this.value$ = 'Select';
167
167
  }
168
168
 
169
- const propName = (this.pConn$.getStateProps() as any).value;
169
+ const propName = this.pConn$.getStateProps().value;
170
170
  const className = this.pConn$.getCaseInfo().getClassName();
171
171
  const refName = propName?.slice(propName.lastIndexOf('.') + 1);
172
172
 
@@ -205,7 +205,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
205
205
  event.value = '';
206
206
  }
207
207
  const actionsApi = this.pConn$?.getActionsApi();
208
- const propName = (this.pConn$?.getStateProps() as any).value;
208
+ const propName = this.pConn$?.getStateProps().value;
209
209
  handleEvent(actionsApi, 'changeNblur', propName, event.value);
210
210
  if (this.configProps$?.onRecordChange) {
211
211
  this.configProps$.onRecordChange(event);
@@ -184,7 +184,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
184
184
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
185
185
  }
186
186
 
187
- this.componentReference = (this.pConn$.getStateProps() as any).value;
187
+ this.componentReference = this.pConn$.getStateProps().value;
188
188
  if (this.listType === 'associated') {
189
189
  this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject('')); // 1st arg empty string until typedef marked correctly
190
190
  }
@@ -220,7 +220,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
220
220
  let datasource = this.configProps$.datasource;
221
221
  let columns = this.configProps$.columns;
222
222
  // const { deferDatasource, datasourceMetadata } = this.configProps$;
223
- const { deferDatasource, datasourceMetadata }: any = this.pConn$.getConfigProps();
223
+ const { deferDatasource, datasourceMetadata } = this.pConn$.getConfigProps();
224
224
  // convert associated to datapage listtype and transform props
225
225
  // Process deferDatasource when datapage name is present. WHhen tableType is promptList / localList
226
226
  if (deferDatasource && datasourceMetadata?.datasource?.name) {
@@ -318,7 +318,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
318
318
 
319
319
  const value = key;
320
320
  const actionsApi = this.pConn$?.getActionsApi();
321
- const propName = (this.pConn$?.getStateProps() as any).value;
321
+ const propName = this.pConn$?.getStateProps().value;
322
322
  handleEvent(actionsApi, 'changeNblur', propName, value);
323
323
  if (this.configProps$?.onRecordChange) {
324
324
  el.value = value;
@@ -164,11 +164,11 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
164
164
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
165
165
  }
166
166
 
167
- this.componentReference = (this.pConn$.getStateProps() as any).value;
167
+ this.componentReference = this.pConn$.getStateProps().value;
168
168
 
169
169
  this.options$ = this.utils.getOptionList(this.configProps$, this.pConn$.getDataObject());
170
170
 
171
- const propName = (this.pConn$.getStateProps() as any).value;
171
+ const propName = this.pConn$.getStateProps().value;
172
172
  const className = this.pConn$.getCaseInfo().getClassName();
173
173
  const refName = propName?.slice(propName.lastIndexOf('.') + 1);
174
174
 
@@ -100,11 +100,13 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
100
100
 
101
101
  // updateSelf
102
102
  updateSelf(): void {
103
- this.componentReference = (this.pConn$.getStateProps() as any).value;
103
+ this.componentReference = this.pConn$.getStateProps().value;
104
104
  // moved this from ngOnInit() and call this from there instead...
105
105
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as {{COMPONENT_CLASS_NAME}}Props;
106
106
 
107
- this.value$ = this.configProps$.value || '';
107
+ if (this.configProps$.value != undefined) {
108
+ this.value$ = this.configProps$.value;
109
+ }
108
110
  this.testId = this.configProps$.testId;
109
111
  this.label$ = this.configProps$.label;
110
112
  this.helperText = this.configProps$.helperText;
@@ -139,7 +139,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
139
139
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
140
140
  }
141
141
 
142
- this.componentReference = (this.pConn$.getStateProps() as any).value;
142
+ this.componentReference = this.pConn$.getStateProps().value;
143
143
 
144
144
  // trigger display of error message with field control
145
145
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -113,7 +113,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
113
113
  this.label$ = this.configProps$.label;
114
114
  this.displayMode$ = this.configProps$.displayMode;
115
115
 
116
- this.componentReference = (this.pConn$.getStateProps() as any).value;
116
+ this.componentReference = this.pConn$.getStateProps().value;
117
117
 
118
118
  if (this.configProps$.visibility != null) {
119
119
  this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
@@ -140,7 +140,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
140
140
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
141
141
  }
142
142
 
143
- this.componentReference = (this.pConn$.getStateProps() as any).value;
143
+ this.componentReference = this.pConn$.getStateProps().value;
144
144
 
145
145
  // trigger display of error message with field control
146
146
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -162,7 +162,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
162
162
  fieldOnChange() {
163
163
  if (this.formGroup$.controls[this.controlName$].value) {
164
164
  const actionsApi = this.pConn$?.getActionsApi();
165
- const propName = (this.pConn$?.getStateProps() as any).value;
165
+ const propName = this.pConn$?.getStateProps().value;
166
166
  const value = this.formGroup$.controls[this.controlName$].value;
167
167
  const eventObj = {
168
168
  target: {
@@ -140,7 +140,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
140
140
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
141
141
  }
142
142
 
143
- this.componentReference = (this.pConn$.getStateProps() as any).value;
143
+ this.componentReference = this.pConn$.getStateProps().value;
144
144
 
145
145
  // trigger display of error message with field control
146
146
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -138,7 +138,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
138
138
  this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
139
139
  }
140
140
 
141
- this.componentReference = (this.pConn$.getStateProps() as any).value;
141
+ this.componentReference = this.pConn$.getStateProps().value;
142
142
 
143
143
  // trigger display of error message with field control
144
144
  if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
@@ -50,7 +50,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
50
50
  }
51
51
 
52
52
  updateSelf() {
53
- const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config);
53
+ const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
54
54
  this.showHighlightedData = rawMetaData?.showHighlightedData;
55
55
 
56
56
  if (this.showHighlightedData) {
@@ -57,7 +57,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
57
57
  }
58
58
 
59
59
  updateSelf() {
60
- const rawMetaData: any = this.pConn$.resolveConfigProps((this.pConn$.getRawMetadata() as any).config);
60
+ const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
61
61
  this.showHighlightedData = rawMetaData?.showHighlightedData;
62
62
 
63
63
  if (this.showHighlightedData) {
@@ -49,7 +49,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit {
49
49
  const propToUse: any = { ...this.pConn$.getInheritedProps() };
50
50
  this.showLabel = propToUse?.showLabel;
51
51
  this.label = propToUse?.label;
52
- const kids = this.pConn$.getChildren() as any[];
52
+ const kids = this.pConn$.getChildren();
53
53
  this.instructions = this.templateUtils.getInstructions(this.pConn$, configProps?.instructions);
54
54
 
55
55
  const numCols = configProps.NumCols ? configProps.NumCols : '1';
@@ -11,7 +11,7 @@
11
11
  .psdk-two-column-column {
12
12
  width: 50%;
13
13
  float: left;
14
- padding: 0rem 0rem;
14
+ padding: 0rem 1.5rem;
15
15
  height: 100%;
16
16
  }
17
17
 
@@ -29,6 +29,6 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnChanges {
29
29
  }
30
30
 
31
31
  updateSelf() {
32
- this.arChildren$ = this.pConn$.getChildren() as any[];
32
+ this.arChildren$ = this.pConn$.getChildren();
33
33
  }
34
34
  }
@@ -231,7 +231,7 @@ export const child2 = [
231
231
  readOnly: false,
232
232
  placeholder: 'Phone',
233
233
  value: '2015550123',
234
- label: '',
234
+ label: 'Phone Number',
235
235
  hasSuggestions: false
236
236
  };
237
237
  },
@@ -34,7 +34,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
34
34
  this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
35
35
 
36
36
  this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as {{COMPONENT_CLASS_NAME}}Props;
37
- this.arChildren$ = this.pConn$.getChildren() as any[];
37
+ this.arChildren$ = this.pConn$.getChildren();
38
38
 
39
39
  this.title$ = this.configProps$.title;
40
40
  const operator = this.configProps$.operator;
@@ -50,7 +50,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnChanges, OnD
50
50
  }
51
51
 
52
52
  updateSelf(): void {
53
- const configProps$ = this.pConn$.getConfigProps() as any;
53
+ const configProps$ = this.pConn$.getConfigProps();
54
54
  this.displayLabel = this.displayLabel?.toLowerCase();
55
55
  const label = configProps$?.label?.toLowerCase();
56
56
  if (label === 'create operator' || this.displayLabel === 'create operator') {
@@ -9,6 +9,7 @@ export { default as mapAllComponents } from './map-all/index.js';
9
9
  export { default as publishComponent } from './publish/index.js';
10
10
  export { default as publishAllComponents } from './publish-all/index.js';
11
11
  export { default as renameComponent } from './rename/index.js';
12
+ export { default as quarantine } from './quarantine/index.js';
12
13
  export { default as listComponents } from './list/index.js';
13
14
  export { default as updateComponent } from './update/index.js';
14
15
  export { default as validate } from './validator/index.js';
@@ -0,0 +1,81 @@
1
+ import fs from 'fs';
2
+ import path, {join} from 'path';
3
+ import inquirer from 'inquirer';
4
+ import chalk from 'chalk';
5
+
6
+
7
+ import {
8
+ showVersion,
9
+ getFramework,
10
+ getJestFunctionalTestList } from '../../util.js';
11
+
12
+ import { JEST_TESTS_FUNCTIONAL_PATH } from '../../constants.js';
13
+
14
+
15
+ export const quarnUnquarnTests = async(answers) => {
16
+ switch (answers.QuarUnQuar) {
17
+ case "Quarantine" :
18
+ await quarantineTests(answers);
19
+ break;
20
+ case "Unquarantine" :
21
+ await unquarantineTests(answers);
22
+ break;
23
+ }
24
+ }
25
+
26
+
27
+
28
+ export const quarantineTests = async(answers) => {
29
+ const testList = await getJestFunctionalTestList("ALL");
30
+ const frameWork = await getFramework();
31
+ const SDK_PATH = frameWork === "SDK-Angular" ? "sdk-a" : "sdk-r";
32
+ const functionalPath = join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH, SDK_PATH);
33
+
34
+ // rename .test to .notest
35
+ for (const testName of testList) {
36
+ const quarantineName = testName.replace(".test", ".notest");
37
+ fs.renameSync(join(functionalPath, testName), join(functionalPath, quarantineName));
38
+ }
39
+
40
+ console.log(chalk.green(`All ${SDK_PATH} tests are quarantined.`));
41
+
42
+ }
43
+
44
+ export const unquarantineTests = async(answers) => {
45
+ const testList = await getJestFunctionalTestList("ALL");
46
+ const frameWork = await getFramework();
47
+ const SDK_PATH = frameWork === "SDK-Angular" ? "sdk-a" : "sdk-r";
48
+ const functionalPath = join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH, SDK_PATH);
49
+
50
+ // rename .test to .notest
51
+ for (const testName of testList) {
52
+ const restoreName = testName.replace(".notest", ".test");
53
+ fs.renameSync(join(functionalPath, testName), join(functionalPath, restoreName));
54
+ }
55
+
56
+ console.log(chalk.green(`All ${SDK_PATH} tests are unquarantined.`));
57
+
58
+ }
59
+
60
+
61
+ export default async options => {
62
+
63
+ await showVersion();
64
+
65
+ const quaranAnswers = await inquirer.prompt([
66
+
67
+ {
68
+ name: 'QuarUnQuar',
69
+ type: 'rawlist',
70
+ message: `Quarantine or UnQuarantine tests`,
71
+ choices: ["Quarantine", "Unquarantine"],
72
+ default: 'Quarantine'
73
+
74
+ }
75
+ ]);
76
+
77
+ // await showCurrentStatus();
78
+ await quarnUnquarnTests(quaranAnswers);
79
+
80
+
81
+ }
package/src/util.js CHANGED
@@ -40,7 +40,8 @@ import {
40
40
  COMPONENT_DIRECTORY_SUFFIX_SDK,
41
41
  DXCB_COMPONENT_DEFAULTS,
42
42
  SERVER_CONFIG,
43
- SERVER_REST_URL
43
+ SERVER_REST_URL,
44
+ JEST_TESTS_FUNCTIONAL_PATH
44
45
  } from './constants.js';
45
46
 
46
47
  export const DXCB_CONFIG_INTERNAL_JSON_FILENAME = 'src/dxcb.config.json';
@@ -765,6 +766,33 @@ export const showVersion = () => {
765
766
  console.log(chalk.redBright("DX Component Builder - SDK requires node v18 or greater, current version: " + process.version));
766
767
  process.exit(1);
767
768
  }
769
+ };
770
+
771
+ export const getJestFunctionalTestList = async(whichTests) => {
772
+ const frameWork = await getFramework();
773
+ const SDK_PATH = frameWork === "SDK-Angular" ? "sdk-a" : "sdk-r";
774
+ const functionalDir = join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH, SDK_PATH);
775
+ const libFilter = "localLib";
776
+
777
+ switch (whichTests) {
778
+ case "ALL" :
779
+ return fs
780
+ .readdirSync(functionalDir, { withFileTypes: true })
781
+ .filter(dirent => !dirent.isDirectory() )
782
+ .map(dirent => dirent.name);
783
+ case "Original":
784
+ return fs
785
+ .readdirSync(functionalDir, { withFileTypes: true })
786
+ .filter(dirent => !dirent.isDirectory() && !dirent.name.startsWith(libFilter))
787
+ .map(dirent => dirent.name);
788
+ case "Library" :
789
+ return fs
790
+ .readdirSync(functionalDir, { withFileTypes: true })
791
+ .filter(dirent => !dirent.isDirectory() && dirent.name.startsWith(libFilter))
792
+ .map(dirent => dirent.name);
793
+ }
794
+
795
+
768
796
  }
769
797
 
770
798
  export const getOOTBComponents = async () => {