@capillarytech/creatives-library 7.17.129 → 7.17.130-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.129",
4
+ "version": "7.17.130-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -211,3 +211,16 @@
211
211
  }
212
212
  }
213
213
 
214
+ .cap-collapsible-new-nav {
215
+ .l2-quick-link-heading, .l2-item-submodule {
216
+ width: 11.25rem;
217
+ }
218
+ }
219
+
220
+ .l1-enabled-popover-container .l2-item-submodule {
221
+ width: 11.25rem;
222
+ }
223
+
224
+ .l1-enabled-popover-container .ant-popover-inner-content .l2-quick-link-container {
225
+ padding: 0.571rem 0.471rem;
226
+ }
@@ -191,7 +191,7 @@ export function* getSupportVideosConfig({ callback }) {
191
191
  }
192
192
  }
193
193
 
194
- function* watchFetchSchemaForEntity() {
194
+ export function* watchFetchSchemaForEntity() {
195
195
  yield takeLatest(types.GET_SCHEMA_FOR_ENTITY_REQUEST, fetchSchemaForEntity);
196
196
  }
197
197
 
@@ -1,7 +1,7 @@
1
1
  import { take, fork, cancel, takeLatest } from 'redux-saga/effects';
2
2
  import { expectSaga } from 'redux-saga-test-plan';
3
3
  import * as matchers from 'redux-saga-test-plan/matchers';
4
- import { authorize, loginFlow, fetchSchemaForEntity, getSupportVideosConfig, watchForGetVideosConfig } from '../sagas';
4
+ import { authorize, loginFlow, fetchSchemaForEntity, getSupportVideosConfig, watchForGetVideosConfig, watchFetchSchemaForEntity } from '../sagas';
5
5
  import { throwError } from 'redux-saga-test-plan/providers';
6
6
  import * as api from '../../../services/api';
7
7
  import {
@@ -13,6 +13,7 @@ import {
13
13
  GET_SUPPORT_VIDEOS_CONFIG_REQUEST,
14
14
  GET_SUPPORT_VIDEOS_CONFIG_SUCCESS,
15
15
  GET_SUPPORT_VIDEOS_CONFIG_FAILURE,
16
+ GET_SCHEMA_FOR_ENTITY_REQUEST,
16
17
  } from '../constants';
17
18
  import { callback, error, error2, videoConfigData } from '../../mockdata';
18
19
 
@@ -196,4 +197,14 @@ describe('watchForGetVideosConfig saga', () => {
196
197
  takeLatest(GET_SUPPORT_VIDEOS_CONFIG_REQUEST, getSupportVideosConfig),
197
198
  );
198
199
  });
200
+ });
201
+
202
+ describe('watchFetchSchemaForEntity saga', () => {
203
+
204
+ it('test watchFetchSchemaForEntity', () => {
205
+ let generator = watchFetchSchemaForEntity();
206
+ expect(generator.next().value).toEqual(
207
+ takeLatest(GET_SCHEMA_FOR_ENTITY_REQUEST, fetchSchemaForEntity),
208
+ );
209
+ });
199
210
  });
@@ -596,9 +596,19 @@ export class Creatives extends React.Component {
596
596
  const channelTemplate = template.value;
597
597
  templateData.accountId = get(channelTemplate, 'definition.accountId');
598
598
  const type = (get(this.props, "messageDetails.type") || '').toLowerCase();
599
+ const sourceType = get(channelTemplate, 'definition.sourceType');
599
600
  if (type === LOYALTY) {
600
- templateData.licenseCode = get(channelTemplate, 'definition.licenseCode');
601
- templateData.templateId = get(channelTemplate, '_id');
601
+ if(sourceType === 'MAPP_SDK') {
602
+ templateData.templateId = get(channelTemplate, '_id');
603
+ templateData.licenseCode = get(channelTemplate, 'definition.licenseCode');
604
+ templateData.gatewayId = get(channelTemplate, 'definition.gatewayId');
605
+ templateData.gatewayAccountId = get(channelTemplate, 'definition.gatewayAccountId');
606
+ templateData.sourceType = get(channelTemplate, 'definition.sourceType');
607
+ } else {
608
+ templateData.templateId = get(channelTemplate, '_id');
609
+ templateData.licenseCode = get(channelTemplate, 'definition.licenseCode');
610
+ templateData.sourceType = get(channelTemplate, 'definition.sourceType');
611
+ }
602
612
  }
603
613
  const androidContent = channel === constants.INAPP ? get(channelTemplate, 'versions.base.content.ANDROID') : get(channelTemplate, 'versions.base.ANDROID');
604
614
  if (!isEmpty(androidContent)) {
@@ -368,11 +368,23 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
368
368
  };
369
369
  obj.type = 'MOBILEPUSH';
370
370
  obj.name = formData['template-name'];
371
- obj.definition = {
372
- accountId: this.props.Templates.selectedWeChatAccount.id,
373
- licenseCode: this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier,
374
- mode: this.props.params.mode,
375
- };
371
+ if(this.props?.Templates?.selectedWeChatAccount?.sourceTypeName === 'MAPP_SDK') {
372
+ obj.definition = {
373
+ accountId: this.props.Templates.selectedWeChatAccount.id,
374
+ licenseCode: this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier,
375
+ gatewayId: this.props.Templates.selectedWeChatAccount.configs.gatewayId,
376
+ gatewayAccountId: this.props.Templates.selectedWeChatAccount.configs.gatewayAccountId,
377
+ mode: this.props.params.mode,
378
+ sourceType: this.props.Templates.selectedWeChatAccount.sourceTypeName,
379
+ };
380
+ } else {
381
+ obj.definition = {
382
+ accountId: this.props.Templates.selectedWeChatAccount.id,
383
+ licenseCode: this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier,
384
+ mode: this.props.params.mode,
385
+ sourceType: this.props.Templates.selectedWeChatAccount.sourceTypeName,
386
+ };
387
+ }
376
388
  const android = {};
377
389
  Object.keys(formData[0]).forEach((data) => {
378
390
  if (!!formData[0][data] && data !== "tabKey") {
@@ -338,10 +338,21 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
338
338
  };
339
339
  obj.type = 'MOBILEPUSH';
340
340
  obj.name = formData['template-name'];
341
- obj.definition = {
342
- accountId: selectedWeChatAccount?.id,
343
- licenseCode: selectedWeChatAccount.sourceAccountIdentifier,
344
- };
341
+ if(this.props?.Templates?.selectedWeChatAccount?.sourceTypeName === 'MAPP_SDK') {
342
+ obj.definition = {
343
+ accountId: selectedWeChatAccount.id,
344
+ licenseCode: selectedWeChatAccount.sourceAccountIdentifier,
345
+ gatewayId: selectedWeChatAccount.configs.gatewayId,
346
+ gatewayAccountId: selectedWeChatAccount.configs.gatewayAccountId,
347
+ sourceType: selectedWeChatAccount.sourceTypeName,
348
+ };
349
+ } else {
350
+ obj.definition = {
351
+ accountId: selectedWeChatAccount?.id,
352
+ licenseCode: selectedWeChatAccount.sourceAccountIdentifier,
353
+ sourceType: selectedWeChatAccount.sourceTypeName,
354
+ };
355
+ }
345
356
  if (this.props.location.query && this.props.location.query.module !== 'dvs') {
346
357
  obj.definition.mode = get(this, 'props.Edit.templateDetails.mode', '') || get(this, 'props.Edit.templateDetails.definition.mode', '');
347
358
  }