From 649abac7da5075cb3e12f74c227933001f97fbd7 Mon Sep 17 00:00:00 2001 From: Gasper Grom Date: Tue, 9 May 2023 15:45:00 +0200 Subject: [PATCH 1/7] Automations bug fixes & improvements --- backend/src/api/automation/automationSlackCallback.ts | 2 +- backend/src/database/repositories/automationRepository.ts | 1 + .../modules/automation/components/automation-dropdown.vue | 6 +++--- .../src/modules/automation/pages/automation-list-page.vue | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/src/api/automation/automationSlackCallback.ts b/backend/src/api/automation/automationSlackCallback.ts index 1fe1cdb0aa..b8b7d84615 100644 --- a/backend/src/api/automation/automationSlackCallback.ts +++ b/backend/src/api/automation/automationSlackCallback.ts @@ -11,7 +11,7 @@ export default async (req, res) => { await SettingsService.save({ slackWebHook: url }, req) await Axios.post(url, { - text: 'Crowd.dev Notifier has been successfully connected.', + text: 'crowd.dev notifier has been successfully connected.', }) res.redirect(redirectUrl) diff --git a/backend/src/database/repositories/automationRepository.ts b/backend/src/database/repositories/automationRepository.ts index 8b14e7ccb3..4c93b1b7f6 100644 --- a/backend/src/database/repositories/automationRepository.ts +++ b/backend/src/database/repositories/automationRepository.ts @@ -189,6 +189,7 @@ export default class AutomationRepository extends RepositoryBase< left join latest_executions le on a.id = le."automationId" where ${conditionsString} ${this.getPaginationString(criteria)} + order by "updatedAt" desc ` // fetch all automations for a tenant // and include the latest execution data if available diff --git a/frontend/src/modules/automation/components/automation-dropdown.vue b/frontend/src/modules/automation/components/automation-dropdown.vue index 3bd8c16ecf..7f46f7c1c7 100644 --- a/frontend/src/modules/automation/components/automation-dropdown.vue +++ b/frontend/src/modules/automation/components/automation-dropdown.vue @@ -21,7 +21,7 @@ > Edit webhook + >Edit automation Delete webhook + />Delete automation @@ -68,7 +68,7 @@ const isReadOnly = computed(() => new AutomationPermissions( const doDestroyWithConfirm = () => ConfirmDialog({ type: 'danger', - title: 'Delete webhook', + title: 'Delete automation', message: "Are you sure you want to proceed? You can't undo this action", confirmButtonText: 'Confirm', diff --git a/frontend/src/modules/automation/pages/automation-list-page.vue b/frontend/src/modules/automation/pages/automation-list-page.vue index 83eaedd2c7..bef0eb5de8 100644 --- a/frontend/src/modules/automation/pages/automation-list-page.vue +++ b/frontend/src/modules/automation/pages/automation-list-page.vue @@ -95,7 +95,7 @@ description="Send Slack notifications when a new activity happens, or a new member joins your community" /> Date: Tue, 9 May 2023 16:27:39 +0200 Subject: [PATCH 2/7] Automation table sortable --- .../repositories/automationRepository.ts | 2 ++ .../components/list/automation-list-table.vue | 22 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/backend/src/database/repositories/automationRepository.ts b/backend/src/database/repositories/automationRepository.ts index 4c93b1b7f6..23460ed2b9 100644 --- a/backend/src/database/repositories/automationRepository.ts +++ b/backend/src/database/repositories/automationRepository.ts @@ -181,6 +181,7 @@ export default class AutomationRepository extends RepositoryBase< a.settings, a.state, a."createdAt", + a."updatedAt", le."executedAt" as "lastExecutionAt", le.state as "lastExecutionState", le.error as "lastExecutionError", @@ -220,6 +221,7 @@ export default class AutomationRepository extends RepositoryBase< settings: row.settings, state: row.state, createdAt: row.createdAt, + updatedAt: row.updatedAt, lastExecutionAt: row.lastExecutionAt, lastExecutionState: row.lastExecutionState, lastExecutionError: row.lastExecutionError, diff --git a/frontend/src/modules/automation/components/list/automation-list-table.vue b/frontend/src/modules/automation/components/list/automation-list-table.vue index f098faa99b..f85677e740 100644 --- a/frontend/src/modules/automation/components/list/automation-list-table.vue +++ b/frontend/src/modules/automation/components/list/automation-list-table.vue @@ -7,8 +7,9 @@ :data="automations" row-key="id" border + :default-sort="{ prop: 'updatedAt', order: 'descending' }" > - + - + - + + + + - +