@capillarytech/creatives-library 8.0.66 → 8.0.68-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": "8.0.66",
4
+ "version": "8.0.68-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Created by vivek on 22/5/17.
3
3
  */
4
- import { fromJS } from 'immutable';
4
+ import { fromJS, Map as ImmutableMap } from 'immutable';
5
5
  import _ from 'lodash';
6
6
  import * as types from './constants';
7
7
  import initialState from '../../initialState';
@@ -113,12 +113,19 @@ function capReducer(state = fromJS(initialState.cap), action) {
113
113
  // Process extended tags
114
114
  const extendedSubtags = getTagMapValue(action?.data?.metaEntities?.extended);
115
115
 
116
+ const getExistingTagLookupMap = (state) => {
117
+ const tagLookupMap = state.getIn(['metaEntities', 'tagLookupMap']);
118
+ return state.get('metaEntities') && ImmutableMap.isMap(tagLookupMap)
119
+ ? tagLookupMap.toJS()
120
+ : {};
121
+ };
122
+
116
123
  // Combine all maps
117
124
  const combinedTagMap = {
118
125
  ...standardTagMap,
119
126
  ...customSubtags,
120
127
  ...extendedSubtags,
121
- ...state.getIn(['metaEntities', 'tagLookupMap'])?.toJS(),
128
+ ...getExistingTagLookupMap(state),
122
129
  };
123
130
  const stateMeta = state.get("metaEntities");
124
131
  return state
@@ -1444,6 +1444,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1444
1444
 
1445
1445
  const accountId = get(this.props, 'Templates.selectedWeChatAccount.uuid');
1446
1446
  const accounts = get(this.props, 'Templates.weCrmAccounts');
1447
+ const getAllTemplatesInProgress = get(this.props, 'Templates.getAllTemplatesInProgress');
1447
1448
  const noWhatsappZaloTemplates = this.isFullMode() && isEmpty(templates) || !this.state.hostName;
1448
1449
  const noFilteredWhatsappZaloTemplates = this.isFullMode() && !isEmpty(templates) && isEmpty(filteredTemplates);
1449
1450
  const noApprovedWhatsappZaloTemplates = !this.isFullMode() && isEmpty(filteredTemplates) && !isEmpty(this.state?.hostName);;
@@ -1456,7 +1457,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1456
1457
  {[WECHAT, MOBILE_PUSH, INAPP, WHATSAPP, ZALO].includes(currentChannel) && this.showAccountName()}
1457
1458
  {filterContent}
1458
1459
  {[WHATSAPP, ZALO].includes(currentChannel) && this.selectedFilters()}
1459
- <CapCustomSkeleton loader={isLoading}>
1460
+ <CapCustomSkeleton loader={isLoading || getAllTemplatesInProgress}>
1460
1461
  {<div>
1461
1462
  {!isEmpty(filteredTemplates) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError) ? (
1462
1463
  <div className={!isEmpty(this.state.searchText) && isEmpty(cardDataList) ? '' : "pagination-container"}>