@capillarytech/creatives-library 7.17.207 → 7.17.208-alpha.0

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.207",
4
+ "version": "7.17.208-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -1066,11 +1066,11 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1066
1066
  if(templateContent){this.setState((prevState) => {
1067
1067
  return {
1068
1068
  formData: {
1069
- ...prevState.formData,
1069
+ ...prevState?.formData,
1070
1070
  base: {
1071
- ...prevState.formData.base,
1071
+ ...prevState?.formData?.base,
1072
1072
  en: {
1073
- ...prevState.formData.base.en,
1073
+ ...prevState?.formData?.base?.en,
1074
1074
  "template-content": preprocessHtml(templateContent)
1075
1075
  }
1076
1076
  }
@@ -22,3 +22,4 @@ export const GET_IOS_CTAS = 'app/v2Containers/PushMessage/Create/GET_IOS_CTAS';
22
22
  export const GET_IOS_CTAS_SUCCESS = 'app/v2Containers/PushMessage/Create/GET_IOS_CTAS_SUCCESS';
23
23
  export const GET_IOS_CTAS_FAILURE = 'app/v2Containers/PushMessage/Create/GET_IOS_CTAS_FAILURE';
24
24
  export const RESET_STORE = 'app/v2Containers/PushMessage/Create/RESET_STORE';
25
+ export const EXTERNAL_LINK_LOWERCASE = 'external link';
@@ -32,6 +32,7 @@ import { CREATE, TRACK_CREATE_MPUSH } from '../../App/constants';
32
32
  import { MOBILE_PUSH } from '../../CreativesContainer/constants';
33
33
  import { getContent } from '../commonMethods';
34
34
  import { getCdnUrl } from '../../../utils/cdnTransformation';
35
+ import { EXTERNAL_LINK_LOWERCASE } from './constants';
35
36
 
36
37
  const PrefixWrapper = styled.div`
37
38
  margin-right: 16px;
@@ -196,11 +197,25 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
196
197
  newFormData[0]["add-sec-cta-2"] = false;
197
198
  }
198
199
  }
199
- this.setState({formData: newFormData, tabCount, isSchemaChanged: !this.state.isSchemaChanged}, () => {
200
- if (isFullMode && showTemplateName) {
201
- showTemplateName({formData: this.state.formData, onFormDataChange: this.onFormDataChange});
200
+ const compareValue =
201
+ newFormData?.[this.state.currentTab - 1]?.[inputField?.id] || "";
202
+ this.setState(
203
+ {
204
+ formData: newFormData,
205
+ tabCount,
206
+ isSchemaChanged:
207
+ compareValue.toLowerCase() === EXTERNAL_LINK_LOWERCASE ||
208
+ !this.state.isSchemaChanged,
209
+ },
210
+ () => {
211
+ if (isFullMode && showTemplateName) {
212
+ showTemplateName({
213
+ formData: this.state.formData,
214
+ onFormDataChange: this.onFormDataChange,
215
+ });
216
+ }
202
217
  }
203
- });
218
+ );
204
219
  };
205
220
 
206
221
  onTagSelect = (data, currentTab, srcComp) => {