Skip to content

definition list for data dictionary view #8110

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

Merged
merged 12 commits into from
Mar 20, 2024

Conversation

wardi
Copy link
Contributor

@wardi wardi commented Mar 11, 2024

Fixes #8108

Proposed fixes:

Switch data dictionary from a table display to a definition list to allow additional information to be added for each field.

Current:

data-dictionary-table

New:

data-dictionary-dl

New with additional information per field:

data-dictionary-extra

Features:

  • includes tests covering changes
  • includes updated documentation
  • includes user-visible changes
  • includes API changes
  • includes bugfix for possible backport

@wardi wardi force-pushed the 8108-data-dictionary-preview branch from 7753765 to 2031711 Compare March 11, 2024 19:00
@wardi
Copy link
Contributor Author

wardi commented Mar 12, 2024

@smotornyuk here's the change with an accordion added that I think is an general improvement. I've added the type information to the header so it's visible even when not expanded. WDYT? (and am I using columns wrong for this? adding a class="row" around them breaks completely)

data-dictionary-accordion

@smotornyuk
Copy link
Member

Looks good. As for col* outside a row, strictly speaking, it's a violation. But, unless you want to write explicit styles or add a dozen extra classes to balance the position of elements, I'd leave col here.

By itself, col* class will not work and you should not rely on it outside of row. But this time it's working because your col* elements are direct descendants of accordion-button element, which shares some properties of row.
To put it simple, col* will work as direct descendant of any element with display:flex (accordion-button has this property). So whenever you are using col*, you can add d-flex class to its parent to make it work.

It's better not to rely on this behavior, because it's specific for Bootstrap v4 and v5 an may change in future. But we are going to update styles anyway, so we can tolerate this inconvenience.

The only thing that requires changes is -sm- part of the class. Use just col-*, i.e col-1 instead of col-sm-1 and the same for any -sm- part. -sm- classes are applied only to screens wider than 570px, so accordions may look worse on mobile. col- + number, without intermediate parts, is applied to any width so you'll have approximately the same appearance on any screen.

@wardi
Copy link
Contributor Author

wardi commented Mar 18, 2024

Thank you @smotornyuk . Here's a fix that updates those column classes and the accordion functionality from fields that have no data dictionary labels/descriptions/extra information.

Here the second field has no title/description/extra so it can't be clicked and has no arrow on the right:

data-dictionary-disabled-dropdown

@smotornyuk smotornyuk merged commit fae6879 into master Mar 20, 2024
@smotornyuk smotornyuk deleted the 8108-data-dictionary-preview branch March 20, 2024 17:33
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.

Custom Data Dictionary preview
2 participants