[MGNLUI-3576] Provide validatable callback action for both dialogs and forms Created: 11/Sep/15  Updated: 29/Sep/15  Resolved: 17/Sep/15

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.4.2
Fix Version/s: 5.4.3

Type: New Feature Priority: Major
Reporter: Aleksandr Pchelintcev Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 2d
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLRES-186 Add create and delete actions for res... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:
Sprint: Basel 11
Story Points: 1

 Description   

The action would be nice to have since on its basis it would be quite easy to set up editing result handling actions.
Currently we have two almost identical callback action impls residing in ui-dialog/ui-form modules with impls hard to extend and re-use.
Proposal is to add a EditorCallbackAction to ui-framework module which would be usable in both dialogs and forms.

A bit more details could be found in a linked wiki-page.



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

To me the only reason why we would perform validation in a callback / callback action, is if we happen to perform sensitive logic there (which it is not designed for).
A callback such as the EditorCallback is intended for reacting once the editor has been terminated, e.g. firing ContentChangeEvent, sending a UI notification.
In resources, this callback has been hijacked to perform resource path creation and saving, instead of doing this in a proper SaveDialogAction. Obviously there may have been limitations that led to that, so let's try to uncover those.

Comment by Mikaël Geljić [ 28/Sep/15 ]

First several observations:

  • CallbackFormAction is never used
    • besides its test class (provides a TestEditorCallback instead of mocking properly)
  • All usages of CallbackDialogActionDefinition are configured as commit action only
    • cancel generally remains the default one: CancelDialogActionDefinition
  • actionName is actually never used in most EditorCallback implementations

Here's what we do now:

  1. Regardless, there is nothing form/dialog-related in those actions/definitions, so we rename it to EditorCallbackAction and deprecate the old ones.
  2. We provide optional validation (configurable, false by default)
  3. We adjust usages of deprecated classes/test-classes *in code*

And what we don't do now:

  1. update inheritance of ChooseDialogActionDefinition (would need to rework ui-form/dialog/framework modules inter-dependencies first)
  2. upgrade existing configured CallbackDialogActionDefinitions.

Both choose-dialogs and callbacks will eventually receive improvements at some point so we don't try to capture that here.

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