diff --git a/changes/16672-software-url-states-bug b/changes/16672-software-url-states-bug new file mode 100644 index 0000000000..7fcd985dac --- /dev/null +++ b/changes/16672-software-url-states-bug @@ -0,0 +1,2 @@ +- Fix URL query params to reset when switching tabs +- Fix vulnerable software dropdown from switching back to all teams diff --git a/frontend/pages/SoftwarePage/SoftwarePage.tsx b/frontend/pages/SoftwarePage/SoftwarePage.tsx index 6718b86ae8..ed148b3a99 100644 --- a/frontend/pages/SoftwarePage/SoftwarePage.tsx +++ b/frontend/pages/SoftwarePage/SoftwarePage.tsx @@ -256,10 +256,8 @@ const SoftwarePage = ({ children, router, location }: ISoftwarePageProps) => { const navigateToNav = useCallback( (i: number): void => { - const navPath = softwareSubNav[i].pathname; - router.replace( - navPath.concat(location?.search || "").concat(location?.hash || "") - ); + const navPath = softwareSubNav[i].pathname.concat(location?.hash || ""); + router.replace(navPath); }, [location, router] ); diff --git a/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx b/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx index e3b8106b2f..8996791cd2 100644 --- a/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx +++ b/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx @@ -207,9 +207,9 @@ const SoftwareTable = ({ routeTemplate: "", queryParams: { query, - teamId, - orderDirection, - orderKey, + team_id: teamId, + order_direction: orderDirection, + order_key: orderKey, vulnerable: isFilterVulnerable, page: 0, // resets page index },