@boomerang-io/carbon-addons-boomerang-react 4.6.21-beta.3 → 4.6.21-beta.6

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.
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var reactRouterDom = require('react-router-dom');
6
7
  var cx = require('classnames');
7
8
  var react = require('@carbon/react');
8
9
  var TooltipHover = require('../TooltipHover/TooltipHover.js');
@@ -37,6 +38,7 @@ function AdvantageSideNav(props) {
37
38
  const [activeMenu, setActiveMenu] = React__default.default.useState(false);
38
39
  const isMenuOpen = isOpen || activeMenu;
39
40
  const windowLocation = window.location;
41
+ const historyy = reactRouterDom.useHistory();
40
42
  const isPartnerUser = user?.type === UserType.USER_PLATFORM_ROLE.Partner;
41
43
  const joinButtontitle = showSelectTeamPurpose ? "Create Team" : "Create or Join Team";
42
44
  const hamburguerMenu = document.getElementById("header-sidenav-menu-button");
@@ -228,9 +230,10 @@ function AdvantageSideNav(props) {
228
230
  handleDocumentCollectionsClick();
229
231
  } }, "Document Collections")) : null,
230
232
  showSecondDivider ? React__default.default.createElement(react.SideNavDivider, null) : null,
231
- catalogNavlink ? (React__default.default.createElement(react.SideNavLink, { to: catalogNavlink, "data-testid": "sidenav-catalog-link", isActive: windowLocation.href.includes(`${baseEnvUrl}/catalog`),
232
- // href={catalogNavlink}
233
- renderIcon: icons.Catalog }, "Catalog")) : null,
233
+ catalogNavlink ? (React__default.default.createElement(react.SideNavLink, { "data-testid": "sidenav-catalog-link", isActive: location.pathname.includes("/catalog"), renderIcon: icons.Catalog, href: catalogNavlink, onClick: (e) => {
234
+ e.preventDefault();
235
+ historyy.push(catalogNavlink);
236
+ } }, "Catalog")) : null,
234
237
  settingsLink ? (React__default.default.createElement(react.SideNavLink, { "data-testid": "sidenav-settings-link", renderIcon: icons.Settings, href: settingsLink, onClick: (e) => {
235
238
  handleSettingsClick();
236
239
  } }, "Settings")) : null,
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { useHistory } from 'react-router-dom';
2
3
  import cx from 'classnames';
3
4
  import { SideNavLink, SideNav, SideNavItems, SideNavDivider, Tag } from '@carbon/react';
4
5
  import TooltipHover from '../TooltipHover/TooltipHover.js';
@@ -28,6 +29,7 @@ function AdvantageSideNav(props) {
28
29
  const [activeMenu, setActiveMenu] = React.useState(false);
29
30
  const isMenuOpen = isOpen || activeMenu;
30
31
  const windowLocation = window.location;
32
+ const historyy = useHistory();
31
33
  const isPartnerUser = user?.type === USER_PLATFORM_ROLE.Partner;
32
34
  const joinButtontitle = showSelectTeamPurpose ? "Create Team" : "Create or Join Team";
33
35
  const hamburguerMenu = document.getElementById("header-sidenav-menu-button");
@@ -219,9 +221,10 @@ function AdvantageSideNav(props) {
219
221
  handleDocumentCollectionsClick();
220
222
  } }, "Document Collections")) : null,
221
223
  showSecondDivider ? React.createElement(SideNavDivider, null) : null,
222
- catalogNavlink ? (React.createElement(SideNavLink, { to: catalogNavlink, "data-testid": "sidenav-catalog-link", isActive: windowLocation.href.includes(`${baseEnvUrl}/catalog`),
223
- // href={catalogNavlink}
224
- renderIcon: Catalog }, "Catalog")) : null,
224
+ catalogNavlink ? (React.createElement(SideNavLink, { "data-testid": "sidenav-catalog-link", isActive: location.pathname.includes("/catalog"), renderIcon: Catalog, href: catalogNavlink, onClick: (e) => {
225
+ e.preventDefault();
226
+ historyy.push(catalogNavlink);
227
+ } }, "Catalog")) : null,
225
228
  settingsLink ? (React.createElement(SideNavLink, { "data-testid": "sidenav-settings-link", renderIcon: Settings, href: settingsLink, onClick: (e) => {
226
229
  handleSettingsClick();
227
230
  } }, "Settings")) : null,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@boomerang-io/carbon-addons-boomerang-react",
3
3
  "description": "Carbon Addons for Boomerang apps",
4
- "version": "4.6.21-beta.3",
4
+ "version": "4.6.21-beta.6",
5
5
  "author": {
6
6
  "name": "Tim Bula",
7
7
  "email": "timrbula@gmail.com"
@@ -73,7 +73,7 @@
73
73
  "react": "^17.0.0 || ^16.14.0",
74
74
  "react-dom": "^17.0.0 || ^16.14.0",
75
75
  "react-query": "^3.34.12",
76
- "react-router-dom": "^5.3.0",
76
+ "react-router-dom": "^6.0.0",
77
77
  "yup": ">=0.32.11"
78
78
  },
79
79
  "devDependencies": {