@capillarytech/creatives-library 7.17.124 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.124",
4
+ "version": "7.17.125",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -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(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/\\&quot;/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 } = mockdata;
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
  });
@@ -34,3 +34,4 @@ export const userData = {
34
34
  accessibleFeatures: ['ENABLE_AI_SUGGESTIONS'],
35
35
  },
36
36
  };
37
+