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

Consistent way of displaying numerical data/dates in table component #679

Closed
rosado opened this issue Nov 20, 2024 · 2 comments · Fixed by #739
Closed

Consistent way of displaying numerical data/dates in table component #679

rosado opened this issue Nov 20, 2024 · 2 comments · Fixed by #739
Assignees
Labels
bug Something isn't working

Comments

@rosado
Copy link
Collaborator

rosado commented Nov 20, 2024

What

Numerical and dates columns in tables should have govuk-table__cell--numeric class on them.

Why

govuk standard.

Background

As pointed out by @alextea in a comment

Can we any numerical or date columns use the govuk-table__cell--numeric class (George implemented this on the dataset table view)

We should put the appropriate class on numerical data and dates in our table component. Right now the use is inconsistent (e.g. putting the class on a cell vs. a column) and sometimes added to cells with non-number type (example, see the 'reference' column which contains data that looks like a number, but also alphanumerical strings).

@rosado rosado converted this from a draft issue Nov 20, 2024
@rosado rosado added the bug Something isn't working label Nov 20, 2024
@DilwoarH
Copy link
Contributor

DilwoarH commented Dec 3, 2024

Let's remove the govuk-table__cell--numeric class altogether. We do not control or enforce the type of data the user provides; therefore, we can never know if it will be a number or a string.

The GOVUK Design system documentation also suggests using this class only when comparing columns of numbers:

When comparing columns of numbers, align the numbers to the right in table cells.

ref: https://design-system.service.gov.uk/components/table/#numbers-in-a-table

What do you think @alextea?

@DilwoarH
Copy link
Contributor

DilwoarH commented Dec 3, 2024

Things that need to be done if we decide to remove the functionality:

  • Remove the use of the class
  • Remove the logic that works out if a column has a numeric value

@DilwoarH DilwoarH moved this from Tech-debt to Eng sprint backlog in Submit and update planning data service Dec 12, 2024
@DilwoarH DilwoarH moved this from Eng sprint backlog to In Development in Submit and update planning data service Dec 12, 2024
DilwoarH added a commit that referenced this issue Dec 12, 2024
This makes all columns consistent. The GOVUK Design system documentation also suggests using this class only when comparing columns of numbers:

When comparing columns of numbers, align the numbers to the right in table cells.

#679
@DilwoarH DilwoarH linked a pull request Dec 12, 2024 that will close this issue
11 tasks
DilwoarH added a commit that referenced this issue Dec 12, 2024
This makes all columns consistent. The GOVUK Design system documentation also suggests using this class only when comparing columns of numbers:

When comparing columns of numbers, align the numbers to the right in table cells.

#679
@DilwoarH DilwoarH moved this from In Development to Code review & QA in Submit and update planning data service Dec 13, 2024
@github-project-automation github-project-automation bot moved this from Code review & QA to Done in Submit and update planning data service Dec 16, 2024
@DilwoarH DilwoarH moved this from Done to Ready for release in Submit and update planning data service Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready for release
Development

Successfully merging a pull request may close this issue.

2 participants