Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use session storage to persist filter and search #3114

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

gordonfarrell
Copy link
Collaborator

PULL REQUEST

Summary

Saves search param info into session storage and uses it to build the href for the link back to the eCR Library from the view page.

Related Issue

Fixes #3063

Acceptance Criteria

When a user has filters applied and navigates into a single eCR, the filters and/or search should persist on return

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 72.72727% with 6 lines in your changes missing coverage. Please review.

Project coverage is 89.11%. Comparing base (8cbac55) to head (b07ab97).

Files with missing lines Patch % Lines
containers/ecr-viewer/src/app/components/utils.ts 66.66% 5 Missing ⚠️
...s/ecr-viewer/src/app/components/EcrTableClient.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3114      +/-   ##
==========================================
+ Coverage   87.02%   89.11%   +2.08%     
==========================================
  Files         219       83     -136     
  Lines       13653     4244    -9409     
  Branches      703      720      +17     
==========================================
- Hits        11882     3782    -8100     
+ Misses       1762      442    -1320     
- Partials        9       20      +11     
Flag Coverage Δ
ecr-viewer 90.85% <72.72%> (-0.15%) ⬇️
fhir-converter ?
ingestion ?
message-parser ?
message-refiner ?
orchestration 85.67% <ø> (ø)
record-linkage ?
trigger-code-reference ?
validation ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...viewer/src/app/view-data/components/BackButton.tsx 100.00% <100.00%> (ø)
...s/ecr-viewer/src/app/components/EcrTableClient.tsx 91.11% <75.00%> (-0.75%) ⬇️
containers/ecr-viewer/src/app/components/utils.ts 66.66% <66.66%> (ø)

... and 141 files with indirect coverage changes

@@ -8,6 +8,7 @@ import { usePathname, useSearchParams, useRouter } from "next/navigation";
import { range } from "../view-data/utils/utils";
import classNames from "classnames";
import Link from "next/link";
import { saveToSessionStorage } from "./utils";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add an e2e test that covers this functionality?


return (
<tr>
<td>
<Link href={`/view-data?id=${item.ecrId}`}>
<Link onClick={saveUrl} href={`/view-data?id=${item.ecrId}`}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so simple! ❤️

Copy link
Collaborator

@mcmcgrath13 mcmcgrath13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filters and search should persist when re-loading the Library
2 participants