[MAGNOLIA-7080] Decorators: Provide possibility to define the order/location of a new configuration item Created: 03/Jul/17 Updated: 05/Mar/21 |
|
| Status: | Accepted |
| Project: | Magnolia |
| Component/s: | configuration |
| Affects Version/s: | 5.5.4 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Christian Ringele | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 7 |
| Labels: | configuration, decoration, decorator | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Template: |
|
||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||
| Epic Link: | LD Backlog | ||||||||||||||||||||||||
| Description |
|
Use case: Generally: In extends it was solved to adding an empty sibling node before the configuration itself. On inputs of @Sasha explicit tags might be the best solution:
columns:
sample: !orderAfter='page'
Also we should think of wiping out/removing a node from the target configuration (comparable to the 'override=true' of extends) Reproduce:
subApps:
browser:
workbench:
contentViews:
tree:
columns:
page:
label: test before
sample:
class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition
propertyName: abstract
label: test
title:
label: test after
See the result in the print screen. |
| Comments |
| Comment by Roman Kovařík [ 25/Aug/17 ] |
| Comment by Christopher Zimmermann [ 17/Jul/18 ] |
|
This is a really common use case. Without support for ordering of decoration, in many cases decoration cannot be used. |
| Comment by Christopher Zimmermann [ 17/Jul/18 ] |
|
Another usecase: reordering fields in a dialog. (for content types) |
| Comment by Richard Gange [ 17/Jul/18 ] |
A lot of times this is handled by using the enabled property. For example, in JCR config we have this one /modules/pages/apps/pages/subApps/browser/workbench/contentViews/tree/columns/path@enabled. If we use something like "override" then that could be a problem when using extends. I would say it's best to leave the override together with extends otherwise we might end up seeing some unforeseen problems for older installations when they upgrade. Instead let's look to provide the enabled property on things we'd like to "turn off" with decorations.
We would also need orderBefore. But maybe a better solution is just to re-declare the nodes in the decoration in the order you would like to see them. So just use the node names. Kind of like the applauncher layout config.
|
| Comment by Christopher Zimmermann [ 23/Jul/18 ] |
|
See this fix for 5.7.1 https://jira.magnolia-cms.com/browse/MAGNOLIA-7343 This fixes the problem described by Christian in ticket description. It is what rgange suggests in the previous comment. It does not address all use-cases, but it is handy and may work for your case. Applying it to the example here, this works now - note the use of the "!override" directive:
columns: !override
page:
sample:
class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition
propertyName: abstract
label: test
title:
|
| Comment by Christopher Zimmermann [ 23/Jul/18 ] |
|
OK - based on the comments, I propose the following 3 new directives: Ordering last is the default condition. |