@capillarytech/creatives-library 7.17.114-alpha.0 → 7.17.114
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/containers/App/constants.js +0 -1
- package/package.json +1 -1
- package/styles/containers/layout/_layoutPage.scss +2 -5
- package/utils/common.js +0 -5
- package/v2Components/FormBuilder/index.js +1 -19
- package/v2Components/FormBuilder/messages.js +0 -4
- package/v2Components/NavigationBar/style.js +4 -6
- package/v2Containers/Cap/index.js +12 -2
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +1 -0
|
@@ -16,7 +16,6 @@ export const BADGES_UI_ENABLED = 'BADGES_UI_ENABLED';
|
|
|
16
16
|
export const JP_LOCALE_HIDE_FEATURE = 'JP_LOCALE_HIDE_FEATURE';
|
|
17
17
|
export const ENABLE_WECHAT = 'ENABLE_WECHAT';
|
|
18
18
|
export const ENABLE_CUSTOMER_BARCODE_TAG = "ENABLE_CUSTOMER_BARCODE_TAG";
|
|
19
|
-
export const EMAIL_UNSUBSCRIBE_TAG_MANDATORY = "EMAIL_UNSUBSCRIBE_TAG_MANDATORY";
|
|
20
19
|
|
|
21
20
|
export const CARD_RELATED_TAGS = [
|
|
22
21
|
'card_series',
|
package/package.json
CHANGED
|
@@ -84,14 +84,11 @@
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
.contet-width-collapse {
|
|
87
|
-
margin-left:
|
|
88
|
-
.component-wrapper {
|
|
89
|
-
max-width: 70.063rem;
|
|
90
|
-
}
|
|
87
|
+
margin-left: 17rem;
|
|
91
88
|
}
|
|
92
89
|
|
|
93
90
|
.content-width-expanded {
|
|
94
|
-
margin-left:
|
|
91
|
+
margin-left: 4.475rem;
|
|
95
92
|
}
|
|
96
93
|
|
|
97
94
|
.breadcrumbs{
|
package/utils/common.js
CHANGED
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
ENABLE_CUSTOMER_BARCODE_TAG,
|
|
19
19
|
BADGES_UI_ENABLED,
|
|
20
20
|
BADGES_ENROLL,
|
|
21
|
-
EMAIL_UNSUBSCRIBE_TAG_MANDATORY,
|
|
22
21
|
BADGES_ISSUE,
|
|
23
22
|
ENABLE_WECHAT,
|
|
24
23
|
} from '../containers/App/constants';
|
|
@@ -113,10 +112,6 @@ export const hasCustomerBarcodeFeatureEnabled = Auth.hasFeatureAccess.bind(
|
|
|
113
112
|
ENABLE_CUSTOMER_BARCODE_TAG,
|
|
114
113
|
);
|
|
115
114
|
|
|
116
|
-
export const hasRemoveEmailUnsubscribeTag = Auth.hasFeatureAccess.bind(
|
|
117
|
-
null,
|
|
118
|
-
EMAIL_UNSUBSCRIBE_TAG_MANDATORY,
|
|
119
|
-
);
|
|
120
115
|
//filtering tags based on scope
|
|
121
116
|
export const filterTags = (tagsToFilter, tagsList) => tagsList?.filter(
|
|
122
117
|
(tag) => !tagsToFilter?.includes(tag?.definition?.value)
|
|
@@ -55,7 +55,6 @@ import { AI_SUGGESTION_API_URL, CONTENT_RECOMMENDATION_BOT } from './constants';
|
|
|
55
55
|
import { GET_TRANSLATION_MAPPED } from '../../containers/TagList/constants';
|
|
56
56
|
import moment from 'moment';
|
|
57
57
|
import { CUSTOMER_BARCODE_TAG , COPY_OF} from '../../containers/App/constants';
|
|
58
|
-
import { hasRemoveEmailUnsubscribeTag } from '../../utils/common';
|
|
59
58
|
const TabPane = Tabs.TabPane;
|
|
60
59
|
const {Column} = Table;
|
|
61
60
|
const {TextArea} = CapInput;
|
|
@@ -990,9 +989,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
990
989
|
if (tagValidationResponse.isBraceError){
|
|
991
990
|
errorString += this.props.intl.formatMessage(globalMessages.unbalanacedCurlyBraces);
|
|
992
991
|
}
|
|
993
|
-
if (tagValidationResponse.isContentEmpty) {
|
|
994
|
-
errorString += this.props.intl.formatMessage(messages.emailBodyEmptyError);
|
|
995
|
-
}
|
|
996
992
|
}
|
|
997
993
|
}
|
|
998
994
|
}
|
|
@@ -1131,8 +1127,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1131
1127
|
response.missingTags = [];
|
|
1132
1128
|
response.unsupportedTags = [];
|
|
1133
1129
|
response.isBraceError = false;
|
|
1134
|
-
response.isContentEmpty = false;
|
|
1135
|
-
const contentForValidation = isEmail ? convert(content) : content ;
|
|
1136
1130
|
if(tags && tags.length) {
|
|
1137
1131
|
_.forEach(tags, (tag) => {
|
|
1138
1132
|
_.forEach(tag.definition.supportedModules, (module) => {
|
|
@@ -1150,19 +1144,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1150
1144
|
let matchImg = regexImgSrc.exec(content);
|
|
1151
1145
|
const regexCustomerBarcode = /{{customer_barcode}}(?![^<]*>)/g;
|
|
1152
1146
|
let matchCustomerBarcode = regexCustomerBarcode.exec(content);
|
|
1153
|
-
// \S matches anything other than a space, a tab, a newline, or a carriage return.
|
|
1154
|
-
const validString= /\S/.test(contentForValidation);
|
|
1155
|
-
if (hasRemoveEmailUnsubscribeTag() && isEmail) {
|
|
1156
|
-
const missingTagIndex = response.missingTags.indexOf("unsubscribe");
|
|
1157
|
-
if(missingTagIndex != -1) { //skip regex tags for mandatory tags also
|
|
1158
|
-
response.missingTags.splice(missingTagIndex, 1);
|
|
1159
|
-
if (validString) {
|
|
1160
|
-
response.valid = true;
|
|
1161
|
-
} else {
|
|
1162
|
-
response.isContentEmpty = true;
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
1147
|
while (match !== null ) {
|
|
1167
1148
|
const tagValue = match[0].substring(this.indexOfEnd(match[0], '{{'), match[0].indexOf('}}'));
|
|
1168
1149
|
match = regex.exec(content);
|
|
@@ -1196,6 +1177,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1196
1177
|
}
|
|
1197
1178
|
}
|
|
1198
1179
|
}
|
|
1180
|
+
const contentForValidation = isEmail ? convert(content) : content ;
|
|
1199
1181
|
if(!validateIfTagClosed(contentForValidation)){
|
|
1200
1182
|
response.isBraceError = true;
|
|
1201
1183
|
response.valid = false;
|
|
@@ -86,8 +86,4 @@ export default defineMessages({
|
|
|
86
86
|
id: 'creatives.componentsV2.FormBuilder.imageReUpload',
|
|
87
87
|
defaultMessage: 'Re upload',
|
|
88
88
|
},
|
|
89
|
-
emailBodyEmptyError: {
|
|
90
|
-
id: 'creatives.componentsV2.FormBuilder.emailBodyEmptyError',
|
|
91
|
-
defaultMessage: 'Email body cannot be empty',
|
|
92
|
-
},
|
|
93
89
|
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export const CapLeftNavigationCss = {
|
|
2
|
-
'
|
|
3
|
-
|
|
4
|
-
'margin-left': '14.9rem',
|
|
2
|
+
'width': '75.770rem',
|
|
3
|
+
'margin-left': 'calc((100vw - 70.063rem)/2 + 1.6rem)',
|
|
5
4
|
};
|
|
6
5
|
|
|
7
6
|
export const CapLeftNavigatioOpenCss = {
|
|
8
|
-
'
|
|
9
|
-
|
|
10
|
-
'margin-left': '18.5rem',
|
|
7
|
+
'width': '71.063rem',
|
|
8
|
+
'margin-left': 'calc((100vw - 70.063rem)/2 + 8rem)',
|
|
11
9
|
};
|
|
@@ -62,6 +62,12 @@ const MainWrapper = styled.div`
|
|
|
62
62
|
top: ${(props) => (props.isLatestLeftNavigationEnabled ? '1.72rem' : '5.29rem')};
|
|
63
63
|
`;
|
|
64
64
|
|
|
65
|
+
const ContentWrapper = styled.div`
|
|
66
|
+
&& {
|
|
67
|
+
margin-left: ${(props) => (props.isLatestLeftNavigationEnabled ? (props.leftNavbarExpanded ? '17rem' : '4.475rem') : 0)};
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
|
|
65
71
|
export class Cap extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
66
72
|
|
|
67
73
|
constructor(props) {
|
|
@@ -519,9 +525,13 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
519
525
|
/>) : ''}
|
|
520
526
|
<MainWrapper isLatestLeftNavigationEnabled={isLatestLeftNavigationEnabled} className="main">
|
|
521
527
|
|
|
522
|
-
<
|
|
528
|
+
<ContentWrapper
|
|
529
|
+
className={`main-content ${this.state.leftNavbarExpanded ? "contet-width-collapse" : "content-width-expanded"}`}
|
|
530
|
+
isLatestLeftNavigationEnabled={isLatestLeftNavigationEnabled}
|
|
531
|
+
leftNavbarExpanded={this.state.leftNavbarExpanded}
|
|
532
|
+
>
|
|
523
533
|
{React.Children.toArray(this.props.children)}
|
|
524
|
-
</
|
|
534
|
+
</ContentWrapper>
|
|
525
535
|
</MainWrapper>
|
|
526
536
|
</div>
|
|
527
537
|
{(toastMessages && toastMessages.length > 0) &&
|