Repository navigation
Conversation
…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>
🌐 Translations synced automaticallyThe key changes below were generated for all target languages, passed the Added (2):
ℹ️ 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. |
… 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>
There was a problem hiding this comment.
🟡 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
| classSelectOptionExport: { | ||
| providesTags: (_result, _error, args) => providingTags.SELECT_OPTION_DETAIL(args.id) | ||
| }, |
There was a problem hiding this comment.
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: { |
There was a problem hiding this comment.
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>
|




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:
ImportExportActionsView, configured with the select option endpoints.GET /class/select-option/{id}/exportand saves it under the name the response gives (select_option_<id>_export.json). A refused export is shown in Studio's error dialog.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.reloadas the Reload button and the import.assets/build/api/docs.jsonopenapi.json(nothing else in the file changes), andnpm run build-api-clientregeneratedclass-definition-slice.gen.tsfrom it.select-option.import.titleandselect-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,lintandbuild-app;npm run build-api-clientreproduces 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