You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current mechanism for defining actions (urls and links) is messy.
They're currently built by the vg based on which views are defined. This is inflexible; views should support multiple actions, different types of actions etc, and we're missing a way to add djagno admin-style lists actions.
Plan:
Remove from there and put on the views themselves as .actions
View.get_actions() should check for .actions otherwise build its own from .viewgroup
They're used to define which actions appear on the page.
List of Action classes, eg [IndexAction, CreateAction]
Action class can specify styling/icons and a URL (index, create). Appears at top.
ActionObject as Action, URL points at an object (update, delete). In item "sidebar"
ActionQuerySet class as Action, but URL takes multiple objects (delete). At top as dropdown.
ActionField as ActionObject but also takes a field
target for this feature: an inline approve toggler, eg a boolean. Would need some templates/text strings to give context, and some JS/htmx
Also accept a list of view names, eg ["index", "create"] which are turned into an Action
View.action - default action class for when used as a string.
Actions should have a way to declare a JS/API version; render()? examples:
approve/unapprove go ticking down a list etc
update inline
delete without leaving page
subclass ActionQuerySet to manage the dropdown action
and ActionField to hook into javascript for an Approve button
But does this complicate things unnecessarily?
View.as_action() could check .action and fall back to wrap Action/ActionObject by default, then View.get_actions() can have a list like ["change", "delete", ApproveAction] etc
The text was updated successfully, but these errors were encountered:
The current mechanism for defining actions (urls and links) is messy.
They're currently built by the vg based on which views are defined. This is inflexible; views should support multiple actions, different types of actions etc, and we're missing a way to add djagno admin-style lists actions.
Plan:
.actions
View.get_actions()
should check for .actions otherwise build its own from.viewgroup
[IndexAction, CreateAction]
ActionObject
asAction
, URL points at an object (update, delete). In item "sidebar"ActionQuerySet
class asAction
, but URL takes multiple objects (delete). At top as dropdown.ActionField
asActionObject
but also takes a field["index", "create"]
which are turned into anAction
View.action
- default action class for when used as a string.render()
? examples:ActionQuerySet
to manage the dropdown actionActionField
to hook into javascript for anApprove
buttonView.as_action()
could check.action
and fall back to wrapAction
/ActionObject
by default, thenView.get_actions()
can have a list like["change", "delete", ApproveAction]
etcThe text was updated successfully, but these errors were encountered: