[MAGNOLIA-6669] Remove node via YAML decoration Created: 18/May/16  Updated: 30/Oct/17  Resolved: 30/Oct/17

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 5.4.6
Fix Version/s: None

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Obsolete Votes: 2
Labels: arch-review
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
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)
Epic Link: LD: Fundamental features

 Description   

It should be possible to remove a node with the YAML decoration feature.

Reason:
With YAML decoration a developer should be able to modify definitions brought in by other modules to achieve the definition that they requrire. Without this feature, they can only add properties.

For example, it is not currently possible to remove a field or tab from a dialog, or remove a page or a component from an availability.

Allowing to remove and re-add a node (override) would also enable removing specific properties which is not currently possible, but should eventually be supported.

See docs describing the current limitation: https://documentation.magnolia-cms.com/display/DOCS/Definition+Decoration#Definitiondecoration-Overridingpropertiesandchangingsubitems

To Specify:
What syntax should be used to remove nodes?

The syntax could use the concept of an override borrowed from JCR extends mechanism which removes all of the properties and subnodes of a node.
https://documentation.magnolia-cms.com/display/DOCS/Configuration+management#Configurationmanagement-Overriding

Validation: https://wiki.magnolia-cms.com/display/PMTEAM/Decoration+improvements+LDV



 Comments   
Comment by Christopher Zimmermann [ 22/Nov/16 ]

Note - Goal: the syntax should be the same for extends as for decoration.

TODO:

  • POC to remove nodes via decoration. (perhaps works the same as extends override.)
Comment by Christopher Zimmermann [ 19/Dec/16 ]

There was some concern about adding this feature, and examples where this would be necessary were requested.

Decoration is useful in both light modules and maven modules. It enables modules to change the configuration brought in by other modules. - in a non-destructive way that is automatically removed when the module is removed.
Some of the below use-cases could be done by modifying the JCR configuration directly. But its convenient to be able to do it via Decoration. And with light modules it’s only possible with decoration.
Another reason I feel this feature is important is that it makes it comprehensive - If a dev knows about "decoration" as a way to modify definitions in other modules - then it is a shame that they are blocked and can only add nodes or change properties.

Examples:
Modify a dialog provided by another module

  • Remove some fields. (ie simplify the mtk “page properties” dialog by removing “navigation title” and “window title”)
  • Remove an action and add a new one. (ie one that sends an email on save.)

Modify an app.

  • Remove roles assigned to a subapps permissions. (Ie remove travel-demo-tour-editor from dam app.)
  • Remove an action, because I am adding a different one.(Ie remove activation, add publication.)
  • Remove availability on an action - such as removing rules.
  • Remove a column from the tree / list view. (Usually because you want to add another one.)
  • Reordering columns in a tree or list view.

I am preparing a demo based on the travel demo. (Or based on another existing demo or templating kit.)

  • Remove some CSS or JS from the provided theme.
  • Remove some components from a templates availability, because I am supplying new ones with a new functionality.
Comment by Christopher Zimmermann [ 26/Jan/17 ]

Removing from backlog based on concerns from PD.

Comment by Christopher Zimmermann [ 30/Oct/17 ]

5.5.6 Introduced the ability to use an "!override" feature in YAML. To be consistant it is also available in decorations.

https://documentation.magnolia-cms.com/display/DOCS/YAML+inherit+and+include#YAMLinheritandinclude-YAMLoverride

https://documentation.magnolia-cms.com/display/DOCS/Definition+decoration#Definitiondecoration-Overridingpropertiesandchangingsubitems

Generated at Mon Feb 12 04:16:42 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.