Uh oh!
There was an error while loading. Please reload this page.
Add support for Actions within plugins - #17
Conversation
…stration and triggering (#10) Co-authored-by: Alison Lai <alisonlai@alisonl01-sigma.local>
Co-authored-by: Alison Lai <alisonlai@alisonl01-sigma.local>
Co-authored-by: Alison Lai <alisonlai@alisonl01-sigma.local>
…#14) Co-authored-by: Alison Lai <alisonlai@alisonl01-sigma.local>
Co-authored-by: Alison Lai <alisonlai@alisonl01-sigma.local>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
** This PR requires a bit of cleanup before it is ready to be merged **
This PR adds support for plugins to trigger actions in workbooks and for workbook actions to call functions within a plugin using the notions of
action trigger(plugin -> workbook) andaction effect(workbook -> plugin).This PR adds the following config options:
action-trigger: This corresponds to an Action selectable within workbook UI by selecting a Plugin, navigating to the Actions sidebar, and adding an Action.action-effect: This corresponds to a new Action type within workbooks. This is selectable by selecting any Action in a workbook, and selectingTrigger plugin, then selected the configuredaction-effectIt adds the following functions:
triggerAction: This function, when called with the config object, will trigger all Actions configured in the workbook UI under the current plugin elementregisterEffect: This function registers a handler for when a certain Action, as configured in UI, is triggered.unregisterEffect: This function will remove any registration (done with the function just above) associated with the id passed in (considering moving this to be a return value ofregisterEffectabove)In addition, it adds the following react hooks:
useActionTrigger: This function returns a callback that triggers the action associated with the id passed inuseActionEffect: This function takes in the associated config item, and handles the unsubscribe on unmount