@integry/sdk 4.7.29 → 4.7.31

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.29",
3
+ "version": "4.7.31",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -636,7 +636,10 @@ const MultipurposeField = (props: MultipurposeFieldProps) => {
636
636
  const vallueToUse = Array.isArray(currentValue)
637
637
  ? currentValue[0]
638
638
  : currentValue;
639
- const isTag = vallueToUse?.startsWith('{') && vallueToUse?.endsWith('}');
639
+ const isTag =
640
+ typeof vallueToUse === 'string'
641
+ ? vallueToUse?.startsWith('{') && vallueToUse?.endsWith('}')
642
+ : false;
640
643
  if (isEditable && !allowTagsInText && isMappable && isTag) {
641
644
  setTempPlaceholder(vallueToUse || '');
642
645
  }
@@ -651,7 +654,7 @@ const MultipurposeField = (props: MultipurposeFieldProps) => {
651
654
  const getStringFromEnd = (str: string): string => {
652
655
  // eslint-disable-next-line @typescript-eslint/no-shadow
653
656
  const regex = /\{([^{}]+)$/;
654
- const matches = (str || '').match(regex);
657
+ const matches = typeof str === 'string' ? (str || '').match(regex) : [];
655
658
 
656
659
  if (matches && matches.length > 1) {
657
660
  const capturedString = matches[0];
@@ -1073,12 +1073,14 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1073
1073
  value,
1074
1074
  isRequired,
1075
1075
  machineName,
1076
+ computeValueUsingActivityOutput,
1076
1077
  }: {
1077
1078
  stepId: number;
1078
1079
  fieldId: number;
1079
1080
  value: string;
1080
1081
  isRequired: boolean;
1081
1082
  machineName?: string;
1083
+ computeValueUsingActivityOutput?: boolean;
1082
1084
  }) => {
1083
1085
  // we want to check if callback function is passed in props, if yes then call it
1084
1086
  if (this.props.onFieldChangeCallback) {
@@ -1105,10 +1107,16 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1105
1107
 
1106
1108
  this.props.onFieldChangeCallback(machineName || '', value);
1107
1109
  } else {
1110
+ const valueToUse = !computeValueUsingActivityOutput
1111
+ ? value
1112
+ : this.getFieldValFromActivityOutputRaw(
1113
+ this.props.activityOutputData,
1114
+ value,
1115
+ );
1108
1116
  this.props.setStepFieldData({
1109
1117
  stepId: `${stepId}`,
1110
1118
  fieldId: `${fieldId}`,
1111
- value,
1119
+ value: valueToUse,
1112
1120
  isRequired,
1113
1121
  });
1114
1122
  this.setState({ changedParentMachineName: machineName });
@@ -1718,34 +1726,16 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1718
1726
  }
1719
1727
  isRequired=${el.is_required}
1720
1728
  isHidden=${el.is_hidden}
1721
- onChange=${(
1722
- val: string,
1723
- passesRegexTest?: boolean,
1724
- ) => {
1725
- if (this.props.onFieldChangeCallback) {
1726
- this.onFieldChange({
1727
- stepId: step.id,
1728
- fieldId: el.id,
1729
- value: isArray
1730
- ? JSON.stringify(val)
1731
- : val,
1732
- isRequired: el.is_required,
1733
- machineName:
1734
- el.activity_field?.machine_name,
1735
- });
1736
- } else {
1737
- setStepFieldData({
1738
- stepId: `${step.id}`,
1739
- fieldId: `${el.id}`,
1740
- value: this.getFieldValFromActivityOutputRaw(
1741
- this.props.activityOutputData,
1742
- val,
1743
- ),
1744
- isRequired: el.is_required,
1745
- passesRegexTest,
1746
- });
1747
- this.props.verifyStepValidity(step.id);
1748
- }
1729
+ onChange=${(val: string) => {
1730
+ this.onFieldChange({
1731
+ stepId: step.id,
1732
+ fieldId: el.id,
1733
+ value: val,
1734
+ isRequired: el.is_required,
1735
+ machineName:
1736
+ el.activity_field?.machine_name,
1737
+ computeValueUsingActivityOutput: true,
1738
+ });
1749
1739
  }}
1750
1740
  isReadOnly=${isReadOnly}
1751
1741
  isChanged=${