refactor(editor): Add infix to Pinia stores (no-changelog) (#6149)
* ⚡ Add infix to Pinia stores * ⚡ Fix paths in mocks * 🐛 Fix import
This commit is contained in:
@@ -8,13 +8,13 @@ import type { Route } from 'vue-router';
|
||||
|
||||
const undoMock = vi.fn();
|
||||
const redoMock = vi.fn();
|
||||
vi.mock('@/stores/ndv', () => ({
|
||||
vi.mock('@/stores/ndv.store', () => ({
|
||||
useNDVStore: () => ({
|
||||
activeNodeName: null,
|
||||
activeNode: {},
|
||||
}),
|
||||
}));
|
||||
vi.mock('@/stores/history', () => {
|
||||
vi.mock('@/stores/history.store', () => {
|
||||
return {
|
||||
useHistoryStore: () => ({
|
||||
popUndoableToUndo: undoMock,
|
||||
@@ -22,7 +22,7 @@ vi.mock('@/stores/history', () => {
|
||||
}),
|
||||
};
|
||||
});
|
||||
vi.mock('@/stores/ui');
|
||||
vi.mock('@/stores/ui.store');
|
||||
vi.mock('vue-router/composables', () => ({
|
||||
useRoute: () => ({}),
|
||||
}));
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { setActivePinia } from 'pinia';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { useUniqueNodeName } from '@/composables/useUniqueNodeName';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
|
||||
describe('useUniqueNodeName', () => {
|
||||
beforeAll(() => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { INodeUi, XYPosition } from '@/Interface';
|
||||
|
||||
import useDeviceSupport from './useDeviceSupport';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import {
|
||||
getMousePosition,
|
||||
getRelativePosition,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
SIDEBAR_WIDTH_EXPANDED,
|
||||
} from '@/utils/nodeViewUtils';
|
||||
import { ref, onMounted, computed } from 'vue';
|
||||
import { useCanvasStore } from '@/stores/canvas';
|
||||
import { useCanvasStore } from '@/stores/canvas.store';
|
||||
|
||||
interface ExtendedHTMLSpanElement extends HTMLSpanElement {
|
||||
x: number;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { MAIN_HEADER_TABS } from '@/constants';
|
||||
import { useNDVStore } from '@/stores/ndv';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import type { Undoable } from '@/models/history';
|
||||
import { BulkCommand } from '@/models/history';
|
||||
import { useHistoryStore } from '@/stores/history';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useHistoryStore } from '@/stores/history.store';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
|
||||
import { ref, onMounted, onUnmounted, nextTick, getCurrentInstance } from 'vue';
|
||||
import { Command } from '@/models/history';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { i18n } from '@/plugins/i18n';
|
||||
import { useRootStore } from '@/stores/n8nRootStore';
|
||||
import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
|
||||
export function useI18n() {
|
||||
const isEnglishLocale = useRootStore().defaultLocale === 'en';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
|
||||
export function useUniqueNodeName() {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user