refactor(editor): Extract workflowHistory code to features (no-changelog) (#20587)

This commit is contained in:
Alex Grozav 2025-10-10 12:53:03 +03:00 committed by GitHub
parent 4e84c53a47
commit c0157f645e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 18 additions and 20 deletions

View File

@ -89,7 +89,7 @@ import UpdatesPanel from '@/components/UpdatesPanel.vue';
import WhatsNewModal from '@/components/WhatsNewModal.vue';
import WorkflowActivationConflictingWebhookModal from '@/components/WorkflowActivationConflictingWebhookModal.vue';
import WorkflowExtractionNameModal from '@/components/WorkflowExtractionNameModal.vue';
import WorkflowHistoryVersionRestoreModal from '@/components/WorkflowHistory/WorkflowHistoryVersionRestoreModal.vue';
import WorkflowHistoryVersionRestoreModal from '@/features/workflowHistory/components/WorkflowHistoryVersionRestoreModal.vue';
import WorkflowSettings from '@/components/WorkflowSettings.vue';
import WorkflowShareModal from '@/components/WorkflowShareModal.ee.vue';
import WorkflowDiffModal from '@/features/workflow-diff/WorkflowDiffModal.vue';

View File

@ -5,9 +5,9 @@ import { waitFor } from '@testing-library/vue';
import userEvent from '@testing-library/user-event';
import type { UserAction } from '@n8n/design-system';
import { createComponentRenderer } from '@/__tests__/render';
import WorkflowHistoryContent from '@/components/WorkflowHistory/WorkflowHistoryContent.vue';
import WorkflowHistoryContent from './WorkflowHistoryContent.vue';
import type { WorkflowHistoryActionTypes } from '@n8n/rest-api-client/api/workflowHistory';
import { workflowVersionDataFactory } from '@/stores/__tests__/utils/workflowHistoryTestUtils';
import { workflowVersionDataFactory } from '../__tests__/utils';
import type { IWorkflowDb } from '@/Interface';
import type { IUser } from 'n8n-workflow';
import { useProjectsStore } from '@/stores/projects.store';

View File

@ -7,7 +7,7 @@ import type {
WorkflowVersionId,
} from '@n8n/rest-api-client/api/workflowHistory';
import WorkflowPreview from '@/components/WorkflowPreview.vue';
import WorkflowHistoryListItem from '@/components/WorkflowHistory/WorkflowHistoryListItem.vue';
import WorkflowHistoryListItem from './WorkflowHistoryListItem.vue';
import { useI18n } from '@n8n/i18n';
import type { IUser } from 'n8n-workflow';

View File

@ -4,9 +4,9 @@ import { createPinia, setActivePinia } from 'pinia';
import { faker } from '@faker-js/faker';
import type { UserAction } from '@n8n/design-system';
import { createComponentRenderer } from '@/__tests__/render';
import WorkflowHistoryList from '@/components/WorkflowHistory/WorkflowHistoryList.vue';
import WorkflowHistoryList from './WorkflowHistoryList.vue';
import type { WorkflowHistoryActionTypes } from '@n8n/rest-api-client/api/workflowHistory';
import { workflowHistoryDataFactory } from '@/stores/__tests__/utils/workflowHistoryTestUtils';
import { workflowHistoryDataFactory } from '../__tests__/utils';
import type { IUser } from 'n8n-workflow';
vi.stubGlobal(

View File

@ -8,7 +8,7 @@ import type {
WorkflowHistoryActionTypes,
WorkflowHistoryRequestParams,
} from '@n8n/rest-api-client/api/workflowHistory';
import WorkflowHistoryListItem from '@/components/WorkflowHistory/WorkflowHistoryListItem.vue';
import WorkflowHistoryListItem from './WorkflowHistoryListItem.vue';
import type { IUser } from 'n8n-workflow';
import { I18nT } from 'vue-i18n';

View File

@ -2,9 +2,9 @@ import { createPinia, setActivePinia } from 'pinia';
import userEvent from '@testing-library/user-event';
import type { UserAction } from '@n8n/design-system';
import { createComponentRenderer } from '@/__tests__/render';
import WorkflowHistoryListItem from '@/components/WorkflowHistory/WorkflowHistoryListItem.vue';
import WorkflowHistoryListItem from './WorkflowHistoryListItem.vue';
import type { WorkflowHistoryActionTypes } from '@n8n/rest-api-client/api/workflowHistory';
import { workflowHistoryDataFactory } from '@/stores/__tests__/utils/workflowHistoryTestUtils';
import { workflowHistoryDataFactory } from '../__tests__/utils';
import { type IUser } from 'n8n-workflow';
const actionTypes: WorkflowHistoryActionTypes = ['restore', 'clone', 'open', 'download'];

View File

@ -8,15 +8,12 @@ import { useRoute, useRouter } from 'vue-router';
import { faker } from '@faker-js/faker';
import { createComponentRenderer } from '@/__tests__/render';
import { SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils';
import WorkflowHistoryPage from '@/views/WorkflowHistory.vue';
import { useWorkflowHistoryStore } from '@/stores/workflowHistory.store';
import WorkflowHistoryPage from './WorkflowHistory.vue';
import { useWorkflowHistoryStore } from '../workflowHistory.store';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { STORES } from '@n8n/stores';
import { VIEWS } from '@/constants';
import {
workflowHistoryDataFactory,
workflowVersionDataFactory,
} from '@/stores/__tests__/utils/workflowHistoryTestUtils';
import { workflowHistoryDataFactory, workflowVersionDataFactory } from '../__tests__/utils';
import type { WorkflowVersion } from '@n8n/rest-api-client/api/workflowHistory';
import type { IWorkflowDb } from '@/Interface';
import { telemetry } from '@/plugins/telemetry';

View File

@ -12,9 +12,9 @@ import type {
WorkflowHistory,
WorkflowVersion,
} from '@n8n/rest-api-client/api/workflowHistory';
import WorkflowHistoryList from '@/components/WorkflowHistory/WorkflowHistoryList.vue';
import WorkflowHistoryContent from '@/components/WorkflowHistory/WorkflowHistoryContent.vue';
import { useWorkflowHistoryStore } from '@/stores/workflowHistory.store';
import WorkflowHistoryList from '../components/WorkflowHistoryList.vue';
import WorkflowHistoryContent from '../components/WorkflowHistoryContent.vue';
import { useWorkflowHistoryStore } from '../workflowHistory.store';
import { useUIStore } from '@/stores/ui.store';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { telemetry } from '@/plugins/telemetry';

View File

@ -1,6 +1,6 @@
import { createPinia, setActivePinia } from 'pinia';
import type { FrontendSettings } from '@n8n/api-types';
import { useWorkflowHistoryStore } from '@/stores/workflowHistory.store';
import { useWorkflowHistoryStore } from './workflowHistory.store';
import { useSettingsStore } from '@/stores/settings.store';
describe('Workflow history store', () => {

View File

@ -67,7 +67,8 @@ const SettingsSourceControl = async () =>
const SettingsExternalSecrets = async () =>
await import('@/features/externalSecrets/views/SettingsExternalSecrets.vue');
const WorkerView = async () => await import('./views/WorkerView.vue');
const WorkflowHistory = async () => await import('@/views/WorkflowHistory.vue');
const WorkflowHistory = async () =>
await import('@/features/workflowHistory/views/WorkflowHistory.vue');
const WorkflowOnboardingView = async () => await import('@/views/WorkflowOnboardingView.vue');
const EvaluationsView = async () =>
await import('@/features/evaluation.ee/views/EvaluationsView.vue');