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

Sort Order Improvements for the Agents table #448

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

Conversation

val500
Copy link
Contributor

@val500 val500 commented Jan 23, 2025

Description

Adds some improvements to the agents table - namely the provisioning streak column. This PR makes the sorting functionality of the table work with this column, first separating by failures/success, then sorting by the streak number. In addition, url parameters were added to persist sorting information on refresh for the agents table. Finally, this column was given the name "Outcome", and a tooltip was added describing this column.

To support this, new functions were added to filter.js - ordering functions were created to differentiate default ordering with provision streak ordering. Also, a new function to get URL parameters and use them to sort the table was also created. Finally, the sortTable function was split into two functions - sortTable and cycleTableSort. sortTable now just sorts a table given an ordering("ascending", "descending", "none"), while cycleTableSort cycles through the ordering states and uses sortTable to apply that ordering.

Resolved issues

Resolves https://warthogs.atlassian.net/browse/CERTTF-396

Documentation

Each new function was given documentation and comments.

Web service API changes

N/A

Tests

N/A

Pictures

No sort applied - note the url
none_sort

Ascending Sort
ascending_sort

Descending Sort
descending_sort

New Tooltip for Column
Screenshot from 2025-01-28 12-19-50

@val500 val500 requested a review from a team January 23, 2025 21:47
@jocave
Copy link
Collaborator

jocave commented Jan 24, 2025

Excited for this, would you mind including a screenshot(s) in this review so can quickly review UI changes? Thanks

@val500
Copy link
Contributor Author

val500 commented Jan 28, 2025

Excited for this, would you mind including a screenshot(s) in this review so can quickly review UI changes? Thanks

Attached new images

@mz2
Copy link
Collaborator

mz2 commented Jan 30, 2025

I'll be annoying and request for a small tweak compared to the acceptance criteria I'd written earlier, now that I see it in action:

I would always start with the failures, and have ascending and descending rather secondarily sort by the numerical value in those groups. It's useful to have a way to highlight the low numbers quickly.

So, ascending:

1 fails
2 fails
3 fails
7 fails
1 successes
2 successes
5 successes

... and descending

7 fails
3 fails
3 fails
1 fails
5 successes
2 successes
1 successes

(with descending the one offered first when you click)

<th aria-sort="none">Name</th>
<th aria-sort="none">State</th>
<th aria-sort="none">Updated At</th>
<th aria-sort="none" class="has-overflow" style="width: 80pt" use-outcome-sort id="agentsOutcomeHeader">
Copy link
Contributor

@pedro-avalos pedro-avalos Jan 30, 2025

Choose a reason for hiding this comment

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

Hey, great work, I have one comment in regards to the icons. You should add the p-table__cell--icon-placeholder on the th and td elements that have icons; this will make the icon display outside the column

See https://vanillaframework.io/docs/base/tables#icons

Suggested change
<th aria-sort="none" class="has-overflow" style="width: 80pt" use-outcome-sort id="agentsOutcomeHeader">
<th aria-sort="none" class="p-table__cell--icon-placeholder has-overflow" style="width: 80pt" use-outcome-sort id="agentsOutcomeHeader">

Copy link
Contributor

Choose a reason for hiding this comment

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

The td element seems to be at line 38. I'm not sure how the icon placeholder behavior and the span and tooltip you have will interact with each other.

<td class="has-overflow">

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.

4 participants