@integry/sdk 4.7.32 → 4.7.34

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integry/sdk",
3
- "version": "4.7.32",
3
+ "version": "4.7.34",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -238,6 +238,22 @@ const ListBox = (props: ListBoxProps) => {
238
238
  };
239
239
  }, [isDropdownOpen]);
240
240
 
241
+ const isInitialLoadRef = useRef(true);
242
+
243
+ useEffect(() => {
244
+ if (isInitialLoadRef.current) {
245
+ isInitialLoadRef.current = false;
246
+ return;
247
+ }
248
+ setEditableTextValue('');
249
+ setQuery('');
250
+ setSearchValue('');
251
+ if (inputRef.current) {
252
+ inputRef.current.value = '';
253
+ }
254
+ onChange('');
255
+ }, [endpointData, endpointUrl, selectedAuthId, parentFieldChanged]);
256
+
241
257
  useEffect(() => {
242
258
  if (query && isSearchable) {
243
259
  const filtered = items.filter((item) =>
@@ -1350,6 +1350,29 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1350
1350
  return updatedObj;
1351
1351
  };
1352
1352
 
1353
+ private findFieldByMachineName = (machineName: string) => {
1354
+ const { stepMapping, step } = this.props;
1355
+ const selectedStep =
1356
+ (stepMapping[step.id] && stepMapping[step.id].step) || step;
1357
+ return selectedStep.template_fields.find(
1358
+ (el) => el.activity_field?.machine_name === machineName,
1359
+ );
1360
+ };
1361
+
1362
+ private checkIfAllParentFieldsHaveDefaultValue = (
1363
+ parentFields: string[],
1364
+ ): boolean =>
1365
+ parentFields.every((parentField) => {
1366
+ const field = this.findFieldByMachineName(parentField);
1367
+ return (
1368
+ field &&
1369
+ field.default_value &&
1370
+ field.default_value !== '' &&
1371
+ field.default_value !== 'null' &&
1372
+ field.default_value !== 'undefined'
1373
+ );
1374
+ });
1375
+
1353
1376
  render() {
1354
1377
  const {
1355
1378
  step,
@@ -1472,6 +1495,9 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1472
1495
  fieldVal = el.default_value;
1473
1496
  }
1474
1497
  }
1498
+ const parentFieldsHaveDefaultValues = this.checkIfAllParentFieldsHaveDefaultValue(
1499
+ elParentFields,
1500
+ );
1475
1501
  return html`
1476
1502
  <div key=${
1477
1503
  el.id
@@ -1596,7 +1622,8 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1596
1622
  this.state.dynamicFieldsData?.[
1597
1623
  parentField
1598
1624
  ],
1599
- )
1625
+ ) &&
1626
+ !parentFieldsHaveDefaultValues
1600
1627
  }
1601
1628
 
1602
1629
  ><//>