@capillarytech/creatives-library 7.17.136-alpha.0 → 7.17.136

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.136-alpha.0",
4
+ "version": "7.17.136",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
9
9
  import styled from 'styled-components';
10
10
  import { loadItem } from 'services/localStorageApi';
11
11
  import { intlShape, injectIntl } from 'react-intl';
12
+ import { get } from 'lodash';
12
13
  import messages from './messages';
13
14
  import { LOYALTY } from '../../v2Containers/App/constants';
14
15
  import {
@@ -148,9 +149,8 @@ export class NavigationBar extends React.Component {
148
149
  handleLeftNavBarExpanded,
149
150
  leftNavbarExpandedProp,
150
151
  } = this.props;
151
- const showDocumentationBot = !userData?.currentOrgDetails?.accessibleFeatures?.includes(
152
- AI_DOCUMENTATION_BOT_DISABLED,
153
- );
152
+ const accessibleDocFeatures = get(userData, 'currentOrgDetails.accessibleFeatures', []);
153
+ const showDocumentationBot = !accessibleDocFeatures.includes(AI_DOCUMENTATION_BOT_DISABLED);
154
154
  const dropdownMenuProps = this.getDropdownMenu();
155
155
  const {
156
156
  currentOrgDetails: {
@@ -186,9 +186,9 @@ export class NavigationBar extends React.Component {
186
186
  showDocumentationBot={showDocumentationBot}
187
187
  setLeftNavbarExpandedProp={handleLeftNavBarExpanded}
188
188
  headerOverideCss={headerOverideCss}
189
- request={Api.request}
190
- getAPICallObject={Api.getAPICallObject}
191
- >
189
+ request={Api?.request}
190
+ getAPICallObject={Api?.getAPICallObject}
191
+ >
192
192
  <div data-testid="cap-wrapper">
193
193
  <CapWrapper isEmbedded={type === EMBEDDED}>
194
194
  <ComponentWrapper>
@@ -52,10 +52,11 @@ describe('NavigationBar', () => {
52
52
  delete updatedProps.userData.currentOrgDetails.accessibleFeatures;
53
53
  renderComponent(updatedProps);
54
54
  const ariaBotIcon = screen.queryByLabelText('open-aira');
55
- expect(ariaBotIcon).toBeNull();
55
+ expect(ariaBotIcon).toBeInTheDocument();
56
56
  });
57
+
57
58
  it('Should contains top vertical', () => {
58
- const updatedProps = { ...props };
59
+ const updatedProps = {...props} ;
59
60
  delete updatedProps.userData.currentOrgDetails.accessibleFeatures;
60
61
  renderComponent(updatedProps);
61
62
  const topVaerticalBar = document.querySelector('.cap-top-bar-vertical');