[MGNLUI-4058] Dialogs have Cancel and Save actions when no actions are specified Created: 27/Oct/16  Updated: 06/Dec/19  Resolved: 17/Apr/19

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

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MGNLUI-4022 Move dialog actions from ui-admincent... Closed
depends upon MAGNOLIA-6790 Implement changing all properties wit... Closed
documentation
to be documented by MGNLUI-5215 DOC: Dialogs have 'commit' and 'cance... Closed
supersession
supersedes MGNLUI-3883 Dialogs have Cancel and Save Changes ... Closed
supersedes MAGNOLIA-6456 Dialogs should have a default actions... Closed
is superseded by MGNLUI-4552 Form action support Closed
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)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: LD: Simple dialog config

 Description   

If a template dialog does not supply an actions node in its definition, then the Cancel and Save Changes actions should be provided by default.
If a dialog does supply an actions node - then only the actions specified should be provided.

Reason: These same actions are used in most dialogs. It is extra effort for developers to always supply them in dialogs, it is something that they can make mistakes with, and it feels like "boilerplate" that must always be added. Evaluators will have a better impression if these same actions are not specified in every dialog definition.

The part of the definition that should be optional:

actions:
  commit:
    class: info.magnolia.ui.admincentral.dialog.action.SaveDialogActionDefinition
  cancel:
    class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition

A dev should not have to supply a specific class - this should work with the existing Dialog class.

Validation: https://wiki.magnolia-cms.com/display/PMTEAM/Simplified+Dialogs+LDV



 Comments   
Comment by Christopher Zimmermann [ 27/Oct/16 ]

Some comments from apchelintcev from the Cloned ticket: I agree with czimmermann's concerns about the solution. Regarding backwards compatibility - we only seem to have case jeopardised - when for some reason the user would opt for a dialog without any actions configured (now they'll suddenly have two actions out of the box).

Such scenario though is not very likely to happen and in my opinion can be sacrificed in favour of a more convenient solution from the UX point of view, i.e. having actions pre-configured by default without a need of specifying any special definition class.

Regarding how we would want to provide those action defs - I see the several ways:

  • directly add those in the definition c-tor (like DefaultActionsDialogDefinition does atm, but directly in CfgdFormDialogDefinition)
  • make the dialog presenter check action set for emptiness and pre-configure the actions if needed
  • employ definition decorators (needs additional research and possibly improving of decoration capabilities)

Which approach to choose is not very clear, first two seem to deliver similar results with similar limitations, third one needs additional research.

Comment by Christopher Zimmermann [ 22/Nov/16 ]

Blocked. Reconsider as part of the content pool story.

TODO:

  • Conceptual work to see if we can solve this generically. (Related: apps, action bar. site template prototype)
  • POC 1: Intelligent builder factory
  • POC 2: Can decoration be used

Also TODO:

  • Consider how to handle existing dialogs, when this feature is introduced. If someone had a dialog with intentionally no actions defined (unlikely, but possible), then introducing this feature would cause SAVE and CANCEL actions to be added.
Comment by Roman Kovařík [ 17/Apr/19 ]

The feature was integrated to new ui-framework.
Will be available for template dialogs when pages as is migrated, see PAGES-178.

Comment by Christopher Zimmermann [ 24/Oct/19 ]

It is finally actually integrated here in 6.2: PAGES-194

woot!

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