The-Graphite-Lab / isMyCustomerMoving

is-my-customer-moving.vercel.app
MIT License
0 stars 0 forks source link

Sweep: Allow sorting by lifetime value on customer data page #170

Open reidelkins opened 1 year ago

reidelkins commented 1 year ago

In the table in frontend/src/components/CustomerData.js allow for sorting based on serviceTitanLifetimeRevenue. Other relevant files might be frontend/src/sections/@dashboard/client/ClientListHead.js, frontend/src/sections/@dashboard/client/CustomerDataFilter.js, and frontend/src/sections/@dashboard/client/ClientListToolbar.js

sweep-ai[bot] commented 1 year ago

Here's the PR! https://github.com/reidelkins/isMyCustomerMoving/pull/172.

⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 5 GPT-4 tickets left. For more GPT-4 tickets, visit our payment portal.To get Sweep to recreate this ticket, leave a comment prefixed with "sweep:" or edit the issue.


Step 1: 🔍 Code Search

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/reidelkins/isMyCustomerMoving/blob/5d026119c89351bb717b2cd49fd2b83f44355f05/frontend/src/components/CustomerData.js#L1-L691 https://github.com/reidelkins/isMyCustomerMoving/blob/5d026119c89351bb717b2cd49fd2b83f44355f05/frontend/src/sections/@dashboard/client/ClientListToolbar.js#L1-L288 https://github.com/reidelkins/isMyCustomerMoving/blob/5d026119c89351bb717b2cd49fd2b83f44355f05/frontend/src/sections/@dashboard/client/CustomerDataFilter.js#L1-L859 https://github.com/reidelkins/isMyCustomerMoving/blob/5d026119c89351bb717b2cd49fd2b83f44355f05/frontend/src/sections/@dashboard/client/ClientListHead.js#L1-L78

I also found the following external resources that might be helpful:

Summaries of links found in the content:


Step 2: 🧐 Snippet Analysis

From looking through the relevant snippets, I decided to make the following modifications:

File Path Proposed Changes
frontend/src/components/CustomerData.js In the handleRequestSort function, add a case for serviceTitanLifetimeRevenue to sort the table based on this field.
frontend/src/sections/dashboard/client/ClientListHead.js Add a TableSortLabel for the serviceTitanLifetimeRevenue field to allow users to sort by this field.

Step 3: 📝 Planning

I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:

Allow sorting by lifetime value on customer data page sweep/sort-by-lifetime-value

Description

This PR addresses the issue #170 by allowing sorting based on the serviceTitanLifetimeRevenue field in the table in frontend/src/components/CustomerData.js.

Summary of Changes

  • Modified frontend/src/components/CustomerData.js to include sorting functionality for the serviceTitanLifetimeRevenue field in the handleRequestSort function.
  • Updated frontend/src/sections/@dashboard/client/ClientListHead.js to include a TableSortLabel for the serviceTitanLifetimeRevenue field to allow users to sort by this field.

Please review and merge this PR at your earliest convenience. Thank you!


Step 4: ⌨️ Coding

I have finished coding the issue. I am now reviewing it for completeness.


Step 5: 🔁 Code Review

Success! 🚀


To recreate the pull request, leave a comment prefixed with "sweep:" or edit the issue. Join Our Discord