[DRAFT WIP] innovation typed table block #5200
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary (required)
Partially addresses issue #4258. We cannot control column widths in the Wagtail
table_block
widget that is used to create the table in the example in the issue (audit documents table). This innovation sprint draft PR customizes the new Wagtailtyped_table_block
to allow users to choose certain preset table column percentage widths. I am not sure how useful this would be in its present form.In regards to the undesirable column width distribution of the table in the example (audit documents table), One way we could solve this by creating another custom table block (not using typed_table_block) that allows the editor to choose to set the table width with a CSS class to
width: auto
. This makes the first column wider to accommodate the text like the "After" screenshot. Also see #4258 (comment)We should avoid setting
table-layout:auto
, overriding our global CSS setting oftable-layout: fixed
becausetable-layouot: fixed
is the more performant and auto might result in a Lighthouse performance audit hit ( Need to confirm this with a test). Also should do more research to determine if CSS width:auto (or unset) is a performance issue. Please note that the table html attributewidth=" "
is deprecated.Note: The failed build on this draft PR is just a FLAKE8 error on
blocks,py
that can be resolved easilyRequired reviewers
None yet as this is a draft PR
Impacted areas of the application
modified: fec/fec/settings/base.py
modified: fec/home/blocks.py
new file: fec/home/templates/blocks/typed_table_block.html
new migrations: Important note: There are a few migration files created while developing this, however if this was to be merged we should start with a fresh database dump locally and create a single migration for this.
Screenshots
Related PRs
Related PRs against other branches:
How to test
(Include any information that may be helpful to the reviewer(s). This might include links to sample pages to test or any local environmental setup that is unusual such as environment variable (never credentials), API version to point to, etc)
System architecture updates (if applicable)
(If this pull request changes our current system diagram, include a description of those changes here and create a new ticket to update the system diagram)