@capillarytech/creatives-library 7.17.89 → 7.17.90

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/initialState.js CHANGED
@@ -16,6 +16,7 @@ export default {
16
16
  layouts: [],
17
17
  },
18
18
  fetchingSchema: true,
19
+ fetchingSchemaError: '',
19
20
  // isLoggedIn,
20
21
  },
21
22
  app: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.89",
4
+ "version": "7.17.90",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -10,7 +10,20 @@ import { connect } from 'react-redux';
10
10
  import moment from 'moment';
11
11
  import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
12
12
  // import styled from 'styled-components';
13
- import { CapSpin, CapModal, CapButton, CapPopover, CapInput, CapTree, CapSelect, CapTooltip, CapLink, CapIcon } from '@capillarytech/cap-ui-library';
13
+ import {
14
+ CapSpin,
15
+ CapModal,
16
+ CapButton,
17
+ CapPopover,
18
+ CapInput,
19
+ CapTree,
20
+ CapSelect,
21
+ CapTooltip,
22
+ CapLink,
23
+ CapIcon,
24
+ CapRow,
25
+ CapLabel,
26
+ } from "@capillarytech/cap-ui-library";
14
27
  import './style.scss';
15
28
  import _ from 'lodash';
16
29
  import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
@@ -239,7 +252,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
239
252
  window.open(TAG_TRANSLATION_DOC, '_blank');
240
253
  }
241
254
  render() {
242
- const { hidePopover = false, tags = {}, intl = {}, moduleFilterEnabled, label, modalProps, channel } = this.props;
255
+ const { hidePopover = false, tags = {}, intl = {}, moduleFilterEnabled, label, modalProps, channel, fetchingSchemaError = false } = this.props;
243
256
  const tg = tags;
244
257
  const {formatMessage} = intl;
245
258
  const { tagValue, expandedKeys, autoExpandParent, searchValue, visible, translationLang } = this.state;
@@ -318,13 +331,39 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
318
331
  {contentSection}
319
332
  </CapModal> :
320
333
  <CapPopover
321
- visible={visible}
334
+ visible={fetchingSchemaError ? false : visible}
322
335
  onVisibleChange={this.togglePopoverVisibility}
323
336
  content={contentSection}
324
337
  trigger="click"
325
338
  placement={translationLang === "ja-JP" && channel === 'EMAIL' ? "bottom" : "rightTop"}
339
+ >
340
+ <CapTooltip
341
+ title={
342
+ fetchingSchemaError && (
343
+ <CapRow className="tooltip-text-container">
344
+ <CapLabel className="tooltip-text1">
345
+ {formatMessage(messages.somethingWentWrong)}
346
+ </CapLabel>
347
+ <CapLabel className="tooltip-text2">
348
+ {formatMessage(messages.labelFetchErrorMsg)}
349
+ </CapLabel>
350
+ </CapRow>
351
+ )
352
+ }
353
+ placement="right"
326
354
  >
327
- <CapButton disabled={this?.props?.disabled} isAddBtn type="flat">{label || ''}</CapButton>
355
+ <CapRow className="tooltip-add-label-container">
356
+ <CapButton
357
+ disabled={
358
+ this?.props?.disabled || fetchingSchemaError
359
+ }
360
+ isAddBtn
361
+ type="flat"
362
+ >
363
+ {label || ""}
364
+ </CapButton>
365
+ </CapRow>
366
+ </CapTooltip>
328
367
  </CapPopover>
329
368
  }
330
369
  <CapModal
@@ -361,7 +400,8 @@ CapTagList.propTypes = {
361
400
  disableTagsDetails: PropTypes.object,
362
401
  currentOrgDetails: PropTypes.object,
363
402
  channel: PropTypes.string,
364
- disabled: PropTypes.bool
403
+ disabled: PropTypes.bool,
404
+ fetchingSchemaError: PropTypes.bool,
365
405
  };
366
406
 
367
407
  CapTagList.defaultValue = {
@@ -50,4 +50,12 @@ export default defineMessages({
50
50
  id: `creatives.componentsV2.CapTagList.customerBarcodeDisable`,
51
51
  defaultMessage: 'This label is not enabled for your organization. Please connect with your Capillary POC',
52
52
  },
53
+ "somethingWentWrong": {
54
+ id: `creatives.componentsV2.CapTagList.somethingWentWrong`,
55
+ defaultMessage: 'Something went wrong',
56
+ },
57
+ 'labelFetchErrorMsg': {
58
+ id: `creatives.componentsV2.CapTagList.labelFetchErrorMsg`,
59
+ defaultMessage: 'Unable to fetch the labels. Please try again later'
60
+ },
53
61
  });
@@ -1,5 +1,26 @@
1
+ @import "~@capillarytech/cap-ui-library/styles/_variables";
2
+
1
3
  @media (max-height: 25rem) {
2
4
  .ant-tree.cap-tree-v2.ant-tree-icon-hide {
3
5
  height: 8.5714rem;
4
6
  }
5
7
  }
8
+
9
+ .tooltip-add-label-container {
10
+ float: right;
11
+ }
12
+
13
+ .tooltip-text-container {
14
+ margin: $CAP_SPACE_12 $CAP_SPACE_20;
15
+ .tooltip-text1 {
16
+ margin-bottom: $CAP_SPACE_08;
17
+ font-weight: $FONT_WEIGHT_MEDIUM;
18
+ color: $FONT_COLOR_06;
19
+ font-size: $FONT_SIZE_L;
20
+ }
21
+ .tooltip-text2 {
22
+ font-weight: $FONT_WEIGHT_REGULAR;
23
+ color: $FONT_COLOR_06;
24
+ font-size: $FONT_SIZE_M;
25
+ }
26
+ }
@@ -39,4 +39,4 @@ export const ORG_REFRESH_SEC = 10;
39
39
  export const ORG_CHANGED = 'ORG_CHANGED';
40
40
 
41
41
  export const ENABLE_AI_SUGGESTIONS = 'ENABLE_AI_SUGGESTIONS';
42
-
42
+ export const ERROR_IN_FETCHING_TAGS = 'Error in fetching tags';
@@ -79,10 +79,12 @@ function capReducer(state = fromJS(initialState.cap), action) {
79
79
  .set('getUserDataCode', action.status);
80
80
  case types.GET_SCHEMA_FOR_ENTITY_REQUEST:
81
81
  return state
82
- .set('fetchingSchema', true);
82
+ .set('fetchingSchema', true)
83
+ .set('fetchingSchemaError', false);
83
84
  case types.GET_SCHEMA_FOR_ENTITY_FAILURE:
84
85
  return state
85
- .set('fetchingSchema', false);
86
+ .set('fetchingSchema', false)
87
+ .set('fetchingSchemaError', true);
86
88
  case types.GET_SCHEMA_FOR_ENTITY_SUCCESS: {
87
89
  const stateMeta = state.get('metaEntities');
88
90
  return state
@@ -90,7 +92,8 @@ function capReducer(state = fromJS(initialState.cap), action) {
90
92
  .set('metaEntities', {
91
93
  layouts: action.data && action.entityType === 'LAYOUT' ? action.data.metaEntities : stateMeta.layouts,
92
94
  tags: action.data && action.entityType === 'TAG' ? action.data.metaEntities : stateMeta.tags,
93
- });
95
+ })
96
+ .set('fetchingSchemaError', false);
94
97
  }
95
98
  case types.CLEAR_META_ENTITIES:
96
99
  return state.set('metaEntities', {
@@ -125,9 +125,28 @@ export function* fetchSchemaForEntity(queryParams) {
125
125
  const result = yield call(Api.fetchSchemaForEntity, queryParams);
126
126
 
127
127
  // const sidebar = result.response.sidebar;
128
- yield put({ type: types.GET_SCHEMA_FOR_ENTITY_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', entityType: queryParams.queryParams.type });
128
+ const {
129
+ success = false,
130
+ response = {},
131
+ status: {
132
+ code = '',
133
+ } = {},
134
+ } = result || {};
135
+ const {
136
+ metaEntities = [],
137
+ } = response || {};
138
+ const {
139
+ queryParams: {
140
+ type = '',
141
+ } = {},
142
+ } = queryParams || {};
143
+ if (success || metaEntities?.length) {
144
+ yield put({ type: types.GET_SCHEMA_FOR_ENTITY_SUCCESS, data: response, statusCode: code, entityType: type });
145
+ } else {
146
+ yield put({ type: types.GET_SCHEMA_FOR_ENTITY_FAILURE, error: true });
147
+ }
129
148
  } catch (error) {
130
- yield put({ type: types.GET_SCHEMA_FOR_ENTITY_FAILURE, error });
149
+ yield put({ type: types.GET_SCHEMA_FOR_ENTITY_FAILURE, error});
131
150
  }
132
151
  }
133
152
 
@@ -73,6 +73,11 @@ const makeSelectFetchingSchema = () => createSelector(
73
73
  (globalState) => globalState.get('fetchingSchema')
74
74
  );
75
75
 
76
+ const makeSelectFetchingSchemaError = () => createSelector(
77
+ selectCapDomain,
78
+ (globalState) => globalState.get('fetchingSchemaError')
79
+ );
80
+
76
81
  const makeSelectLoyaltyPromotionDisplay = () => createSelector(
77
82
  selectCapDomain,
78
83
  (globalState) => ({
@@ -94,4 +99,5 @@ export {
94
99
  makeSelectFetchingSchema,
95
100
  setInjectedTags,
96
101
  makeSelectLoyaltyPromotionDisplay,
102
+ makeSelectFetchingSchemaError,
97
103
  };
@@ -1,10 +1,16 @@
1
- import { authorize, loginFlow } from '../sagas';
2
1
  import { take, fork, cancel } from 'redux-saga/effects';
2
+ import { expectSaga } from "redux-saga-test-plan";
3
+ import * as matchers from "redux-saga-test-plan/matchers";
4
+ import { authorize, loginFlow, fetchSchemaForEntity } from '../sagas';
3
5
  import {
4
6
  LOGIN_REQUEST,
5
7
  LOGIN_FAILURE,
6
8
  LOGOUT_REQUEST_V2,
9
+ GET_SCHEMA_FOR_ENTITY_SUCCESS,
10
+ GET_SCHEMA_FOR_ENTITY_FAILURE
7
11
  } from '../constants';
12
+ import { fetchSchemaForEntity as fetchSchemaForEntityApi } from "../../../services/api";
13
+
8
14
  describe('loginFlow', () => {
9
15
  it('should handle the login flow', () => {
10
16
  const generator = loginFlow();
@@ -28,4 +34,98 @@ describe('loginFlow', () => {
28
34
  }
29
35
  catch{}
30
36
  });
37
+ });
38
+
39
+ describe("fetchSchemaForEntity", () => {
40
+ it("handle success response from fetchSchemaForEntity", () => {
41
+ expectSaga(fetchSchemaForEntity, {
42
+ queryParams: {
43
+ type: 'tags'
44
+ },
45
+ })
46
+ .provide([
47
+ [
48
+ matchers.call.fn(fetchSchemaForEntityApi),
49
+ {
50
+ success: true,
51
+ response: {},
52
+ },
53
+ ],
54
+ ])
55
+ .put({
56
+ type: GET_SCHEMA_FOR_ENTITY_SUCCESS,
57
+ data: {},
58
+ statusCode: '',
59
+ entityType: 'tags'
60
+ })
61
+ .run();
62
+ });
63
+
64
+ it("handle success response from fetchSchemaForEntity when metaEntities available", () => {
65
+ expectSaga(fetchSchemaForEntity, {
66
+ queryParams: {
67
+ type: 'tags'
68
+ },
69
+ })
70
+ .provide([
71
+ [
72
+ matchers.call.fn(fetchSchemaForEntityApi),
73
+ {
74
+ response: {
75
+ metaEntities: []
76
+ },
77
+ },
78
+ ],
79
+ ])
80
+ .put({
81
+ type: GET_SCHEMA_FOR_ENTITY_SUCCESS,
82
+ data: {
83
+ metaEntities: []
84
+ },
85
+ statusCode: '',
86
+ entityType: 'tags'
87
+ })
88
+ .run();
89
+ });
90
+
91
+ it("handle when response and query params are empty from fetchSchemaForEntity when metaEntities available", () => {
92
+ expectSaga(fetchSchemaForEntity, {})
93
+ .provide([
94
+ [
95
+ matchers.call.fn(fetchSchemaForEntityApi),
96
+ {
97
+ success: true
98
+ },
99
+ ],
100
+ ])
101
+ .put({
102
+ type: GET_SCHEMA_FOR_ENTITY_SUCCESS,
103
+ data: {},
104
+ statusCode: '',
105
+ entityType: ''
106
+ })
107
+ .run();
108
+ });
109
+
110
+ it("handle error response from fetchSchemaForEntity", () => {
111
+ expectSaga(fetchSchemaForEntity, {
112
+ queryParams: {
113
+ type: 'tags'
114
+ },
115
+ })
116
+ .provide([
117
+ [
118
+ matchers.call.fn(fetchSchemaForEntityApi),
119
+ {
120
+ success: false,
121
+ response: {},
122
+ },
123
+ ],
124
+ ])
125
+ .put({
126
+ type: GET_SCHEMA_FOR_ENTITY_FAILURE,
127
+ error: 'Error in fetching tags'
128
+ })
129
+ .run();
130
+ });
31
131
  });
@@ -23085,6 +23085,7 @@ new message content.",
23085
23085
  "app": Object {},
23086
23086
  "cap": Object {
23087
23087
  "fetchingSchema": true,
23088
+ "fetchingSchemaError": "",
23088
23089
  "messages": Array [],
23089
23090
  "metaEntities": Object {
23090
23091
  "layouts": Array [],
@@ -5326,6 +5326,7 @@ new message content.",
5326
5326
  "app": Object {},
5327
5327
  "cap": Object {
5328
5328
  "fetchingSchema": true,
5329
+ "fetchingSchemaError": "",
5329
5330
  "messages": Array [],
5330
5331
  "metaEntities": Object {
5331
5332
  "layouts": Array [],
@@ -7389,6 +7390,7 @@ new message content.",
7389
7390
  "app": Object {},
7390
7391
  "cap": Object {
7391
7392
  "fetchingSchema": true,
7393
+ "fetchingSchemaError": "",
7392
7394
  "messages": Array [],
7393
7395
  "metaEntities": Object {
7394
7396
  "layouts": Array [],
@@ -18759,6 +18761,7 @@ new message content.",
18759
18761
  "app": Object {},
18760
18762
  "cap": Object {
18761
18763
  "fetchingSchema": true,
18764
+ "fetchingSchemaError": "",
18762
18765
  "messages": Array [],
18763
18766
  "metaEntities": Object {
18764
18767
  "layouts": Array [],
@@ -20822,6 +20825,7 @@ new message content.",
20822
20825
  "app": Object {},
20823
20826
  "cap": Object {
20824
20827
  "fetchingSchema": true,
20828
+ "fetchingSchemaError": "",
20825
20829
  "messages": Array [],
20826
20830
  "metaEntities": Object {
20827
20831
  "layouts": Array [],
@@ -30716,6 +30720,7 @@ new message content.",
30716
30720
  "app": Object {},
30717
30721
  "cap": Object {
30718
30722
  "fetchingSchema": true,
30723
+ "fetchingSchemaError": "",
30719
30724
  "messages": Array [],
30720
30725
  "metaEntities": Object {
30721
30726
  "layouts": Array [],
@@ -32779,6 +32784,7 @@ new message content.",
32779
32784
  "app": Object {},
32780
32785
  "cap": Object {
32781
32786
  "fetchingSchema": true,
32787
+ "fetchingSchemaError": "",
32782
32788
  "messages": Array [],
32783
32789
  "metaEntities": Object {
32784
32790
  "layouts": Array [],
@@ -40416,6 +40422,7 @@ new message content.",
40416
40422
  "app": Object {},
40417
40423
  "cap": Object {
40418
40424
  "fetchingSchema": true,
40425
+ "fetchingSchemaError": "",
40419
40426
  "messages": Array [],
40420
40427
  "metaEntities": Object {
40421
40428
  "layouts": Array [],
@@ -42479,6 +42486,7 @@ new message content.",
42479
42486
  "app": Object {},
42480
42487
  "cap": Object {
42481
42488
  "fetchingSchema": true,
42489
+ "fetchingSchemaError": "",
42482
42490
  "messages": Array [],
42483
42491
  "metaEntities": Object {
42484
42492
  "layouts": Array [],
@@ -52310,6 +52318,7 @@ new message content.",
52310
52318
  "app": Object {},
52311
52319
  "cap": Object {
52312
52320
  "fetchingSchema": true,
52321
+ "fetchingSchemaError": "",
52313
52322
  "messages": Array [],
52314
52323
  "metaEntities": Object {
52315
52324
  "layouts": Array [],
@@ -67751,6 +67760,7 @@ new message content.",
67751
67760
  "app": Object {},
67752
67761
  "cap": Object {
67753
67762
  "fetchingSchema": true,
67763
+ "fetchingSchemaError": "",
67754
67764
  "messages": Array [],
67755
67765
  "metaEntities": Object {
67756
67766
  "layouts": Array [],
@@ -83086,6 +83096,7 @@ new message content.",
83086
83096
  "app": Object {},
83087
83097
  "cap": Object {
83088
83098
  "fetchingSchema": true,
83099
+ "fetchingSchemaError": "",
83089
83100
  "messages": Array [],
83090
83101
  "metaEntities": Object {
83091
83102
  "layouts": Array [],
@@ -98527,6 +98538,7 @@ new message content.",
98527
98538
  "app": Object {},
98528
98539
  "cap": Object {
98529
98540
  "fetchingSchema": true,
98541
+ "fetchingSchemaError": "",
98530
98542
  "messages": Array [],
98531
98543
  "metaEntities": Object {
98532
98544
  "layouts": Array [],
@@ -111114,6 +111126,7 @@ new message content.",
111114
111126
  "app": Object {},
111115
111127
  "cap": Object {
111116
111128
  "fetchingSchema": true,
111129
+ "fetchingSchemaError": "",
111117
111130
  "messages": Array [],
111118
111131
  "metaEntities": Object {
111119
111132
  "layouts": Array [],
@@ -113177,6 +113190,7 @@ new message content.",
113177
113190
  "app": Object {},
113178
113191
  "cap": Object {
113179
113192
  "fetchingSchema": true,
113193
+ "fetchingSchemaError": "",
113180
113194
  "messages": Array [],
113181
113195
  "metaEntities": Object {
113182
113196
  "layouts": Array [],
@@ -123017,6 +123031,7 @@ new message content.",
123017
123031
  "app": Object {},
123018
123032
  "cap": Object {
123019
123033
  "fetchingSchema": true,
123034
+ "fetchingSchemaError": "",
123020
123035
  "messages": Array [],
123021
123036
  "metaEntities": Object {
123022
123037
  "layouts": Array [],
@@ -128272,6 +128287,7 @@ new message content.",
128272
128287
  "app": Object {},
128273
128288
  "cap": Object {
128274
128289
  "fetchingSchema": true,
128290
+ "fetchingSchemaError": "",
128275
128291
  "messages": Array [],
128276
128292
  "metaEntities": Object {
128277
128293
  "layouts": Array [],
@@ -135313,6 +135329,7 @@ new message content.",
135313
135329
  "app": Object {},
135314
135330
  "cap": Object {
135315
135331
  "fetchingSchema": true,
135332
+ "fetchingSchemaError": "",
135316
135333
  "messages": Array [],
135317
135334
  "metaEntities": Object {
135318
135335
  "layouts": Array [],
@@ -139602,6 +139619,7 @@ new message content.",
139602
139619
  "app": Object {},
139603
139620
  "cap": Object {
139604
139621
  "fetchingSchema": true,
139622
+ "fetchingSchemaError": "",
139605
139623
  "messages": Array [],
139606
139624
  "metaEntities": Object {
139607
139625
  "layouts": Array [],
@@ -141665,6 +141683,7 @@ new message content.",
141665
141683
  "app": Object {},
141666
141684
  "cap": Object {
141667
141685
  "fetchingSchema": true,
141686
+ "fetchingSchemaError": "",
141668
141687
  "messages": Array [],
141669
141688
  "metaEntities": Object {
141670
141689
  "layouts": Array [],
@@ -149324,6 +149343,7 @@ new message content.",
149324
149343
  "app": Object {},
149325
149344
  "cap": Object {
149326
149345
  "fetchingSchema": true,
149346
+ "fetchingSchemaError": "",
149327
149347
  "messages": Array [],
149328
149348
  "metaEntities": Object {
149329
149349
  "layouts": Array [],
@@ -151381,6 +151401,7 @@ new message content.",
151381
151401
  "app": Object {},
151382
151402
  "cap": Object {
151383
151403
  "fetchingSchema": true,
151404
+ "fetchingSchemaError": "",
151384
151405
  "messages": Array [],
151385
151406
  "metaEntities": Object {
151386
151407
  "layouts": Array [],
@@ -158464,6 +158485,7 @@ new message content.",
158464
158485
  "app": Object {},
158465
158486
  "cap": Object {
158466
158487
  "fetchingSchema": true,
158488
+ "fetchingSchemaError": "",
158467
158489
  "messages": Array [],
158468
158490
  "metaEntities": Object {
158469
158491
  "layouts": Array [],
@@ -160527,6 +160549,7 @@ new message content.",
160527
160549
  "app": Object {},
160528
160550
  "cap": Object {
160529
160551
  "fetchingSchema": true,
160552
+ "fetchingSchemaError": "",
160530
160553
  "messages": Array [],
160531
160554
  "metaEntities": Object {
160532
160555
  "layouts": Array [],
@@ -167887,6 +167910,7 @@ new message content.",
167887
167910
  "app": Object {},
167888
167911
  "cap": Object {
167889
167912
  "fetchingSchema": true,
167913
+ "fetchingSchemaError": "",
167890
167914
  "messages": Array [],
167891
167915
  "metaEntities": Object {
167892
167916
  "layouts": Array [],
@@ -169950,6 +169974,7 @@ new message content.",
169950
169974
  "app": Object {},
169951
169975
  "cap": Object {
169952
169976
  "fetchingSchema": true,
169977
+ "fetchingSchemaError": "",
169953
169978
  "messages": Array [],
169954
169979
  "metaEntities": Object {
169955
169980
  "layouts": Array [],
@@ -177594,6 +177619,7 @@ new message content.",
177594
177619
  "app": Object {},
177595
177620
  "cap": Object {
177596
177621
  "fetchingSchema": true,
177622
+ "fetchingSchemaError": "",
177597
177623
  "messages": Array [],
177598
177624
  "metaEntities": Object {
177599
177625
  "layouts": Array [],
@@ -179657,6 +179683,7 @@ new message content.",
179657
179683
  "app": Object {},
179658
179684
  "cap": Object {
179659
179685
  "fetchingSchema": true,
179686
+ "fetchingSchemaError": "",
179660
179687
  "messages": Array [],
179661
179688
  "metaEntities": Object {
179662
179689
  "layouts": Array [],
@@ -187017,6 +187044,7 @@ new message content.",
187017
187044
  "app": Object {},
187018
187045
  "cap": Object {
187019
187046
  "fetchingSchema": true,
187047
+ "fetchingSchemaError": "",
187020
187048
  "messages": Array [],
187021
187049
  "metaEntities": Object {
187022
187050
  "layouts": Array [],
@@ -189080,6 +189108,7 @@ new message content.",
189080
189108
  "app": Object {},
189081
189109
  "cap": Object {
189082
189110
  "fetchingSchema": true,
189111
+ "fetchingSchemaError": "",
189083
189112
  "messages": Array [],
189084
189113
  "metaEntities": Object {
189085
189114
  "layouts": Array [],
@@ -196731,6 +196760,7 @@ new message content.",
196731
196760
  "app": Object {},
196732
196761
  "cap": Object {
196733
196762
  "fetchingSchema": true,
196763
+ "fetchingSchemaError": "",
196734
196764
  "messages": Array [],
196735
196765
  "metaEntities": Object {
196736
196766
  "layouts": Array [],
@@ -198794,6 +198824,7 @@ new message content.",
198794
198824
  "app": Object {},
198795
198825
  "cap": Object {
198796
198826
  "fetchingSchema": true,
198827
+ "fetchingSchemaError": "",
198797
198828
  "messages": Array [],
198798
198829
  "metaEntities": Object {
198799
198830
  "layouts": Array [],
@@ -3196,6 +3196,7 @@ FREE GIFTS-
3196
3196
  "app": Object {},
3197
3197
  "cap": Object {
3198
3198
  "fetchingSchema": true,
3199
+ "fetchingSchemaError": "",
3199
3200
  "messages": Array [],
3200
3201
  "metaEntities": Object {
3201
3202
  "layouts": Array [],
@@ -10525,6 +10526,7 @@ FREE GIFTS-
10525
10526
  "app": Object {},
10526
10527
  "cap": Object {
10527
10528
  "fetchingSchema": true,
10529
+ "fetchingSchemaError": "",
10528
10530
  "messages": Array [],
10529
10531
  "metaEntities": Object {
10530
10532
  "layouts": Array [],
@@ -18274,6 +18276,7 @@ FREE GIFTS-
18274
18276
  "app": Object {},
18275
18277
  "cap": Object {
18276
18278
  "fetchingSchema": true,
18279
+ "fetchingSchemaError": "",
18277
18280
  "messages": Array [],
18278
18281
  "metaEntities": Object {
18279
18282
  "layouts": Array [],
@@ -26132,6 +26135,7 @@ FREE GIFTS-
26132
26135
  "app": Object {},
26133
26136
  "cap": Object {
26134
26137
  "fetchingSchema": true,
26138
+ "fetchingSchemaError": "",
26135
26139
  "messages": Array [],
26136
26140
  "metaEntities": Object {
26137
26141
  "layouts": Array [],
@@ -19,7 +19,7 @@ import * as globalActions from '../Cap/actions';
19
19
  // import styled from styled-components;
20
20
  import CapTagList from '../../v2Components/CapTagList';
21
21
  import './_tagList.scss';
22
- import { selectCurrentOrgDetails } from '../Cap/selectors';
22
+ import { selectCurrentOrgDetails, makeSelectFetchingSchemaError } from '../Cap/selectors';
23
23
  import { injectIntl } from 'react-intl';
24
24
  import { scope } from './messages';
25
25
  import { handleInjectedData, hasGiftVoucherFeature, hasPromoFeature, hasBadgesFeature, transformBadgeTags } from '../../utils/common';
@@ -33,6 +33,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
33
33
  this.state = {
34
34
  loading: false,
35
35
  tags: [],
36
+ tagsError: false,
36
37
  };
37
38
  this.renderTags = this.renderTags.bind(this);
38
39
  this.populateTags = this.populateTags.bind(this);
@@ -57,6 +58,9 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
57
58
 
58
59
  this.setState({loading: false});
59
60
  }
61
+ if (nextProps?.fetchingSchemaError) {
62
+ this.setState({tagsError: nextProps?.fetchingSchemaError});
63
+ }
60
64
 
61
65
  }
62
66
  componentDidUpdate(prevProps) {
@@ -285,6 +289,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
285
289
  currentOrgDetails={this.props.currentOrgDetails}
286
290
  channel={this.props.channel}
287
291
  disabled={this.props.disabled}
292
+ fetchingSchemaError={this?.state?.tagsError}
288
293
  />
289
294
  </div>
290
295
  );
@@ -312,11 +317,13 @@ TagList.propTypes = {
312
317
  currentOrgDetails: PropTypes.object,
313
318
  channel: PropTypes.string,
314
319
  disabled: PropTypes.bool,
320
+ fetchingSchemaError: PropTypes.bool,
315
321
  };
316
322
 
317
323
  const mapStateToProps = createStructuredSelector({
318
324
  TagList: makeSelectTagList(),
319
325
  currentOrgDetails: selectCurrentOrgDetails(),
326
+ fetchingSchemaError: makeSelectFetchingSchemaError(),
320
327
  });
321
328
 
322
329
  function mapDispatchToProps(dispatch) {
@@ -1185,6 +1185,7 @@ export const Whatsapp = (props) => {
1185
1185
  if (unsubscribeRequired) {
1186
1186
  return `${updatedSmsEditor.join('')}\n${formatMessage(
1187
1187
  messages.templateMessageUnsubscribeText,
1188
+ { unsubscribe: "{{unsubscribe}}" }
1188
1189
  )}`;
1189
1190
  }
1190
1191
  //campaigns edit flow + unsubscribeNotRequired
@@ -1,6 +1,6 @@
1
1
  import { createSelector } from 'reselect';
2
2
 
3
- const selectWhatsappDomain = () => (state) => state.get('templates');
3
+ const selectWhatsappDomain = () => (state) => state.get('whatsapp');
4
4
  const selectAccountDomain = () => (state) => state.get('templates');
5
5
 
6
6
  const makeSelectWhatsapp = () =>
@@ -124802,6 +124802,7 @@ Click {{3}} to unsubscribe'",
124802
124802
  "app": Object {},
124803
124803
  "cap": Object {
124804
124804
  "fetchingSchema": true,
124805
+ "fetchingSchemaError": "",
124805
124806
  "messages": Array [],
124806
124807
  "metaEntities": Object {
124807
124808
  "layouts": Array [],
@@ -160206,6 +160207,7 @@ Click {{3}} to unsubscribe'",
160206
160207
  "app": Object {},
160207
160208
  "cap": Object {
160208
160209
  "fetchingSchema": true,
160210
+ "fetchingSchemaError": "",
160209
160211
  "messages": Array [],
160210
160212
  "metaEntities": Object {
160211
160213
  "layouts": Array [],
@@ -177725,6 +177727,7 @@ Click {{unsubscribe}} to unsubscribe",
177725
177727
  "app": Object {},
177726
177728
  "cap": Object {
177727
177729
  "fetchingSchema": true,
177730
+ "fetchingSchemaError": "",
177728
177731
  "messages": Array [],
177729
177732
  "metaEntities": Object {
177730
177733
  "layouts": Array [],
@@ -189965,6 +189968,7 @@ new message content.",
189965
189968
  "app": Object {},
189966
189969
  "cap": Object {
189967
189970
  "fetchingSchema": true,
189971
+ "fetchingSchemaError": "",
189968
189972
  "messages": Array [],
189969
189973
  "metaEntities": Object {
189970
189974
  "layouts": Array [],