Abp: Blazor: Entity Actions component

Created on 22 Sep 2020  路  1Comment  路  Source: abpframework/abp

We add actions to the DataGrid almost in all pages. It causes repeating code. We can create a component that we can simply add the actions column.

image

Features;

  • Allows to set a policy (permission) for each action and hide the action if no permission
  • If none of the action policies was granted, the column should be completely invisible
  • If only one action available (including non-authorized actions) then show a button, instead of dropdown.
  • Allow to set an action as "primary". In this case, the dropdown becomes a split button:
    image

Note that: We should allow to reuse the same dropdown everywhere, independent from the data grid as well as inside a data grid.

abp-framework effort-13 feature ui-blazor

Most helpful comment

@hikalkan Good suggestion.

I have another two on top of yours:

  • actions are often linked with some validation function that enable/disable it.
    For example:
    If we have two actions "Set as read", "Set as unread" and item(row) with "IsReaded" field with value set to true then first
    action is disabled and second is enabled. And vice versa.
    So, if we can inject some function into action that return true/false or better can set action's properties it will be very handfull.

  • if you create indepentent action component, please split it on ActionComponent and ActionService. It will be very usefull, because in that case we can use action service with more that one component. We can bind it to button collections for example.

    So, with other words: action service can be service as single point of truth for actions in it's collection of actions.
    Action component is only for visual presentation.

Regards

>All comments

@hikalkan Good suggestion.

I have another two on top of yours:

  • actions are often linked with some validation function that enable/disable it.
    For example:
    If we have two actions "Set as read", "Set as unread" and item(row) with "IsReaded" field with value set to true then first
    action is disabled and second is enabled. And vice versa.
    So, if we can inject some function into action that return true/false or better can set action's properties it will be very handfull.

  • if you create indepentent action component, please split it on ActionComponent and ActionService. It will be very usefull, because in that case we can use action service with more that one component. We can bind it to button collections for example.

    So, with other words: action service can be service as single point of truth for actions in it's collection of actions.
    Action component is only for visual presentation.

Regards

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zsanhong picture zsanhong  路  3Comments

hitaspdotnet picture hitaspdotnet  路  3Comments

Trojaner picture Trojaner  路  3Comments

vfabregat picture vfabregat  路  3Comments

wocar picture wocar  路  3Comments