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

Fides table column utilities #4569

Merged
merged 17 commits into from
Jan 29, 2024
Merged

Conversation

allisonking
Copy link
Contributor

@allisonking allisonking commented Jan 23, 2024

Closes https://ethyca.atlassian.net/browse/PROD-1505

Description Of Changes

Screen.Recording.2024-01-24.at.3.43.42.PM.mov

Code Changes

  • Add column resizing to FidesTableV2
  • Add displaying all/grouping all to FidesTableV2 cells that use the GroupCountBadgeCell component
  • Memoize the table to allow for more performant resizing
  • Configure datamap reporting table, consent configuration table, and adding multiple systems table to use column resizing

Steps to Confirm

  • Play with the tables in /add-systems/multiple, /reporting/datamap, and /consent/configure by resizing the columns
  • In the datamap reporting table, you can also group/display all for fields that have multiple values

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Issue Requirements are Met
  • Update CHANGELOG.md

Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fides-plus-nightly ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2024 8:17pm

Copy link

cypress bot commented Jan 23, 2024

Passing run #6085 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge 8149f31 into ee825df...
Project: fides Commit: c9a84af368 ℹ️
Status: Passed Duration: 00:35 💡
Started: Jan 26, 2024 8:25 PM Ended: Jan 26, 2024 8:26 PM

Review all test suite changes for PR #4569 ↗︎

? flexRender(cell.column.columnDef.cell, cell.getContext())
? flexRender(cell.column.columnDef.cell, {
...cell.getContext(),
isDisplayAll,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a way to pass a prop from the table environment to the cell. most of the time we can pass props during the column definition, but in this case where we want a column to toggle between displaying all and grouping all, we don't know that value at definition time. so we need to pass a prop at render time instead (taken from TanStack/table#4391 (reply in thread))

@@ -159,57 +159,39 @@ export const ConsentManagementTable = () => {
id: "name",
cell: (props) => <DefaultCell value={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="Vendor" {...props} />,
meta: {
maxWidth: "350px",
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these widths don't work too well when column resizing is enabled

@@ -218,7 +212,13 @@ export const AddMultipleSystems = ({ redirectRoute }: Props) => {
pagination: {
pageSize: PAGE_SIZES[0],
},
columnSizing: {
select: 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this allows these two columns to start off initially small (it doesn't start at 0, and admittedly I don't quite know how this works, but 0 seems to work ok)

Copy link
Contributor

@galvana galvana left a comment

Choose a reason for hiding this comment

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

Thank you for the quick turnaround, this looks amazing! Everything works as expected and your implementation looks solid (as far as a backend engineer like myself can tell 😄). It makes sense how we would add the expand and collapse feature to other tables so this looks good to me. Let's give @mfbrown a chance to provide some more UAT before we merge.

@allisonking allisonking merged commit 4f7c531 into main Jan 29, 2024
13 checks passed
@allisonking allisonking deleted the aking/prod-1505/column-utilities branch January 29, 2024 16:22
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.

2 participants