@capillarytech/creatives-library 7.17.62 → 7.17.64
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
|
@@ -211,7 +211,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
211
211
|
</CapTreeNode>
|
|
212
212
|
);
|
|
213
213
|
hidingDateTagsForJpLocale(hideDateTagsForJpLocale, val, list, tagValue);
|
|
214
|
-
} else if (searchString === '' || !searchString || ((val.name || '').toLowerCase().indexOf(searchString.toLowerCase()) !== -1)) {
|
|
214
|
+
} else if (searchString === '' || !searchString || (String(val.name || '').toLowerCase().indexOf(searchString.toLowerCase()) !== -1)) {
|
|
215
215
|
let childDisabled = true;
|
|
216
216
|
if (key === CUSTOMER_BARCODE_TAG && !hasCustomerBarcodeFeatureEnabled()) {
|
|
217
217
|
childDisabled = true;
|
|
@@ -11,6 +11,7 @@ import React from 'react';
|
|
|
11
11
|
|
|
12
12
|
// import { FormattedMessage } from 'react-intl';
|
|
13
13
|
import _ from 'lodash';
|
|
14
|
+
import CapSpin from '@capillarytech/cap-ui-library/CapSpin';
|
|
14
15
|
// import messages from './messages';
|
|
15
16
|
const loadScript = require('load-script');
|
|
16
17
|
const defaultScriptUrl = `${window.location.origin}/arya/ui/library/ckeditor/ckeditor.js`;
|
|
@@ -137,6 +138,8 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
137
138
|
content: "",
|
|
138
139
|
editorInstance: undefined,
|
|
139
140
|
setInitData: false,
|
|
141
|
+
isLoading: true,
|
|
142
|
+
scriptLoaded: false,
|
|
140
143
|
};
|
|
141
144
|
|
|
142
145
|
this.delayTimer = 0;
|
|
@@ -182,10 +185,14 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
182
185
|
}
|
|
183
186
|
}
|
|
184
187
|
}
|
|
188
|
+
onLoad = () => {
|
|
189
|
+
this.setState({ scriptLoaded: true }, () => {
|
|
190
|
+
this.initializeEditor();
|
|
191
|
+
});
|
|
192
|
+
};
|
|
185
193
|
|
|
186
|
-
|
|
194
|
+
initializeEditor = () => {
|
|
187
195
|
if (this.unmounting) return;
|
|
188
|
-
|
|
189
196
|
|
|
190
197
|
if (!window.CKEDITOR) {
|
|
191
198
|
console.error("CKEditor not found");
|
|
@@ -243,6 +250,7 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
243
250
|
this.editorInstance.on(index, event);
|
|
244
251
|
});
|
|
245
252
|
}
|
|
253
|
+
this.setState({ isLoading: false });
|
|
246
254
|
}
|
|
247
255
|
|
|
248
256
|
onFocusOut = () => {
|
|
@@ -271,11 +279,12 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
271
279
|
};
|
|
272
280
|
|
|
273
281
|
render() {
|
|
274
|
-
|
|
275
282
|
return (
|
|
276
|
-
<
|
|
277
|
-
<div
|
|
278
|
-
|
|
283
|
+
<CapSpin spinning={this.state.isLoading}>
|
|
284
|
+
<div id={this.props.id} style={{borderRight: "1px solid #000 !important"}}>
|
|
285
|
+
<div className={this.props.activeClass} ref={(node) => (this.node = node)}/>
|
|
286
|
+
</div>
|
|
287
|
+
</CapSpin>
|
|
279
288
|
);
|
|
280
289
|
}
|
|
281
290
|
}
|
|
@@ -2362,7 +2362,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2362
2362
|
history: [],
|
|
2363
2363
|
};
|
|
2364
2364
|
if (this.state.isEdit) {
|
|
2365
|
-
obj._id = this.props.Email.templateDetails
|
|
2365
|
+
obj._id = this.props.Email.templateDetails?._id || '';
|
|
2366
2366
|
}
|
|
2367
2367
|
obj.type = 'EMAIL';
|
|
2368
2368
|
const baseLanguage = this.props.currentOrgDetails.basic_details.base_language;
|
|
@@ -1016,7 +1016,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1016
1016
|
} = {},
|
|
1017
1017
|
} = {},
|
|
1018
1018
|
} = {},
|
|
1019
|
-
} = template;
|
|
1019
|
+
} = template || {};
|
|
1020
1020
|
if (this.props.isFullMode && !this.props.isDltFromRcs && !(this.state.channel.toUpperCase() === WHATSAPP && status === WHATSAPP_STATUSES.approved) && !(this.state.hostName === HOST_GUPSHUP)) {
|
|
1021
1021
|
templateData.extra.push(<CapDropdown
|
|
1022
1022
|
overlay={
|
|
@@ -874,7 +874,6 @@ export const Whatsapp = (props) => {
|
|
|
874
874
|
|
|
875
875
|
const templateMessageErrorHandler = (value) => {
|
|
876
876
|
let errorMessage = false;
|
|
877
|
-
const percentSignRegex = /%/;
|
|
878
877
|
if (value === '') {
|
|
879
878
|
errorMessage = formatMessage(messages.emptyTemplateMessageErrorMessage);
|
|
880
879
|
} else if (
|
|
@@ -882,9 +881,6 @@ export const Whatsapp = (props) => {
|
|
|
882
881
|
TEMPLATE_MESSAGE_MAX_LENGTH
|
|
883
882
|
) {
|
|
884
883
|
errorMessage = formatMessage(messages.templateMessageLengthError);
|
|
885
|
-
} else if ( host === HOST_GUPSHUP && percentSignRegex.test(value)
|
|
886
|
-
) {
|
|
887
|
-
errorMessage = formatMessage(messages.noPercentSign);
|
|
888
884
|
} else {
|
|
889
885
|
const validVarArr = value.match(validVarRegex) || [];
|
|
890
886
|
const validVarSet = [...new Set(validVarArr)];
|