From df474f3ccbc629a8e308359e6a4973cc00b86e17 Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Fri, 21 Mar 2025 20:22:28 +0100 Subject: [PATCH] feat(editor): Insights summary banner (#13424) Co-authored-by: Guillaume Jacquart --- packages/@n8n/permissions/src/constants.ee.ts | 1 + .../src/components/N8nLoading/Loading.vue | 7 +- .../components/Projects/ProjectHeader.test.ts | 15 -- .../src/components/Projects/ProjectHeader.vue | 14 +- .../global/GlobalExecutionsList.vue | 3 +- .../editor-ui/src/composables/useOverview.ts | 20 ++ .../components/InsightsSummary.test.ts | 56 +++++ .../insights/components/InsightsSummary.vue | 224 ++++++++++++++++++ .../InsightsSummary.test.ts.snap | 75 ++++++ .../src/features/insights/insights.api.ts | 6 + .../features/insights/insights.constants.ts | 34 +++ .../src/features/insights/insights.store.ts | 35 +++ .../src/features/insights/insights.types.ts | 14 ++ .../src/features/insights/insights.utils.ts | 22 ++ packages/frontend/editor-ui/src/init.ts | 3 + .../editor-ui/src/permissions.test.ts | 5 + .../src/plugins/i18n/locales/en.json | 10 +- .../editor-ui/src/plugins/icons/index.ts | 6 + .../editor-ui/src/stores/rbac.store.ts | 1 + .../editor-ui/src/views/CredentialsView.vue | 13 +- .../editor-ui/src/views/ExecutionsView.vue | 16 +- .../editor-ui/src/views/WorkflowsView.vue | 13 +- 22 files changed, 559 insertions(+), 34 deletions(-) create mode 100644 packages/frontend/editor-ui/src/composables/useOverview.ts create mode 100644 packages/frontend/editor-ui/src/features/insights/components/InsightsSummary.test.ts create mode 100644 packages/frontend/editor-ui/src/features/insights/components/InsightsSummary.vue create mode 100644 packages/frontend/editor-ui/src/features/insights/components/__snapshots__/InsightsSummary.test.ts.snap create mode 100644 packages/frontend/editor-ui/src/features/insights/insights.api.ts create mode 100644 packages/frontend/editor-ui/src/features/insights/insights.constants.ts create mode 100644 packages/frontend/editor-ui/src/features/insights/insights.store.ts create mode 100644 packages/frontend/editor-ui/src/features/insights/insights.types.ts create mode 100644 packages/frontend/editor-ui/src/features/insights/insights.utils.ts diff --git a/packages/@n8n/permissions/src/constants.ee.ts b/packages/@n8n/permissions/src/constants.ee.ts index 70ad68c52c7..e850d124cbf 100644 --- a/packages/@n8n/permissions/src/constants.ee.ts +++ b/packages/@n8n/permissions/src/constants.ee.ts @@ -23,4 +23,5 @@ export const RESOURCES = { workersView: ['manage'] as const, workflow: ['share', 'execute', 'move', ...DEFAULT_OPERATIONS] as const, folder: [...DEFAULT_OPERATIONS] as const, + insights: ['list'] as const, } as const; diff --git a/packages/frontend/@n8n/design-system/src/components/N8nLoading/Loading.vue b/packages/frontend/@n8n/design-system/src/components/N8nLoading/Loading.vue index 50bcc94e82c..1955054588f 100644 --- a/packages/frontend/@n8n/design-system/src/components/N8nLoading/Loading.vue +++ b/packages/frontend/@n8n/design-system/src/components/N8nLoading/Loading.vue @@ -19,6 +19,7 @@ interface LoadingProps { animated?: boolean; loading?: boolean; rows?: number; + cols?: number; shrinkLast?: boolean; variant?: (typeof VARIANT)[number]; } @@ -27,6 +28,7 @@ withDefaults(defineProps(), { animated: true, loading: true, rows: 1, + cols: 0, shrinkLast: true, variant: 'p', }); @@ -38,7 +40,10 @@ withDefaults(defineProps(), { :animated="animated" :class="['n8n-loading', `n8n-loading-${variant}`]" > -