phac-nml / irida

Canada’s Integrated Rapid Infectious Disease Analysis Platform for Genomic Epidemiology
https://irida.ca
Apache License 2.0
40 stars 31 forks source link

Order of columns in metadata table is not properly loaded from the templates #1478

Closed apetkau closed 1 year ago

apetkau commented 1 year ago

Describe the bug

The order of metadata columns in a metadata table is not preserved when saving metadata templates. This is a feature that is described in our documentation (https://phac-nml.github.io/irida-documentation/user/user/sample-metadata/#saving-column-order-and-visible-metadata), but no longer seems to work.

Steps to reproduce the problem

  1. Re-order metadata columns and save a metadata template. For example, here I move staramr/mlst-scheme/0.3.0 to the front of the columns displayed in the table (after the dates). When saving the template, this order is reflected in the list of visible columns to the right. That is, both locations where the column order is shown are consistent. image
  2. Click off and back on the metadata page and re-load the template. Now, staramr/gene/0.3.0 is in the front of the columns displayed in the table, even though staramr/mlst-scheme/0.3.0 remains at the top of the list of visible columns to the right. That is, there is an inconsistency in the order of the columns shown. image.

Expected behaviour

I expected the column order displayed in the metadata table to be preserved when reloading a metadata template.

Additional context

None.

apetkau commented 1 year ago

One additional comment is that it's possible that the metadata table is configured to order columns alphabetically by default (and so ignore the order of the columns saved in the metadata template).

This also works correctly in IRIDA 20.01 (and possibly later versions, I haven't tested).