Skip to content

[Studio] Reuse the resolver step and mapping dialog outside the importer's editor - #707

Open
markus-moser wants to merge 15 commits into
2026.xfrom
studio-reusable-mapping-steps
Open

markus-moser wants to merge 15 commits into
2026.xfrom
studio-reusable-mapping-steps

Conversation

@markus-moser

@markus-moser markus-moser commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • The mapping step, its preview hooks and the advanced mapping dialog read from a mapping source (React context) instead of a configuration name. The importer's own editor wraps its data setup tab in a stored-configuration source, so its requests are unchanged.
  • PostedMappingSource serves 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_dataImporterDataObject or plugin_datahub_admin), since the posted pipeline runs operators on posted rows without a configuration to check against. A preview refuses importAsset, which fetches files and creates folders even in a dry run.
  • ResolverStep, AdvancedMappingModal, PostedMappingSource and the two form converters are bound in Studio's container under DataImporter/Components/* and DataImporter/Utils/*. ResolverStep no longer takes the unused configName. The dialog loads the default class attributes itself when its host has none.
  • Tests: jest (a jsdom project next to the existing node one) for both sources, the mapping step and dialog on a posted source, the two endpoints' requests and the container bindings; unit tests for the posted and stored transformation previews.

🤖 Generated with Claude Code

Part of pimcore/product-management#1577

markus-moser and others added 5 commits October 1, 2026 12:30
…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>
@markus-moser markus-moser changed the title [Studio] Reuse the resolver and mapping steps outside the importer's editor [Studio] Reuse the resolver step and mapping dialog outside the importer's editor Oct 1, 2026
markus-moser and others added 7 commits October 1, 2026 12:28
…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>
@markus-moser
markus-moser marked this pull request as ready for review October 8, 2026 11:10
Copilot AI balanced review requested due to automatic review settings October 8, 2026 11:10

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.

🔵 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.

Comment thread src/Schema/TransformationResultParameters.php Outdated
Comment thread src/Schema/TransformationResultParameters.php Outdated
markus-moser and others added 3 commits October 8, 2026 13:32
… 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>
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

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.

2 participants