@capillarytech/creatives-library 7.17.135 → 7.17.136-alpha.1

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.135",
4
+ "version": "7.17.136-alpha.1",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/services/api.js CHANGED
@@ -548,3 +548,5 @@ export const getNavigationConfigApi = async () => {
548
548
  const url = `${ARYA_ENDPOINT}/navigations`;
549
549
  return await request(url, getAPICallObject('GET'));
550
550
  };
551
+
552
+ export {request, getAPICallObject};
@@ -14,10 +14,9 @@ import { LOYALTY } from '../../v2Containers/App/constants';
14
14
  import {
15
15
  HELP_URL,
16
16
  LOYALTY_HELP_URL,
17
- ENABLE_AI_SUGGESTIONS,
18
17
  ENABLE_NEW_LEFT_NAVIGATION,
19
18
  DEFAULT_MODULE,
20
- AI_DOCUMENTATION_BOT_ENABLED
19
+ AI_DOCUMENTATION_BOT_DISABLED,
21
20
  } from '../../v2Containers/Cap/constants';
22
21
  import CapNavigation from '@capillarytech/cap-ui-library/CapNavigation';
23
22
  import configPath from '../../config/path';
@@ -149,7 +148,9 @@ export class NavigationBar extends React.Component {
149
148
  handleLeftNavBarExpanded,
150
149
  leftNavbarExpandedProp,
151
150
  } = this.props;
152
- const showDocumentationBot = userData?.currentOrgDetails?.accessibleFeatures?.includes(ENABLE_AI_SUGGESTIONS) || userData?.currentOrgDetails?.accessibleFeatures?.includes(AI_DOCUMENTATION_BOT_ENABLED);
151
+ const showDocumentationBot = !userData?.currentOrgDetails?.accessibleFeatures?.includes(
152
+ AI_DOCUMENTATION_BOT_DISABLED,
153
+ );
153
154
  const dropdownMenuProps = this.getDropdownMenu();
154
155
  const {
155
156
  currentOrgDetails: {
@@ -185,6 +186,8 @@ export class NavigationBar extends React.Component {
185
186
  showDocumentationBot={showDocumentationBot}
186
187
  setLeftNavbarExpandedProp={handleLeftNavBarExpanded}
187
188
  headerOverideCss={headerOverideCss}
189
+ request={Api.request}
190
+ getAPICallObject={Api.getAPICallObject}
188
191
  >
189
192
  <div data-testid="cap-wrapper">
190
193
  <CapWrapper isEmbedded={type === EMBEDDED}>
@@ -7,19 +7,25 @@ import { render, screen } from '../../../utils/test-utils';
7
7
 
8
8
  import { NavigationBar } from '../index';
9
9
  import * as mockdata from './mockData';
10
+ import { Provider } from 'react-redux';
11
+ import configureStore from '../../../store';
12
+ import { browserHistory } from 'react-router';
13
+ const { userData } = mockdata;
10
14
 
11
- const { userData} = mockdata;
12
-
15
+ let store;
16
+ beforeAll(() => {
17
+ store = configureStore({}, browserHistory);
18
+ });
13
19
  const ComponentToRender = injectIntl(NavigationBar);
14
-
15
20
  const renderComponent = (props) => {
16
21
  render(
17
- <Router>
18
- <ComponentToRender {...props} />
19
- </Router>,
22
+ <Provider store={store}>
23
+ <Router>
24
+ <ComponentToRender {...props} />
25
+ </Router>
26
+ </Provider>
20
27
  );
21
28
  };
22
-
23
29
  describe('NavigationBar', () => {
24
30
  const props = {
25
31
  topbarMenuData: [{}],
@@ -46,10 +52,10 @@ describe('NavigationBar', () => {
46
52
  delete updatedProps.userData.currentOrgDetails.accessibleFeatures;
47
53
  renderComponent(updatedProps);
48
54
  const ariaBotIcon = screen.queryByLabelText('open-aira');
49
- expect(ariaBotIcon).toBeNull();
55
+ expect(ariaBotIcon).toBeInTheDocument();
50
56
  });
51
57
  it('Should contains top vertical', () => {
52
- const updatedProps = {...props} ;
58
+ const updatedProps = { ...props };
53
59
  delete updatedProps.userData.currentOrgDetails.accessibleFeatures;
54
60
  renderComponent(updatedProps);
55
61
  const topVaerticalBar = document.querySelector('.cap-top-bar-vertical');
@@ -43,6 +43,7 @@ export const AI_CONTENT_BOT_DISABLED = 'AI_CONTENT_BOT_DISABLED';
43
43
  export const AI_DOCUMENTATION_BOT_ENABLED = 'AI_DOCUMENTATION_BOT_ENABLED';
44
44
  export const ERROR_IN_FETCHING_TAGS = 'Error in fetching tags';
45
45
  export const ENABLE_NEW_LEFT_NAVIGATION = 'ENABLE_NEW_LEFT_NAVIGATION';
46
+ export const AI_DOCUMENTATION_BOT_DISABLED = 'AI_DOCUMENTATION_BOT_DISABLED';
46
47
 
47
48
  export const GET_SUPPORT_VIDEOS_CONFIG_REQUEST =
48
49
  'cap/GET_SUPPORT_VIDEOS_CONFIG_REQUEST';