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:
@@ -1,4 +1,4 @@
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { i18n as locale } from '@/plugins/i18n';
|
||||
import { mapStores } from 'pinia';
|
||||
import mixins from 'vue-typed-mixins';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { mapStores } from 'pinia';
|
||||
import { ensureSyntaxTree } from '@codemirror/language';
|
||||
|
||||
import { workflowHelpers } from '@/mixins/workflowHelpers';
|
||||
import { useNDVStore } from '@/stores/ndv';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { EXPRESSION_EDITOR_PARSER_TIMEOUT } from '@/constants';
|
||||
|
||||
import type { PropType } from 'vue';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { IExternalHooks } from '@/Interface';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import { useWebhooksStore } from '@/stores/webhooks';
|
||||
import { useWebhooksStore } from '@/stores/webhooks.store';
|
||||
import { defineComponent } from 'vue';
|
||||
import { runExternalHook } from '@/utils';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import mixins from 'vue-typed-mixins';
|
||||
import { deviceSupportHelpers } from '@/mixins/deviceSupportHelpers';
|
||||
import { getMousePosition } from '@/utils/nodeViewUtils';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
|
||||
export const moveNodeWorkflow = mixins(deviceSupportHelpers).extend({
|
||||
data() {
|
||||
|
||||
@@ -2,8 +2,8 @@ import mixins from 'vue-typed-mixins';
|
||||
import { showMessage } from './showMessage';
|
||||
import { VERSIONS_MODAL_KEY } from '@/constants';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useVersionsStore } from '@/stores/versions';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { useVersionsStore } from '@/stores/versions.store';
|
||||
|
||||
export const newVersions = mixins(showMessage).extend({
|
||||
computed: {
|
||||
|
||||
@@ -6,14 +6,14 @@ import { NO_OP_NODE_TYPE } from '@/constants';
|
||||
|
||||
import type { INodeTypeDescription } from 'n8n-workflow';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import type { BrowserJsPlumbInstance } from '@jsplumb/browser-ui';
|
||||
import type { Endpoint, EndpointOptions } from '@jsplumb/core';
|
||||
import * as NodeViewUtils from '@/utils/nodeViewUtils';
|
||||
import { useHistoryStore } from '@/stores/history';
|
||||
import { useCanvasStore } from '@/stores/canvas';
|
||||
import { useHistoryStore } from '@/stores/history.store';
|
||||
import { useCanvasStore } from '@/stores/canvas.store';
|
||||
|
||||
export const nodeBase = mixins(deviceSupportHelpers).extend({
|
||||
mounted() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { EnableNodeToggleCommand } from './../models/history';
|
||||
import { useHistoryStore } from '@/stores/history';
|
||||
import { useHistoryStore } from '@/stores/history.store';
|
||||
import { PLACEHOLDER_FILLED_AT_EXECUTION_TIME, CUSTOM_API_CALL_KEY } from '@/constants';
|
||||
|
||||
import type {
|
||||
@@ -33,11 +33,11 @@ import { get } from 'lodash-es';
|
||||
import { isObjectLiteral } from '@/utils';
|
||||
import { getCredentialPermissions } from '@/permissions';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useSettingsStore } from '@/stores/settings';
|
||||
import { useUsersStore } from '@/stores/users';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes';
|
||||
import { useCredentialsStore } from '@/stores/credentials';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { useCredentialsStore } from '@/stores/credentials.store';
|
||||
import Vue from 'vue';
|
||||
|
||||
export const nodeHelpers = Vue.extend({
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { INodeTypeDescription, IPinData } from 'n8n-workflow';
|
||||
import { stringSizeInBytes } from '@/utils';
|
||||
import { MAX_WORKFLOW_PINNED_DATA_SIZE, PIN_DATA_NODE_TYPES_DENYLIST } from '@/constants';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
|
||||
export interface IPinDataContext {
|
||||
node: INodeUi;
|
||||
|
||||
@@ -27,13 +27,13 @@ import { WORKFLOW_SETTINGS_MODAL_KEY } from '@/constants';
|
||||
import { getTriggerNodeServiceName } from '@/utils';
|
||||
import { codeNodeEditorEventBus } from '@/event-bus';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes';
|
||||
import { useCredentialsStore } from '@/stores/credentials';
|
||||
import { useSettingsStore } from '@/stores/settings';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { useCredentialsStore } from '@/stores/credentials.store';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { parse } from 'flatted';
|
||||
import { useSegment } from '@/stores/segment';
|
||||
import { useSegment } from '@/stores/segment.store';
|
||||
|
||||
export const pushConnection = mixins(
|
||||
externalHooks,
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { ElMessageBoxOptions } from 'element-ui/types/message-box';
|
||||
import type { ElMessageComponent, ElMessageOptions, MessageType } from 'element-ui/types/message';
|
||||
import { sanitizeHtml } from '@/utils';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
|
||||
let stickyNotificationQueue: ElNotificationComponent[] = [];
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { IPermissions } from '@/Interface';
|
||||
import { isAuthorized } from '@/utils';
|
||||
import { useUsersStore } from '@/stores/users';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { defineComponent } from 'vue';
|
||||
import type { Route } from 'vue-router';
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ import {
|
||||
WORKFLOW_ACTIVE_MODAL_KEY,
|
||||
} from '@/constants';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useSettingsStore } from '@/stores/settings';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
|
||||
export const workflowActivate = mixins(externalHooks, workflowHelpers, showMessage).extend({
|
||||
data() {
|
||||
|
||||
@@ -48,15 +48,15 @@ import mixins from 'vue-typed-mixins';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { getSourceItems } from '@/utils';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useRootStore } from '@/stores/n8nRootStore';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
import type { IWorkflowSettings } from 'n8n-workflow';
|
||||
import { useNDVStore } from '@/stores/ndv';
|
||||
import { useTemplatesStore } from '@/stores/templates';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes';
|
||||
import { useWorkflowsEEStore } from '@/stores/workflows.ee';
|
||||
import { useUsersStore } from '@/stores/users';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { useTemplatesStore } from '@/stores/templates.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { useWorkflowsEEStore } from '@/stores/workflows.ee.store';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import type { IPermissions } from '@/permissions';
|
||||
import { getWorkflowPermissions } from '@/permissions';
|
||||
import type { ICredentialsResponse } from '@/Interface';
|
||||
|
||||
@@ -10,9 +10,9 @@ import { showMessage } from '@/mixins/showMessage';
|
||||
import mixins from 'vue-typed-mixins';
|
||||
import { useTitleChange } from '@/composables/useTitleChange';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useRootStore } from '@/stores/n8nRootStore';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
|
||||
export const workflowRun = mixins(externalHooks, workflowHelpers, showMessage).extend({
|
||||
setup() {
|
||||
|
||||
Reference in New Issue
Block a user