-
Notifications
You must be signed in to change notification settings - Fork 24
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
Keep filters option when switching repos #226
Closed
Closed
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
18e4c72
Persist common filters across repos
Arif-Khalid 12db6ab
Store filter changes based on a boolean
Arif-Khalid b3ebf41
Checkbox for keeping filters
Arif-Khalid 03faca9
Comment and clean up code
Arif-Khalid fa959c2
Update code comments
Arif-Khalid 334199a
Fix intial filters not applying to new repo
Arif-Khalid ffec9b1
Fix import in CardViewComponent
Arif-Khalid e1a4928
Refactor filters store into a static class
Arif-Khalid 2138224
Fix linting issues
Arif-Khalid 372393e
Store search bar filter
Arif-Khalid d22d9f6
Add comments in FiltersStore
Arif-Khalid 8fdf7c0
Store selected and hidden labels
Arif-Khalid ef2ecc5
Fix linting errors
Arif-Khalid 089a9eb
Fix milestones property of default filter being changed
Arif-Khalid 0bf2c33
Merge pull request #1 from Arif-Khalid/main
Arif-Khalid 8d75b16
Merge branch 'main' into 205-keep-filters
gycgabriel bf6ba3a
Merge branch 'main' into 205-keep-filters
gycgabriel 30051f5
Remove unsupported structureClone method
Arif-Khalid a2f8ef8
Merge branch '205-keep-filters' of https://github.com/Arif-Khalid/WAT…
Arif-Khalid 2785012
Merge branch 'main' into 205-keep-filters
Arif-Khalid 0fb4a55
Merge branch 'main' into 205-keep-filters
Arif-Khalid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { DEFAULT_DROPDOWN_FILTER, DropdownFilter } from './dropdownfilter'; | ||
|
||
const STORED_FILTER_PROPERTIES = ['status', 'type', 'sort', 'sortDirection']; | ||
|
||
/** This static class stores the filters applied for the purpose of saving filters across repo changes */ | ||
export class FiltersStore { | ||
/** This copy of the dropdown filter is constantly updated when a change in the drop down filter occurs */ | ||
private static currentDropdownFilter: DropdownFilter = { ...DEFAULT_DROPDOWN_FILTER }; | ||
|
||
/** This copy of the search filter is constantly updated when a change in search filter occurs*/ | ||
private static currentSearchFilter = ''; | ||
|
||
static updateDropdownFilter(dropdownFilter: DropdownFilter) { | ||
for (const property of STORED_FILTER_PROPERTIES) { | ||
this.currentDropdownFilter[property] = dropdownFilter[property]; | ||
} | ||
} | ||
|
||
static getInitialDropdownFilter(): DropdownFilter { | ||
return { ...this.currentDropdownFilter }; | ||
} | ||
|
||
static updateSearchFilter(searchFilter: string) { | ||
this.currentSearchFilter = searchFilter.slice(); | ||
} | ||
|
||
static getInitialSearchFilter(): string { | ||
return this.currentSearchFilter.slice(); | ||
} | ||
|
||
static clearStoredFilters() { | ||
this.currentDropdownFilter = { ...DEFAULT_DROPDOWN_FILTER }; | ||
this.currentSearchFilter = ''; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -13,3 +13,8 @@ | |
.mat-dialog-actions { | ||
justify-content: flex-end; | ||
} | ||
|
||
header { | ||
display: flex; | ||
justify-content: space-between; | ||
} |
5 changes: 4 additions & 1 deletion
5
src/app/shared/repo-change-form/repo-change-form.component.html
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why name it initial?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is named initial because this search filter variable is not updated at all when the user types. Instead this variable is simply used to initialize what is seen by the user at the search bar when they first open a new repo.