From 0a77ec6b6a87f2accde0d9d37cb697fc68f1f95b Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Mon, 6 Oct 2025 11:33:44 +0300 Subject: [PATCH] refactor(editor): Extract `evaluation` code into feature (no-changelog) (#20364) --- .../Evaluations.ee/shared/statusDictionary.ts | 37 ------------------ .../composables/useActionsGeneration.ts | 2 +- .../components/Node/NodeCreator/viewsData.ts | 2 +- .../WorkflowProductionChecklist.test.ts | 2 +- .../WorkflowProductionChecklist.vue | 2 +- .../components}/ListRuns/MetricsChart.vue | 4 +- .../components}/ListRuns/RunsSection.vue | 6 +-- .../components}/ListRuns/TestRunsTable.vue | 5 +-- .../Paywall/EvaluationsPaywall.vue | 0 .../components}/SetupWizard/SetupWizard.vue | 2 +- .../components}/shared/StepHeader.vue | 0 .../components}/shared/StepIndicator.vue | 0 .../components}/shared/TableCell.vue | 0 .../components}/shared/TableStatusCell.vue | 2 +- .../components}/shared/TestTableBase.vue | 2 +- .../composables}/useMetricsChart.test.ts | 4 +- .../composables/useMetricsChart.ts | 2 +- .../evaluation.ee/evaluation.api.ts} | 0 .../evaluation.ee/evaluation.constants.ts} | 38 +++++++++++++++++++ .../evaluation.ee/evaluation.store.test.ts} | 6 +-- .../evaluation.ee/evaluation.store.ts} | 4 +- .../evaluation.ee/evaluation.types.ts} | 0 .../evaluation.ee/evaluation.utils.test.ts} | 4 +- .../evaluation.ee/evaluation.utils.ts} | 4 +- .../views}/EvaluationsRootView.test.ts | 6 +-- .../views}/EvaluationsRootView.vue | 6 +-- .../views}/EvaluationsView.test.ts | 6 +-- .../evaluation.ee/views}/EvaluationsView.vue | 4 +- .../views}/TestRunDetailView.test.ts | 4 +- .../views}/TestRunDetailView.vue | 13 +++---- packages/frontend/editor-ui/src/router.ts | 8 ++-- 31 files changed, 88 insertions(+), 87 deletions(-) delete mode 100644 packages/frontend/editor-ui/src/components/Evaluations.ee/shared/statusDictionary.ts rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/ListRuns/MetricsChart.vue (94%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/ListRuns/RunsSection.vue (91%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/ListRuns/TestRunsTable.vue (95%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/Paywall/EvaluationsPaywall.vue (100%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/SetupWizard/SetupWizard.vue (99%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/shared/StepHeader.vue (100%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/shared/StepIndicator.vue (100%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/shared/TableCell.vue (100%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/shared/TableStatusCell.vue (97%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee/components}/shared/TestTableBase.vue (98%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee/tests => features/evaluation.ee/composables}/useMetricsChart.test.ts (92%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee => features/evaluation.ee}/composables/useMetricsChart.ts (98%) rename packages/frontend/editor-ui/src/{api/evaluation.ee.ts => features/evaluation.ee/evaluation.api.ts} (100%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee/shared/errorCodes.ts => features/evaluation.ee/evaluation.constants.ts} (78%) rename packages/frontend/editor-ui/src/{stores/evaluation.store.ee.test.ts => features/evaluation.ee/evaluation.store.test.ts} (95%) rename packages/frontend/editor-ui/src/{stores/evaluation.store.ee.ts => features/evaluation.ee/evaluation.store.ts} (97%) rename packages/frontend/editor-ui/src/{components/Evaluations.ee/types.ts => features/evaluation.ee/evaluation.types.ts} (100%) rename packages/frontend/editor-ui/src/{views/Evaluations.ee/utils.test.ts => features/evaluation.ee/evaluation.utils.test.ts} (99%) rename packages/frontend/editor-ui/src/{views/Evaluations.ee/utils.ts => features/evaluation.ee/evaluation.utils.ts} (96%) rename packages/frontend/editor-ui/src/{views/Evaluations.ee/tests => features/evaluation.ee/views}/EvaluationsRootView.test.ts (98%) rename packages/frontend/editor-ui/src/{views/Evaluations.ee => features/evaluation.ee/views}/EvaluationsRootView.vue (96%) rename packages/frontend/editor-ui/src/{views/Evaluations.ee/tests => features/evaluation.ee/views}/EvaluationsView.test.ts (95%) rename packages/frontend/editor-ui/src/{views/Evaluations.ee => features/evaluation.ee/views}/EvaluationsView.vue (95%) rename packages/frontend/editor-ui/src/{views/Evaluations.ee => features/evaluation.ee/views}/TestRunDetailView.test.ts (98%) rename packages/frontend/editor-ui/src/{views/Evaluations.ee => features/evaluation.ee/views}/TestRunDetailView.vue (96%) diff --git a/packages/frontend/editor-ui/src/components/Evaluations.ee/shared/statusDictionary.ts b/packages/frontend/editor-ui/src/components/Evaluations.ee/shared/statusDictionary.ts deleted file mode 100644 index 4465e1808d5..00000000000 --- a/packages/frontend/editor-ui/src/components/Evaluations.ee/shared/statusDictionary.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { TestRunRecord } from '@/api/evaluation.ee'; -import { type IconName } from '@n8n/design-system/components/N8nIcon/icons'; -import type { IconColor } from '@n8n/design-system/types/icon'; - -export const statusDictionary: Record< - TestRunRecord['status'], - { icon: IconName; color: IconColor } -> = { - new: { - icon: 'status-new', - color: 'foreground-xdark', - }, - running: { - icon: 'spinner', - color: 'secondary', - }, - completed: { - icon: 'status-completed', - color: 'success', - }, - error: { - icon: 'triangle-alert', - color: 'danger', - }, - cancelled: { - icon: 'status-canceled', - color: 'foreground-xdark', - }, - warning: { - icon: 'status-warning', - color: 'warning', - }, - success: { - icon: 'status-completed', - color: 'success', - }, -}; diff --git a/packages/frontend/editor-ui/src/components/Node/NodeCreator/composables/useActionsGeneration.ts b/packages/frontend/editor-ui/src/components/Node/NodeCreator/composables/useActionsGeneration.ts index c3e72f3312d..e6041f8e09c 100644 --- a/packages/frontend/editor-ui/src/components/Node/NodeCreator/composables/useActionsGeneration.ts +++ b/packages/frontend/editor-ui/src/components/Node/NodeCreator/composables/useActionsGeneration.ts @@ -20,7 +20,7 @@ import { i18n } from '@n8n/i18n'; import { getCredentialOnlyNodeType } from '@/utils/credentialOnlyNodes'; import { formatTriggerActionName } from '../utils'; -import { useEvaluationStore } from '@/stores/evaluation.store.ee'; +import { useEvaluationStore } from '@/features/evaluation.ee/evaluation.store'; import { useSettingsStore } from '@/stores/settings.store'; const PLACEHOLDER_RECOMMENDED_ACTION_KEY = 'placeholder_recommended'; diff --git a/packages/frontend/editor-ui/src/components/Node/NodeCreator/viewsData.ts b/packages/frontend/editor-ui/src/components/Node/NodeCreator/viewsData.ts index ae81a5e0db0..401ffef7d64 100644 --- a/packages/frontend/editor-ui/src/components/Node/NodeCreator/viewsData.ts +++ b/packages/frontend/editor-ui/src/components/Node/NodeCreator/viewsData.ts @@ -68,7 +68,7 @@ import { useTemplatesStore } from '@/features/templates/templates.store'; import type { BaseTextKey } from '@n8n/i18n'; import camelCase from 'lodash/camelCase'; import { useSettingsStore } from '@/stores/settings.store'; -import { useEvaluationStore } from '@/stores/evaluation.store.ee'; +import { useEvaluationStore } from '@/features/evaluation.ee/evaluation.store'; import { getAiTemplatesCallout, getPreBuiltAgentsCalloutWithDivider } from './utils'; import { useCalloutHelpers } from '@/composables/useCalloutHelpers'; diff --git a/packages/frontend/editor-ui/src/components/WorkflowProductionChecklist.test.ts b/packages/frontend/editor-ui/src/components/WorkflowProductionChecklist.test.ts index 3a5c89a2de4..7d8553ac113 100644 --- a/packages/frontend/editor-ui/src/components/WorkflowProductionChecklist.test.ts +++ b/packages/frontend/editor-ui/src/components/WorkflowProductionChecklist.test.ts @@ -2,7 +2,7 @@ import { createComponentRenderer } from '@/__tests__/render'; import { createTestingPinia } from '@pinia/testing'; import { ref } from 'vue'; import WorkflowProductionChecklist from '@/components/WorkflowProductionChecklist.vue'; -import { useEvaluationStore } from '@/stores/evaluation.store.ee'; +import { useEvaluationStore } from '@/features/evaluation.ee/evaluation.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import { useWorkflowSettingsCache } from '@/composables/useWorkflowsCache'; import { useUIStore } from '@/stores/ui.store'; diff --git a/packages/frontend/editor-ui/src/components/WorkflowProductionChecklist.vue b/packages/frontend/editor-ui/src/components/WorkflowProductionChecklist.vue index 81ae509a534..5beb6715478 100644 --- a/packages/frontend/editor-ui/src/components/WorkflowProductionChecklist.vue +++ b/packages/frontend/editor-ui/src/components/WorkflowProductionChecklist.vue @@ -2,7 +2,7 @@ import { computed, ref, onMounted, watch } from 'vue'; import { useI18n } from '@n8n/i18n'; import { useRouter } from 'vue-router'; -import { useEvaluationStore } from '@/stores/evaluation.store.ee'; +import { useEvaluationStore } from '@/features/evaluation.ee/evaluation.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; import type { ActionType, WorkflowSettings } from '@/composables/useWorkflowsCache'; import { useWorkflowSettingsCache } from '@/composables/useWorkflowsCache'; diff --git a/packages/frontend/editor-ui/src/components/Evaluations.ee/ListRuns/MetricsChart.vue b/packages/frontend/editor-ui/src/features/evaluation.ee/components/ListRuns/MetricsChart.vue similarity index 94% rename from packages/frontend/editor-ui/src/components/Evaluations.ee/ListRuns/MetricsChart.vue rename to packages/frontend/editor-ui/src/features/evaluation.ee/components/ListRuns/MetricsChart.vue index 79f9df6e2cb..42ee11a04cd 100644 --- a/packages/frontend/editor-ui/src/components/Evaluations.ee/ListRuns/MetricsChart.vue +++ b/packages/frontend/editor-ui/src/features/evaluation.ee/components/ListRuns/MetricsChart.vue @@ -1,8 +1,8 @@