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

Migrate subproject funding modal to DataGridPro #1517

Merged
merged 10 commits into from
Jan 2, 2025

Conversation

mddilley
Copy link
Collaborator

@mddilley mddilley commented Dec 30, 2024

Associated issues

Closes cityofaustin/atd-data-tech#18179

This PR migrates the eCapris subproject funding source table in the "FROM ECAPRIS" modal to use DataGridPro.

Testing

URL to test:

Local or deploy preview

Steps to test:

This table fetches rows from an open dataset by the eCapris subproject ID set on a project. Some IDs match many results while other only match a few so you can use both 11280.006 which will show 18 rows in the table and 7333.001 which will show 4 rows in the table.

You can find other eCapris subproject IDs to test using this query on the open dataset - you just have to remove the comma in the SP_NUMBER_TXT column.

  1. Create a new project and set 11280.006 as the eCapris subproject ID in the project summary view or in the Funding tab.
  2. In the Funding tab, add a new funding source using the "from eCapris" option.
  3. A modal will open up to show the table, and you should be able to select one, some, or all FDU rows. Notice that the "Add Funding Source" button is only enabled if a row(s) is selected. The columns are also sortable.
  4. Add one or more rows, and you should see new funding source rows populated with:
    • Status is "Confirmed"
    • Fund and Dept-unit
    • Amount is $0
  5. Also notice that once a funding source is added from the modal, then you can no longer add it. Delete some funding sources from the table and notice that you can added them again from the modal.
  6. Try these steps again with the subproject ID set to 7333.001 to see how the table hides pagination if there are 10 or less rows in the table.

Ship list

@mddilley mddilley added the WIP Work in progress label Dec 30, 2024
* User Hook
* @type {object} CognitoUserSession
*/
const { user } = useUser();
Copy link
Collaborator Author

@mddilley mddilley Dec 30, 2024

Choose a reason for hiding this comment

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

This user data was retrieved to be passed to the SubprojectFundingModal component where it was no longer used in the funding source mutation.

onSelectionChange={(rows) => setSelectedFdus(rows)}
pagination
pageSizeOptions={[PAGE_SIZE]}
hideFooter={filteredData.length < PAGE_SIZE}
Copy link
Collaborator Author

@mddilley mddilley Dec 30, 2024

Choose a reason for hiding this comment

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

The previous table hid the pagination if there were 10 or less rows so I kept that around, and I'm on the fence. Here is what it looks like both ways.

With pagination hidden when there are 10 or less results:
Screenshot 2024-12-30 at 11 01 10 AM

With pagination always showing (arrows are disabled):
Screenshot 2024-12-30 at 11 01 25 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

I kinda like how pagination shows you how many record options there are. Not sure how helpful that is in the real world.

Copy link
Member

@johnclary johnclary Dec 31, 2024

Choose a reason for hiding this comment

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

yeah, I also think i prefer the pagination visible all the time. in addition to the record count i like when it's disabled on-screen because it's a little hint that sometimes there may be a lot of rows in the table.

lately i have been feeling down about hidden functionality in general—i feel like it leads to an inconsistent UX and maybe more bugs.

Copy link
Contributor

Choose a reason for hiding this comment

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

i agree with john and mateo!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

awesome y'all - thanks! I removed the conditional render. 🗑️ 👋

@mddilley mddilley removed the WIP Work in progress label Dec 30, 2024
Copy link
Contributor

@mateoclarke mateoclarke left a comment

Choose a reason for hiding this comment

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

govfunding

I'm not sure how common this use case is but if you switch your eCapris ID, the old funding sources added from the previous eCAPRIS ID persist. I could see a world where those would get removed if the eCAPRIS ID no longer matches. But I'm probably overthinking that use case.

Overall, works just as described in testing steps.

onSelectionChange={(rows) => setSelectedFdus(rows)}
pagination
pageSizeOptions={[PAGE_SIZE]}
hideFooter={filteredData.length < PAGE_SIZE}
Copy link
Contributor

Choose a reason for hiding this comment

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

I kinda like how pagination shows you how many record options there are. Not sure how helpful that is in the real world.

Copy link
Member

@johnclary johnclary left a comment

Choose a reason for hiding this comment

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

Another one bites the dust—looks great! 🙌

Copy link
Contributor

@roseeichelmann roseeichelmann left a comment

Choose a reason for hiding this comment

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

this looks and works great! 🚀

Copy link
Member

@chiaberry chiaberry left a comment

Choose a reason for hiding this comment

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

welcome to the datagrid pro world!

@mddilley mddilley merged commit 21cd9cd into main Jan 2, 2025
4 checks passed
@mddilley mddilley deleted the mike/18179_subproject_funding_table branch January 2, 2025 16:04
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.

Migrate subproject funding modal to DataGridPro
5 participants