@capillarytech/creatives-library 2.0.14 → 2.0.15
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.
|
@@ -370,18 +370,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
-
setLocale = () => {
|
|
374
|
-
const user = localStorage.getItem('user');
|
|
375
|
-
let locale = 'en';
|
|
376
|
-
if (user) {
|
|
377
|
-
locale = JSON.parse(user).lang;
|
|
378
|
-
}
|
|
379
|
-
locale = this.getMappedLocale(locale);
|
|
380
|
-
//locale = 'zh';
|
|
381
|
-
console.log('Setting final locale as', locale);
|
|
382
|
-
moment.locale(locale);
|
|
383
|
-
};
|
|
384
|
-
|
|
385
373
|
getMappedLocale = (locale) => {
|
|
386
374
|
const map = {
|
|
387
375
|
'en': 'en',
|
|
@@ -435,7 +423,18 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
435
423
|
});
|
|
436
424
|
}
|
|
437
425
|
};
|
|
438
|
-
|
|
426
|
+
onPaginationChange = () => { this.getAllTemplates({getNextPage: true}); }
|
|
427
|
+
setLocale = () => {
|
|
428
|
+
const user = localStorage.getItem('user');
|
|
429
|
+
let locale = 'en';
|
|
430
|
+
if (user) {
|
|
431
|
+
locale = JSON.parse(user).lang;
|
|
432
|
+
}
|
|
433
|
+
locale = this.getMappedLocale(locale);
|
|
434
|
+
//locale = 'zh';
|
|
435
|
+
console.log('Setting final locale as', locale);
|
|
436
|
+
moment.locale(locale);
|
|
437
|
+
};
|
|
439
438
|
getCurrentWindow(e) {
|
|
440
439
|
console.log('in sms templates', e);
|
|
441
440
|
const response = {
|
|
@@ -731,7 +730,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
731
730
|
});
|
|
732
731
|
} else {
|
|
733
732
|
this.props.router.push({
|
|
734
|
-
pathname:
|
|
733
|
+
pathname: `/templates/${this.state.channel.toLowerCase()}/create`,
|
|
735
734
|
query: type === 'embedded' ? {type: 'embedded', module} : {module},
|
|
736
735
|
});
|
|
737
736
|
}
|
|
@@ -1207,7 +1206,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1207
1206
|
/>
|
|
1208
1207
|
);
|
|
1209
1208
|
}
|
|
1210
|
-
|
|
1211
1209
|
render() {
|
|
1212
1210
|
console.log('templates props', this.props);
|
|
1213
1211
|
let pageHeaderText = '';
|
|
@@ -1227,30 +1225,30 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1227
1225
|
pageHeaderText = this.props.intl.formatMessage(messages.lineHeader);
|
|
1228
1226
|
}
|
|
1229
1227
|
}
|
|
1230
|
-
const options = [
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
];
|
|
1240
|
-
const typeOptions = [
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
];
|
|
1228
|
+
// const options = [
|
|
1229
|
+
// {
|
|
1230
|
+
// value: "Most Recent",
|
|
1231
|
+
// label: this.props.intl.formatMessage(messages.mostRecentOption),
|
|
1232
|
+
// },
|
|
1233
|
+
// {
|
|
1234
|
+
// value: "Alphabetically",
|
|
1235
|
+
// label: this.props.intl.formatMessage(messages.alphabeticallyOption),
|
|
1236
|
+
// },
|
|
1237
|
+
// ];
|
|
1238
|
+
// const typeOptions = [
|
|
1239
|
+
// {
|
|
1240
|
+
// value: "All",
|
|
1241
|
+
// label: "All",
|
|
1242
|
+
// },
|
|
1243
|
+
// {
|
|
1244
|
+
// label: "Text",
|
|
1245
|
+
// value: 'Text',
|
|
1246
|
+
// },
|
|
1247
|
+
// {
|
|
1248
|
+
// label: "Image",
|
|
1249
|
+
// value: "Image",
|
|
1250
|
+
// },
|
|
1251
|
+
// ];
|
|
1254
1252
|
const filterContent = (
|
|
1255
1253
|
<div className="action-container">
|
|
1256
1254
|
<CapInput
|
|
@@ -1261,24 +1259,14 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1261
1259
|
value={this.state.searchText}
|
|
1262
1260
|
onChange={(e) => this.searchTemplate(e.target.value)}
|
|
1263
1261
|
/>
|
|
1264
|
-
|
|
1265
|
-
<CapButton
|
|
1262
|
+
<div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
|
|
1263
|
+
<CapButton
|
|
1264
|
+
type={this.props.isComponent ? "secondary" : "primary"}
|
|
1265
|
+
onClick={(ev) => this.props.isComponent ? this.handleBlankTemplateAction() : this.createTemplate(ev)} >
|
|
1266
|
+
{ this.props.intl.formatMessage(messages.createNewActionButton) }
|
|
1267
|
+
</CapButton>
|
|
1266
1268
|
</div>
|
|
1267
|
-
|
|
1268
|
-
<div className="action-container">
|
|
1269
|
-
<div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
|
|
1270
|
-
<div className="select-font">{this.props.intl.formatMessage(messages.sortBy)}</div>
|
|
1271
|
-
<CapSelect key={"select-account"} style={{width: '120px', marginLeft: '16px', minWidth: 'initial'}} defaultValue="Most Recent" onChange={this.handleSortBy} options={options}>
|
|
1272
|
-
</CapSelect>
|
|
1273
|
-
</div>
|
|
1274
|
-
{ (this.state.channel.toLowerCase() === 'mobilepush' || this.state.channel.toLowerCase() === 'line') &&
|
|
1275
|
-
<div style={{display: "flex", justifyContent: "space-between", alignItems: 'center', marginLeft: '16px'}}>
|
|
1276
|
-
<div className="select-font">Type</div>
|
|
1277
|
-
<CapSelect key={"select-type"} style={{width: '120px', marginLeft: '16px', minWidth: 'initial'}} defaultValue="All" onChange={this.handleType} options={typeOptions}>
|
|
1278
|
-
</CapSelect>
|
|
1279
|
-
</div>
|
|
1280
|
-
}
|
|
1281
|
-
</div>}
|
|
1269
|
+
|
|
1282
1270
|
</div>
|
|
1283
1271
|
);
|
|
1284
1272
|
const accountOptions = [];
|
|
@@ -1481,7 +1469,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1481
1469
|
</Row>
|
|
1482
1470
|
<Row className="template-header-container">
|
|
1483
1471
|
<div className="template-header">{(this.props.location.query.type === 'embedded' && moduleName === 'dvs') ? pageHeaderDvs : pageHeader}</div>
|
|
1484
|
-
{!this.props.isComponent && actionButton}
|
|
1485
1472
|
</Row>
|
|
1486
1473
|
<Row>
|
|
1487
1474
|
<Helmet
|
|
@@ -1491,9 +1478,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1491
1478
|
]}
|
|
1492
1479
|
/>
|
|
1493
1480
|
{this.props.renderNewCardGrid && templateList && templateList.length > 0 &&
|
|
1494
|
-
|
|
1481
|
+
<Pagination onPageChange={this.onPaginationChange} paginationSelector="pagination-container">
|
|
1482
|
+
{this.props.renderNewCardGrid({templates: this.props.TemplatesList, filterContent, handlers: {handlePreviewClick: this.handlePreviewClick, handleEditClick: this.handleEditClick}})}
|
|
1483
|
+
</Pagination>
|
|
1495
1484
|
}
|
|
1496
|
-
{!this.props.renderNewCardGrid && ((templateList && templateList.length > 0) || isSearch) &&
|
|
1485
|
+
{!this.props.renderNewCardGrid && ((templateList && templateList.length > 0) || isSearch) &&
|
|
1486
|
+
<Pagination onPageChange={this.onPaginationChange} paginationSelector="pagination-container">
|
|
1497
1487
|
<CardGrid
|
|
1498
1488
|
className={this.state.channel.toLowerCase() === "mobilepush" ? "mobilepush-templates" : ""}
|
|
1499
1489
|
listItem={templateList}
|
|
@@ -44,7 +44,9 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
44
44
|
}));
|
|
45
45
|
return (<div>
|
|
46
46
|
{filterContent}
|
|
47
|
-
<
|
|
47
|
+
<div className="pagination-container">
|
|
48
|
+
<CapCustomCardList cardList={cardDataList} type="SMS" />
|
|
49
|
+
</div>
|
|
48
50
|
</div>);
|
|
49
51
|
}
|
|
50
52
|
getTemplatesComponent(channel) {
|
|
@@ -83,7 +85,13 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
83
85
|
render() {
|
|
84
86
|
return (
|
|
85
87
|
<div>
|
|
86
|
-
<CapTab
|
|
88
|
+
<CapTab
|
|
89
|
+
panes={this.state.panes}
|
|
90
|
+
onChange={this.channelChange}
|
|
91
|
+
activeKey={this.state.selectedChannel}
|
|
92
|
+
defaultActiveKey={this.state.selectedChannel}/>
|
|
93
|
+
|
|
94
|
+
|
|
87
95
|
</div>
|
|
88
96
|
|
|
89
97
|
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capillarytech/creatives-library",
|
|
3
3
|
"author": "meharaj",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.15",
|
|
5
5
|
"description": "Capillary creatives ui",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"module": "./index.es.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"sanitize.css": "4.1.0",
|
|
62
62
|
"semantic-ui-react": "0.68.3",
|
|
63
63
|
"source-map-loader": "^0.2.4",
|
|
64
|
-
"styled-components": "
|
|
64
|
+
"styled-components": "2",
|
|
65
65
|
"warning": "3.0.0",
|
|
66
66
|
"whatwg-fetch": "2.0.1"
|
|
67
67
|
}
|