@boomerang-io/carbon-addons-boomerang-react 4.6.21-beta.4 → 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.
@@ -38,7 +38,7 @@ function AdvantageSideNav(props) {
38
38
  const [activeMenu, setActiveMenu] = React__default.default.useState(false);
39
39
  const isMenuOpen = isOpen || activeMenu;
40
40
  const windowLocation = window.location;
41
- const location = reactRouterDom.useLocation();
41
+ const historyy = reactRouterDom.useHistory();
42
42
  const isPartnerUser = user?.type === UserType.USER_PLATFORM_ROLE.Partner;
43
43
  const joinButtontitle = showSelectTeamPurpose ? "Create Team" : "Create or Join Team";
44
44
  const hamburguerMenu = document.getElementById("header-sidenav-menu-button");
@@ -230,18 +230,10 @@ function AdvantageSideNav(props) {
230
230
  handleDocumentCollectionsClick();
231
231
  } }, "Document Collections")) : null,
232
232
  showSecondDivider ? React__default.default.createElement(react.SideNavDivider, null) : null,
233
- catalogNavlink ? (React__default.default.createElement(reactRouterDom.Link, { to: catalogNavlink, style: { textDecoration: "none" } },
234
- React__default.default.createElement(react.SideNavLink, { "data-testid": "sidenav-catalog-link", isActive: location.pathname.includes("/catalog"), renderIcon: icons.Catalog }, "Catalog"))
235
- // <SideNavLink
236
- // to={catalogNavlink}
237
- // data-testid="sidenav-catalog-link"
238
- // isActive={windowLocation.href.includes(`${baseEnvUrl}/catalog`)}
239
- // // href={catalogNavlink}
240
- // renderIcon={Catalog}
241
- // >
242
- // Catalog
243
- // </SideNavLink>
244
- ) : 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,
245
237
  settingsLink ? (React__default.default.createElement(react.SideNavLink, { "data-testid": "sidenav-settings-link", renderIcon: icons.Settings, href: settingsLink, onClick: (e) => {
246
238
  handleSettingsClick();
247
239
  } }, "Settings")) : null,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useLocation, Link } from 'react-router-dom';
2
+ import { useHistory } from 'react-router-dom';
3
3
  import cx from 'classnames';
4
4
  import { SideNavLink, SideNav, SideNavItems, SideNavDivider, Tag } from '@carbon/react';
5
5
  import TooltipHover from '../TooltipHover/TooltipHover.js';
@@ -29,7 +29,7 @@ function AdvantageSideNav(props) {
29
29
  const [activeMenu, setActiveMenu] = React.useState(false);
30
30
  const isMenuOpen = isOpen || activeMenu;
31
31
  const windowLocation = window.location;
32
- const location = useLocation();
32
+ const historyy = useHistory();
33
33
  const isPartnerUser = user?.type === USER_PLATFORM_ROLE.Partner;
34
34
  const joinButtontitle = showSelectTeamPurpose ? "Create Team" : "Create or Join Team";
35
35
  const hamburguerMenu = document.getElementById("header-sidenav-menu-button");
@@ -221,18 +221,10 @@ function AdvantageSideNav(props) {
221
221
  handleDocumentCollectionsClick();
222
222
  } }, "Document Collections")) : null,
223
223
  showSecondDivider ? React.createElement(SideNavDivider, null) : null,
224
- catalogNavlink ? (React.createElement(Link, { to: catalogNavlink, style: { textDecoration: "none" } },
225
- React.createElement(SideNavLink, { "data-testid": "sidenav-catalog-link", isActive: location.pathname.includes("/catalog"), renderIcon: Catalog }, "Catalog"))
226
- // <SideNavLink
227
- // to={catalogNavlink}
228
- // data-testid="sidenav-catalog-link"
229
- // isActive={windowLocation.href.includes(`${baseEnvUrl}/catalog`)}
230
- // // href={catalogNavlink}
231
- // renderIcon={Catalog}
232
- // >
233
- // Catalog
234
- // </SideNavLink>
235
- ) : 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,
236
228
  settingsLink ? (React.createElement(SideNavLink, { "data-testid": "sidenav-settings-link", renderIcon: Settings, href: settingsLink, onClick: (e) => {
237
229
  handleSettingsClick();
238
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.4",
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": {