Repository navigation
feat(client): import and export the catalogue as JSON - #421
Open
mbarrenechea wants to merge 3 commits into
Open
mbarrenechea wants to merge 3 commits into
mbarrenechea wants to merge 3 commits into
Conversation
Topics, subtopics and indicators get the import-export plugin, so entries prepared in staging can be loaded into production from a file. The catalogue is now created only by import: catalogueAccess.create refuses anything but a catalogue import, which also hides Create New, and the auto-increment hook is gone, so every row names its own Content Code. JSON only, both ways. The plugin rebuilds CSV rows by splitting column names on `_`, which tears description_short apart, and a resource block has no flat shape. A before hook prepares each batch: values with no locale go to en, every localized map leads with en (the plugin otherwise writes the first locale it finds into the English slot), translated legend labels inside a resource become per-locale copies, and relationships exported at depth 1 are read back as Content Codes. Rows missing a Content Code or _status, missing en on create, or leaving a required field empty in a locale they write are flagged and then failed at write time, so they show up as per-row issues instead of being logged and counted as imported. The import marker rides on req.context, which only works with disableJobsQueue: true. Imports and exports are now admin-only. Refs: AM-739
The plugin's "Fields to export" preselects the list view's columns, so an untouched indicators export held id, name, subtopic and _status and could not be imported back whole. The picker now preselects every field for topics, subtopics and indicators; it can still be narrowed by hand. Users keep the plugin's default. Refs: AM-739
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rowErrors splits into textErrors and requiredErrors (complexity 27 to under 15), children drops its nested ternary, and the stored-row lookup keys on normaliseId(row.id) instead of String(row.id). Error order and messages are unchanged. Refs: AM-739
|
mbarrenechea
marked this pull request as ready for review
October 8, 2026 07:13
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Topics, subtopics and indicators can now be exported and imported as JSON from the admin, so entries prepared in staging can be loaded into production from a file. Exports preselect every field, so an untouched export can be imported back whole. Imports and exports are admin-only, and JSON is the only format, because the plugin's CSV round-trip splits column names on
_and tearsdescription_shortapart.The decision to push on: the catalogue can now be created only by import.
catalogueAccess.createrefuses everything else, which hides Create New, and the auto-increment hook is gone, so every row has to carry its own Content Code. The import marker rides onreq.context, which only works withdisableJobsQueue: true, so imports run inline in the request rather than as queued jobs.Testing
_statusand English values: it is created with that Content Code and links to its subtopic