Repository navigation
[Improvement]: [Redirects] Allow redirect targets to be data objects or assets - #4269
Open
dolmit-tanel-paaro wants to merge 10 commits into
Open
dolmit-tanel-paaro wants to merge 10 commits into
dolmit-tanel-paaro wants to merge 10 commits into
Conversation
Adds a target type column to the redirects grid and a target type field to the beginner modal, and sends the type along when an element is dropped onto the target cell, so the Studio API can resolve the target as a document, an asset or a data object (pimcore/pimcore#18293). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The beginner flow creates plain path/URL redirects, where a target type has nothing to attach to and is cleared again by the server - so the field looked broken on almost every use. Element targets are set in the grid instead, where dropping an element fills in the type. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Typing into the target cell reset the type to null, which discarded an explicit choice the user had just made in the target type column. The server already clears the type when the target does not resolve to an element. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sending the row's current type restricted the lookup to that type, so typing an asset or object path into a cell that was set to Document never resolved. The server now detects the type when none is sent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Delayed update responses can overwrite newer row edits, leaving stale values that subsequent saves may persist.
1 open issue
What changed in this PR
Verdict: Needs changes. This PR exposes asset and data-object redirect targets in Studio’s redirects grid, complementing the linked core and backend changes.
Changes:
- Adds an editable Target Type column and supports dropping all three element types.
- Sends target types to the API and applies server-resolved values to grid rows.
- Extends API types and adds labels across nine locales.
The changes sit within the redirects module. Backend compatibility depends on the companion releases; no regression tests or documentation changes are included in the reviewed files.
| File | Description |
|---|---|
| translations/studio.sv.yaml | Adds Swedish target-type labels. |
| translations/studio.pl.yaml | Adds Polish target-type labels. |
| translations/studio.no.yaml | Adds Norwegian target-type labels. |
| translations/studio.nl.yaml | Adds Dutch target-type labels. |
| translations/studio.it.yaml | Adds Italian target-type labels. |
| translations/studio.fr.yaml | Adds French target-type labels. |
| translations/studio.es.yaml | Adds Spanish target-type labels. |
| translations/studio.en.yaml | Adds English target-type labels. |
| translations/studio.de.yaml | Adds German target-type labels. |
| assets/js/src/core/modules/redirects/table/table.tsx | Adds target-type editing, expanded drops, and response synchronization. |
| assets/js/src/core/modules/redirects/seo-api-slice.gen.ts | Adds target types to API contracts. |
| assets/js/src/core/modules/redirects/redirects-container.tsx | Initializes new rows without a target type. |
| assets/js/src/core/modules/redirects/hooks/use-redirects.tsx | Sends target types and returns updated server data. |
| assets/js/src/core/modules/redirects/hooks/use-redirect-options.ts | Supplies translated target-type options. |
Review effort: Balanced
A redirect to a plain URL carries targetType: null, which the published enum did not allow, so the backend schema now lists null among its values. Spec and slice are regenerated output, not hand-edited. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two quick edits to one row could end with the grid showing the older value: the response to the first edit arrived last and replaced the row. A per-row submission counter makes a response apply only while it is still the newest one. Also regenerates the API client for the reordered targetType property. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dolmit-tanel-paaro
marked this pull request as ready for review
October 27, 2026 06:52
pimcore-deployments
marked this pull request as draft
October 27, 2026 06:52
dolmit-tanel-paaro
marked this pull request as ready for review
October 27, 2026 07:07
pimcore-deployments
marked this pull request as draft
October 27, 2026 07:07
Keeps the nesting inside onUpdateCellData within the limit, and makes the replacement a plain function of (rows, rowId, next). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dolmit-tanel-paaro
marked this pull request as ready for review
October 27, 2026 07:27
ValeriaMaltseva
requested review from
ValeriaMaltseva
and
a balanced review from Copilot
October 27, 2026 08:51
ValeriaMaltseva
requested review from
robertSt7
and removed request for
ValeriaMaltseva
October 27, 2026 14:06
RTK Query returns a rejected mutation in result.error rather than throwing, so a rejected update only rolled the row back with no message - including the validation error the API now returns for a target type that resolves to no usable element. Mirrors createNewRedirect in the same hook. Co-Authored-By: Claude Opus 5 (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.




Changes in this pull request
Resolves pimcore/platform-version#707
Tracked in pimcore/pimcore#15398
Companion to pimcore/pimcore#18293 and pimcore/studio-backend-bundle#2155, which let a redirect target be a data object or an asset instead of always a document. Part of pimcore/pimcore#15398.
This is the UI half the maintainers asked for in pimcore/pimcore#18293 - without it the feature is not reachable for end users.
targetTypeadded to the generated API slice and todocs.jsonopenapi.json, matching the backend's generated schema byte for byte.Additional info
Requires pimcore/studio-backend-bundle#2155 (and pimcore/pimcore#18293 under it) - the column stays empty without the API field.
Deliberately not added to the beginner modal: that flow creates plain path/URL redirects, where there is no element for a type to describe, so the field cleared itself on almost every use.
Checked with
tsc --noEmit,eslint, and manually against a 2026.x instance with Studio: drag & drop of all three element types, manual entry, type detection, external URLs, and CSV export/import.