Skip to content

[Feature] Export and import Select Options configurations - #4402

Open
sholzer wants to merge 10 commits into
2026.xfrom
claude/issue-1964-select-options-export-import
Open

sholzer wants to merge 10 commits into
2026.xfrom
claude/issue-1964-select-options-export-import

Conversation

@sholzer

@sholzer sholzer commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Changes in this pull request

Resolves #1964

Select Options configurations could not be exported or imported in Studio, so moving them from one system to another (for example from QA to production) meant re-entering them by hand. Class definitions, field collections, object bricks and classification stores already have export and import.

This builds on the export and import endpoints from pimcore/studio-backend-bundle#2261:

  • Toolbar: the editor of an open select option gets the same "More" dropdown next to Reload as class definitions, field collections and object bricks, with Export and Import. It is the shared ImportExportActionsView, configured with the select option endpoints.
  • Export fetches GET /class/select-option/{id}/export and saves it under the name the response gives (select_option_<id>_export.json). A refused export is shown in Studio's error dialog.
  • Import opens the shared import dialog and uploads the file to POST /class/select-option/{id}/import. The file replaces the configuration of the open select option and keeps its id. Afterwards a success message is shown, and the select option tree and the open editor are reloaded (unsaved edits in the form are replaced, as with Reload). A configuration that is not writeable is refused by the import endpoint and the dialog shows its error, as for class definitions, field collections and object bricks.
  • Form: saving reloads the editor through the same reload as the Reload button and the import.
  • API types: the two endpoints are added to assets/build/api/docs.jsonopenapi.json (nothing else in the file changes), and npm run build-api-client regenerated class-definition-slice.gen.ts from it.
  • Translations: two new keys, select-option.import.title and select-option.import.success, in English; the other languages come from the translation workflow.

For reviewers to weigh: merge pimcore/studio-backend-bundle#2261 first. Without it Export and Import end in a 404, and a schema refresh from a backend without pimcore/studio-backend-bundle#2261 would drop the two endpoints from the spec again.

Additional info

Tests:

  • select-option-import-export-actions.test.tsx: Export and Import sit behind the More menu and go to the open select option's endpoints; an import reports success and refreshes the tree and the editor.
  • select-option-form.test.tsx: an import and a save both reload the select option into the tree and the form; nothing changes when the reload finds nothing.

Verified: the full jest suite (562 suites, 4034 tests); check-types, lint and build-app; npm run build-api-client reproduces the committed generated files exactly.

Not verified: importing into a configuration that is not writeable (none was available). The build output is not part of this PR.

🤖 Generated with Claude Code

sholzer and others added 7 commits November 20, 2026 12:09
…PI client

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…n export and import

Co-Authored-By: Claude <noreply@anthropic.com>
…elect-options-export-import

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…r select options

Select options now render the same ImportExportActionsView as class
definitions, field collections, object bricks and classification stores:
Export and Import sit behind the toolbar's "More" dropdown, and export
fetches the file so a refused request shows Studio's error message
instead of navigating away. The shared view gets an optional
importDisabled prop so import stays unavailable for configurations
that cannot be saved.

Co-Authored-By: Claude <noreply@anthropic.com>
… the editor reload

- The shared import/export actions take an optional importDisabledReason,
  shown as a tooltip on the import. Select options pass
  "config_not_writeable", as Save and Delete do.
- The form's save handler calls reload instead of a copy of it; a form
  test covers the reload after an import and after a save.
- The actions wrapper takes onImported, like the shared view.
- The non-English locales are left to the translation workflow.

Co-Authored-By: Claude <noreply@anthropic.com>
@pimcore-deployments

Copy link
Copy Markdown
Collaborator

🌐 Translations synced automatically

The key changes below were generated for all target languages, passed the
mechanical validation gate (key parity, order, placeholders, types, plurals),
and are being committed to this branch by the workflow (check the run status
if the commit is not visible).
Please review the generated translations.

Added (2):

  • select-option.import.title
  • select-option.import.success

ℹ️ Pre-existing translation errors (not from this PR)

32 validation error(s) predating this PR are still present. They are not blocking it and PR runs do not repair them; clearing them needs a dedicated PR.

sholzer and others added 2 commits November 26, 2026 13:19
… options

Select options use ImportExportActionsView as the other definition
screens do, without a disabled state for the import: a configuration
that cannot be saved is refused by the import endpoint, whose error the
import dialog shows.

Co-Authored-By: Claude <noreply@anthropic.com>

Copilot AI 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.

🟡 Changes recommended

The new SDK import and export hooks mishandle file data: imports JSON-serialize the Blob instead of using multipart upload, while exports return parsed JSON rather than the promised Blob, breaking both workflows.

2 open issues
What changed in this PR

Adds Select Options export and import to Studio, enabling configuration migration between environments through the shared import/export interface and addressing #1964.

Changes:

  • Adds Export and Import to the editor’s More menu and shares reload logic across import, save, and manual reload.
  • Exposes generated SDK hooks with cache-tag enhancements.
  • Adds focused component tests and import translations in nine languages.

Requires pimcore/studio-backend-bundle#2261 to be merged and deployed first. Tests were not run during this review.

File Description
translations/​studio.sv.yaml Adds Swedish import messages.
translations/​studio.pl.yaml Adds Polish import messages.
translations/​studio.no.yaml Adds Norwegian import messages.
translations/​studio.nl.yaml Adds Dutch import messages.
translations/​studio.it.yaml Adds Italian import messages.
translations/​studio.fr.yaml Adds French import messages.
translations/​studio.es.yaml Adds Spanish import messages.
translations/​studio.en.yaml Adds English import messages.
translations/​studio.de.yaml Adds German import messages.
assets/​js/​src/​core/​modules/​select-option/​components/​detail/​select-option-import-export-actions.tsx Configures shared actions for Select Options endpoints.
assets/​js/​src/​core/​modules/​select-option/​components/​detail/​select-option-import-export-actions.test.tsx Tests action wiring, URLs, and import callbacks.
assets/​js/​src/​core/​modules/​select-option/​components/​detail/​select-option-form.tsx Adds toolbar actions and centralizes editor reload.
assets/​js/​src/​core/​modules/​select-option/​components/​detail/​select-option-form.test.tsx Tests reload after import and save.
assets/​js/​src/​core/​modules/​class-definition/​class-definition-slice.gen.ts Adds generated endpoints, types, and hooks.
assets/​js/​src/​core/​modules/​class-definition/​class-definition-slice-enhanced.ts Adds cache tags and exports the new hooks.

Review effort: Balanced

Comment on lines +297 to +299
classSelectOptionExport: {
providesTags: (_result, _error, args) => providingTags.SELECT_OPTION_DETAIL(args.id)
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in 4b89562. Export and Import in the UI run through the shared ImportExportActionsView (a fetch for the download, the import dialog's upload), so these hooks were unused. The PR no longer exports them or adds cache tags for them; the generated endpoints stay as generated.

classSelectOptionExport: {
providesTags: (_result, _error, args) => providingTags.SELECT_OPTION_DETAIL(args.id)
},
classSelectOptionImport: {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in 4b89562. Export and Import in the UI run through the shared ImportExportActionsView (a fetch for the download, the import dialog's upload), so these hooks were unused. The PR no longer exports them or adds cache tags for them; the generated endpoints stay as generated.

Export and import run through the shared ImportExportActionsView, so
the generated endpoints need no hooks or cache tags of their own. As
generated they read the export as JSON and send the import file as
JSON, so the SDK should not offer them.

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@sholzer
sholzer requested a review from vin0401 November 26, 2026 14:30
@sholzer sholzer added this to the 2026.4.0 milestone Nov 26, 2026
@sholzer
sholzer marked this pull request as ready for review November 26, 2026 14:30
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.

Export function for Select Options

3 participants