@capillarytech/creatives-library 7.17.123 → 7.17.125
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 +1 -1
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +2 -2
- package/v2Components/CapImageUpload/index.js +5 -3
- package/v2Components/CapImageUpload/index.scss +3 -0
- package/v2Components/CapVideoUpload/index.scss +0 -1
- package/v2Components/Ckeditor/index.js +17 -0
- package/v2Components/NavigationBar/index.js +6 -3
- package/v2Components/NavigationBar/tests/index.test.js +8 -1
- package/v2Components/NavigationBar/tests/mockData.js +1 -0
- package/v2Containers/CreativesContainer/index.js +1 -1
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -15
- package/v2Containers/Viber/index.js +1 -1
- package/v2Containers/Viber/index.scss +0 -6
- package/v2Containers/Viber/messages.js +2 -2
package/package.json
CHANGED
|
@@ -284,11 +284,11 @@ describe("Creatives testing template creation", () => {
|
|
|
284
284
|
fireEvent.change(msgBox, {
|
|
285
285
|
target: { value: ' ' },
|
|
286
286
|
});
|
|
287
|
-
expect(creativesScreen.getByText(/template
|
|
287
|
+
expect(creativesScreen.getByText(/template message cannot be empty/i)).toBeInTheDocument();
|
|
288
288
|
fireEvent.change(msgBox, {
|
|
289
289
|
target: { value: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' },
|
|
290
290
|
});
|
|
291
|
-
expect(creativesScreen.getByText(/Template
|
|
291
|
+
expect(creativesScreen.getByText(/Template message length cannot exceed 1000/i)).toBeInTheDocument();
|
|
292
292
|
fireEvent.change(msgBox, {
|
|
293
293
|
target: { value: ' viber_test_template}}} ' },
|
|
294
294
|
});
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
CapHeading,
|
|
16
16
|
CapButton,
|
|
17
17
|
CapImage,
|
|
18
|
+
CapError,
|
|
18
19
|
} from '@capillarytech/cap-ui-library';
|
|
19
20
|
import { injectIntl, FormattedMessage, intlShape} from 'react-intl';
|
|
20
21
|
import { isEmpty, get } from 'lodash';
|
|
@@ -212,8 +213,9 @@ function CapImageUpload(props) {
|
|
|
212
213
|
</CapButton>
|
|
213
214
|
)}
|
|
214
215
|
</CapUploader.CapDragger>
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
<CapError type="error" className="upload-image-error">
|
|
217
|
+
{isImageError}
|
|
218
|
+
</CapError>
|
|
217
219
|
</>
|
|
218
220
|
);
|
|
219
221
|
}
|
|
@@ -233,7 +235,7 @@ function CapImageUpload(props) {
|
|
|
233
235
|
<div style={style} className="cap-custom-image-upload">
|
|
234
236
|
<WithLabel
|
|
235
237
|
key={`with-label`}
|
|
236
|
-
|
|
238
|
+
ifError={!!isImageError}
|
|
237
239
|
|
|
238
240
|
/>
|
|
239
241
|
<form encType="multipart/form-data" id={`form`} className={className}>
|
|
@@ -185,6 +185,23 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
+
|
|
189
|
+
componentDidUpdate(prevProps) {
|
|
190
|
+
if (this.props.content !== prevProps.content) {
|
|
191
|
+
let content = '';
|
|
192
|
+
this.id = this.props.id;
|
|
193
|
+
if (this.props.content !== '') {
|
|
194
|
+
content = this.props.content;
|
|
195
|
+
content = content.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\\"/g, "\"");
|
|
196
|
+
}
|
|
197
|
+
this.setState({ content }, () => {
|
|
198
|
+
if (this.editorInstance) {
|
|
199
|
+
this.editorInstance.setData(content);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
188
205
|
onLoad = () => {
|
|
189
206
|
this.setState({ scriptLoaded: true }, () => {
|
|
190
207
|
this.initializeEditor();
|
|
@@ -100,7 +100,7 @@ export class NavigationBar extends React.Component {
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
getTopbarIcons = (showDocumentationBot = false) => {
|
|
103
|
+
getTopbarIcons = (showDocumentationBot = false, isLatestLeftNavigationEnabled = false) => {
|
|
104
104
|
const {settingsIcon} = this.state;
|
|
105
105
|
const ICONS = [
|
|
106
106
|
{
|
|
@@ -108,9 +108,12 @@ export class NavigationBar extends React.Component {
|
|
|
108
108
|
key: 'help',
|
|
109
109
|
onClickHandler: this.onHelpIconClick,
|
|
110
110
|
},
|
|
111
|
-
settingsIcon,
|
|
112
111
|
];
|
|
112
|
+
if (!isLatestLeftNavigationEnabled) {
|
|
113
|
+
ICONS.push(settingsIcon);
|
|
114
|
+
}
|
|
113
115
|
return showDocumentationBot ? ICONS.slice(1) : ICONS; // If showDocumentationBot is true, help icon will be replaced by Aira icon on UI
|
|
116
|
+
|
|
114
117
|
};
|
|
115
118
|
|
|
116
119
|
getDropdownMenu = () => {
|
|
@@ -147,7 +150,6 @@ export class NavigationBar extends React.Component {
|
|
|
147
150
|
} = this.props;
|
|
148
151
|
const showDocumentationBot = userData?.currentOrgDetails?.accessibleFeatures?.includes(ENABLE_AI_SUGGESTIONS);
|
|
149
152
|
const dropdownMenuProps = this.getDropdownMenu();
|
|
150
|
-
const topbarIcons = this.getTopbarIcons(showDocumentationBot);
|
|
151
153
|
const {
|
|
152
154
|
currentOrgDetails: {
|
|
153
155
|
accessibleFeatures = [],
|
|
@@ -156,6 +158,7 @@ export class NavigationBar extends React.Component {
|
|
|
156
158
|
const isLatestLeftNavigationEnabled = accessibleFeatures?.includes(
|
|
157
159
|
ENABLE_NEW_LEFT_NAVIGATION,
|
|
158
160
|
);
|
|
161
|
+
const topbarIcons = this.getTopbarIcons(showDocumentationBot,isLatestLeftNavigationEnabled);
|
|
159
162
|
const topbarMenuDataModified = isLatestLeftNavigationEnabled ? [] : topbarMenuData;
|
|
160
163
|
const headerOverideCss = isLatestLeftNavigationEnabled && (leftNavbarExpandedProp ? CapLeftNavigatioOpenCss : CapLeftNavigationCss);
|
|
161
164
|
return (
|
|
@@ -8,7 +8,7 @@ import { render, screen } from '../../../utils/test-utils';
|
|
|
8
8
|
import { NavigationBar } from '../index';
|
|
9
9
|
import * as mockdata from './mockData';
|
|
10
10
|
|
|
11
|
-
const { userData
|
|
11
|
+
const { userData} = mockdata;
|
|
12
12
|
|
|
13
13
|
const ComponentToRender = injectIntl(NavigationBar);
|
|
14
14
|
|
|
@@ -48,4 +48,11 @@ describe('NavigationBar', () => {
|
|
|
48
48
|
const ariaBotIcon = screen.queryByLabelText('open-aira');
|
|
49
49
|
expect(ariaBotIcon).toBeNull();
|
|
50
50
|
});
|
|
51
|
+
it('Should contains top vertical', () => {
|
|
52
|
+
const updatedProps = {...props} ;
|
|
53
|
+
delete updatedProps.userData.currentOrgDetails.accessibleFeatures;
|
|
54
|
+
renderComponent(updatedProps);
|
|
55
|
+
const topVaerticalBar = document.querySelector('.cap-top-bar-vertical');
|
|
56
|
+
expect(topVaerticalBar).toBeInTheDocument();
|
|
57
|
+
});
|
|
51
58
|
});
|
|
@@ -48,7 +48,7 @@ const CREATIVES_CONTAINER = 'creativesContainer';
|
|
|
48
48
|
const SlideBoxWrapper = styled.div`
|
|
49
49
|
.cap-slide-box-v2-container{
|
|
50
50
|
.slidebox-header, .slidebox-content-container, .slidebox-footer{
|
|
51
|
-
padding: 0
|
|
51
|
+
padding: 0 3rem;
|
|
52
52
|
&.has-footer{
|
|
53
53
|
overflow-x: hidden;
|
|
54
54
|
}
|
|
@@ -51820,14 +51820,12 @@ new message content.",
|
|
|
51820
51820
|
}
|
|
51821
51821
|
>
|
|
51822
51822
|
<_class
|
|
51823
|
-
errorMessage={false}
|
|
51824
51823
|
ifError={false}
|
|
51825
51824
|
key="with-label"
|
|
51826
51825
|
labelPosition="top"
|
|
51827
51826
|
>
|
|
51828
51827
|
<ComponentWithLabelHOC__CapComponentStyled
|
|
51829
51828
|
className="component-with-label"
|
|
51830
|
-
errorMessage={false}
|
|
51831
51829
|
labelPosition="top"
|
|
51832
51830
|
>
|
|
51833
51831
|
<div
|
|
@@ -51840,7 +51838,6 @@ new message content.",
|
|
|
51840
51838
|
className="ComponentWithLabelHOC__ComponentWithLabelWrapper-sc-1qk6bpg-1 evSAae"
|
|
51841
51839
|
>
|
|
51842
51840
|
<Component
|
|
51843
|
-
errorMessage={false}
|
|
51844
51841
|
ifError={false}
|
|
51845
51842
|
>
|
|
51846
51843
|
<div
|
|
@@ -67266,14 +67263,12 @@ new message content.",
|
|
|
67266
67263
|
}
|
|
67267
67264
|
>
|
|
67268
67265
|
<_class
|
|
67269
|
-
errorMessage={false}
|
|
67270
67266
|
ifError={false}
|
|
67271
67267
|
key="with-label"
|
|
67272
67268
|
labelPosition="top"
|
|
67273
67269
|
>
|
|
67274
67270
|
<ComponentWithLabelHOC__CapComponentStyled
|
|
67275
67271
|
className="component-with-label"
|
|
67276
|
-
errorMessage={false}
|
|
67277
67272
|
labelPosition="top"
|
|
67278
67273
|
>
|
|
67279
67274
|
<div
|
|
@@ -67286,7 +67281,6 @@ new message content.",
|
|
|
67286
67281
|
className="ComponentWithLabelHOC__ComponentWithLabelWrapper-sc-1qk6bpg-1 evSAae"
|
|
67287
67282
|
>
|
|
67288
67283
|
<Component
|
|
67289
|
-
errorMessage={false}
|
|
67290
67284
|
ifError={false}
|
|
67291
67285
|
>
|
|
67292
67286
|
<div
|
|
@@ -82606,14 +82600,12 @@ new message content.",
|
|
|
82606
82600
|
}
|
|
82607
82601
|
>
|
|
82608
82602
|
<_class
|
|
82609
|
-
errorMessage={false}
|
|
82610
82603
|
ifError={false}
|
|
82611
82604
|
key="with-label"
|
|
82612
82605
|
labelPosition="top"
|
|
82613
82606
|
>
|
|
82614
82607
|
<ComponentWithLabelHOC__CapComponentStyled
|
|
82615
82608
|
className="component-with-label"
|
|
82616
|
-
errorMessage={false}
|
|
82617
82609
|
labelPosition="top"
|
|
82618
82610
|
>
|
|
82619
82611
|
<div
|
|
@@ -82626,7 +82618,6 @@ new message content.",
|
|
|
82626
82618
|
className="ComponentWithLabelHOC__ComponentWithLabelWrapper-sc-1qk6bpg-1 evSAae"
|
|
82627
82619
|
>
|
|
82628
82620
|
<Component
|
|
82629
|
-
errorMessage={false}
|
|
82630
82621
|
ifError={false}
|
|
82631
82622
|
>
|
|
82632
82623
|
<div
|
|
@@ -98052,14 +98043,12 @@ new message content.",
|
|
|
98052
98043
|
}
|
|
98053
98044
|
>
|
|
98054
98045
|
<_class
|
|
98055
|
-
errorMessage={false}
|
|
98056
98046
|
ifError={false}
|
|
98057
98047
|
key="with-label"
|
|
98058
98048
|
labelPosition="top"
|
|
98059
98049
|
>
|
|
98060
98050
|
<ComponentWithLabelHOC__CapComponentStyled
|
|
98061
98051
|
className="component-with-label"
|
|
98062
|
-
errorMessage={false}
|
|
98063
98052
|
labelPosition="top"
|
|
98064
98053
|
>
|
|
98065
98054
|
<div
|
|
@@ -98072,7 +98061,6 @@ new message content.",
|
|
|
98072
98061
|
className="ComponentWithLabelHOC__ComponentWithLabelWrapper-sc-1qk6bpg-1 evSAae"
|
|
98073
98062
|
>
|
|
98074
98063
|
<Component
|
|
98075
|
-
errorMessage={false}
|
|
98076
98064
|
ifError={false}
|
|
98077
98065
|
>
|
|
98078
98066
|
<div
|
|
@@ -122549,14 +122537,12 @@ new message content.",
|
|
|
122549
122537
|
}
|
|
122550
122538
|
>
|
|
122551
122539
|
<_class
|
|
122552
|
-
errorMessage={false}
|
|
122553
122540
|
ifError={false}
|
|
122554
122541
|
key="with-label"
|
|
122555
122542
|
labelPosition="top"
|
|
122556
122543
|
>
|
|
122557
122544
|
<ComponentWithLabelHOC__CapComponentStyled
|
|
122558
122545
|
className="component-with-label"
|
|
122559
|
-
errorMessage={false}
|
|
122560
122546
|
labelPosition="top"
|
|
122561
122547
|
>
|
|
122562
122548
|
<div
|
|
@@ -122569,7 +122555,6 @@ new message content.",
|
|
|
122569
122555
|
className="ComponentWithLabelHOC__ComponentWithLabelWrapper-sc-1qk6bpg-1 evSAae"
|
|
122570
122556
|
>
|
|
122571
122557
|
<Component
|
|
122572
|
-
errorMessage={false}
|
|
122573
122558
|
ifError={false}
|
|
122574
122559
|
>
|
|
122575
122560
|
<div
|
|
@@ -473,7 +473,7 @@ export const Viber = (props) => {
|
|
|
473
473
|
>
|
|
474
474
|
{formatMessage(messages.save)}
|
|
475
475
|
</CapButton>
|
|
476
|
-
<CapButton className="cta-btn-action" onClick={handleCancelCta}>
|
|
476
|
+
<CapButton type="secondary" className="cta-btn-action" onClick={handleCancelCta}>
|
|
477
477
|
{formatMessage(messages.cancel)}
|
|
478
478
|
</CapButton>
|
|
479
479
|
</CapColumn>
|
|
@@ -100,11 +100,11 @@ export default defineMessages({
|
|
|
100
100
|
},
|
|
101
101
|
emptyContentErrorMessage: {
|
|
102
102
|
id: `${scope}.emptyContentErrorMessage`,
|
|
103
|
-
defaultMessage: 'Template
|
|
103
|
+
defaultMessage: 'Template message cannot be empty',
|
|
104
104
|
},
|
|
105
105
|
limitExceededContentErrorMessage: {
|
|
106
106
|
id: `${scope}.limitExceededContentErrorMessage`,
|
|
107
|
-
defaultMessage: 'Template
|
|
107
|
+
defaultMessage: 'Template message length cannot exceed 1000',
|
|
108
108
|
},
|
|
109
109
|
invalidTagError: {
|
|
110
110
|
id: `${scope}.invalidTagError`,
|