From fe84c0f21ca3ba443a3165e771322d8cdb4d2ebc Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 1 Jun 2022 22:39:51 +0100 Subject: [PATCH] Adding pagination control to the API and to the frontend, as well as getting view working as expected, emitting different key combinations to be able to search by any pattern. --- .../builderStore/store/automation/index.js | 4 +- .../portal/overview/HistoryTab.svelte | 94 +++++++-- .../portal/overview/StatusRenderer.svelte | 4 +- .../app/[application]/automate/_layout.svelte | 4 + packages/frontend-core/src/api/automations.js | 4 +- .../server/src/api/controllers/automation.js | 6 +- .../server/src/automations/history/index.ts | 140 -------------- .../server/src/automations/logging/index.ts | 180 ++++++++++++++++++ packages/server/src/db/utils.js | 37 ++-- packages/server/src/db/views/staticViews.js | 13 +- packages/server/src/definitions/automation.ts | 6 + packages/server/src/threads/automation.js | 4 +- 12 files changed, 316 insertions(+), 180 deletions(-) delete mode 100644 packages/server/src/automations/history/index.ts create mode 100644 packages/server/src/automations/logging/index.ts diff --git a/packages/builder/src/builderStore/store/automation/index.js b/packages/builder/src/builderStore/store/automation/index.js index 73e3d83832..b409ee5ffd 100644 --- a/packages/builder/src/builderStore/store/automation/index.js +++ b/packages/builder/src/builderStore/store/automation/index.js @@ -122,10 +122,12 @@ const automationActions = store => ({ return state }) }, - getLogs: async (automationId, startDate) => { + getLogs: async ({ automationId, startDate, status, page } = {}) => { return await API.getAutomationLogs({ automationId, startDate, + status, + page, }) }, addTestDataToAutomation: data => { diff --git a/packages/builder/src/components/portal/overview/HistoryTab.svelte b/packages/builder/src/components/portal/overview/HistoryTab.svelte index 7925419091..0feeb7c7e1 100644 --- a/packages/builder/src/components/portal/overview/HistoryTab.svelte +++ b/packages/builder/src/components/portal/overview/HistoryTab.svelte @@ -1,5 +1,5 @@ @@ -65,13 +107,23 @@