Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/src/baserow/contrib/automation/api/nodes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
from baserow.contrib.automation.workflows.exceptions import (
AutomationWorkflowDoesNotExist,
)
from baserow.contrib.automation.workflows.handler import AutomationWorkflowHandler
from baserow.contrib.automation.workflows.service import AutomationWorkflowService

AUTOMATION_NODES_TAG = "Automation nodes"
Expand Down Expand Up @@ -175,7 +176,7 @@ def post(self, request, data: Dict, workflow_id: int):
}
)
def get(self, request, workflow_id: int):
workflow = AutomationWorkflowService().get_workflow(request.user, workflow_id)
workflow = AutomationWorkflowHandler().get_workflow(workflow_id)

nodes = AutomationNodeService().get_nodes(request.user, workflow)

Expand Down
14 changes: 14 additions & 0 deletions backend/src/baserow/contrib/automation/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ def ready(self):

action_scope_registry.register(WorkflowActionScopeType())

from baserow.core.registries import permission_manager_type_registry

from .permission_manager import AllowIfTemplatePermissionManagerType

prev_manager = permission_manager_type_registry.get(
AllowIfTemplatePermissionManagerType.type
)
permission_manager_type_registry.unregister(
AllowIfTemplatePermissionManagerType.type
)
permission_manager_type_registry.register(
AllowIfTemplatePermissionManagerType(prev_manager)
)

automation_node_type_registry.register(LocalBaserowCreateRowNodeType())
automation_node_type_registry.register(LocalBaserowUpdateRowNodeType())
automation_node_type_registry.register(LocalBaserowDeleteRowNodeType())
Expand Down
31 changes: 31 additions & 0 deletions backend/src/baserow/contrib/automation/permission_manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from django.contrib.auth import get_user_model

from baserow.contrib.automation.nodes.operations import ListAutomationNodeOperationType
from baserow.contrib.automation.operations import ListAutomationWorkflowsOperationType
from baserow.core.permission_manager import (
AllowIfTemplatePermissionManagerType as CoreAllowIfTemplatePermissionManagerType,
)
from baserow.core.registries import PermissionManagerType

User = get_user_model()


class AllowIfTemplatePermissionManagerType(CoreAllowIfTemplatePermissionManagerType):
"""
Allows read operation on templates.
"""

AUTOMATION_OPERATION_ALLOWED_ON_TEMPLATES = [
ListAutomationWorkflowsOperationType.type,
ListAutomationNodeOperationType.type,
]

@property
def OPERATION_ALLOWED_ON_TEMPLATES(self):
return (
self.prev_manager_type.OPERATION_ALLOWED_ON_TEMPLATES
+ self.AUTOMATION_OPERATION_ALLOWED_ON_TEMPLATES
)

def __init__(self, prev_manager_type: PermissionManagerType):
self.prev_manager_type = prev_manager_type
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SerializedDict(IntegrationDict):

serializer_field_names = ["host", "port", "use_tls", "username", "password"]
allowed_fields = ["host", "port", "use_tls", "username", "password"]
sensitive_fields = ["username", "password"]
sensitive_fields = ["host", "port", "use_tls", "username", "password"]

request_serializer_field_names = ["host", "port", "use_tls", "username", "password"]
request_serializer_field_overrides = {}
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ def test_smtp_integration_export_serialized_exclude_sensitive(data_fixture):
expected_serialized = {
"id": AnyInt(),
"type": "smtp",
"host": "smtp.example.com",
"port": 587,
"use_tls": True,
"host": None,
"port": None,
"use_tls": None,
"username": None,
"password": None,
"name": "",
Expand Down
14 changes: 14 additions & 0 deletions backend/tests/baserow/core/test_basic_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ def test_get_permissions(data_fixture):
"dashboard.data_source.read",
"dashboard.list_data_sources",
"dashboard.data_source.dispatch",
"automation.list_workflows",
"automation.workflow.list_nodes",
],
"workspace_template_ids": [],
},
Expand Down Expand Up @@ -575,6 +577,8 @@ def test_get_permissions(data_fixture):
"dashboard.data_source.read",
"dashboard.list_data_sources",
"dashboard.data_source.dispatch",
"automation.list_workflows",
"automation.workflow.list_nodes",
],
"workspace_template_ids": [],
},
Expand Down Expand Up @@ -648,6 +652,8 @@ def test_get_permissions(data_fixture):
"dashboard.data_source.read",
"dashboard.list_data_sources",
"dashboard.data_source.dispatch",
"automation.list_workflows",
"automation.workflow.list_nodes",
],
"workspace_template_ids": [],
},
Expand Down Expand Up @@ -704,6 +710,8 @@ def test_get_permissions(data_fixture):
"dashboard.data_source.read",
"dashboard.list_data_sources",
"dashboard.data_source.dispatch",
"automation.list_workflows",
"automation.workflow.list_nodes",
],
"workspace_template_ids": [],
},
Expand Down Expand Up @@ -777,6 +785,8 @@ def test_get_permissions(data_fixture):
"dashboard.data_source.read",
"dashboard.list_data_sources",
"dashboard.data_source.dispatch",
"automation.list_workflows",
"automation.workflow.list_nodes",
],
"workspace_template_ids": [],
},
Expand Down Expand Up @@ -833,6 +843,8 @@ def test_get_permissions(data_fixture):
"dashboard.data_source.read",
"dashboard.list_data_sources",
"dashboard.data_source.dispatch",
"automation.list_workflows",
"automation.workflow.list_nodes",
],
"workspace_template_ids": [],
},
Expand Down Expand Up @@ -906,6 +918,8 @@ def test_get_permissions(data_fixture):
"dashboard.data_source.read",
"dashboard.list_data_sources",
"dashboard.data_source.dispatch",
"automation.list_workflows",
"automation.workflow.list_nodes",
],
"workspace_template_ids": [],
},
Expand Down
40 changes: 20 additions & 20 deletions backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "feature",
"message": "Support automation templates",
"issue_origin": "github",
"issue_number": 3871,
"domain": "automation",
"bullet_points": [],
"created_at": "2026-03-10"
}
17 changes: 17 additions & 0 deletions web-frontend/modules/automation/applicationTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { populateAutomationWorkflow } from '@baserow/modules/automation/store/au
import { DEVELOPMENT_STAGES } from '@baserow/modules/core/constants'
import { pageFinished } from '@baserow/modules/core/utils/routing'
import { nextTick } from '#imports'
import WorkflowTemplate from '@baserow/modules/automation/components/workflow/WorkflowTemplate.vue'
import WorkflowTemplateSideBar from '@baserow/modules/automation/components/workflow/WorkflowTemplateSideBar.vue'

export class AutomationApplicationType extends ApplicationType {
static getType() {
Expand Down Expand Up @@ -52,6 +54,21 @@ export class AutomationApplicationType extends ApplicationType {
return SidebarComponentAutomation
}

getTemplateSidebarComponent() {
return WorkflowTemplateSideBar
}

getTemplatesPageComponent() {
return WorkflowTemplate
}

getTemplatePage(application) {
return {
automation: application,
page: application.workflows[0],
}
}

delete(application) {
const { $store, $router } = this.app
const workflowSelected = $store.getters['automationWorkflow/getWorkflows'](
Expand Down
39 changes: 24 additions & 15 deletions web-frontend/modules/automation/components/AutomationHeader.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<template>
<header class="layout__col-2-1 header header--space-between">
<ul class="header__filter">
<li
v-if="
$hasPermission(
'application.update',
automation,
automation.workspace.id
)
"
class="header__filter-item"
>
<ul
class="header__filter"
v-if="
$hasPermission(
'application.update',
automation,
automation.workspace.id
)
"
>
<li class="header__filter-item">
<a
data-item-type="settings"
class="header__filter-link"
@click="openSettingsModal"
><i class="header__filter-icon iconoir-settings"></i>
<span class="header__filter-name">{{
$t('automationHeader.settingsBtn')
}}</span>
<span class="header__filter-name"
>{{ $t('automationHeader.settingsBtn') }}
</span>
</a>
</li>
<li class="header__filter-item">
Expand Down Expand Up @@ -62,7 +62,16 @@
</li>
</ul>

<div class="header__right">
<div
class="header__right"
v-if="
$hasPermission(
'application.update',
automation,
automation.workspace.id
)
"
>
<span class="header__switch-container">
<template v-if="!publishedOn">
<Badge color="cyan" rounded size="small">{{
Expand Down
Loading
Loading