@capillarytech/creatives-library 8.0.38 → 8.0.39-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
|
@@ -33,7 +33,7 @@ import styles, { CapTabStyle } from './TemplatesV2.style';
|
|
|
33
33
|
import { CREATIVES_UI_VIEW, LOYALTY, WHATSAPP, RCS, LINE, EMAIL, ASSETS, JP_LOCALE_HIDE_FEATURE, ZALO, INAPP } from '../App/constants';
|
|
34
34
|
import AccessForbidden from '../../v2Components/AccessForbidden';
|
|
35
35
|
import { getObjFromQueryParams } from '../../utils/v2common';
|
|
36
|
-
import { makeSelectAuthenticated, selectCurrentOrgDetails } from "
|
|
36
|
+
import { makeSelectAuthenticated, selectCurrentOrgDetails } from "../../v2Containers/Cap/selectors";
|
|
37
37
|
import injectSaga from '../../utils/injectSaga';
|
|
38
38
|
import injectReducer from '../../utils/injectReducer';
|
|
39
39
|
|
|
@@ -64,16 +64,16 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
64
64
|
|
|
65
65
|
const defaultPanes = {
|
|
66
66
|
sms: {content: <></>, tab: intl.formatMessage(messages.sms), key: 'sms'},
|
|
67
|
+
rcs: { content: <></>, tab: intl.formatMessage(messages.rcs), key: RCS },
|
|
67
68
|
email: {content: <></>, tab: intl.formatMessage(messages.email), key: 'email'},
|
|
68
69
|
//'wechat': {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
|
|
69
70
|
mPush: {content: <></>, tab: intl.formatMessage(messages.pushNotification), key: 'mobilepush'},
|
|
70
|
-
whatsapp: { content: <></>, tab: intl.formatMessage(messages.whatsapp), key: WHATSAPP },
|
|
71
|
-
zalo: { content: <div></div>, tab: intl.formatMessage(messages.zalo), key: ZALO },
|
|
72
|
-
viber: {content: <></>, tab: intl.formatMessage(messages.viber), key: 'viber'},
|
|
73
71
|
inApp: { content: <div></div>, tab: intl.formatMessage(messages.inapp), key: INAPP },
|
|
74
|
-
facebook: {content: <div></div>, tab: intl.formatMessage(messages.facebook), key: 'facebook'},
|
|
75
|
-
rcs: { content: <></>, tab: intl.formatMessage(messages.rcs), key: RCS },
|
|
76
72
|
line: {content: <></>, tab: intl.formatMessage(messages.line), key: 'line'},
|
|
73
|
+
viber: {content: <></>, tab: intl.formatMessage(messages.viber), key: 'viber'},
|
|
74
|
+
facebook: {content: <div></div>, tab: intl.formatMessage(messages.facebook), key: 'facebook'},
|
|
75
|
+
whatsapp: { content: <></>, tab: intl.formatMessage(messages.whatsapp), key: WHATSAPP },
|
|
76
|
+
zalo: { content: <div></div>, tab: intl.formatMessage(messages.zalo), key: ZALO },
|
|
77
77
|
};
|
|
78
78
|
//Hiding we chat for all orgs across UI for now and enabling it based on feature 'ENABLE_WECHAT'
|
|
79
79
|
|
|
@@ -120,12 +120,12 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
120
120
|
pane.disabled = true;
|
|
121
121
|
if (pane.key === 'facebook' && showDisabledFBInfo) {
|
|
122
122
|
pane.tab = (<CapTooltip
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
title={
|
|
124
|
+
intl.formatMessage(messages.facebookDisableinfo)
|
|
125
|
+
}
|
|
126
|
+
>
|
|
127
|
+
{intl.formatMessage(messages.facebook)}
|
|
128
|
+
</CapTooltip>);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
return pane;
|
|
@@ -178,16 +178,16 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
178
178
|
this.setState({selectedChannel: nextProps.channel, panes });
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
getTemplateDataForGrid = ({templates, handlers, filterContent, channel, isLoading, loadingTip}) => {
|
|
181
|
+
getTemplateDataForGrid = ({templates, handlers, filterContent, channel, isLoading, loadingTip}) => {
|
|
182
182
|
const currentChannel = channel.toUpperCase();
|
|
183
183
|
const cardDataList = templates.map((template) => {
|
|
184
184
|
const templateData =
|
|
185
185
|
{
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
186
|
+
key: `${currentChannel}-card-${template.name}`,
|
|
187
|
+
title: <span title={template.name} >{template.name}</span>,
|
|
188
|
+
extra: [<CapIcon type="eye" onClick={() => { if (this.props.isFullMode) { handlers.handlePreviewClick(template); } else { this.props.handlePeviewTemplate(template); } }} />],
|
|
189
|
+
hoverOption: <CapButton onClick={(e) => handlers.handleEditClick(e, template._id)}>{this.props.intl.formatMessage(this.props.isFullMode ? messages.edit : messages.select)}</CapButton>,
|
|
190
|
+
};
|
|
191
191
|
if (currentChannel === "SMS") {
|
|
192
192
|
templateData.content = template.versions.base['sms-editor'];
|
|
193
193
|
} else if (currentChannel === "EMAIL") {
|
|
@@ -196,16 +196,16 @@ getTemplateDataForGrid = ({templates, handlers, filterContent, channel, isLoadin
|
|
|
196
196
|
return templateData;
|
|
197
197
|
});
|
|
198
198
|
return (<div>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
199
|
+
{filterContent}
|
|
200
|
+
<CapSpin spinning={isLoading} tip={loadingTip}>
|
|
201
|
+
<div className="pagination-container">
|
|
202
|
+
<CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={currentChannel} />
|
|
203
|
+
</div>
|
|
204
|
+
</CapSpin>
|
|
205
205
|
|
|
206
|
-
|
|
206
|
+
</div>);
|
|
207
207
|
}
|
|
208
|
-
getGalleryComponent = (location) => <Gallery location={location} isFullMode={this.props.isFullMode}/>
|
|
208
|
+
getGalleryComponent = (location) => <Gallery location={location} isFullMode={this.props.isFullMode}/>
|
|
209
209
|
getCallTaskComponent = () => (
|
|
210
210
|
<CallTask
|
|
211
211
|
onCreateNew={this.props.createNew}
|
|
@@ -243,8 +243,8 @@ getGalleryComponent = (location) => <Gallery location={location} isFullMode={thi
|
|
|
243
243
|
<Line
|
|
244
244
|
{...this.props}
|
|
245
245
|
isCreateFlow
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
/>
|
|
247
|
+
)
|
|
248
248
|
|
|
249
249
|
getFTPComponent = () => (
|
|
250
250
|
<FTP mode={this.props.FTPMode} {...this.props} />
|
|
@@ -276,19 +276,19 @@ getGalleryComponent = (location) => <Gallery location={location} isFullMode={thi
|
|
|
276
276
|
return this.getGalleryComponent(location);
|
|
277
277
|
default:
|
|
278
278
|
return (<Templates
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
279
|
+
key={channel}
|
|
280
|
+
location={location}
|
|
281
|
+
route={{name: channel}}
|
|
282
|
+
router={this.props.router}
|
|
283
|
+
isFullMode={this.props.isFullMode}
|
|
284
|
+
createNew={this.props.createNew}
|
|
285
|
+
onSelectTemplate={(id) => this.props.onSelectTemplate(this.selectTemplate(id))}
|
|
286
|
+
renderNewCardGrid={this.getTemplateDataForGrid}
|
|
287
|
+
handlePeviewTemplate={this.props.handlePeviewTemplate}
|
|
288
|
+
messageStrategy={this.props.messageStrategy}
|
|
289
|
+
smsRegister={smsRegister}
|
|
290
|
+
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
291
|
+
/>);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
|
|
@@ -316,8 +316,8 @@ getGalleryComponent = (location) => <Gallery location={location} isFullMode={thi
|
|
|
316
316
|
return this.props.Templates.loadingTemplates;
|
|
317
317
|
}
|
|
318
318
|
render() {
|
|
319
|
-
const { isFullMode, className, cap = {},
|
|
320
|
-
const { accessiblePermissions = []} = cap.user ||
|
|
319
|
+
const { isFullMode, className, cap = {}, Global = {}} = this.props;
|
|
320
|
+
const { accessiblePermissions = []} = cap.user || Global.user || {};
|
|
321
321
|
let isCreativeAccessible = true;
|
|
322
322
|
if (!accessiblePermissions.includes(CREATIVES_UI_VIEW)) {
|
|
323
323
|
isCreativeAccessible = false;
|
|
@@ -377,7 +377,7 @@ TemplatesV2.defaultProps = {
|
|
|
377
377
|
};
|
|
378
378
|
|
|
379
379
|
const mapStateToProps = createStructuredSelector({
|
|
380
|
-
|
|
380
|
+
Global: makeSelectAuthenticated(),
|
|
381
381
|
Templates: makeSelectTemplates(),
|
|
382
382
|
TemplatesList: makeSelectTemplatesResponse(),
|
|
383
383
|
currentOrgDetails: selectCurrentOrgDetails(),
|