Skip to content

Commit

Permalink
Merge pull request #486 from OpenCatalogi/package-update
Browse files Browse the repository at this point in the history
filters update
  • Loading branch information
remko48 authored Aug 16, 2024
2 parents be0c740 + 5127758 commit 3eab4af
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pwa/src/services/filtersToQueryParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export const filtersToQueryParams = (filters: any): string => {
case "developmentStatus":
value === "hideObsolete" ? (params += `&developmentStatus[ne]=obsolete`) : (params += `&${key}=${value}`);
break;
// case "softwareType":
// value === "standalone" ? (params += `&softwareType[regex]=${value}`) : (params += `&${key}=${value}`);
// break;
case "componentsCurrentPage":
params += "";
break;
Expand Down Expand Up @@ -102,16 +99,22 @@ export const filtersToUrlQueryParams = (filters: Record<string, any>, pathname:
if (value === null || value === undefined || value === "" || (Array.isArray(value) && _.isEmpty(value)))
return null;

if (pathname.includes("/publications") || pathname === "/") {
if (pathname.includes("/components") || pathname === "/") {
if (key === "landingDisplayLayout") return null;
if (key === "dependenciesDisplayLayout") return null;
if (key === "catagoryDisplayLayout") return null;
if (key === "organizationsResultDisplayLayout") return null;
if (key === "applicationCurrentPage") return null;
if (key === "organizationCurrentPage") return null;
if (key === "organizationCurrentPage") return null;
if (key === "publicationCurrentPage") return null;
if (key === "publicationsResultDisplayLayout") return null;

return null;
if (key === "isForked" && window.sessionStorage.getItem("FILTER_FORKS") === "false") return null;
if (key === "orderRating" && window.sessionStorage.getItem("FILTER_RATING") === "false") return null;
if (key === "rating" && window.sessionStorage.getItem("FILTER_RATING") !== "OpenCatalogi") return null;
if (key === "ratingCommonground" && window.sessionStorage.getItem("FILTER_RATING") !== "Commonground")
return null;

}

const formattedValue = Array.isArray(value)
Expand Down

0 comments on commit 3eab4af

Please sign in to comment.