Skip to content

Commit

Permalink
chore: return back redirect route and remove remnants
Browse files Browse the repository at this point in the history
  • Loading branch information
mkholjuraev committed Aug 16, 2023
1 parent cff8071 commit 1eebc6d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/Routes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Suspense, lazy, useEffect, useMemo, useState } from 'react';
import { useRoutes } from 'react-router-dom';
import { Navigate, useRoutes } from 'react-router-dom';
import { getSearchParams } from './constants';
import RenderWrapper from './Utilities/Wrapper';
import useFeatureFlag from './Utilities/useFeatureFlag';
Expand Down Expand Up @@ -69,6 +69,10 @@ export const Routes = () => {
<RenderWrapper cmp={InventoryTable} isRbacEnabled {...searchParams} />
),
},
{
path: '/*',
element: <Navigate to="/" replace />,
},
]);

return !hasSystems ? (
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/TestingUtilities.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
export const mountWithRouter = (Component, initialEntriest) => {
export const mountWithRouter = (Component, initialEntries) => {
const wrapper = mount(
<MemoryRouter initialEntriest={initialEntriest}>{Component}</MemoryRouter>
<MemoryRouter initialEntriest={initialEntries}>{Component}</MemoryRouter>
);

return wrapper;
Expand Down
1 change: 0 additions & 1 deletion src/components/InventoryDetail/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const redirectToInventoryList = (id, onBackToListClick, navigate) => {
document.referrer !==
`${document.location.origin}${document.location.pathname}`
) {
console.log('hello');
navigate(-1);
} else {
location.href = location.pathname.replace(
Expand Down

0 comments on commit 1eebc6d

Please sign in to comment.