Skip to content

fix: publish with schema - #1182

Merged
ThibaudDauce merged 20 commits into
mainfrom
fix/structured-publication-spreadsheet
Aug 11, 2026
Merged

fix: publish with schema#1182
ThibaudDauce merged 20 commits into
mainfrom
fix/structured-publication-spreadsheet

Conversation

@ThibaudDauce

@ThibaudDauce ThibaudDauce commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

SheetJS is only used for the binary formats. It can read CSV too, but it needs the
whole file in memory, where PapaParse streams it and never converts anything, which
both the announced 420 MB limit and identifiers like 01004 depend on. It is loaded
dynamically so its 2.4 MB are only fetched when a binary file is dropped.

Cells are read as the text the spreadsheet displays, which keeps dates and leading
zeros intact, except for numbers: the General format renders anything past eleven
digits as 8.69084E+12, so their raw value is used instead.
Replays datagouv/data.gouv.fr#2060 with the files it was reported with: the same
washing machine record as CSV (comma and semicolon), XLSX and ODS, against the real
durability, reparability and IRVE schemas.

The catalog, the schema definitions and Validata are stubbed, so a test states the
validation report it works against instead of discovering it, and the column counts
in the assertions are measured on the fixtures. Publishing with a schema is only
offered on behalf of an organization, so each test creates its own.
Searching compared raw strings, so « lave linge » missed « Lave-linge » and
« reparabilite » missed « réparabilité ». Query and schema are now normalized the same
way and compared word by word, and the name is searched along with the title and the
description so a pasted identifier such as etalab/schema-irve-statique finds its
schema. The publication wizard and the search filter share the one function.
The reload guard added to isCurrentStepValid also covered step 4, where save() empties
the form right after navigating there. The watchEffect then sent the user back to
step 1, making the final screen unreachable and clearing the dataset just created.
The guard now stops before the last step, which only reads newDataset — the same
bounding the classic wizard already applies.
A file sharing no column with the schema opened a dedicated screen instead of the
editor, which cost two refs, a computed, a render branch and a nextTick round trip.
The banner already says what is wrong and already offers to change the schema, so the
table is now always built — only its rows are dropped, since none of their columns
belongs to the schema.

The threshold was also a cliff: 227 unknown columns out of 228 loaded the table, 228
switched to a blocking screen. And the case the report describes is the partial one,
which never reached that screen.
Plural forms on the unknown columns message, which read '1 des 228 colonnes sont inconnues'. A punctuation-only query no longer matches the whole schema catalog. Arrow keys stop scrolling the page while moving through the listbox, which also fixes the support choices using the same composable. SchemaCard goes back to a div, since tabindex already made it focusable and a button may not hold headings and paragraphs. The active option now travels with its schema instead of being looked up again, two dead branches are gone, the error table no longer carries the DSFR bottom margin, and the wizard title comment says what is actually shared between steps: the path.

Adds the two missing tests: keyboard navigation of the listbox, and the banner shown when the schema itself cannot be fetched.
udata validates a resource's schema against its own catalog (core/dataset/models.py), so publishing with a made-up name failed with a 400 and the wizard stayed on step 3. The stub now carries the real identifiers, which the fixtures already are, and the version 'latest', always accepted. Also updates two assertions left behind by the new wording of the unknown columns message.
Comment thread components/Datasets/TabularEditor.client.vue Outdated
Comment thread components/Datasets/TabularEditor.client.vue Outdated

@nicolaskempf57 nicolaskempf57 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to also test a csv with a tab separator ?

@ThibaudDauce
ThibaudDauce merged commit 846ae0d into main Aug 11, 2026
11 checks passed
@ThibaudDauce
ThibaudDauce deleted the fix/structured-publication-spreadsheet branch August 11, 2026 12:17
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.

Formats de fichier non acceptés à l'import

2 participants