Skip to content

[discuss][uiActions] How to force specific action execution?  #72673

@Dosant

Description

@Dosant

Assuming we have:

  • Trigger1,
  • ActionA attached to Trigger1
  • ActionB attached to Trigger1

When app executes Trigger1, context menu popup is shown and user has to pick either ActionA or ActionB.
But assume for some cases app knows it wants to execute ActionA

What is the best way to implement this?

Some options I thought of:

  1. just execute Action1 directly without using a trigger? (is it a hack and uiActions shouldn't be used like this? Or is this fine?)
  2. Implement more specific trigger: "Trigger2" and attach only ActionA to it. Execute Trigger2
  3. Introduce concept of "default" action and allow to specify during trigger execution uiActions.exec(Trigger1, {useDefaultAction: true}), where it knowns default is ActionA

Probably related to #47468?

@streamich, @ppisljar, @stacey-gammon what is your take on it?


Real use case where this came up:

After adding nested triggers and actions I refactored explore underlying data to use Apply_filter_action. This enabled "explore underlying data" for Maps. Instead of disabling this functionality completely, I'd like to leave it. But there are advanced cases where this popup spoils the UX and, for now, I'd just like to not show that popup for some cases, but apply filter directly. (see Nathan's comment #71445 (comment))

But I am not sure what is the correct way to do it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:UIActionsUI actions. These are client side only, not related to the server side actions..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions