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
fix: add rowgroup to tables #5005
Conversation
Lint re-formatting makes it look like a big change, but it's just the addition of <div role="rowgroup"> elements around header row and data rows as described here: https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/table/ Part of #4967. Signed-off-by: Tim deBoer <git@tdeboer.ca>
LGTM reviewed using https://github.com/containers/podman-desktop/pull/5005/files?diff=unified&w=1 I suppose we need a test to test this role, see if we.re able to correctly use them to fetch items/data |
Signed-off-by: Tim deBoer <git@tdeboer.ca>
TBH I expect our e2e tests will use the other parts of #4967 (e.g. lookup row by name) more than this role, I was just ticking it off as an easy thing we can fix to be correct for Aria. We should have tests though - added. |
It has come up a couple times so I thought I should make a proposal for how I think we should share column renderers between tables. IMHO we have three cases: 1. Type-specific column rendering like Image name. These should continue to be type-specific as today. 2. Generic columns that really just need to (e.g.) render a string in a certain way. 3. The middle ground where it's a little more complex, or maybe you need to render a couple properties. This commit adds a simple type-mapping function to directly support #2, and applies it to VolumeList. For the middle ground, I think we're going to have convenient cases where objects used in two tables have the same property types & names (e.g. { id: string, some-prop: number}) and we can just render those, and other cases where maybe the renderer should use another type (e.g. Condition) or one of the objects has a different property name. Again, this commit provides a simple way for tables to do whatever mapping is required. Based on top of #5005 assuming that would merge soon. Fixes #5002. We would share more columns as we add other tables that would use them. Signed-off-by: Tim deBoer <git@tdeboer.ca>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirm that there is no change UI wise! Code LGTM.
It has come up a couple times so I thought I should make a proposal for how I think we should share column renderers between tables. IMHO we have three cases: 1. Type-specific column rendering like Image name. These should continue to be type-specific as today. 2. Generic columns that really just need to (e.g.) render a string in a certain way. 3. The middle ground where it's a little more complex, or maybe you need to render a couple properties. This commit adds a simple type-mapping function to directly support #2, and applies it to VolumeList. For the middle ground, I think we're going to have convenient cases where objects used in two tables have the same property types & names (e.g. { id: string, some-prop: number}) and we can just render those, and other cases where maybe the renderer should use another type (e.g. Condition) or one of the objects has a different property name. Again, this commit provides a simple way for tables to do whatever mapping is required. Based on top of #5005 assuming that would merge soon. Fixes #5002. We would share more columns as we add other tables that would use them. Signed-off-by: Tim deBoer <git@tdeboer.ca>
* feat: column type mapping It has come up a couple times so I thought I should make a proposal for how I think we should share column renderers between tables. IMHO we have three cases: 1. Type-specific column rendering like Image name. These should continue to be type-specific as today. 2. Generic columns that really just need to (e.g.) render a string in a certain way. 3. The middle ground where it's a little more complex, or maybe you need to render a couple properties. This commit adds a simple type-mapping function to directly support #2, and applies it to VolumeList. For the middle ground, I think we're going to have convenient cases where objects used in two tables have the same property types & names (e.g. { id: string, some-prop: number}) and we can just render those, and other cases where maybe the renderer should use another type (e.g. Condition) or one of the objects has a different property name. Again, this commit provides a simple way for tables to do whatever mapping is required. Based on top of #5005 assuming that would merge soon. Fixes #5002. We would share more columns as we add other tables that would use them. Signed-off-by: Tim deBoer <git@tdeboer.ca> * fix: generic render type Responding to PR feedback: - Changes SimpleColumn object type to string. - Uses a generic parameter default to provide typing to Column renderMapping. The second type parameter on Column defaults to the original type, but if you set it then the renderMapping must convert to that type. Signed-off-by: Tim deBoer <git@tdeboer.ca> * chore: use nullish coalescing Signed-off-by: Tim deBoer <git@tdeboer.ca> --------- Signed-off-by: Tim deBoer <git@tdeboer.ca>
What does this PR do?
Lint re-formatting makes it look like a big change, but it's just the addition of
Screenshot/screencast of this PR
N/A, no change.
What issues does this PR fix or reference?
Part of #4967.
How to test this PR?
yarn test:renderer
or try Volumes page to confirm no change.