-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1987 from jadmsaadaot/TRACK-task#1986
Make my workplan filters sticky
- Loading branch information
Showing
8 changed files
with
71 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { WorkPlanFilters } from "./MyWorkPlanContext"; | ||
|
||
export const MY_WORKLAN_FILTERS: { [key in keyof WorkPlanFilters]: string } = { | ||
teams: "my-workplan-teams", | ||
work_states: "my-workplan-work-states", | ||
regions: "my-workplan-regions", | ||
project_types: "my-workplan-project-types", | ||
work_types: "my-workplan-work-types", | ||
text: "my-workplan-text", | ||
}; | ||
|
||
export const MY_WORKPLAN_CACHED_SEARCH_OPTIONS = "my-workplan-search-options"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { MY_WORKLAN_FILTERS } from "./constants"; | ||
|
||
export const getCachedSearchOptions = () => { | ||
return { | ||
teams: JSON.parse(sessionStorage.getItem(MY_WORKLAN_FILTERS.teams) || "[]"), | ||
work_states: JSON.parse( | ||
sessionStorage.getItem(MY_WORKLAN_FILTERS.work_states) || "[]" | ||
), | ||
regions: JSON.parse( | ||
sessionStorage.getItem(MY_WORKLAN_FILTERS.regions) || "[]" | ||
), | ||
project_types: JSON.parse( | ||
sessionStorage.getItem(MY_WORKLAN_FILTERS.project_types) || "[]" | ||
), | ||
work_types: JSON.parse( | ||
sessionStorage.getItem(MY_WORKLAN_FILTERS.work_types) || "[]" | ||
), | ||
}; | ||
}; |