mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 13:39:44 +02:00
refactor(editor): Repoint useToast imports to @n8n/composables and drop the @/app shim (no-changelog) (#35348)
Some checks failed
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (22.22.3) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.18.0) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Util: Update Node Popularity / approve-and-automerge (push) Has been cancelled
Some checks failed
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (22.22.3) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.18.0) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Util: Update Node Popularity / approve-and-automerge (push) Has been cancelled
Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Charlie Kolb <charlie@n8n.io>
This commit is contained in:
parent
e408c1406a
commit
fa2d8a131c
|
|
@ -4,7 +4,7 @@ import { createEventBus } from '@n8n/utils/event-bus';
|
|||
import Modal from './Modal.vue';
|
||||
import { ABOUT_MODAL_KEY } from '../constants';
|
||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useClipboard } from '@n8n/composables/useClipboard';
|
||||
import { useDebugInfo } from '@/app/composables/useDebugInfo';
|
||||
import { useInstanceRegistryStore } from '@/features/instanceRegistry/stores/instanceRegistry.store';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { useClipboard } from '@n8n/composables/useClipboard';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
|
||||
import { N8nInputLabel } from '@n8n/design-system';
|
||||
type Props = {
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ import { type MockedStore, mockedStore } from '@/__tests__/utils';
|
|||
import { createTestingPinia } from '@pinia/testing';
|
||||
import CredentialResolverEditModal from '@/app/components/CredentialResolverEditModal.vue';
|
||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { CREDENTIAL_RESOLVER_EDIT_MODAL_KEY } from '../constants';
|
||||
import * as restApiClient from '@n8n/rest-api-client';
|
||||
import type { CredentialResolverType } from '@n8n/api-types';
|
||||
import { defineComponent, h, watch, toRefs } from 'vue';
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showError = vi.fn();
|
||||
return {
|
||||
useToast: () => ({
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
type IMenuItem,
|
||||
} from '@n8n/design-system';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { CREDENTIAL_RESOLVER_EDIT_MODAL_KEY } from '../constants';
|
||||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
import Modal from './Modal.vue';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref, watch, onMounted, nextTick } from 'vue';
|
||||
import { MAX_WORKFLOW_NAME_LENGTH } from '@/app/constants';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import WorkflowTagsDropdown from '@/features/shared/tags/components/WorkflowTagsDropdown.vue';
|
||||
import Modal from '@/app/components/Modal.vue';
|
||||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@ import { useUsersStore } from '@/features/settings/users/users.store';
|
|||
import { useNDVStore } from '@/features/ndv/shared/ndv.store';
|
||||
import { useProjectsStore } from '@/features/collaboration/projects/projects.store';
|
||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { renderComponent } from '@/__tests__/render';
|
||||
import { mockedStore } from '@/__tests__/utils';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useFreeAiCredits } from '@/app/composables/useFreeAiCredits';
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: vi.fn(),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { computed, ref, useCssModule } from 'vue';
|
||||
import { type ActionDropdownItem, N8nActionDropdown } from '@n8n/design-system';
|
||||
import type { WorkflowDataUpdate } from '@n8n/rest-api-client';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ vi.mock('@/app/stores/pushConnection.store', () => ({
|
|||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showError = vi.fn();
|
||||
const showMessage = vi.fn();
|
||||
const showToast = vi.fn();
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import GithubButton from 'vue-github-button';
|
|||
import type { FolderShortInfo } from '@/features/core/folders/folders.types';
|
||||
|
||||
import { N8nIcon } from '@n8n/design-system';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const locale = useI18n();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import userEvent from '@testing-library/user-event';
|
|||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useMessage } from '@/app/composables/useMessage';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useWorkflowsStore } from '@/app/stores/workflows.store';
|
||||
import { useWorkflowsListStore } from '@/app/stores/workflowsList.store';
|
||||
import { useProjectsStore } from '@/features/collaboration/projects/projects.store';
|
||||
|
|
@ -61,7 +61,7 @@ vi.mock('@/app/stores/pushConnection.store', () => ({
|
|||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showError = vi.fn();
|
||||
const showMessage = vi.fn();
|
||||
const showToast = vi.fn(() => ({ close: vi.fn() }));
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@ import { useDocumentTitle } from '@/app/composables/useDocumentTitle';
|
|||
import { useInjectWorkflowId } from '@/app/composables/useInjectWorkflowId';
|
||||
import { useMessage } from '@/app/composables/useMessage';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import type { NotificationHandle } from '@n8n/composables/useToast';
|
||||
import { useToast, type NotificationHandle } from '@n8n/composables/useToast';
|
||||
import { nodeViewEventBus } from '@/app/event-bus';
|
||||
import type { IWorkflowDb } from '@/Interface';
|
||||
import type { FolderShortInfo } from '@/features/core/folders/folders.types';
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ vi.mock('@/app/composables/useWorkflowActivate', () => ({
|
|||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({
|
||||
showMessage: mockShowMessage,
|
||||
showError: mockShowError,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import { useCollaborationStore } from '@/features/collaboration/collaboration/co
|
|||
import { ProjectTypes } from '@/features/collaboration/projects/projects.types';
|
||||
import { useProjectsStore } from '@/features/collaboration/projects/projects.store';
|
||||
import { useWorkflowActivate } from '@/app/composables/useWorkflowActivate';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
import type { WorkflowVersionFormModalEventBusEvents } from '@/features/workflows/workflowHistory/components/WorkflowVersionFormModal.vue';
|
||||
import { useWorkflowHistoryStore } from '@/features/workflows/workflowHistory/workflowHistory.store';
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ vi.mock('@/app/composables/useWorkflowActivate', () => ({
|
|||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({
|
||||
showMessage: mockShowMessage,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import { useI18n } from '@n8n/i18n';
|
|||
import { N8nHeading, N8nCallout, N8nButton, N8nLink } from '@n8n/design-system';
|
||||
import WorkflowVersionForm from '@/app/components/WorkflowVersionForm.vue';
|
||||
import { getActivatableTriggerNodes } from '@/app/utils/nodeTypesUtils';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useWorkflowActivate } from '@/app/composables/useWorkflowActivate';
|
||||
import { useCredentialsStore } from '@/features/credentials/credentials.store';
|
||||
import { OPEN_AI_API_CREDENTIAL_TYPE } from 'n8n-workflow';
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import { useRunWorkflow } from '@/app/composables/useRunWorkflow';
|
|||
import { useExternalHooks } from '@/app/composables/useExternalHooks';
|
||||
import { usePinnedData } from '@/app/composables/usePinnedData';
|
||||
import { useMessage } from '@/app/composables/useMessage';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import * as buttonParameterUtils from '@/features/ndv/parameters/utils/buttonParameter.utils';
|
||||
|
||||
vi.mock('vue-router', () => ({
|
||||
|
|
@ -41,7 +41,7 @@ vi.mock('vue-router', () => ({
|
|||
RouterLink: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showError = vi.fn();
|
||||
const showMessage = vi.fn();
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { NPS_SURVEY_MODAL_KEY } from '@/app/constants';
|
||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
import ModalDrawer from '@/app/components/ModalDrawer.vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { STOP_MANY_EXECUTIONS_MODAL_KEY } from '../constants';
|
|||
import StopManyExecutionsModal from './StopManyExecutionsModal.vue';
|
||||
import type { RenderResult } from '@testing-library/vue';
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showError = vi.fn();
|
||||
const showMessage = vi.fn();
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Modal from '@/app/components/Modal.vue';
|
|||
import { useI18n } from '@n8n/i18n';
|
||||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
|
||||
import { N8nButton, N8nFormInput, N8nCallout, N8nText } from '@n8n/design-system';
|
||||
import { useExecutionsStore } from '@/features/execution/executions/executions.store';
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import * as vueRouter from 'vue-router';
|
|||
import { useProjectsStore } from '@/features/collaboration/projects/projects.store';
|
||||
import type { ProjectListItem } from '@/features/collaboration/projects/projects.types';
|
||||
import { useMessage } from '@/app/composables/useMessage';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useWorkflowsStore } from '@/app/stores/workflows.store';
|
||||
import { useWorkflowsListStore } from '@/app/stores/workflowsList.store';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
|
|
@ -38,7 +38,7 @@ vi.mock('vue-router', () => {
|
|||
};
|
||||
});
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showError = vi.fn();
|
||||
const showMessage = vi.fn();
|
||||
const showToast = vi.fn();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
WORKFLOW_HISTORY_VERSION_UNPUBLISH,
|
||||
} from '@/app/constants';
|
||||
import { useMessage } from '@/app/composables/useMessage';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { getResourcePermissions } from '@n8n/permissions';
|
||||
import dateformat from 'dateformat';
|
||||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ import WorkflowDescriptionModal from '@/app/components/WorkflowDescriptionModal.
|
|||
import { useWorkflowsStore } from '@/app/stores/workflows.store';
|
||||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { STORES } from '@n8n/stores';
|
||||
import { WORKFLOW_DESCRIPTION_MODAL_KEY } from '../constants';
|
||||
import type { IWorkflowDb } from '@/Interface';
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showError = vi.fn();
|
||||
return {
|
||||
useToast: () => ({
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
useWorkflowDocumentStore,
|
||||
createWorkflowDocumentId,
|
||||
} from '@/app/stores/workflowDocument.store';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { WORKFLOW_DESCRIPTION_MODAL_KEY } from '../constants';
|
||||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import type { INodeUi } from '@/Interface';
|
|||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
import type { ExtractableSubgraphData } from 'n8n-workflow';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
|
||||
import { N8nButton, N8nFormInput } from '@n8n/design-system';
|
||||
const props = defineProps<{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, onBeforeUnmount, ref, computed, watch } from 'vue';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import type { IWorkflowDb } from '@/Interface';
|
||||
import type { IWorkflowTemplate } from '@n8n/rest-api-client/api/templates';
|
||||
import { useExecutionsStore } from '@/features/execution/executions/executions.store';
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const toast = {
|
|||
showError: vi.fn(),
|
||||
};
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => toast,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watch, onMounted, onBeforeUnmount, nextTick, h } from 'vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { usePostHog } from '@/app/stores/posthog.store';
|
||||
import type { ITimeoutHMS, IWorkflowSettings, IWorkflowShortResponse } from '@/Interface';
|
||||
import type { WorkflowDataUpdate } from '@n8n/rest-api-client/api/workflows';
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ vi.mock('vue-router', async (importOriginal) => {
|
|||
}),
|
||||
};
|
||||
});
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({
|
||||
showMessage: vi.fn(),
|
||||
showError: vi.fn(),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import Modal from './Modal.vue';
|
|||
import { EnterpriseEditionFeature, MODAL_CONFIRM, WORKFLOW_SHARE_MODAL_KEY } from '@/app/constants';
|
||||
import { getResourcePermissions } from '@n8n/permissions';
|
||||
import { useMessage } from '@/app/composables/useMessage';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
import { useWorkflowsStore } from '@/app/stores/workflows.store';
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ import { createCanvasConnectionHandleString } from '@/features/workflows/canvas/
|
|||
import { isVNode, nextTick, reactive, ref } from 'vue';
|
||||
import type { CanvasLayoutEvent } from '@/features/workflows/canvas/composables/useCanvasLayout';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import * as nodeHelpers from '@/app/composables/useNodeHelpers';
|
||||
import * as workflowsApi from '@/app/api/workflows';
|
||||
import { useBuilderStore } from '@/features/ai/assistant/builder.store';
|
||||
|
|
@ -157,7 +157,7 @@ vi.mock('@n8n/composables/useTelemetry', () => {
|
|||
};
|
||||
});
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showMessage = vi.fn();
|
||||
const showError = vi.fn();
|
||||
const showToast = vi.fn();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import { useI18n } from '@n8n/i18n';
|
|||
import { useNodeHelpers } from '@/app/composables/useNodeHelpers';
|
||||
import { type PinDataSource, usePinnedData } from '@/app/composables/usePinnedData';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useWorkflowHelpers } from '@/app/composables/useWorkflowHelpers';
|
||||
import { useWorkflowNormalization } from '@/app/composables/useWorkflowNormalization';
|
||||
import { getExecutionErrorToastConfiguration } from '@/features/execution/executions/executions.utils';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { captureException } from '@sentry/vue';
|
||||
import type { BaseTextKey } from '@n8n/i18n';
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ vi.mock('@n8n/composables/useTelemetry', () => ({
|
|||
useTelemetry: () => telemetry,
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => toast,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { useProjectsStore } from '@/features/collaboration/projects/projects.sto
|
|||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
import { useUsersStore } from '@/features/settings/users/users.store';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
|
||||
const showSuccessCallout = ref(false);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useProjectsStore } from '@/features/collaboration/projects/projects.sto
|
|||
import { mockedStore } from '@/__tests__/utils';
|
||||
import type router from 'vue-router';
|
||||
import { flushPromises } from '@vue/test-utils';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { usePageRedirectionHelper } from '@/app/composables/usePageRedirectionHelper';
|
||||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
import { useCloudPlanStore } from '@n8n/stores/cloudPlan.store';
|
||||
|
|
@ -37,7 +37,7 @@ vi.mock('@/app/composables/usePageRedirectionHelper', () => {
|
|||
};
|
||||
});
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showMessage = vi.fn();
|
||||
const showError = vi.fn();
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { INSTANCE_AI_VIEW } from '@/features/ai/instanceAi/constants';
|
|||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { sortByProperty } from '@n8n/utils/sort/sort-by-property';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useProjectsStore } from '@/features/collaboration/projects/projects.store';
|
||||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
import { useCloudPlanStore } from '@n8n/stores/cloudPlan.store';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
|
||||
const showToast = vi.fn();
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showToast }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import get from 'lodash/get';
|
|||
import { toJsonObject as curlToJson, type JSONOutput } from 'curlconverter';
|
||||
|
||||
import { CURL_IMPORT_NODES_PROTOCOLS, CURL_IMPORT_NOT_SUPPORTED_PROTOCOLS } from '@/app/constants';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { importCurlEventBus } from '@/app/event-bus';
|
||||
import type { BaseTextKey } from '@n8n/i18n';
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ vi.mock('@n8n/composables/useTelemetry', () => ({
|
|||
useTelemetry: vi.fn(() => ({ track: trackSpy })),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showMessage: showMessageSpy }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import type { INodeUi } from '@/Interface';
|
|||
import { useNodeTypesStore } from '@/app/stores/nodeTypes.store';
|
||||
import type { WorkflowDocumentStore } from '@/app/stores/workflowDocument.store';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from './useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
|
||||
/**
|
||||
* Removes node groups that this instance's backend would reject on save
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ vi.mock('@n8n/i18n', () => ({
|
|||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: vi.fn().mockReturnValue({
|
||||
showMessage: vi.fn(),
|
||||
showError: vi.fn(),
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import { useNodeHelpers } from '@/app/composables/useNodeHelpers';
|
|||
import { usePinnedData } from '@/app/composables/usePinnedData';
|
||||
import { useMessage } from '@/app/composables/useMessage';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useExternalHooks } from '@/app/composables/useExternalHooks';
|
||||
import { useEditorContext } from '@/app/composables/useEditorContext';
|
||||
import { injectWorkflowDocumentStore } from '@/app/stores/workflowDocument.store';
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import {
|
|||
} from 'n8n-workflow';
|
||||
import type { NodeConnectionType, INodeTypeDescription } from 'n8n-workflow';
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({ useToast: vi.fn(() => ({ showError: vi.fn() })) }));
|
||||
vi.mock('@n8n/composables/useToast', () => ({ useToast: vi.fn(() => ({ showError: vi.fn() })) }));
|
||||
vi.mock('@n8n/i18n', async (importActual) => ({
|
||||
...(await importActual()),
|
||||
useI18n: () => ({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import type { IDataObject, INodeExecutionData, IPinData } from 'n8n-workflow';
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ vi.mock('@n8n/composables/useTelemetry', () => ({
|
|||
|
||||
const mockToastShowError = vi.hoisted(() => vi.fn());
|
||||
const mockToastShowMessage = vi.hoisted(() => vi.fn());
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: vi.fn(() => ({
|
||||
showError: mockToastShowError,
|
||||
showMessage: mockToastShowMessage,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { useI18n } from '@n8n/i18n';
|
|||
import { useRoute } from 'vue-router';
|
||||
import { VIEWS } from '@/app/constants';
|
||||
import type { ExecutionStatus, ExecutionSummary } from 'n8n-workflow';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useCanvasOperations } from '@/app/composables/useCanvasOperations';
|
||||
import { useNodeHelpers } from '@/app/composables/useNodeHelpers';
|
||||
import { useExternalHooks } from '@/app/composables/useExternalHooks';
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ const opts: PushHandlerOptions = {
|
|||
};
|
||||
|
||||
const mockShowMessage = vi.fn();
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({
|
||||
showMessage: mockShowMessage,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useExternalHooks } from '@/app/composables/useExternalHooks';
|
|||
import { useNodeHelpers } from '@/app/composables/useNodeHelpers';
|
||||
import { useRunWorkflow } from '@/app/composables/useRunWorkflow';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useWorkflowHelpers } from '@/app/composables/useWorkflowHelpers';
|
||||
import { useWorkflowSaving } from '@/app/composables/useWorkflowSaving';
|
||||
import { WORKFLOW_SETTINGS_MODAL_KEY } from '@/app/constants';
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ const { mockToast, mockI18n, mockSettingsStore, mockWorkflowsStore } = vi.hoiste
|
|||
},
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => mockToast,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { WorkflowFailedToActivate } from '@n8n/api-types/push/workflow';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useActivationError } from '@/app/composables/useActivationError';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useWorkflowDocumentStore } from '@/app/stores/workflowDocument.store';
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ vi.mock('@/app/stores/ui.store', () => ({
|
|||
useUIStore: () => mockUIStore,
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => mockToast,
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { WorkflowPartiallyActivated } from '@n8n/api-types/push/workflow';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useWorkflowsListStore } from '@/app/stores/workflowsList.store';
|
||||
import { useWorkflowDocumentStore } from '@/app/stores/workflowDocument.store';
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import { useWorkflowsStore } from '@/app/stores/workflows.store';
|
|||
import { useWorkflowExecutionStateStore } from '@/app/stores/workflowExecutionState.store';
|
||||
import { createWorkflowDocumentId } from '@/app/stores/workflowDocument.store';
|
||||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useWorkflowHelpers } from '@/app/composables/useWorkflowHelpers';
|
||||
import { useWorkflowSaving } from '@/app/composables/useWorkflowSaving';
|
||||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
|
|
@ -207,7 +207,7 @@ vi.mock('@/app/composables/useExternalHooks', () => ({
|
|||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: vi.fn().mockReturnValue({
|
||||
clearAllStickyNotifications: vi.fn(),
|
||||
showMessage: vi.fn(),
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import {
|
|||
import { retry } from '@n8n/utils/retry';
|
||||
import { computed, getCurrentInstance, type Ref } from 'vue';
|
||||
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useMessage } from '@/app/composables/useMessage';
|
||||
import { useNodeHelpers } from '@/app/composables/useNodeHelpers';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { setActivePinia } from 'pinia';
|
||||
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
|
||||
/**
|
||||
* This module is a pure re-export. Kept as its own test file so the
|
||||
* assertion below runs in a module registry where nothing else could have
|
||||
* registered a notifier: importing the shim, and only the shim, must leave
|
||||
* `useToast` unwired.
|
||||
*
|
||||
* That is what makes deleting this file behaviour-neutral when the shim is
|
||||
* retired. Re-adding a registration here fails this test.
|
||||
*/
|
||||
describe('useToast shim', () => {
|
||||
beforeEach(() => {
|
||||
setActivePinia(createTestingPinia({ stubActions: false }));
|
||||
|
||||
const appEl = document.createElement('div');
|
||||
appEl.id = 'n8n-app';
|
||||
document.body.appendChild(appEl);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
document.getElementById('n8n-app')?.remove();
|
||||
});
|
||||
|
||||
it('registers nothing, so removing it changes no behaviour', () => {
|
||||
useToast().showMessage({ message: 'Not rendered' });
|
||||
|
||||
expect(document.querySelector('.el-notification')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
* @deprecated Import from `@n8n/composables/useToast` instead. This re-export
|
||||
* shim keeps existing `@/app/composables/useToast` call sites working during
|
||||
* the CAT-3686 frontend-modularization migration and will be removed once
|
||||
* importers are retired per-directory. (N8N-66)
|
||||
*
|
||||
* Nothing but the re-export belongs here: the bootstrap registration this file
|
||||
* used to carry now lives in `@/app/init/toastNotifier`, called from
|
||||
* `initializeCore()`, so deleting this file is behaviour-neutral. `useToast.test.ts`
|
||||
* guards that.
|
||||
*/
|
||||
export { useToast } from '@n8n/composables/useToast';
|
||||
|
|
@ -70,7 +70,7 @@ vi.mock('@n8n/composables/useTelemetry', () => ({
|
|||
useTelemetry: vi.fn().mockReturnValue({ track: vi.fn() }),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: vi.fn().mockReturnValue({ showError: vi.fn(), showMessage: vi.fn() }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { useWorkflowsListStore } from '@/app/stores/workflowsList.store';
|
|||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
import { useExternalHooks } from '@/app/composables/useExternalHooks';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useWorkflowId } from '@/app/composables/useWorkflowId';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { ref } from 'vue';
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ vi.mock('@/app/stores/history.store', () => ({
|
|||
useHistoryStore: vi.fn().mockReturnValue(mockHistoryStore),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: vi.fn().mockReturnValue({
|
||||
showMessage: vi.fn(),
|
||||
showError: vi.fn(),
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import type {
|
|||
INode,
|
||||
IWorkflowGroup,
|
||||
} from 'n8n-workflow';
|
||||
import { useToast } from './useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { VIEWS, WORKFLOW_EXTRACTION_NAME_MODAL_KEY } from '@/app/constants';
|
||||
import { useHistoryStore } from '@/app/stores/history.store';
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ vi.mock('@/app/composables/useExternalHooks', () => ({
|
|||
})),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: vi.fn(() => ({
|
||||
showError: vi.fn(),
|
||||
showMessage: vi.fn(),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { ref, computed } from 'vue';
|
|||
import { type RouteRecordNameGeneric, useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { safeParseWorkflowStructure, WorkflowStructureValidationError } from 'n8n-workflow';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useDocumentTitle } from '@/app/composables/useDocumentTitle';
|
||||
import { useExternalHooks } from '@/app/composables/useExternalHooks';
|
||||
import { useCanvasOperations } from '@/app/composables/useCanvasOperations';
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ vi.mock('@/app/composables/useMessage', () => {
|
|||
|
||||
const showMessageSpy = vi.hoisted(() => vi.fn());
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({
|
||||
showMessage: showMessageSpy,
|
||||
showToast: vi.fn(() => ({ close: vi.fn() })),
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import { useCanvasStore } from '@/app/stores/canvas.store';
|
|||
import type { IUpdateInformation, IWorkflowDb } from '@/Interface';
|
||||
import type { WorkflowDataCreate, WorkflowDataUpdate } from '@n8n/rest-api-client/api/workflows';
|
||||
import { isExpression, type IDataObject } from 'n8n-workflow';
|
||||
import { useToast } from './useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useExternalHooks } from './useExternalHooks';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useNodeHelpers } from './useNodeHelpers';
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import { registerToastNotifier } from '@/app/init/toastNotifier';
|
|||
const showMessage = vi.fn();
|
||||
const showToast = vi.fn();
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showMessage, showToast }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import '@/app/polyfills';
|
|||
import SourceControlInitializationErrorMessage from '@/features/integrations/sourceControl.ee/components/SourceControlInitializationErrorMessage.vue';
|
||||
import { useExternalHooks } from '@/app/composables/useExternalHooks';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { registerToastNotifier } from '@/app/init/toastNotifier';
|
||||
import { isDataWorkerEnabled } from '@/app/workers/isDataWorkerEnabled';
|
||||
import { EnterpriseEditionFeature, VIEWS } from '@/app/constants';
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ import type {
|
|||
INodeParameters,
|
||||
IWorkflowGroup,
|
||||
} from 'n8n-workflow';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useCredentialsStore } from '@/features/credentials/credentials.store';
|
||||
import { useEnvironmentsStore } from '@/features/settings/environments.ee/environments.store';
|
||||
import { historyBus } from '@/app/models/history';
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import {
|
|||
} from '@n8n/design-system';
|
||||
import { MCP_SCOPE_GROUPS } from '@/features/ai/mcpAccess/mcp.constants';
|
||||
import { getClientBrand } from '@/features/ai/mcpAccess/clients.utils';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import ScopesSelector from '@/app/components/scopes/ScopesSelector.vue';
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ vi.mock('@n8n/composables/useTelemetry', () => ({
|
|||
}));
|
||||
|
||||
const mockShowError = vi.fn();
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: mockShowError }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import { useFolders } from '@/features/core/folders/composables/useFolders';
|
|||
import { useMessage } from '@/app/composables/useMessage';
|
||||
import { useProjectPages } from '@/features/collaboration/projects/composables/useProjectPages';
|
||||
import { useTelemetry } from '@n8n/composables/useTelemetry';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { hasPermission } from '@/app/utils/rbac/permissions';
|
||||
import {
|
||||
DEBOUNCE_TIME,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { createComponentRenderer } from '@/__tests__/render';
|
||||
import { mockedStore, type MockedStore } from '@/__tests__/utils';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useExposeAllWorkflowsToMcpStore } from '@/experiments/exposeAllWorkflowsToMcp/stores/exposeAllWorkflowsToMcp.store';
|
||||
import { useMCPStore } from '@/features/ai/mcpAccess/mcp.store';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
|
|
@ -8,7 +8,7 @@ import userEvent from '@testing-library/user-event';
|
|||
import { defineComponent } from 'vue';
|
||||
import ExposeAllWorkflowsToMcpModal from './ExposeAllWorkflowsToMcpModal.vue';
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showMessage = vi.fn();
|
||||
const showError = vi.fn();
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import Modal from '@/app/components/Modal.vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
import { EXPOSE_ALL_WORKFLOWS_TO_MCP_MODAL_KEY } from '@/experiments/exposeAllWorkflowsToMcp/constants';
|
||||
import { useExposeAllWorkflowsToMcpStore } from '@/experiments/exposeAllWorkflowsToMcp/stores/exposeAllWorkflowsToMcp.store';
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ vi.mock('@n8n/composables/useClipboard', () => ({
|
|||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({
|
||||
showError: mockShowError,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import Modal from '@/app/components/Modal.vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import SurfaceMcpBridgeGraphic from '@/experiments/surfaceMcpToNewCloudUsers/components/SurfaceMcpBridgeGraphic.vue';
|
||||
import { SURFACE_MCP_ONBOARDING_MODAL_KEY } from '@/experiments/surfaceMcpToNewCloudUsers/constants';
|
||||
import { useSurfaceMcpToNewCloudUsersStore } from '@/experiments/surfaceMcpToNewCloudUsers/stores/surfaceMcpToNewCloudUsers.store';
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ vi.mock('@/app/composables/useMessage', () => ({
|
|||
useMessage: () => ({ confirm: vi.fn() }),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: showErrorMock, showMessage: showMessageMock }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ vi.mock('@/app/stores/ui.store', () => ({
|
|||
}));
|
||||
|
||||
const showErrorSpy = vi.fn();
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: showErrorSpy }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ vi.mock('@/app/stores/favorites.store', () => ({
|
|||
useFavoritesStore: () => favoritesStoreMock,
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: vi.fn() }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ vi.mock('@n8n/design-system', () => ({
|
|||
}));
|
||||
|
||||
// Reads a Pinia store for notifications — irrelevant to panel behavior.
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showMessage: vi.fn() }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ vi.mock('@n8n/design-system', () => ({
|
|||
N8nText: { template: '<span><slot /></span>', props: ['tag', 'bold', 'size', 'color'] },
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: vi.fn() }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ vi.mock('@n8n/i18n', () => ({
|
|||
useI18n: () => ({ baseText: (key: string) => key }),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => {
|
||||
vi.mock('@n8n/composables/useToast', () => {
|
||||
const showMessage = vi.fn();
|
||||
const showError = vi.fn();
|
||||
return { useToast: () => ({ showMessage, showError }) };
|
||||
|
|
@ -250,7 +250,7 @@ describe('AgentPublishButton', () => {
|
|||
it('treats publish as successful when telemetry fingerprinting throws', async () => {
|
||||
const { publishAgent } = await import('../composables/useAgentApi');
|
||||
const { buildAgentConfigFingerprint } = await import('../composables/agentTelemetry.utils');
|
||||
const { useToast } = await import('@/app/composables/useToast');
|
||||
const { useToast } = await import('@n8n/composables/useToast');
|
||||
const updatedAgent = createAgent({ activeVersionId: 'v1', activeVersion });
|
||||
vi.mocked(publishAgent).mockResolvedValue(updatedAgent);
|
||||
vi.mocked(buildAgentConfigFingerprint).mockRejectedValueOnce(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import type { ThreadDetail } from '../composables/useAgentThreadsApi';
|
|||
const getThreadDetail = vi.fn();
|
||||
const showError = vi.fn();
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ vi.mock('@/app/composables/useMessage', () => ({
|
|||
useMessage: () => ({ confirm: vi.fn() }),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: vi.fn(), showMessage: vi.fn() }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ vi.mock('@/features/settings/users/users.store', () => ({
|
|||
useUsersStore: () => ({ currentUserId: 'user-1' }),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: showErrorMock }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ vi.mock('../composables/useAgentApi', () => ({
|
|||
|
||||
const showMessageSpy = vi.fn();
|
||||
const showErrorSpy = vi.fn();
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showMessage: showMessageSpy, showError: showErrorSpy }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import type { AgentJsonMcpServerConfig, AgentJsonToolRef } from '../types';
|
|||
|
||||
const showMessageMock = vi.fn();
|
||||
const showErrorMock = vi.fn();
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({
|
||||
showError: showErrorMock,
|
||||
showMessage: showMessageMock,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ vi.mock('@n8n/permissions', () => ({
|
|||
getResourcePermissions: () => ({ credential: { create: true } }),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showMessage: showMessageMock, showError: showErrorMock }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ vi.mock('@n8n/i18n', () => ({
|
|||
vi.mock('@n8n/composables/useTelemetry', () => ({
|
||||
useTelemetry: () => ({ track: mocks.track }),
|
||||
}));
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: mocks.showError }),
|
||||
}));
|
||||
vi.mock('@/features/ai/instanceAi/instanceAi.store', () => ({
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ vi.mock('@n8n/stores/useRootStore', () => ({
|
|||
}));
|
||||
|
||||
const { showMessageSpy } = vi.hoisted(() => ({ showMessageSpy: vi.fn() }));
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: vi.fn(), showMessage: showMessageSpy }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ vi.mock('@n8n/i18n', () => ({
|
|||
useI18n: () => ({ baseText: (k: string) => k }),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({ showError: vi.fn() }),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ vi.mock('../composables/useAgentConfirmationModal', () => ({
|
|||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/composables/useToast', () => ({
|
||||
vi.mock('@n8n/composables/useToast', () => ({
|
||||
useToast: () => ({
|
||||
showMessage: mocks.showMessage,
|
||||
showError: mocks.showError,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import NodeIcon from '@/app/components/NodeIcon.vue';
|
||||
import { AI_MCP_TOOL_NODE_TYPE } from '@/app/constants/nodeTypes';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
import { useNodeTypesStore } from '@/app/stores/nodeTypes.store';
|
||||
import type { AgentConfigValidationIssue, AgentJsonTaskConfig, AgentTaskDto } from '@n8n/api-types';
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { useI18n } from '@n8n/i18n';
|
|||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
import { MODAL_CONFIRM } from '@/app/constants';
|
||||
import TimeAgo from '@/app/components/TimeAgo.vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
import { useMcp } from '@/features/ai/mcpAccess/composables/useMcp';
|
||||
import { useMCPStore } from '@/features/ai/mcpAccess/mcp.store';
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
MAX_AGENT_CHAT_ATTACHMENTS_PER_MESSAGE,
|
||||
PROVIDER_CAPABILITIES,
|
||||
} from '@n8n/api-types';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import ChatInputBase from '@/features/ai/shared/components/ChatInputBase.vue';
|
||||
import AttachmentPreview from '@/features/ai/instanceAi/components/AttachmentPreview.vue';
|
||||
import { useAgentChatStream } from '../composables/useAgentChatStream';
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { useI18n } from '@n8n/i18n';
|
|||
|
||||
import { getDebounceTime } from '@n8n/composables/useDebounce';
|
||||
import { DEBOUNCE_TIME } from '@/app/constants/durations';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useAgentProjectId } from '../composables/useAgentProjectId';
|
||||
import { useUsersStore } from '@/features/settings/users/users.store';
|
||||
import shared from '../styles/agent-panel.module.scss';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts" setup>
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useAgentSessionsStore } from '@/features/agents/agentSessions.store';
|
||||
import type {
|
||||
AgentExecution,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import {
|
|||
N8nTooltip,
|
||||
} from '@n8n/design-system';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useUsersStore } from '@/features/settings/users/users.store';
|
||||
|
||||
import { useAgentModelCredentials } from '../composables/useAgentModelCredentials';
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import { useRootStore } from '@n8n/stores/useRootStore';
|
|||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import Modal from '@/app/components/Modal.vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { MODAL_CONFIRM } from '@/app/constants';
|
||||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import type { INode, INodeProperties, INodeTypeDescription } from 'n8n-workflow'
|
|||
|
||||
import { getWorkflow } from '@/app/api/workflows';
|
||||
import { AI_MCP_TOOL_NODE_TYPE } from '@/app/constants/nodeTypes';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useNodeTypesStore } from '@/app/stores/nodeTypes.store';
|
||||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
import { stripToolSuffix } from '@/app/stores/aiGateway.store';
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { getResourcePermissions } from '@n8n/permissions';
|
|||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
|
||||
import Modal from '@/app/components/Modal.vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useUIStore } from '@/app/stores/ui.store';
|
||||
import CredentialIcon from '@/features/credentials/components/CredentialIcon.vue';
|
||||
import { CREDENTIAL_EDIT_MODAL_KEY } from '@/features/credentials/credentials.constants';
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { useAgentModelCredentials } from '../../composables/useAgentModelCredent
|
|||
import { useAgentProjectId } from '../../composables/useAgentProjectId';
|
||||
import AgentModelSelector from '../AgentModelSelector.vue';
|
||||
import { computed, watch } from 'vue';
|
||||
import { useToast } from '@/app/composables/useToast';
|
||||
import { useToast } from '@n8n/composables/useToast';
|
||||
import { useAgentBuilderSettingsStore } from '../../agentBuilderSettings.store';
|
||||
import { sanitizeModelId } from '../../utils/model-string';
|
||||
import { useModelCatalog } from '../../composables/useModelCatalog';
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user