@capillarytech/creatives-library 7.17.124 → 7.17.126-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 +1 -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/v2Components/Pagination/index.js +2 -1
- package/v2Containers/Cap/sagas.js +0 -2
- package/v2Containers/Templates/index.js +1 -1
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +10 -0
package/package.json
CHANGED
|
@@ -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
|
});
|
|
@@ -13,7 +13,7 @@ class Pagination extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
13
13
|
|
|
14
14
|
handleScroll = (e) => {
|
|
15
15
|
const offset = 50;
|
|
16
|
-
if ((e.target.scrollHeight - e.target.scrollTop) - offset <= e.target.clientHeight) {
|
|
16
|
+
if ((e.target.scrollHeight - e.target.scrollTop) - offset <= e.target.clientHeight && !this.props.templateInProgress) {
|
|
17
17
|
this.props.onPageChange();
|
|
18
18
|
}
|
|
19
19
|
};
|
|
@@ -31,6 +31,7 @@ Pagination.propTypes = {
|
|
|
31
31
|
children: PropTypes.element,
|
|
32
32
|
onPageChange: PropTypes.func,
|
|
33
33
|
style: PropTypes.object,
|
|
34
|
+
templateInProgress: PropTypes.bool,
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
Pagination.defaultProps = {
|
|
@@ -193,8 +193,6 @@ export function* getSupportVideosConfig({ callback }) {
|
|
|
193
193
|
|
|
194
194
|
function* watchFetchSchemaForEntity() {
|
|
195
195
|
const watcher = yield takeLatest(types.GET_SCHEMA_FOR_ENTITY_REQUEST, fetchSchemaForEntity);
|
|
196
|
-
yield take(LOCATION_CHANGE);
|
|
197
|
-
yield cancel(watcher);
|
|
198
196
|
}
|
|
199
197
|
|
|
200
198
|
|
|
@@ -3084,7 +3084,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
3084
3084
|
}
|
|
3085
3085
|
|
|
3086
3086
|
<CapRow>
|
|
3087
|
-
<Pagination onPageChange={templates.length ? this.onPaginationChange : () => {}} paginationSelector="pagination-container">
|
|
3087
|
+
<Pagination templateInProgress={this.props.Templates.getAllTemplatesInProgress} onPageChange={templates.length ? this.onPaginationChange : () => {}} paginationSelector="pagination-container">
|
|
3088
3088
|
{this.getTemplateDataForGrid({ isLoading, loadingTip, channel: this.state.channel, templates: this.state.searchingZaloTemplate ? this.state.searchedZaloTemplates : this.props.TemplatesList, filterContent, handlers: { handlePreviewClick: this.handlePreviewClick, handleEditClick: this.handleEditClick}})}
|
|
3089
3089
|
</Pagination>
|
|
3090
3090
|
{showNoTemplatesFound &&
|
|
@@ -107,6 +107,7 @@ exports[`Test Templates container Should render temlates when Zalo templates are
|
|
|
107
107
|
onPageChange={[Function]}
|
|
108
108
|
paginationContainer="pagination-container"
|
|
109
109
|
paginationSelector="pagination-container"
|
|
110
|
+
templateInProgress={false}
|
|
110
111
|
>
|
|
111
112
|
<div>
|
|
112
113
|
<div
|
|
@@ -483,6 +484,7 @@ exports[`Test Templates container Should render temlates when whatsapp templates
|
|
|
483
484
|
onPageChange={[Function]}
|
|
484
485
|
paginationContainer="pagination-container"
|
|
485
486
|
paginationSelector="pagination-container"
|
|
487
|
+
templateInProgress={false}
|
|
486
488
|
>
|
|
487
489
|
<div>
|
|
488
490
|
<div
|
|
@@ -721,6 +723,7 @@ exports[`Test Templates container Should render temlates when whatsapp templates
|
|
|
721
723
|
onPageChange={[Function]}
|
|
722
724
|
paginationContainer="pagination-container"
|
|
723
725
|
paginationSelector="pagination-container"
|
|
726
|
+
templateInProgress={false}
|
|
724
727
|
>
|
|
725
728
|
<div>
|
|
726
729
|
<div
|
|
@@ -1015,6 +1018,7 @@ exports[`Test Templates container Should render temlates when zalo templates are
|
|
|
1015
1018
|
onPageChange={[Function]}
|
|
1016
1019
|
paginationContainer="pagination-container"
|
|
1017
1020
|
paginationSelector="pagination-container"
|
|
1021
|
+
templateInProgress={false}
|
|
1018
1022
|
>
|
|
1019
1023
|
<div>
|
|
1020
1024
|
<div
|
|
@@ -1186,6 +1190,7 @@ exports[`Test Templates container Test max templates exceeded 1`] = `
|
|
|
1186
1190
|
onPageChange={[Function]}
|
|
1187
1191
|
paginationContainer="pagination-container"
|
|
1188
1192
|
paginationSelector="pagination-container"
|
|
1193
|
+
templateInProgress={false}
|
|
1189
1194
|
>
|
|
1190
1195
|
<div>
|
|
1191
1196
|
<div
|
|
@@ -1647,6 +1652,7 @@ exports[`Test Templates container Test max templates not exceeded 1`] = `
|
|
|
1647
1652
|
onPageChange={[Function]}
|
|
1648
1653
|
paginationContainer="pagination-container"
|
|
1649
1654
|
paginationSelector="pagination-container"
|
|
1655
|
+
templateInProgress={false}
|
|
1650
1656
|
>
|
|
1651
1657
|
<div>
|
|
1652
1658
|
<div
|
|
@@ -2090,6 +2096,7 @@ exports[`Test Templates container Test max templates warning 1`] = `
|
|
|
2090
2096
|
onPageChange={[Function]}
|
|
2091
2097
|
paginationContainer="pagination-container"
|
|
2092
2098
|
paginationSelector="pagination-container"
|
|
2099
|
+
templateInProgress={false}
|
|
2093
2100
|
>
|
|
2094
2101
|
<div>
|
|
2095
2102
|
<div
|
|
@@ -2533,6 +2540,7 @@ exports[`Test Templates container Test removing all whatsapp filterss 1`] = `
|
|
|
2533
2540
|
onPageChange={[Function]}
|
|
2534
2541
|
paginationContainer="pagination-container"
|
|
2535
2542
|
paginationSelector="pagination-container"
|
|
2543
|
+
templateInProgress={false}
|
|
2536
2544
|
>
|
|
2537
2545
|
<div>
|
|
2538
2546
|
<div
|
|
@@ -2797,6 +2805,7 @@ exports[`Test Templates container Test removing all whatsapp filterss 2`] = `
|
|
|
2797
2805
|
onPageChange={[Function]}
|
|
2798
2806
|
paginationContainer="pagination-container"
|
|
2799
2807
|
paginationSelector="pagination-container"
|
|
2808
|
+
templateInProgress={false}
|
|
2800
2809
|
>
|
|
2801
2810
|
<div>
|
|
2802
2811
|
<div
|
|
@@ -3035,6 +3044,7 @@ exports[`Test Templates container Test removing single filter 1`] = `
|
|
|
3035
3044
|
onPageChange={[Function]}
|
|
3036
3045
|
paginationContainer="pagination-container"
|
|
3037
3046
|
paginationSelector="pagination-container"
|
|
3047
|
+
templateInProgress={false}
|
|
3038
3048
|
>
|
|
3039
3049
|
<div>
|
|
3040
3050
|
<div
|