nova-detached-actions
nova-detached-actions copied to clipboard
Fix selected resources issue
Unfortunately, in this pull request, I did a lot of changes, but I hope that it will be approved despite of that. From redesigning the components architecture to improving the flow of loading of actions, and fixing multiple issues.
Redesign the component's architecture
- Rename the
ResourceDetail
nova-component intoResourceDetailView
to better express what kind of component it is. - Rename the
IndexActions
component intoActionButtonGroup
to transform it into a reusable component and better express what this component contains. - Rename the
InvisibleActions
component intoInvisibleActionsDropdown
to better express what kind of component it is. - Delete the
DetailActions
component and reuse theActionButtonGroup
instead of it.
Improvements
- Use the actions that came from the Nova parent's components, filtering them by
detachedAction
property and pass them toActionButtonGroup
andActionSelector
orDetailActionDropdown
components. This improvement will help us to be able to usecanSee
andcanRun
after a resource was selected. - Show standalone detached actions without selecting a resource.
Fixing issues
- Fix webpack mix alias issue.
- Keep actions in the initial order(remove
.reverse()
calling). - Fix selected resource issue, passing the Nova parent's
selectedResources
intoActionButtonGroup
. - Reload the listing or the detail page after the action was executed by using
@actionExecuted
directive.
ping @the-alichemist