Skip to content

[DataTable] One object per column for value, display and format - #11252

Closed
HenriRabalais wants to merge 4 commits into
aces:mainfrom
HenriRabalais:2026-10-14_datatable-column-objects
Closed

HenriRabalais wants to merge 4 commits into
aces:mainfrom
HenriRabalais:2026-10-14_datatable-column-objects

Conversation

@HenriRabalais

@HenriRabalais HenriRabalais commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

DataTable fields can now define their own cells. A field takes value, display and format functions that read off the row's record: value is what filtering matches against, display is the text the CSV and sorting use, and format is what the cell shows, falling back to display. DataTable wraps the <td>.

A field without these goes through getFormattedCell and getMappedCell as before, so the other modules are unchanged.

All four biobank tables use the new fields. Each column is defined in one place, and candidates are found through a lookup by PSCID built once per render instead of a search for each cell.

Changes

  • Added value, display and format to DataTable fields.
  • Added the new field properties to DataTable.d.ts.
  • Converted the biobank specimen and pool tabs.
  • Converted the biobank container and shipment tabs.
  • The specimen Visit Label filter matches the visit label, not the session ID.
  • Sex and Diagnosis show on the specimen tab.
  • Specimen attribute columns stay aligned when a specimen has no data for a process.
  • Select columns such as Type, Status and Site sort by their label.

Testing Instructions

  1. Go to Biobank and open the Specimen tab.
  2. Type a visit label into the Visit Label filter and check that the matching specimens show.
  3. Try the other filters, then sort by Type and by Status.
  4. Click a PSCID and a Visit Label, and check that each link goes to the right page.
  5. Download the CSV and check that it has labels rather than IDs.
  6. Open the Pool tab, click Aliquot on a pool, and check that the form opens for that pool.
  7. Open Access Profile and check that the table, filters and CSV work as before.

Related Issues

Resolves #11251

This touches the same render loop as #10285, so whichever merges second will need a rebase.

@HenriRabalais HenriRabalais added Category: Refactor PR or issue that aims to improve the existing code Area: UI PR or issue related to the user interface Language: Javascript PR or issue that update Javascript code Module: biobank PR or issue related to biobank module labels Oct 14, 2026
@HenriRabalais HenriRabalais self-assigned this Oct 14, 2026
@MaximeBICMTL

MaximeBICMTL commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

If we are to refactor this component so much, could it also be converted to Typescript? I can volunteer for review.

@HenriRabalais

Copy link
Copy Markdown
Collaborator Author

@MaximeBICMTL thanks, and appreciate the offer! I think the TypeScript conversion is its own PR though, since it's separate from the column change here. To me it feels like an entirely new set of work.

@HenriRabalais

Copy link
Copy Markdown
Collaborator Author

closing this in favour of #11277, which takes the same column objects into a new component as suggested on #11251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: UI PR or issue related to the user interface Category: Refactor PR or issue that aims to improve the existing code Language: Javascript PR or issue that update Javascript code Module: biobank PR or issue related to biobank module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DataTable] One object per column for value, display and format

2 participants