Repository navigation
[Studio] Reuse the resolver step and mapping dialog outside the importer's editor - #707
Open
markus-moser wants to merge 15 commits into
Open
markus-moser wants to merge 15 commits into
markus-moser wants to merge 15 commits into
Conversation
…editor The mapping step reads its source data from a mapping source instead of a stored configuration name. The importer's own editor passes the stored configuration; other bundles post their mapping and records and get the previews from two new endpoints. The steps and the form converters are bound in Studio's container so other bundles can host them in their own forms. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ing limits Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s in CI Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ping-steps Studio tests run on jest, as set up on 2026.x: the mapping source, step and dialog tests move next to their source and run in a jsdom project; vitest is dropped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ng pipelines A posted pipeline has no configuration permission grid, so the base Data Hub permission is not enough: it now takes admin, plugin_datahub_admin or the importer adapter permission, the same rule a stored importer falls back to. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The posted preview endpoint executes caller-controlled, network-capable operators and has unresolved request-contract and null-preservation defects.
3 open findings
What changed in this PR
Introduces reusable mapping sources so external Studio forms can host Data Importer mapping UI without stored configurations.
Changes:
- Adds stored/posted mapping-source contexts and migrates mapping previews to them.
- Adds posted-mapping preview/type endpoints and generated clients.
- Exposes components/converters through the Studio container and expands tests.
Review assessment:
- The abstraction is implemented at appropriate UI/service boundaries.
- Internal call sites appear migrated and the API additions are additive.
- Blocking concerns remain: posted pipelines can invoke network-capable operators (
TransformationService.php:147-152), required request fields are optional at runtime (TransformationResultParameters.php:37,44), and posted previews alter explicit nulls (posted-mapping-source.tsx:69). - OpenAPI documentation was added, but consumer integration documentation was not evident.
| File | Description |
|---|---|
| tests/unit/StoredMappingTransformationTest.php | Tests stored previews. |
| tests/unit/PostedMappingTransformationTest.php | Tests posted previews and permissions. |
| src/Utils/Constants/PermissionConstants.php | Adds adapter permission constant. |
| src/Service/Studio/TransformationServiceInterface.php | Adds posted-preview methods. |
| src/Service/Studio/TransformationService.php | Implements shared preview execution. |
| src/Schema/TransformationResultParameters.php | Defines posted-preview payload. |
| src/Resources/translations/studio_api_docs.en.yaml | Documents new endpoints. |
| src/Controller/Studio/Mapping/LoadTransformationResultController.php | Adds posted-result endpoint. |
| src/Controller/Studio/Mapping/CalculateTransformationResultTypeController.php | Adds posted-type endpoint. |
| assets/studio/package.json | Adds React testing dependencies. |
| assets/studio/package-lock.json | Locks testing dependencies. |
| assets/studio/js/test/support/studio-components.tsx | Provides component test stubs. |
| assets/studio/js/test/support/dom-environment.ts | Adds jsdom environment support. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/utils.ts | Adds federated utility mock. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/modules/widget-manager.ts | Adds widget-manager mock. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/modules/element.ts | Adds element mock. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/modules/application-logger.ts | Adds logger mock. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/modules/app.ts | Adds module app mock. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/index.ts | Adds bundle root mock. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/components.ts | Re-exports component stubs. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/app.ts | Adds app mock. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/api/class-definition.ts | Adds class-definition mock. |
| assets/studio/js/test/__mocks__/studio-ui-bundle/api.ts | Adds API mock. |
| assets/studio/js/test/__mocks__/data-hub/index.ts | Adds Data Hub mock. |
| assets/studio/js/src/modules/data-importer/mapping-endpoints.test.ts | Tests generated endpoint requests. |
| assets/studio/js/src/modules/data-importer/index.tsx | Registers reusable services. |
| assets/studio/js/src/modules/data-importer/data-importer-module.test.ts | Tests container bindings. |
| assets/studio/js/src/modules/data-importer/data-importer-api-slice.gen.ts | Adds generated endpoint clients. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/shared/use-preview-record-query.ts | Reads previews from context. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/resolver-step/resolver-step.tsx | Removes unused configuration prop. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/preview-import-step/preview-import-step.tsx | Uses contextual preview source. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/sources-panel/sources-panel.tsx | Removes configuration prop. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/mapping-step.tsx | Migrates mapping UI to source context. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/mapping-step.test.tsx | Tests posted-source mapping UI. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/mapping-item/mapping-item.tsx | Removes configuration propagation. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/mapping-item/mapping-item-with-filter.tsx | Simplifies mapping context use. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/mapping-item/mapping-item-with-filter.test.tsx | Tests mapping context forwarding. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/mapping-item-context.tsx | Removes configuration name. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/hooks/use-mapping-step-loader.tsx | Loads through mapping source. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-source/stored-config-mapping-source.tsx | Adapts stored endpoint queries. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-source/stored-config-mapping-source.test.tsx | Tests stored-source behavior. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-source/posted-mapping-source.tsx | Implements posted records source. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-source/posted-mapping-source.test.tsx | Tests posted-source behavior. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-source/mapping-source.ts | Defines source context contract. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/advanced-mapping-modal/step-source/step-source.tsx | Uses contextual previews. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/advanced-mapping-modal/result-preview/result-preview.tsx | Removes configuration forwarding. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/advanced-mapping-modal/result-preview/result-preview-context.tsx | Simplifies preview context. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/advanced-mapping-modal/preview-panel/preview-panel.tsx | Routes previews through source. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/advanced-mapping-modal/hooks/use-auto-recalculate-type.ts | Uses source request shape. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/advanced-mapping-modal/advanced-mapping-modal.tsx | Makes dialog source-agnostic. |
| assets/studio/js/src/modules/data-importer/components/tabs/steps/advanced-mapping-modal/advanced-mapping-modal.test.tsx | Tests posted-source dialog. |
| assets/studio/js/src/modules/data-importer/components/tabs/data-setup-tab.tsx | Wraps editor in stored source. |
| assets/studio/js/src/config/service-ids.ts | Adds external service IDs. |
| assets/studio/jest.config.ts | Splits Node and DOM test projects. |
| assets/studio/build/api/openapi-config.ts | Generates posted endpoint hooks. |
Files not reviewed (1)
- assets/studio/package-lock.json: Generated file
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
… as stored previews do Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…etch Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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.




Lets another bundle host the importer's resolver step and mapping dialog in its own form, on data that is not a stored import configuration.
PostedMappingSourceserves given columns and records and gets the transformation type and result previews from two new endpoints that take the posted mapping (POST /mapping/transformation-result-type,POST /mapping/transformation-result). They need the importer's permission (plugin_datahub_adapter_dataImporterDataObjectorplugin_datahub_admin), since the posted pipeline runs operators on posted rows without a configuration to check against. A preview refusesimportAsset, which fetches files and creates folders even in a dry run.ResolverStep,AdvancedMappingModal,PostedMappingSourceand the two form converters are bound in Studio's container underDataImporter/Components/*andDataImporter/Utils/*.ResolverStepno longer takes the unusedconfigName. The dialog loads the default class attributes itself when its host has none.🤖 Generated with Claude Code
Part of pimcore/product-management#1577