From 2769c0029dfc5bfa4dd8b53da2786b533306057d Mon Sep 17 00:00:00 2001 From: Joshua Graber Date: Tue, 19 Mar 2024 15:49:20 -0400 Subject: [PATCH 1/5] fix(pages): update search results filtering Accommodate multiple items of each record_type --- client/src/pages/SearchResultPage.vue | 43 ++++++++++++++------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/client/src/pages/SearchResultPage.vue b/client/src/pages/SearchResultPage.vue index c4dc7ed2..f5f59279 100644 --- a/client/src/pages/SearchResultPage.vue +++ b/client/src/pages/SearchResultPage.vue @@ -42,32 +42,38 @@
- - +

{{ section.header }} - +

- -
+ class="grid pdap-grid-container-column-3 gap-4" + > + +
+ - - From 14c898991118d3bae58e675ed7c383b2729866cb Mon Sep 17 00:00:00 2001 From: Joshua Graber Date: Tue, 19 Mar 2024 15:59:36 -0400 Subject: [PATCH 2/5] refactor(pages): update SearchResultPage Get count from API results Misc template cleanup --- client/src/pages/SearchResultPage.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/src/pages/SearchResultPage.vue b/client/src/pages/SearchResultPage.vue index f5f59279..ee6026bd 100644 --- a/client/src/pages/SearchResultPage.vue +++ b/client/src/pages/SearchResultPage.vue @@ -42,12 +42,9 @@
-
@@ -67,7 +64,7 @@ :data-source="result" />
-
+ @@ -134,7 +131,7 @@ export default { // Set data and away we go this.searchResult = resultFormatted; - this.count = Object.entries(this.searchResult).length; + this.count = res.data.count; } catch (error) { console.error(error); } finally { From 943581aad1d46e354d8effb2f359428460dab0b5 Mon Sep 17 00:00:00 2001 From: Joshua Graber Date: Tue, 19 Mar 2024 15:59:50 -0400 Subject: [PATCH 3/5] test(pages): update SearchResultPage snapshot --- .../searchResultPage.test.js.snap | 168 +++++++++++++----- 1 file changed, 121 insertions(+), 47 deletions(-) diff --git a/client/src/pages/__tests__/__snapshots__/searchResultPage.test.js.snap b/client/src/pages/__tests__/__snapshots__/searchResultPage.test.js.snap index b0190c24..f6ba6be7 100644 --- a/client/src/pages/__tests__/__snapshots__/searchResultPage.test.js.snap +++ b/client/src/pages/__tests__/__snapshots__/searchResultPage.test.js.snap @@ -4,7 +4,7 @@ exports[`SearchResultPage renders with data > Calls API and renders search resul

Data Sources Search results

-

Searching for "calls" in "Cook". Found 1 result. +

Searching for "calls" in "Cook". Found 3 results.

-
-

Police & public interactions

-
-

311 Calls for City of Chicago

- -

Record type

-
Calls for Service
-
-

Agency

-

Chicago Police Department - IL

+
+

Police & public interactions

+
+
+

Calls for Service for Cicero Police Department - IN

+ +

Record type

+
Calls for Service
+
+

Agency

+

Cicero Police Department - IN

+
+ +

Time range

+

2016–Unknown end

+

Formats available

+
    +
  • [
  • +
  • ]
  • +
+ +
+
+

Calls for Service for Chicago Police Department - IL

+ +

Record type

+
Calls for Service
+
+

Agency

+

Chicago Police Department - IL

+
+ +

Time range

+

2018–Unknown end

+

Formats available

+
    +
  • [
  • +
  • ]
  • +
+
- -

Time range

-

12/17/2018–Unknown end

-

Formats available

-
    -
  • [
  • -
  • '
  • -
  • C
  • -
  • S
  • -
  • V
  • -
  • '
  • -
  • ,
  • -
  • -
  • '
  • -
  • X
  • -
  • M
  • -
  • L
  • -
  • '
  • -
  • ,
  • -
  • -
  • '
  • -
  • R
  • -
  • D
  • -
  • F
  • -
  • '
  • -
  • ,
  • -
  • -
  • '
  • -
  • R
  • -
  • S
  • -
  • S
  • -
  • '
  • -
  • ]
  • -
- +

Time range

+

12/17/2018–Unknown end

+

Formats available

+
    +
  • [
  • +
  • '
  • +
  • C
  • +
  • S
  • +
  • V
  • +
  • '
  • +
  • ,
  • +
  • +
  • '
  • +
  • X
  • +
  • M
  • +
  • L
  • +
  • '
  • +
  • ,
  • +
  • +
  • '
  • +
  • R
  • +
  • D
  • +
  • F
  • +
  • '
  • +
  • ,
  • +
  • +
  • '
  • +
  • R
  • +
  • S
  • +
  • S
  • +
  • '
  • +
  • ]
  • +
+ +
From 5a0c1d9b9b4dfb5df984485e476ae586ae8cef88 Mon Sep 17 00:00:00 2001 From: Joshua Graber Date: Tue, 19 Mar 2024 16:24:32 -0400 Subject: [PATCH 4/5] refactor(pages): update search result page Handle UI more elegantly --- client/src/pages/SearchResultPage.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/client/src/pages/SearchResultPage.vue b/client/src/pages/SearchResultPage.vue index ee6026bd..b1e2894a 100644 --- a/client/src/pages/SearchResultPage.vue +++ b/client/src/pages/SearchResultPage.vue @@ -46,19 +46,15 @@ v-for="section in uiShape" :key="section.header" data-test="search" - class="p-0 w-full" + class="mt-8 p-0 w-full" >

{{ section.header }}

-
+
{ + return [...acc, ...this.searchResult[cur.type]]; + }, []); + }, getResultsCopy() { return `${this.count} ${pluralize('result', this.count)}`; }, From 44c585c70ddce75e86d4b20db2e7ca1cd95cb8ac Mon Sep 17 00:00:00 2001 From: Joshua Graber Date: Tue, 19 Mar 2024 16:25:08 -0400 Subject: [PATCH 5/5] test(pages): update search results snapshot --- .../pages/__tests__/__snapshots__/searchResultPage.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/pages/__tests__/__snapshots__/searchResultPage.test.js.snap b/client/src/pages/__tests__/__snapshots__/searchResultPage.test.js.snap index f6ba6be7..1c818fc2 100644 --- a/client/src/pages/__tests__/__snapshots__/searchResultPage.test.js.snap +++ b/client/src/pages/__tests__/__snapshots__/searchResultPage.test.js.snap @@ -19,7 +19,7 @@ exports[`SearchResultPage renders with data > Calls API and renders search resul

-
+

Police & public interactions