You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Summary

actionbar - enabled/disabled visible/hidden

based on selected node/item (not all actions operate on a node/item)

based on roles

 

Availability

Problem

The action bar can take several states within one sub-app.

  • In page editor, some actions are displayed or hidden according to the type of selection (page, area, optional area, component)
  • This is currently handled in a dirty way:
    • The action bar provides an API for showing/hiding a whole section
    • Therefore the page editor sub-app defines 7 different sections, which mostly hold similar groups, and sometimes even similar (i.e. duplicated) action definitions.
  • Sometimes the context sensitivity is only represented by enabling/disabling one or several actions
    • Each sub-app has to reimplement the itemSelected listener to control proper enablement of actions
    • Basic conditional enablement is not ensured, nor is it configurable
    • One cannot easily control which actions are available (visible/enabled) based on parameters out of configuration (roles, instance)
  • Conditional enablement of actions has already caused many issues before alpha1

Proposal

  • Action bar definition should define two things:
    • the structure: sections, groups, and all possible actions in these groups, in one single place. This ensures proper ordering of actions at all time
    • the states that describe e.g. the section titles, the set of actions displayed, and potential substates. This mechanism should allow for additive composition of states (think of the use case for an optional AND editable area in page editor)
  • Implementing context sensitivity then only means to configure these states properly and toggle between them.
  • (warning)It is likely that context sensitivity is not handled at all at the action bar level, but rather straight on the actions.
    • If so, the action bar definition is reduced to its sole structure.
    • Edge case (page editor): do we provide a way to configure context-sensitive section titles?

Decision

-

 

Access Control

 

Configuration Proposal

Given the base path /modules/foo-app-bar/apps/bar/subApps/browser/

Node nameValue
  • actions
-
    • addBar
-
    • addCocktail
-
    • editBar

-

      • class
info.magnolia.ui.admincentral.action.EditDialogActionDefinition
      • dialogName
foo-app-bar:bars
      • i18nBasename
foo.bar.actions.edit
      • icon
icon-edit
      • label
Edit
      • nodeType
foo:bar
    • editCocktail
-
      • extends
../editBar
      • implementationClass
org.foo.app.bar.action.EditCocktailAction
      • nodeType
foo:cocktail
    • delete
-
      • class
info.magnolia.ui.admincentral.action.DeleteItemActionDefinition
      • icon
icon-trash
      • label
Delete item
      • visible
-
        • voters
-
          • role
-
            • allow
-
              • 0
admin
              • 1
editor
            • class
info.magnolia...RoleVoter
          • type
-
            • allow
-
              • 0
foo:bar
            • deny
-
              • 0
foo:readonlybar
            • class
info.magnolia.ui...WorkbenchSelectionTypeVoter
          • instance
-
            • allow
-
              • 0
magnoliaAuthor
            • class
info.magnolia...SystemInstanceVoter
          • op
AND
      • disabled
-
        • voters
-
          • multiselect
-
            • class
info.magnolia.ui...WorkbenchMultipleSelectionVoter
          • nullselect
-
            • class
info.magnolia.ui...WorkbenchNullSelectionVoter
          • rootselect
-
            • class
info.magnolia.ui...WorkbenchRootSelectionVoter
          • op
OR

(lightbulb) Proposal: implement context sensitivity here, on actions. This is conceptually close to template definitions availability

  • An option is to use voters for both visibility and disablement of an action (see delete action).
  • We may then consider a default configuration for content subApps

 

 

  • No labels