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

feat: [M3-6715] - Allow sorting by amount on billing activity table #10941

Conversation

pmakode-akamai
Copy link
Contributor

@pmakode-akamai pmakode-akamai commented Sep 16, 2024

Description 📝

As a user, when I click the "Amount" column header, the Billing Activity table should be ordered by the amount column.

Related discussion: #9271 (comment)

Note

We are considering client-side ordering.

Changes 🔄

List any change relevant to the reviewer.

  • Add client-side ordering by total amount for the "Amount" column.
  • Default to ordering by date when no valid 'orderBy' value is provided.
  • Change to client-side pagination on the billing activity table.

Target release date 🗓️

N/A

How to test 🧪

Prerequisites

  • Test with real data or turn MSW 'ON' & set it to Legacy MSW Handlers

Verification steps

  • Verify that sorting by 'Amount' on the billing activity table works correctly (for both - Invoices and Payments data).
  • Verify that the data is ordered by 'date' by default (when no valid 'orderBy' value is provided).
  • Verify that pagination on the billing activity table is working as expected.

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

Copy link

github-actions bot commented Sep 16, 2024

Coverage Report:
Base Coverage: 87.23%
Current Coverage: 87.22%

@mjac0bs
Copy link
Contributor

mjac0bs commented Sep 16, 2024

Hey @pmakode-akamai, were you able to mock this? I was having trouble verifying the change because as an employee, all my invoices are $0.00 and I've got no payment history (and I assume that's the same for you). When I turned the MSW on and set it to Preset Mocking to use our legacy handlers, I was still seeing the /invoices and /payments endpoints return data for my account, not the mocked MSW request.

@pmakode-akamai
Copy link
Contributor Author

pmakode-akamai commented Sep 16, 2024

Hey @pmakode-akamai, were you able to mock this? I was having trouble verifying the change because as an employee, all my invoices are $0.00 and I've got no payment history (and I assume that's the same for you). When I turned the MSW on and set it to Preset Mocking to use our legacy handlers, I was still seeing the /invoices and /payments endpoints return data for my account, not the mocked MSW request.

Hey Mariah (@mjac0bs), yes, I'm able to mock by setting this to Legacy MSW Handlers.

Screenshot 2024-09-16 at 11 34 37 PM

With huge data (for pagination)

Screenshot 2024-09-16 at 11 40 44 PM

Screenshot 2024-09-16 at 11 41 01 PM

@mjac0bs
Copy link
Contributor

mjac0bs commented Sep 16, 2024

Hey Mariah (@mjac0bs), yes, I'm able to mock by setting this to Legacy MSW Handlers.

For some reason, I was thinking Legacy was called Preset, even though it's clearly not. 🤦🏼‍♀️ Thanks!

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Sorting and pagination worked well with the mocks using the Legacy MSW Handlers once I learned how to read. 🙂

Approving pending a few comments that I left.

@mjac0bs mjac0bs added the Add'tl Approval Needed Waiting on another approval! label Sep 16, 2024
@pmakode-akamai pmakode-akamai force-pushed the M3-6715-feat-allow-sorting-by-amount-on-billing-activity-table branch from 6dc8b5b to b53089d Compare September 17, 2024 07:13
Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

Sorting is working!

@pmakode-akamai pmakode-akamai force-pushed the M3-6715-feat-allow-sorting-by-amount-on-billing-activity-table branch from 0658126 to f7bd03d Compare October 3, 2024 07:48
@pmakode-akamai pmakode-akamai force-pushed the M3-6715-feat-allow-sorting-by-amount-on-billing-activity-table branch from f7bd03d to 0b33cc1 Compare October 7, 2024 11:51
@abailly-akamai abailly-akamai merged commit b9f0379 into linode:develop Oct 7, 2024
20 checks passed
@pmakode-akamai pmakode-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! Ready for Review labels Oct 7, 2024
Copy link

cypress bot commented Oct 7, 2024

Cloud Manager E2E    Run #6629

Run Properties:  status check passed Passed #6629  •  git commit b9f0379d8c: feat: [M3-6715] - Allow sorting by amount on billing activity table (#10941)
Project Cloud Manager E2E
Branch Review develop
Run status status check passed Passed #6629
Run duration 24m 57s
Commit git commit b9f0379d8c: feat: [M3-6715] - Allow sorting by amount on billing activity table (#10941)
Committer Purvesh Makode
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 414
View all changes introduced in this branch ↗︎

hasyed-akamai pushed a commit to hasyed-akamai/manager that referenced this pull request Oct 9, 2024
…inode#10941)

* Add allow sorting by amount on billing activity table

* Added changeset: Allow sorting by amount on billing activity table

* Update getOrderedPaginatedData function

* refactor: use useMemo to optimize orderedPaginatedData

* Fix: Change colSpan 5 to 4

* Few fixes...

* Add default case to order data by date in descending order

* Use createDisplayPage to paginate ordered data list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants