From 9125fa38703bc9b460c4277f42a3cd3b1084018c Mon Sep 17 00:00:00 2001 From: pratap0007 Date: Wed, 17 Mar 2021 11:26:01 +0530 Subject: [PATCH] Adds selected filters in the url as a query parameter This patch updates url based on the selected filters, search query and sort by Signed-off-by: Shiv Verma --- ui/src/common/params.ts | 7 ++ .../App/__snapshots__/App.test.tsx.snap | 23 ++++--- ui/src/containers/App/index.tsx | 2 + ui/src/containers/ParseUrl/ParseUrl.test.tsx | 24 +++++++ ui/src/containers/ParseUrl/index.tsx | 23 +++++++ .../__snapshots__/Resources.test.tsx.snap | 4 +- ui/src/containers/Resources/index.tsx | 65 +++++++++++++++---- ui/src/containers/Search/index.tsx | 27 +------- ui/src/store/catalog.test.ts | 21 ++++++ ui/src/store/catalog.ts | 13 ++++ ui/src/store/category.test.ts | 50 ++++++++++++++ ui/src/store/category.ts | 14 ++++ ui/src/store/resource.test.ts | 23 +++++++ ui/src/store/resource.ts | 32 +++++++++ 14 files changed, 279 insertions(+), 49 deletions(-) create mode 100644 ui/src/common/params.ts create mode 100644 ui/src/containers/ParseUrl/ParseUrl.test.tsx create mode 100644 ui/src/containers/ParseUrl/index.tsx diff --git a/ui/src/common/params.ts b/ui/src/common/params.ts new file mode 100644 index 0000000000..260a326b58 --- /dev/null +++ b/ui/src/common/params.ts @@ -0,0 +1,7 @@ +export enum Params { + Query = 'query', + SortBY = 'sortBy', + Category = 'category', + Kind = 'kind', + Catalog = 'catalog' +} diff --git a/ui/src/containers/App/__snapshots__/App.test.tsx.snap b/ui/src/containers/App/__snapshots__/App.test.tsx.snap index 457d8790f3..4b4d217f7a 100644 --- a/ui/src/containers/App/__snapshots__/App.test.tsx.snap +++ b/ui/src/containers/App/__snapshots__/App.test.tsx.snap @@ -8,6 +8,9 @@ exports[`App should render the component correctly and match the snapshot 1`] = + + +
@@ -98,13 +101,13 @@ exports[`App should render the component correctly and match the snapshot 1`] =
+
-