[MGNLUI-6878] Can't add custom actions to dialogs Created: 20/Sep/21  Updated: 22/Oct/21  Resolved: 13/Oct/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.11
Fix Version/s: 6.2.13

Type: Bug Priority: Blocker
Reporter: Roberto Gaona Assignee: Adam Siska
Resolution: Fixed Votes: 0
Labels: VN-Testing, cs-bk, maintenance, ui-team-support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
is cloned by MGNLDAM-993 CLONE - Can't add custom actions to d... Closed
Problem/Incident
Relates
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Date of First Response:
Sprint: UI FW 38, UI FW 39
Story Points: 5

 Description   

Steps to reproduce

  1.  Create an Action which extends from a class other than CancelDialogAction or SaveDialogAction (both deprecated)
  2.  Add such action to a dialog on the PostCreate method (as stated on the documentation)

Expected results

The action appears at the bottom of the dialog.

Actual results

If the action doesn't extend from SaveDialogAction or CancelDialogAction, no action appears.

Workaround

Development notes

An option would be to expose ACTION_CONVERTERS same way as FIELD_DEFINITION_CONVERTERS.



 Comments   
Comment by Mikaël Geljić [ 21/Sep/21 ]

ActionDefinitions don't have a new base class in 6 UI Framework vs. Magnolia 5, so there's no easy way to ignore only UI 5 actions.
No luck either looking at their implementationClass: there's only one shared AbstractAction. Concrete implementations may inject JCR "adapters" (the deprecated way), or ValueContext (the new way).

I was thinking about two ways: reject the action only if it's marked as @MgnlDeprecated (annotation retention is runtime, but is unfortunately not @Inherited).

The other way would be to extract a static map, like we have for FIELD_DEFINITION_CONVERTERS, but for action definitions. We already have a note about that in Blossom docs:

  • Custom fields require an extra field converter, along with the updated Vaadin 8 field implementation. These may be registered into the DefinitionConverter#FIELD_DEFINITION_CONVERTERS within a static initializer block.

via https://docs.magnolia-cms.com/product-docs/6.2/Modules/List-of-modules/Blossom-module.html#_updating_to_magnolia_6_2

Moving to MGNLUI.

Comment by Adam Siska [ 13/Oct/21 ]

For RN: Custom commit actions for dialogs are supported in M5 compatibility layer.

Generated at Mon Feb 12 09:40:54 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.