diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index aca9f926fb..20ba275c25 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -250,7 +250,7 @@ export interface IWorkflowData { export interface IWorkflowDataUpdate { id?: string; name?: string; - nodes?: INode[]; + nodes?: Array; connections?: IConnections; settings?: IWorkflowSettings; active?: boolean; @@ -363,6 +363,7 @@ export interface ICredentialsResponse extends ICredentialsEncrypted { homeProject?: ProjectSharingData; currentUserHasAccess?: boolean; scopes?: Scope[]; + ownedBy?: Pick; } export interface ICredentialsBase { diff --git a/packages/editor-ui/src/composables/useCanvasMouseSelect.ts b/packages/editor-ui/src/composables/useCanvasMouseSelect.ts index a04342db23..525402e819 100644 --- a/packages/editor-ui/src/composables/useCanvasMouseSelect.ts +++ b/packages/editor-ui/src/composables/useCanvasMouseSelect.ts @@ -64,7 +64,7 @@ export default function useCanvasMouseSelect() { selectActive.value = false; } - function _getSelectionBox(event: MouseEvent) { + function _getSelectionBox(event: MouseEvent | TouchEvent) { const [x, y] = getMousePositionWithinNodeView(event); return { x: Math.min(x, selectBox.value.x), @@ -74,7 +74,7 @@ export default function useCanvasMouseSelect() { }; } - function _getNodesInSelection(event: MouseEvent): INodeUi[] { + function _getNodesInSelection(event: MouseEvent | TouchEvent): INodeUi[] { const returnNodes: INodeUi[] = []; const selectionBox = _getSelectionBox(event); @@ -128,9 +128,9 @@ export default function useCanvasMouseSelect() { _updateSelectBox(e); } - function mouseUpMouseSelect(e: MouseEvent) { + function mouseUpMouseSelect(e: MouseEvent | TouchEvent) { // Ignore right-click - if (e.button === 2 || isContextMenuOpen.value) return; + if (('button' in e && e.button === 2) || isContextMenuOpen.value) return; if (!selectActive.value) { if (isTouchDevice && e.target instanceof HTMLElement) { diff --git a/packages/editor-ui/src/stores/ui.store.ts b/packages/editor-ui/src/stores/ui.store.ts index 59d9439573..3467bd5217 100644 --- a/packages/editor-ui/src/stores/ui.store.ts +++ b/packages/editor-ui/src/stores/ui.store.ts @@ -212,7 +212,7 @@ export const useUIStore = defineStore(STORES.UI, { const settingsStore = useSettingsStore(); const deploymentType = settingsStore.deploymentType; - let contextKey = ''; + let contextKey: '' | '.cloud' | '.desktop' = ''; if (deploymentType === 'cloud') { contextKey = '.cloud'; } else if (deploymentType === 'desktop_mac' || deploymentType === 'desktop_win') { @@ -266,7 +266,7 @@ export const useUIStore = defineStore(STORES.UI, { }, }, }, - }; + } as const; }, getLastSelectedNode(): INodeUi | null { const workflowsStore = useWorkflowsStore(); diff --git a/packages/editor-ui/src/utils/nodeViewUtils.ts b/packages/editor-ui/src/utils/nodeViewUtils.ts index d03f1a7874..d8491765f2 100644 --- a/packages/editor-ui/src/utils/nodeViewUtils.ts +++ b/packages/editor-ui/src/utils/nodeViewUtils.ts @@ -16,6 +16,7 @@ import { NodeConnectionType } from 'n8n-workflow'; import type { BrowserJsPlumbInstance } from '@jsplumb/browser-ui'; import { EVENT_CONNECTION_MOUSEOUT, EVENT_CONNECTION_MOUSEOVER } from '@jsplumb/browser-ui'; import { useUIStore } from '@/stores/ui.store'; +import type { StyleValue } from 'vue'; /* Canvas constants and functions. @@ -609,7 +610,7 @@ export const getBackgroundStyles = ( scale: number, offsetPosition: XYPosition, executionPreview: boolean, -) => { +): StyleValue => { const squareSize = GRID_SIZE * scale; const dotSize = 1 * scale; const dotPosition = (GRID_SIZE / 2) * scale; @@ -623,7 +624,7 @@ export const getBackgroundStyles = ( }; } - const styles: object = { + const styles: StyleValue = { 'background-size': `${squareSize}px ${squareSize}px`, 'background-position': `left ${offsetPosition[0]}px top ${offsetPosition[1]}px`, }; diff --git a/packages/editor-ui/src/views/AuthView.vue b/packages/editor-ui/src/views/AuthView.vue index f3db74f4aa..3c95a67cb9 100644 --- a/packages/editor-ui/src/views/AuthView.vue +++ b/packages/editor-ui/src/views/AuthView.vue @@ -22,10 +22,11 @@