@capillarytech/creatives-library 7.17.3 → 7.17.5-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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.3",
4
+ "version": "7.17.5-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -0,0 +1,2 @@
1
+ export const HIDE_DEFAULT_EMAIL_TEMPLATES = 'HIDE_DEFAULT_EMAIL_TEMPLATES';
2
+ export const START_FROM_SCRATCH = 'Start from Scratch';
@@ -10,15 +10,32 @@ import PropTypes from 'prop-types';
10
10
  import {CapButton, CapCustomCard, CapSpin} from '@capillarytech/cap-ui-library';
11
11
  import { FormattedMessage } from 'react-intl';
12
12
  import messages from './messages';
13
+ import { START_FROM_SCRATCH, HIDE_DEFAULT_EMAIL_TEMPLATES } from './constants';
13
14
  const {CapCustomCardList} = CapCustomCard;
14
15
  function CmsTemplatesComponent(props) {
15
- const cardDataList = (props.cmsTemplates || []).map((template) => (
16
- {
17
- key: template.name,
18
- title: template.name,
19
- url: template.versions.base.preview_http_url,
20
- hoverOption: <CapButton onClick={() => props.handleEdmDefaultTemplateSelection(template._id)}><FormattedMessage {...messages.select}/></CapButton>,
21
- }));
16
+ const { accessibleFeatures = [] } = props.currentOrgDetails || {};
17
+ const hideDefaultEmailTemplates = accessibleFeatures.includes(HIDE_DEFAULT_EMAIL_TEMPLATES);
18
+
19
+ const cardDataList = props.cmsTemplates?.reduce((result, template) => {
20
+ const { name, _id, versions: { base } = {} } = template || {};
21
+ const commonProperties = {
22
+ key: _id,
23
+ title: name,
24
+ url: base?.preview_http_url,
25
+ hoverOption: <CapButton onClick={() => props.handleEdmDefaultTemplateSelection(_id)}><FormattedMessage {...messages.select}/></CapButton>,
26
+ };
27
+
28
+ if (hideDefaultEmailTemplates) {
29
+ if (name === START_FROM_SCRATCH) {
30
+ result.push(commonProperties);
31
+ }
32
+ } else {
33
+ result.push(commonProperties);
34
+ }
35
+
36
+ return result;
37
+ }, []);
38
+
22
39
  return (<CapSpin spinning={props.cmsTemplatesLoader}>
23
40
  <div className="pagination-container">
24
41
  <CapCustomCardList cardList={cardDataList} type="Email" />
@@ -28,6 +45,8 @@ function CmsTemplatesComponent(props) {
28
45
 
29
46
  CmsTemplatesComponent.propTypes = {
30
47
  cmsTemplates: PropTypes.array,
48
+ currentOrgDetails: PropTypes.object,
49
+ cmsTemplatesLoader: PropTypes.any,
31
50
  };
32
51
 
33
52
  export default CmsTemplatesComponent;
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import '@testing-library/jest-dom';
3
+ import cloneDeep from 'lodash/cloneDeep';
4
+ import {
5
+ fireEvent,
6
+ render,
7
+ screen,
8
+ } from '../../../utils/test-utils';
9
+ import CmsTemplatesComponent from '../index';
10
+ import { cmsTemplatesMockData, currentOrgDetailsMockData } from './mockData';
11
+
12
+ const renderComponent = (props) => render(
13
+ <CmsTemplatesComponent {...props} />
14
+ );
15
+
16
+ describe("Test CmsTemplatesComponent", () => {
17
+ const props = {
18
+ cmsTemplates: cmsTemplatesMockData,
19
+ currentOrgDetails: currentOrgDetailsMockData,
20
+ cmsTemplatesLoader: false,
21
+ handleEdmDefaultTemplateSelection: jest.fn(),
22
+ };
23
+ const { getByText, getAllByText } = screen;
24
+
25
+ it("Should show only Start from scratch template", () => {
26
+ renderComponent(props);
27
+ expect(
28
+ getByText(/Start from scratch/i)
29
+ ).toBeInTheDocument();
30
+ expect(
31
+ getByText(/Select/i)
32
+ ).toBeInTheDocument();
33
+ fireEvent.click(getByText(/Select/i));
34
+ expect(props.handleEdmDefaultTemplateSelection).toBeCalledWith(cmsTemplatesMockData[1]._id);
35
+ });
36
+
37
+ it("Should show all templates", () => {
38
+ const updatedProps = cloneDeep(props);
39
+ updatedProps.currentOrgDetails.accessibleFeatures.pop();
40
+ renderComponent(updatedProps);
41
+ expect(
42
+ getByText(/1-column_base_template/i)
43
+ ).toBeInTheDocument();
44
+
45
+ const selectButtons = getAllByText(/Select/i);
46
+ expect(selectButtons[0]).toBeInTheDocument();
47
+ expect(
48
+ getByText(/Start from scratch/i)
49
+ ).toBeInTheDocument();
50
+ expect(selectButtons[1]).toBeInTheDocument();
51
+ fireEvent.click(selectButtons[0]);
52
+ expect(props.handleEdmDefaultTemplateSelection).toBeCalledWith(cmsTemplatesMockData[0]._id);
53
+ });
54
+ });
@@ -0,0 +1,95 @@
1
+ export const cmsTemplatesMockData = [
2
+ {
3
+ _id: "5f7b614e5f09ebe595ff4045",
4
+ updatedAt: "2020-10-05T18:10:18.798Z",
5
+ createdAt: "2020-10-05T18:09:20.882Z",
6
+ definition: {
7
+ tag: "BEE_DEFAULT",
8
+ defaultTemplateMigratedViaScript: true,
9
+ },
10
+ orgId: 1231,
11
+ updatedBy: "4",
12
+ createdBy: "4",
13
+ name: "1-column_base_template",
14
+ isActive: true,
15
+ versions: {
16
+ base: {
17
+ "base": true,
18
+ "selectedLanguages": [
19
+ "en",
20
+ ],
21
+ "fileParams": {
22
+ public_url: "https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/e4324932-c4f9-404d-8d4d-18f7350efa32",
23
+ secure_file_path: "https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/e4324932-c4f9-404d-8d4d-18f7350efa32",
24
+ acl: null,
25
+ last_modified_by: null,
26
+ last_modified_on: 1601921360000,
27
+ added_by: 0,
28
+ added_on: 1601921360000,
29
+ file_size: 22301,
30
+ content_type: null,
31
+ name: "file_1601921358731",
32
+ file_handle: null,
33
+ },
34
+ "drag_drop_id": "5f7b614e5f09ebe595ff4045",
35
+ "json-content": "{\n \"page\": {\n \"template\": {\n \"name\": \"template-base\",\n \"type\": \"basic\",\n \"version\": \"2.0.0\"\n },\n \"description\": \"\",\n \"title\": \"\",\n \"rows\": [\n {\n \"columns\": [\n {\n \"style\": {\n \"padding-bottom\": \"20px\",\n \"padding-right\": \"0px\",\n \"border-left\": \"0px solid transparent\",\n \"padding-top\": \"20px\",\n \"border-bottom\": \"0px solid transparent\",\n \"border-top\": \"0px solid transparent\",\n \"background-color\": \"transparent\",\n \"padding-left\": \"0px\",\n \"border-right\": \"0px solid transparent\"\n },\n \"modules\": [\n {\n \"locked\": false,\n \"type\": \"mailup-bee-newsletter-modules-text\",\n \"descriptor\": {\n \"style\": {\n \"padding-bottom\": \"0px\",\n \"padding-left\": \"10px\",\n \"padding-right\": \"10px\",\n \"padding-top\": \"10px\"\n },\n \"computedStyle\": {\n \"hideContentOnMobile\": false\n },\n \"text\": {\n \"style\": {\n \"font-family\": \"inherit\",\n \"line-height\": \"120%\",\n \"color\": \"#7c4b96\"\n },\n \"html\": \"<div class=\\\"txtTinyMce-wrapper\\\" style=\\\"font-size: 12px; line-height: 14px;\\\" data-mce-style=\\\"font-size: 12px; line-height: 14px;\\\">\\n<p style=\\\"font-size: 18px; line-height: 21px;\\\" data-mce-style=\\\"font-size: 18px; line-height: 21px;\\\"><span style=\\\"font-size: 22px; line-height: 26px;\\\" data-mce-style=\\\"font-size: 22px; line-height: 26px;\\\"><strong><span style=\\\"line-height: 26px; font-size: 22px;\\\" data-mce-style=\\\"line-height: 26px; font-size: 22px;\\\">Time for great email design</span></strong></span></p>\\n</div>\",\n \"computedStyle\": {\n \"linkColor\": \"#7c4b96\"\n }\n }\n }\n },\n {\n \"locked\": false,\n \"type\": \"mailup-bee-newsletter-modules-text\",\n \"descriptor\": {\n \"style\": {\n \"padding-bottom\": \"10px\",\n \"padding-left\": \"10px\",\n \"padding-right\": \"10px\",\n \"padding-top\": \"5px\"\n },\n \"computedStyle\": {\n \"hideContentOnMobile\": false\n },\n \"text\": {\n \"style\": {\n \"font-family\": \"inherit\",\n \"line-height\": \"120%\",\n \"color\": \"#777777\"\n },\n \"html\": \"<div class=\\\"txtTinyMce-wrapper\\\" style=\\\"font-size: 12px; line-height: 14px;\\\" data-mce-style=\\\"font-size: 12px; line-height: 14px;\\\">\\n<p style=\\\"font-size: 14px; line-height: 16px;\\\" data-mce-style=\\\"font-size: 14px; line-height: 16px;\\\">I'm a New Text block ready for your Message content.</p>\\n</div>\",\n \"computedStyle\": {\n \"linkColor\": \"#7c4b96\"\n }\n }\n }\n }\n ],\n \"grid-columns\": 12\n }\n ],\n \"locked\": false,\n \"content\": {\n \"style\": {\n \"background-image\": \"none\",\n \"background-repeat\": \"no-repeat\",\n \"width\": \"500px\",\n \"background-position\": \"top left\",\n \"background-color\": \"transparent\",\n \"color\": \"#333\"\n },\n \"computedStyle\": {\n \"rowColStackOnMobile\": true\n }\n },\n \"container\": {\n \"style\": {\n \"background-image\": \"none\",\n \"background-color\": \"#E5E5E5\",\n \"background-position\": \"top left\",\n \"background-repeat\": \"no-repeat\"\n }\n },\n \"type\": \"one-column-empty\"\n },\n {\n \"columns\": [\n {\n \"style\": {\n \"padding-bottom\": \"10px\",\n \"padding-right\": \"10px\",\n \"border-left\": \"0px solid transparent\",\n \"padding-top\": \"10px\",\n \"border-bottom\": \"0px solid transparent\",\n \"border-top\": \"0px solid transparent\",\n \"background-color\": \"transparent\",\n \"padding-left\": \"10px\",\n \"border-right\": \"0px solid transparent\"\n },\n \"modules\": [\n {\n \"locked\": false,\n \"type\": \"mailup-bee-newsletter-modules-image\",\n \"descriptor\": {\n \"style\": {\n \"padding-bottom\": \"0px\",\n \"padding-left\": \"0px\",\n \"padding-top\": \"0px\",\n \"padding-right\": \"0px\",\n \"width\": \"100%\"\n },\n \"image\": {\n \"href\": \"https://beefree.io\",\n \"alt\": \"Image\",\n \"src\": \"https://s3-ap-southeast-1.amazonaws.com/fs.capillary.sg/intouch_creative_assets/9feb4634-4b01-409b-8aec-cd044ecd.png\"\n },\n \"computedStyle\": {\n \"class\": \"center autowidth fullwidth\",\n \"width\": 480\n }\n }\n }\n ],\n \"grid-columns\": 12\n }\n ],\n \"locked\": false,\n \"content\": {\n \"style\": {\n \"background-image\": \"none\",\n \"background-repeat\": \"no-repeat\",\n \"width\": \"500px\",\n \"background-position\": \"top left\",\n \"background-color\": \"transparent\",\n \"color\": \"#000000\"\n },\n \"computedStyle\": {\n \"rowColStackOnMobile\": true\n }\n },\n \"container\": {\n \"style\": {\n \"background-image\": \"none\",\n \"background-color\": \"#f3f3f3\",\n \"background-position\": \"top left\",\n \"background-repeat\": \"no-repeat\"\n }\n },\n \"type\": \"one-column-empty\"\n },\n {\n \"columns\": [\n {\n \"style\": {\n \"padding-bottom\": \"30px\",\n \"padding-right\": \"0px\",\n \"border-left\": \"0px solid transparent\",\n \"padding-top\": \"30px\",\n \"border-bottom\": \"0px solid transparent\",\n \"border-top\": \"0px solid transparent\",\n \"background-color\": \"transparent\",\n \"padding-left\": \"0px\",\n \"border-right\": \"0px solid transparent\"\n },\n \"modules\": [\n {\n \"locked\": false,\n \"type\": \"mailup-bee-newsletter-modules-text\",\n \"descriptor\": {\n \"style\": {\n \"padding-bottom\": \"0px\",\n \"padding-left\": \"10px\",\n \"padding-right\": \"10px\",\n \"padding-top\": \"10px\"\n },\n \"computedStyle\": {\n \"hideContentOnMobile\": false\n },\n \"text\": {\n \"style\": {\n \"font-family\": \"inherit\",\n \"line-height\": \"120%\",\n \"color\": \"#2d2d2d\"\n },\n \"html\": \"<div class=\\\"txtTinyMce-wrapper\\\" style=\\\"font-size: 12px; line-height: 14px;\\\" data-mce-style=\\\"font-size: 12px; line-height: 14px;\\\">\\n<p style=\\\"font-size: 14px; line-height: 16px;\\\" data-mce-style=\\\"font-size: 14px; line-height: 16px;\\\"><span style=\\\"font-size: 24px; line-height: 28px;\\\" data-mce-style=\\\"font-size: 24px; line-height: 28px;\\\"><strong><span style=\\\"line-height: 28px; font-size: 24px;\\\" data-mce-style=\\\"line-height: 28px; font-size: 24px;\\\">I'm a very important title</span></strong></span></p>\\n</div>\",\n \"computedStyle\": {\n \"linkColor\": \"#7c4b96\"\n }\n }\n }\n },\n {\n \"locked\": false,\n \"type\": \"mailup-bee-newsletter-modules-text\",\n \"descriptor\": {\n \"style\": {\n \"padding-bottom\": \"5px\",\n \"padding-left\": \"10px\",\n \"padding-right\": \"10px\",\n \"padding-top\": \"5px\"\n },\n \"computedStyle\": {\n \"hideContentOnMobile\": false\n },\n \"text\": {\n \"style\": {\n \"font-family\": \"inherit\",\n \"line-height\": \"120%\",\n \"color\": \"#777777\"\n },\n \"html\": \"<div class=\\\"txtTinyMce-wrapper\\\" style=\\\"font-size: 12px; line-height: 14px;\\\" data-mce-style=\\\"font-size: 12px; line-height: 14px;\\\">\\n<p style=\\\"font-size: 14px; line-height: 16px;\\\" data-mce-style=\\\"font-size: 14px; line-height: 16px;\\\"><span style=\\\"font-size: 16px; line-height: 19px;\\\" data-mce-style=\\\"font-size: 16px; line-height: 19px;\\\">I'm a subtitle: not as big as the title, but more descriptive</span></p>\\n</div>\",\n \"computedStyle\": {\n \"linkColor\": \"#7c4b96\"\n }\n }\n }\n },\n {\n \"locked\": false,\n \"type\": \"mailup-bee-newsletter-modules-text\",\n \"descriptor\": {\n \"style\": {\n \"padding-bottom\": \"10px\",\n \"padding-left\": \"10px\",\n \"padding-right\": \"10px\",\n \"padding-top\": \"15px\"\n },\n \"computedStyle\": {\n \"hideContentOnMobile\": false\n },\n \"text\": {\n \"style\": {\n \"font-family\": \"inherit\",\n \"line-height\": \"120%\",\n \"color\": \"#aaaaaa\"\n },\n \"html\": \"<div class=\\\"txtTinyMce-wrapper\\\" style=\\\"font-size: 12px; line-height: 14px;\\\" data-mce-style=\\\"font-size: 12px; line-height: 14px;\\\">\\n<p style=\\\"font-size: 14px; line-height: 16px;\\\" data-mce-style=\\\"font-size: 14px; line-height: 16px;\\\">I'm a block of text and I like latin. Pellentesque vel dui sed orci faucibus iaculis. Suspendisse dictum magna id purus tincidunt rutrum. Hey look, I'm a fake link.</p>\\n</div>\",\n \"computedStyle\": {\n \"linkColor\": \"#7c4b96\"\n }\n }\n }\n },\n {\n \"locked\": false,\n \"type\": \"mailup-bee-newsletter-modules-button\",\n \"descriptor\": {\n \"style\": {\n \"padding-bottom\": \"10px\",\n \"padding-left\": \"10px\",\n \"padding-right\": \"10px\",\n \"padding-top\": \"15px\",\n \"text-align\": \"center\"\n },\n \"computedStyle\": {\n \"width\": 158,\n \"height\": 38\n },\n \"button\": {\n \"style\": {\n \"padding-right\": \"20px\",\n \"line-height\": \"180%\",\n \"padding-top\": \"5px\",\n \"width\": \"40%\",\n \"border-top\": \"0px solid transparent\",\n \"background-color\": \"#7c4b96\",\n \"border-right\": \"0px solid transparent\",\n \"color\": \"#ffffff\",\n \"font-family\": \"inherit\",\n \"padding-bottom\": \"5px\",\n \"border-radius\": \"5px\",\n \"border-bottom\": \"0px solid transparent\",\n \"border-left\": \"0px solid transparent\",\n \"max-width\": \"100%\",\n \"padding-left\": \"20px\"\n },\n \"label\": \"<div class=\\\"txtTinyMce-wrapper\\\" style=\\\"font-size: 12px; line-height: 21px;\\\">\\n<p style=\\\"font-family: inherit; font-size: 16px; line-height: 28px;\\\"><span style=\\\"font-size: 14px; line-height: 25px;\\\">READ MORE</span></p>\\n</div>\",\n \"href\": \"\"\n }\n }\n }\n ],\n \"grid-columns\": 12\n }\n ],\n \"locked\": false,\n \"content\": {\n \"style\": {\n \"background-image\": \"none\",\n \"background-repeat\": \"no-repeat\",\n \"width\": \"500px\",\n \"background-position\": \"top left\",\n \"background-color\": \"transparent\",\n \"color\": \"#333\"\n },\n \"computedStyle\": {\n \"rowColStackOnMobile\": true\n }\n },\n \"container\": {\n \"style\": {\n \"background-image\": \"none\",\n \"background-color\": \"transparent\",\n \"background-position\": \"top left\",\n \"background-repeat\": \"no-repeat\"\n }\n },\n \"type\": \"one-column-empty\"\n },\n {\n \"columns\": [\n {\n \"style\": {\n \"padding-bottom\": \"25px\",\n \"padding-right\": \"0px\",\n \"border-left\": \"0px solid transparent\",\n \"padding-top\": \"25px\",\n \"border-bottom\": \"0px solid transparent\",\n \"border-top\": \"0px solid transparent\",\n \"background-color\": \"transparent\",\n \"padding-left\": \"0px\",\n \"border-right\": \"0px solid transparent\"\n },\n \"modules\": [\n {\n \"locked\": false,\n \"type\": \"mailup-bee-newsletter-modules-social\",\n \"descriptor\": {\n \"style\": {\n \"padding-bottom\": \"10px\",\n \"padding-left\": \"10px\",\n \"padding-right\": \"10px\",\n \"padding-top\": \"10px\",\n \"text-align\": \"center\"\n },\n \"computedStyle\": {\n \"iconsDefaultWidth\": 32,\n \"width\": 151,\n \"height\": 52,\n \"padding\": \"0 5px 0 0\"\n },\n \"iconsList\": {\n \"icons\": [\n {\n \"image\": {\n \"href\": \"http://twitter.com/\",\n \"prefix\": \"http://twitter.com/\",\n \"title\": \"Twitter\",\n \"alt\": \"Twitter\",\n \"src\": \"https://s3-ap-southeast-1.amazonaws.com/fs.capillary.sg/intouch_creative_assets/1762d8d0-3e2b-43fe-aaf2-30644867.png\"\n },\n \"name\": \"twitter\",\n \"type\": \"follow\",\n \"text\": \"\"\n },\n {\n \"image\": {\n \"href\": \"https://www.facebook.com/\",\n \"prefix\": \"https://www.facebook.com/\",\n \"title\": \"Facebook\",\n \"alt\": \"Facebook\",\n \"src\": \"https://s3-ap-southeast-1.amazonaws.com/fs.capillary.sg/intouch_creative_assets/5eace44c-70ac-4da5-a0e1-702efc78.png\"\n },\n \"name\": \"facebook\",\n \"type\": \"follow\",\n \"text\": \"\"\n },\n {\n \"image\": {\n \"href\": \"https://instagram.com/\",\n \"prefix\": \"https://instagram.com/\",\n \"title\": \"Instagram\",\n \"alt\": \"Instagram\",\n \"src\": \"https://s3-ap-southeast-1.amazonaws.com/fs.capillary.sg/intouch_creative_assets/14513c3d-84b5-4f03-989f-1133998a.png\"\n },\n \"name\": \"instagram\",\n \"type\": \"follow\",\n \"text\": \"\"\n }\n ]\n }\n }\n },\n {\n \"locked\": false,\n \"type\": \"mailup-bee-newsletter-modules-text\",\n \"descriptor\": {\n \"style\": {\n \"padding-bottom\": \"10px\",\n \"padding-left\": \"10px\",\n \"padding-right\": \"10px\",\n \"padding-top\": \"10px\"\n },\n \"computedStyle\": {\n \"hideContentOnMobile\": false\n },\n \"text\": {\n \"style\": {\n \"font-family\": \"inherit\",\n \"line-height\": \"120%\",\n \"color\": \"#bbbbbb\"\n },\n \"html\": \"<div class=\\\"txtTinyMce-wrapper\\\" style=\\\"font-size: 12px; line-height: 14px;\\\" data-mce-style=\\\"font-size: 12px; line-height: 14px;\\\">\\n<p style=\\\"font-size: 18px; line-height: 21px; text-align: center;\\\" data-mce-style=\\\"font-size: 18px; line-height: 21px; text-align: center;\\\"><span style=\\\"font-size: 14px; line-height: 16px;\\\" data-mce-style=\\\"font-size: 14px; line-height: 16px;\\\">This is a sample template from BEE free email editor</span><br><span style=\\\"font-size: 14px; line-height: 16px;\\\" data-mce-style=\\\"font-size: 14px; line-height: 16px;\\\">Visit <span style=\\\"text-decoration: underline; line-height: 16px; font-size: 14px; color: rgb(255, 255, 255);\\\" data-mce-style=\\\"text-decoration: underline; line-height: 16px; font-size: 14px; color: rgb(255, 255, 255);\\\"><a style=\\\"color: #ffffff; text-decoration: underline;\\\" href=\\\"https://beefree.io\\\" target=\\\"_blank\\\" rel=\\\"noopener\\\">beefree.io</a></span>&nbsp;to create beautiful and rich email messages at no cost.</span></p>\\n</div>\",\n \"computedStyle\": {\n \"linkColor\": \"#7c4b96\"\n }\n }\n }\n }\n ],\n \"grid-columns\": 12\n }\n ],\n \"locked\": false,\n \"content\": {\n \"style\": {\n \"background-image\": \"none\",\n \"background-repeat\": \"no-repeat\",\n \"width\": \"500px\",\n \"background-position\": \"top left\",\n \"background-color\": \"transparent\",\n \"color\": \"#333\"\n },\n \"computedStyle\": {\n \"rowColStackOnMobile\": true\n }\n },\n \"container\": {\n \"style\": {\n \"background-image\": \"none\",\n \"background-color\": \"#2d2d2d\",\n \"background-position\": \"top left\",\n \"background-repeat\": \"no-repeat\"\n }\n },\n \"type\": \"one-column-empty\"\n }\n ],\n \"body\": {\n \"webFonts\": [],\n \"content\": {\n \"style\": {\n \"font-family\": \"Arial, 'Helvetica Neue', Helvetica, sans-serif\",\n \"color\": \"#000000\"\n },\n \"computedStyle\": {\n \"messageBackgroundColor\": \"transparent\",\n \"linkColor\": \"#7c4b96\",\n \"messageWidth\": \"500px\"\n }\n },\n \"container\": {\n \"style\": {\n \"background-color\": \"#FFFFFF\"\n }\n },\n \"type\": \"mailup-bee-page-properties\"\n }\n }\n}\n",
36
+ "is_drag_drop": true,
37
+ "preview_http_url": "https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/41b59bb7-ea91-4296-b3b9-fb219c11.png",
38
+ "isPreviewGenerated": 1,
39
+ },
40
+ },
41
+ type: "EMAIL",
42
+ __v: 1,
43
+ },
44
+ {
45
+ _id: "5f7b61605f09ebe595ff404e",
46
+ updatedAt: "2020-10-05T18:10:05.997Z",
47
+ createdAt: "2020-10-05T18:09:38.041Z",
48
+ definition: {
49
+ tag: "BEE_DEFAULT",
50
+ defaultTemplateMigratedViaScript: true,
51
+ },
52
+ orgId: 1231,
53
+ updatedBy: "4",
54
+ createdBy: "4",
55
+ name: "Start from Scratch",
56
+ isActive: true,
57
+ versions: {
58
+ base: {
59
+ "base": true,
60
+ "selectedLanguages": [
61
+ "en",
62
+ ],
63
+ "fileParams": {
64
+ public_url: "https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/80ee553d-08fc-4a71-bfd3-cff42e5f9074",
65
+ secure_file_path: "https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/80ee553d-08fc-4a71-bfd3-cff42e5f9074",
66
+ acl: null,
67
+ last_modified_by: null,
68
+ last_modified_on: 1601921377000,
69
+ added_by: 0,
70
+ added_on: 1601921377000,
71
+ file_size: 4708,
72
+ content_type: null,
73
+ name: "file_1601921376764",
74
+ file_handle: null,
75
+ },
76
+ "drag_drop_id": "5f7b61605f09ebe595ff404e",
77
+ "json-content": "{\"page\":{\"title\":\"Template Base\",\"description\":\"Test template for BEE\",\"template\":{\"name\":\"template-base\",\"type\":\"basic\",\"version\":\"0.0.1\"},\"body\":{\"type\":\"mailup-bee-page-proprerties\",\"container\":{\"style\":{\"background-color\":\"#FFFFFF\"}},\"content\":{\"style\":{\"font-family\":\"Arial, 'Helvetica Neue', Helvetica, sans-serif\",\"color\":\"#000000\"},\"computedStyle\":{\"linkColor\":\"#0068A5\",\"messageBackgroundColor\":\"transparent\",\"messageWidth\":\"500px\"}},\"webFonts\":[]},\"rows\":[{\"type\":\"one-column-empty\",\"container\":{\"style\":{\"background-color\":\"transparent\",\"background-image\":\"none\",\"background-repeat\":\"no-repeat\",\"background-position\":\"top left\"}},\"content\":{\"style\":{\"background-color\":\"transparent\",\"color\":\"#000000\",\"width\":\"500px\",\"background-image\":\"none\",\"background-repeat\":\"no-repeat\",\"background-position\":\"top left\"},\"computedStyle\":{\"rowColStackOnMobile\":true,\"rowReverseColStackOnMobile\":false}},\"columns\":[{\"grid-columns\":12,\"modules\":[],\"style\":{\"background-color\":\"transparent\",\"padding-top\":\"5px\",\"padding-right\":\"0px\",\"padding-bottom\":\"5px\",\"padding-left\":\"0px\",\"border-top\":\"0px solid transparent\",\"border-right\":\"0px solid transparent\",\"border-bottom\":\"0px solid transparent\",\"border-left\":\"0px solid transparent\"}}]}]}}",
78
+ "is_drag_drop": true,
79
+ "preview_http_url": "https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/19f5a8e0-2b70-4f09-9e8d-39b2c3f8.png",
80
+ "isPreviewGenerated": 1,
81
+ },
82
+ },
83
+ type: "EMAIL",
84
+ __v: 1,
85
+ },
86
+ ];
87
+
88
+ export const currentOrgDetailsMockData = {
89
+ accessibleFeatures: [
90
+ "PROMO_ENGINE",
91
+ "JOURNEY_UI",
92
+ "LOYALTY_PROMOTION_ENABLED",
93
+ "HIDE_DEFAULT_EMAIL_TEMPLATES",
94
+ ],
95
+ };
@@ -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,
@@ -29,6 +29,7 @@ import messages from './messages';
29
29
  import { CHANNEL_CREATE_TRACK_MAPPING } from '../App/constants';
30
30
  import { gtmPush } from '../../utils/gtmTrackers';
31
31
  import { EMAIL } from '../CreativesContainer/constants';
32
+ import { selectCurrentOrgDetails } from "../../v2Containers/Cap/selectors";
32
33
 
33
34
  const CapRadioCardWithLabel = ComponentWithLabelHOC(CapRadioCard);
34
35
  const { timeTracker } = GA;
@@ -206,6 +207,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
206
207
  onTestContentClicked,
207
208
  cmsTemplatesLoader,
208
209
  editor,
210
+ currentOrgDetails,
209
211
  } = this.props;
210
212
  const {
211
213
  templateName,
@@ -282,6 +284,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
282
284
  cmsTemplates={CmsTemplates}
283
285
  handleEdmDefaultTemplateSelection={this.useEditor}
284
286
  cmsTemplatesLoader={cmsTemplatesLoader}
287
+ currentOrgDetails={currentOrgDetails || cap?.currentOrgDetails}
285
288
  />
286
289
  )}
287
290
  </div>
@@ -315,6 +318,7 @@ EmailWrapper.propTypes = {
315
318
  forwardedTags: PropTypes.object,
316
319
  selectedOfferDetails: PropTypes.array,
317
320
  getCmsTemplatesInProgress: PropTypes.bool,
321
+ currentOrgDetails: PropTypes.object,
318
322
  };
319
323
 
320
324
  const mapStateToProps = createStructuredSelector({
@@ -323,6 +327,7 @@ const mapStateToProps = createStructuredSelector({
323
327
  SelectedEdmDefaultTemplate: selectEdmEditor(),
324
328
  isUploading: uploadSelector(),
325
329
  cmsTemplatesLoader: selectCmsTemplatesLoader(),
330
+ currentOrgDetails: selectCurrentOrgDetails(),
326
331
  });
327
332
 
328
333
  function mapDispatchToProps(dispatch) {