Adding workflow management
I
This commit is contained in:
22
src/components/workflows/commands.py
Normal file
22
src/components/workflows/commands.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from components.BaseCommandManager import BaseCommandManager
|
||||
from components.workflows.constants import Routes, ROUTE_ROOT
|
||||
|
||||
|
||||
class WorkflowsCommandManager(BaseCommandManager):
|
||||
def __init__(self, owner):
|
||||
super().__init__(owner)
|
||||
|
||||
def request_add_workflow(self):
|
||||
return {
|
||||
"hx-get": f"{ROUTE_ROOT}{Routes.AddWorkflow}",
|
||||
"hx-target": f"#{self._owner.tabs_manager.get_id()}",
|
||||
"hx-swap": "outerHTML",
|
||||
"hx-vals": f'{{"_id": "{self._id}"}}',
|
||||
}
|
||||
|
||||
def add_workflow(self, tab_id: str):
|
||||
return {
|
||||
"hx-post": f"{ROUTE_ROOT}{Routes.AddWorkflow}",
|
||||
"hx-target": f"#w_{self._id}",
|
||||
"hx-vals": f'js:{{"_id": "{self._id}", "tab_id": "{tab_id}", "tab_boundaries": getTabContentBoundaries("{self._owner.tabs_manager.get_id()}")}}',
|
||||
}
|
||||
Reference in New Issue
Block a user