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

[#12329] Refactoring of sortable tables - Student list #12539

Merged
merged 28 commits into from
Sep 23, 2023

Conversation

domoberzin
Copy link
Contributor

@domoberzin domoberzin commented Jul 31, 2023

Fixes part of #12329

Outline of Solution
Refactored student list to fully use sortable tables, coupled with minor changes to sortable table to accommodate different styling on the header of the table.

Following the lead of #12501, I created the cell-with-actions component to support the various buttons on the original table.

Also modified the sortable-table component to be able to take in a customHeaderStyle that supports styling of the header, since for the student list, the class used in the header is bg-info (A cyan-ish colour). This allows the class of the header to be customized beyond the standard blue of bg-primary or the blank white.

As the student list originally supported highlighting, I imported the highlighter pipe directly into student-list.component in and set the displayValue of the SortableTableCellData to the highlighted version based on the searchString.

I also believe this refactoring fixes #12536 as shown in the video below.

Screen.Recording.2023-08-01.at.4.01.44.AM.mov

One thing to note is, the original student list had a setting to enable a gray header, which was set in the <thead> element. While this is probably achievable with some changes within the sortable-table component, I opted for a slightly simpler solution, to use bg-light instead, which is a light gray colour, please refer to the images below and let me know if the colour change is acceptable, otherwise I will attempt to make it closer to the original.

Original:
image

Current:
image

@domoberzin domoberzin marked this pull request as ready for review July 31, 2023 18:40
@domoberzin domoberzin marked this pull request as draft July 31, 2023 19:08
@domoberzin domoberzin marked this pull request as ready for review July 31, 2023 20:04
@jasonqiu212 jasonqiu212 added the s.ToReview The PR is waiting for review(s) label Aug 3, 2023
@nusoss-bot
Copy link

Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢
Hope someone can get it to move forward again soon...

1 similar comment
@nusoss-bot
Copy link

Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢
Hope someone can get it to move forward again soon...

@nusoss-bot
Copy link

Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢
Hope someone can get it to move forward again soon...

@domoberzin
Copy link
Contributor Author

Hey @jasonqiu212 @weiquu @cedricongjh, this PR is ready for review!

@jasonqiu212
Copy link
Contributor

Hi @domoberzin, Sorry for the delay! I'll try to review this PR within the next few days

@nusoss-bot
Copy link

Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢
Hope someone can get it to move forward again soon...

@@ -116,7 +116,7 @@ public void testAll() {
______TS("delete student");
detailsPage.sortByName();
detailsPage.sortByStatus();
StudentAttributes[] studentsAfterDelete = { students[3], students[0], students[1] };
StudentAttributes[] studentsAfterDelete = { students[0], students[3], students[1] };
Copy link
Contributor

Choose a reason for hiding this comment

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

could I check why the E2E test has changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this is due to the fact that in the original table, when clicking on sort, it would sort descending by default, while the current implementation would sort it in ascending by default, hence the change in the ordering

Copy link
Contributor

@cedricongjh cedricongjh left a comment

Choose a reason for hiding this comment

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

just a small comment, otherwise LGTM!

@cedricongjh cedricongjh added s.FinalReview The PR is ready for final review and removed s.ToReview The PR is waiting for review(s) labels Sep 17, 2023
Copy link
Contributor

@jasonqiu212 jasonqiu212 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the great work @domoberzin

Seems strange to me that there are 2 differing stylings for the table header - The gray and cyan blue. Perhaps we can consider standardizing it to cyan blue only? What do you think @cedricongjh

@jasonqiu212 jasonqiu212 added s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging and removed s.FinalReview The PR is ready for final review labels Sep 22, 2023
@jasonqiu212
Copy link
Contributor

Hi @domoberzin, Sorry could you help to fix the snapshot tests? I think they're failing after merging in your other refactoring for extension confirm model.

@domoberzin
Copy link
Contributor Author

Hi @jasonqiu212, snapshots have been updated

@jasonqiu212 jasonqiu212 merged commit 23f92b7 into TEAMMATES:master Sep 23, 2023
8 checks passed
@wkurniawan07 wkurniawan07 added the c.Task Other non-user-facing works, e.g. refactoring, adding tests label Jan 21, 2024
@wkurniawan07 wkurniawan07 added this to the V8.30.0 milestone Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Task Other non-user-facing works, e.g. refactoring, adding tests s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instructor Search Page: sorting affects sort icons for all tables
5 participants