@capillarytech/creatives-library 7.17.6 → 7.17.8

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": "7.17.6",
4
+ "version": "7.17.8",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
8
8
  import React from 'react';
9
9
  import { connect } from 'react-redux';
10
10
  // import styled from 'styled-components';
11
- import { CapSpin, CapModal, CapButton, CapPopover, CapInput, CapTree, CapSelect, CapTooltip } from '@capillarytech/cap-ui-library';
11
+ import { CapSpin, CapModal, CapButton, CapPopover, CapInput, CapTree, CapSelect, CapTooltip, CapLink, CapIcon } from '@capillarytech/cap-ui-library';
12
12
 
13
13
  import _ from 'lodash';
14
14
  import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
@@ -17,6 +17,7 @@ import messages from './messages';
17
17
  import { makeSelectLoyaltyPromotionDisplay } from '../../v2Containers/Cap/selectors';
18
18
  import { CARD_RELATED_TAGS } from '../../containers/App/constants';
19
19
  import { hasCardBasedScope } from '../../utils/common';
20
+ import moment from 'moment';
20
21
 
21
22
  const {Search} = CapInput;
22
23
  const {CapTreeNode} = CapTree;
@@ -32,10 +33,33 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
32
33
  visible: false,
33
34
  dynamicDateValue: '',
34
35
  showModal: false,
36
+ japaneseLang: '',
35
37
  };
36
38
  this.renderTags = this.renderTags.bind(this);
37
39
  this.getSearchedExpandedKeys = this.getSearchedExpandedKeys.bind(this);
38
40
  }
41
+ getMappedLocale = (locale) => {
42
+ const map = {
43
+ 'en': 'en-US',
44
+ 'zh-cn': 'zh',
45
+ 'zh': 'zh',
46
+ 'en-US': 'en-US',
47
+ 'ja-JP': 'ja-JP',
48
+ };
49
+ return map[locale];
50
+ };
51
+ componentDidMount() {
52
+ const user = localStorage.getItem('user');
53
+ let locale = localStorage.getItem('jlocale') || 'en';
54
+ moment.locale(locale);
55
+ if (user) {
56
+ locale = JSON.parse(user).lang || locale;
57
+ }
58
+ locale = this.getMappedLocale(locale);
59
+ this.setState({
60
+ japaneseLang: locale,
61
+ });
62
+ }
39
63
 
40
64
  onChange = (e) => {
41
65
  const value = e.target.value;
@@ -178,12 +202,14 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
178
202
  });
179
203
  return list;
180
204
  }
181
-
205
+ openTranslationLink = () => {
206
+ window.open(`https://docs.capillarytech.com/docs/tags-translation`, "_blank");
207
+ }
182
208
  render() {
183
209
  const { hidePopover = false, tags = {}, intl = {}, moduleFilterEnabled, label, modalProps } = this.props;
184
210
  const tg = tags;
185
211
  const {formatMessage} = intl;
186
- const { tagValue, expandedKeys, autoExpandParent, searchValue, visible } = this.state;
212
+ const { tagValue, expandedKeys, autoExpandParent, searchValue, visible, japaneseLang } = this.state;
187
213
  const options = [
188
214
  {
189
215
  value: "All",
@@ -222,9 +248,37 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
222
248
  expandedKeys={expandedKeys}
223
249
  autoExpandParent={autoExpandParent}
224
250
  onExpand={this.onExpand}
225
- >
251
+ >
226
252
  {this.renderTags(tg, searchValue)}
227
253
  </CapTree>
254
+ {
255
+ japaneseLang === "ja-JP" &&
256
+ <div className = 'tag-list-footer'>
257
+ <CapIcon
258
+ type="help"
259
+ size="s"
260
+ />
261
+
262
+ <CapLink>
263
+ <CapButton type="flat" style={{padding: '0px'}} onClick={this.openTranslationLink} >
264
+ <div className = 'tag-list-footer-icon'>
265
+ <div>ヘルプ :トークンの定義</div>
266
+ <CapIcon
267
+ type="open-in-new-light"
268
+ size="s"
269
+ style={{ marginRight: 4 }}
270
+
271
+ svgProps={{
272
+ fill: '#2466ea',
273
+ }}
274
+ />
275
+ </div>
276
+ </CapButton>
277
+ </CapLink>
278
+
279
+ </div>
280
+ }
281
+
228
282
  </CapSpin>
229
283
  </div>);
230
284
  return (
@@ -233,18 +287,18 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
233
287
  visible={this.props.visibleTaglist}
234
288
  footer={[]}
235
289
  {...modalProps}
236
- >
290
+ >
237
291
  {contentSection}
238
292
  </CapModal> :
239
- <CapPopover
240
- visible={visible}
241
- onVisibleChange={this.togglePopoverVisibility}
242
- content={contentSection}
243
- trigger="click"
244
- placement="rightTop"
293
+ <CapPopover
294
+ visible={visible}
295
+ onVisibleChange={this.togglePopoverVisibility}
296
+ content={contentSection}
297
+ trigger="click"
298
+ placement="rightTop"
245
299
  >
246
- <CapButton isAddBtn type="flat">{label || ''}</CapButton>
247
- </CapPopover>
300
+ <CapButton isAddBtn type="flat">{label || ''}</CapButton>
301
+ </CapPopover>
248
302
  }
249
303
  <CapModal
250
304
  visible={this.state.showModal}
@@ -351,7 +351,7 @@ export const response = {
351
351
  fontFamily: "open-sans, sans-serif",
352
352
  fontStyle: "normal",
353
353
  fontWeight: "600",
354
- marginLeft: "5px",
354
+ justifyContent: "flex-end",
355
355
  },
356
356
  customComponent: true,
357
357
  width: 2,
@@ -6,3 +6,15 @@
6
6
  max-height: 300px;
7
7
  overflow-y: auto;
8
8
  }
9
+
10
+ .tag-list-footer {
11
+ display: flex;
12
+ align-items: center;
13
+ }
14
+ .tag-list-footer-icon {
15
+ display: flex;
16
+ }
17
+ .tag-list-footer-icon > div {
18
+ color: #2466ea;
19
+ padding: 0px 10px;
20
+ }