-
Notifications
You must be signed in to change notification settings - Fork 245
Add collapse, empty states and deep linking to group by #6498
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
Conversation
Dependency Review✅ No vulnerabilities or OpenSSF Scorecard issues found.Scanned FilesNone |
app/web/src/newhotness/Explore.vue
Outdated
watch([groupBySelection], () => { | ||
const query: SelectionsInQueryString = { | ||
...router.currentRoute.value?.query, | ||
}; | ||
delete query.map; | ||
delete query.groupBy; | ||
|
||
query.grid = "1"; | ||
router.push({ query }); | ||
|
||
if (groupBySelection.value === GroupByCriteria.Diff) { | ||
query.groupBy = "diff"; | ||
} else if (groupBySelection.value === GroupByCriteria.Qualification) { | ||
query.groupBy = "qual"; | ||
} else if (groupBySelection.value === GroupByCriteria.Upgrade) { | ||
query.groupBy = "upgr"; | ||
} | ||
|
||
router.push({ | ||
query, | ||
}); | ||
}); | ||
|
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.
Such a clean and elegant watcher!
f44afc6
to
86ee105
Compare
"Failed qualifications": [], | ||
Warnings: [], | ||
"Passed qualifications": [], |
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.
Intentional ordering
delete query.map; | ||
delete query.groupBy; | ||
|
||
query.grid = "1"; |
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.
Note: when you share the link you also need to be sent to the grid rather than the map. This handles that.
case "running": | ||
return "Running"; | ||
return "Running qualifications"; |
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.
"Running" is not real and will die in a follow up PR. This is from before qualifications were on the prop tree... might be like... since late 2022 😅. For now, we'll keep it since we discovered this right as we were wrapping it. It is harmless.
const getQualificationStatusTitle = (component: ComponentInList) => { | ||
const status = getQualificationStatus(component); | ||
switch (status) { | ||
case "success": | ||
return "Passed"; | ||
return "Passed qualifications"; |
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.
Note: the section titles and icons are intentional and match what we have discussed.
@@ -265,6 +265,7 @@ export type SelectionsInQueryString = Partial<{ | |||
map: string; | |||
grid: string; | |||
c: string; | |||
groupBy: "diff" | "qual" | "upgr"; |
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.
These are the first four characters of each type. We may go down to one character or change this in the future, but we wanted something that could be backwards compatible to start.
// Handle the very first time everything is loaded. We want empty sections to begin collapsed | ||
// and non-empty sections to be expanded by default. | ||
if (collapsed === undefined) { | ||
collapsed = count === 0; | ||
} |
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.
Here's the deal: this was originally a "toggle", but we needed to handle a ternary state. By default, empty sections needed to be collapsed and non-empty sections needed to be expanded. So, this is how we handle that.
<div v-else> | ||
<!-- footer area --> | ||
</div> |
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.
Subtle, but important to have a div here.
86ee105
to
0cb9741
Compare
Co-authored-by: Victor Bustamante <victor@systeminit.com> Signed-off-by: Nick Gerace <nick@systeminit.com>
54ec15f
to
67e2416
Compare
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.
Excellent router query work
How does this PR change the system?
Screenshots: