@capillarytech/creatives-library 7.17.208 → 7.17.210

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.208",
4
+ "version": "7.17.210",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -97,7 +97,7 @@ function capReducer(state = fromJS(initialState.cap), action) {
97
97
  return state
98
98
  .set('fetchingLiquidTags', false)
99
99
  case types.GET_SCHEMA_FOR_ENTITY_SUCCESS: {
100
- //Process standard tags (same as before)
100
+ //Process standard tags
101
101
  const standardTagMapInitial = _.keyBy(
102
102
  action?.data?.metaEntities?.standard,
103
103
  item => item?.definition?.value
@@ -155,6 +155,7 @@ export function SlideBoxContent(props) {
155
155
  moduleType,
156
156
  showLiquidErrorInFooter,
157
157
  creativesMode,
158
+ hostName='',
158
159
  } = props;
159
160
  const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
160
161
  const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
@@ -543,6 +544,7 @@ export function SlideBoxContent(props) {
543
544
  query,
544
545
  search: '',
545
546
  }}
547
+ hostName={hostName}
546
548
  />
547
549
  }
548
550
  {
@@ -924,5 +926,6 @@ SlideBoxContent.propTypes = {
924
926
  moduleType: PropTypes.string,
925
927
  showLiquidErrorInFooter: PropTypes.bool,
926
928
  creativesMode: PropTypes.string,
929
+ hostName: PropTypes.string,
927
930
  };
928
931
  export default SlideBoxContent;
@@ -1313,6 +1313,7 @@ export class Creatives extends React.Component {
1313
1313
  moduleType={this.props.messageDetails?.type}
1314
1314
  showLiquidErrorInFooter={this.showLiquidErrorInFooter}
1315
1315
  creativesMode={creativesMode} // An existing prop that we're using here. Required to ensure correct account details in Edit or Preview in case of Embedded mode.
1316
+ hostName={this.props.hostName || ''}
1316
1317
  />
1317
1318
  }
1318
1319
  footer={this.shouldShowFooter() &&
@@ -1371,6 +1372,7 @@ Creatives.propTypes = {
1371
1372
  selectedAccount: PropTypes.object,
1372
1373
  strategy: PropTypes.string,
1373
1374
  orgUnitId: PropTypes.number,
1375
+ hostName: PropTypes.string,
1374
1376
  };
1375
1377
  const mapStatesToProps = () => createStructuredSelector({
1376
1378
  isLoading: isLoadingSelector(),
@@ -14,6 +14,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
14
14
  currentChannel="RCS"
15
15
  getFormData={[Function]}
16
16
  handleClose={[Function]}
17
+ hostName=""
17
18
  onCallTaskSubmit={[Function]}
18
19
  onChannelChange={[Function]}
19
20
  onCreateComplete={[MockFunction]}
@@ -90,6 +91,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
90
91
  currentChannel="WHATSAPP"
91
92
  getFormData={[Function]}
92
93
  handleClose={[Function]}
94
+ hostName=""
93
95
  onCallTaskSubmit={[Function]}
94
96
  onChannelChange={[Function]}
95
97
  onCreateComplete={[MockFunction]}
@@ -166,6 +168,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
166
168
  currentChannel="WHATSAPP"
167
169
  getFormData={[Function]}
168
170
  handleClose={[Function]}
171
+ hostName=""
169
172
  onCallTaskSubmit={[Function]}
170
173
  onChannelChange={[Function]}
171
174
  onCreateComplete={[MockFunction]}
@@ -246,6 +249,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
246
249
  currentChannel="WHATSAPP"
247
250
  getFormData={[Function]}
248
251
  handleClose={[Function]}
252
+ hostName=""
249
253
  onCallTaskSubmit={[Function]}
250
254
  onChannelChange={[Function]}
251
255
  onCreateComplete={[MockFunction]}
@@ -326,6 +330,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
326
330
  currentChannel="WHATSAPP"
327
331
  getFormData={[Function]}
328
332
  handleClose={[Function]}
333
+ hostName=""
329
334
  onCallTaskSubmit={[Function]}
330
335
  onChannelChange={[Function]}
331
336
  onCreateComplete={[MockFunction]}
@@ -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) => {
@@ -65,8 +65,9 @@ export const Zalo = (props) => {
65
65
  injectedTags,
66
66
  getFormData,
67
67
  selectedOfferDetails,
68
+ hostName: zaloHostName = '',
68
69
  } = props || {};
69
- const {hostName = ''} = senderDetails;
70
+ const {hostName = zaloHostName || ''} = senderDetails;
70
71
  const { formatMessage } = intl;
71
72
  const [oa_id, setOaId] = useState('');
72
73
  const [token, setToken] = useState('');