-
Notifications
You must be signed in to change notification settings - Fork 32
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
Change instance filtering to url instead of state [WD-7026] #527
Change instance filtering to url instead of state [WD-7026] #527
Conversation
Demo starting at https://lxd-ui-527.demos.haus |
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.
Very well done :) I've left a few comments.
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.
This works really well, good work!
Some ideas to simplify the code in addition to @lorumic below.
|
|
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 all looks good and works as expected. I have left a comment, but it's a minor thing. Feel free to implement it or not.
if (url.href !== window.location.href) { | ||
setSearchParams(url.searchParams); | ||
if (newSearchParams.toString() !== currentWindowSearchParams.toString()) { | ||
setSearchParams(newSearchParams); | ||
} | ||
}; | ||
|
||
const getChips = (): SearchAndFilterChip[] => { | ||
const searchParams = new URLSearchParams(window.location.search); | ||
const statusChipUrl = [ |
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.
I just realised that this now looks pretty similar to the items that we have below, inlined with the newSearchData
array. I wonder if this should be inlined there too, instead of having, it alone, its own const
declaration?
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.
LGTM, thanks for applying the changes :)
Done
QA