@capillarytech/creatives-library 7.17.17 → 7.17.19

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.17",
4
+ "version": "7.17.19",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -53,11 +53,11 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
53
53
  componentDidMount() {
54
54
  const user = localStorage.getItem('user');
55
55
  let locale = 'en';
56
- moment.locale(locale);
57
56
  if (user) {
58
57
  locale = JSON.parse(user).lang || locale;
59
58
  }
60
59
  locale = this.getTranslationMappedLocale(locale);
60
+ moment.locale(locale);
61
61
  this.setState({
62
62
  translationLang: locale,
63
63
  });
@@ -293,7 +293,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
293
293
  onVisibleChange={this.togglePopoverVisibility}
294
294
  content={contentSection}
295
295
  trigger="click"
296
- placement={channel === 'EMAIL' ? "bottom" : "rightTop"}
296
+ placement={translationLang === "ja-JP" && channel === 'EMAIL' ? "bottom" : "rightTop"}
297
297
  >
298
298
  <CapButton isAddBtn type="flat">{label || ''}</CapButton>
299
299
  </CapPopover>
@@ -3066,7 +3066,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
3066
3066
  id={val.id}
3067
3067
  userLocale={this.props.userLocale}
3068
3068
  selectedOfferDetails={this.props.selectedOfferDetails}
3069
- channel={this.props.schema.channel}
3069
+ channel={channel}
3070
3070
  />
3071
3071
  </CapColumn>
3072
3072
  );
@@ -36,6 +36,7 @@ import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
36
36
  import { gtmPush } from '../../utils/gtmTrackers';
37
37
  const {CapCustomCardList} = CapCustomCard;
38
38
  import {transformEmailTemplates, storeS3FileSizeDetails, CREATIVES_S3_ASSET_FILESIZES} from '../../utils/cdnTransformation';
39
+ import { GET_TRANSLATION_MAPPED } from '../../containers/TagList/constants';
39
40
 
40
41
  export class Email extends React.Component { // eslint-disable-line react/prefer-stateless-function
41
42
  constructor(props) {
@@ -80,6 +81,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
80
81
  addLanguageType: '',
81
82
  startValidation: false,
82
83
  saveForm: false,
84
+ translationLang: 'en',
83
85
  };
84
86
 
85
87
  this.isTagLoaded = false;
@@ -204,7 +206,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
204
206
  // this.startTemplateCreation();
205
207
  // }, 15000);
206
208
  }
207
-
209
+
210
+ getTranslationMappedLocale(locale) {
211
+ return GET_TRANSLATION_MAPPED?.[locale];
212
+ }
208
213
  componentDidMount() {
209
214
  const query = {
210
215
  layout: 'EMAIL',
@@ -216,6 +221,16 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
216
221
  if (this.props.location.query.type === 'embedded') {
217
222
  this.showNext();
218
223
  }
224
+ const user = localStorage.getItem('user');
225
+ let locale = 'en';
226
+ if (user) {
227
+ locale = JSON.parse(user)?.lang || locale;
228
+ }
229
+ locale = this.getTranslationMappedLocale(locale);
230
+ moment.locale(locale);
231
+ this.setState({
232
+ translationLang: locale,
233
+ });
219
234
  }
220
235
 
221
236
  checkBeeEditorAllowedForLibrary = () => {
@@ -2714,6 +2729,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2714
2729
  uuid={CmsSettings.uuid}
2715
2730
  type={CmsSettings.type}
2716
2731
  isEmailLoading={isLoading}
2732
+ userLocale={this.state.translationLang}
2717
2733
  /> : ''}
2718
2734
  </Col>
2719
2735
  </Row>