mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-31 15:37:26 -08:00
fix(n8n Form Node): Popup does not work in some browsers (no-changelog) (#12176)
This commit is contained in:
parent
454b022305
commit
73f0c4cca9
|
@ -37,6 +37,7 @@ import { useAssistantStore } from '@/stores/assistant.store';
|
|||
import NodeExecutionErrorMessage from '@/components/NodeExecutionErrorMessage.vue';
|
||||
import type { IExecutionResponse } from '@/Interface';
|
||||
import { EASY_AI_WORKFLOW_JSON } from '@/constants.workflows';
|
||||
import { clearPopupWindowState } from '../utils/executionUtils';
|
||||
|
||||
export function usePushConnection({ router }: { router: ReturnType<typeof useRouter> }) {
|
||||
const workflowHelpers = useWorkflowHelpers({ router });
|
||||
|
@ -201,6 +202,7 @@ export function usePushConnection({ router }: { router: ReturnType<typeof useRou
|
|||
}
|
||||
|
||||
if (receivedData.type === 'executionFinished') {
|
||||
clearPopupWindowState();
|
||||
const workflow = workflowsStore.getWorkflowById(receivedData.data.workflowId);
|
||||
if (workflow?.meta?.templateId) {
|
||||
const isEasyAIWorkflow =
|
||||
|
|
|
@ -85,7 +85,7 @@ import { TelemetryHelpers } from 'n8n-workflow';
|
|||
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useSettingsStore } from './settings.store';
|
||||
import { closeFormPopupWindow, openFormPopupWindow } from '@/utils/executionUtils';
|
||||
import { clearPopupWindowState, openFormPopupWindow } from '@/utils/executionUtils';
|
||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { updateCurrentUserSettings } from '@/api/users';
|
||||
|
@ -1608,7 +1608,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => {
|
|||
uiStore.removeActiveAction('workflowRunning');
|
||||
workflowHelpers.setDocumentTitle(workflowName.value, 'IDLE');
|
||||
|
||||
closeFormPopupWindow();
|
||||
clearPopupWindowState();
|
||||
|
||||
const runData = workflowExecutionData.value?.data?.resultData.runData ?? {};
|
||||
for (const nodeName in runData) {
|
||||
|
|
|
@ -82,27 +82,22 @@ export const executionFilterToQueryFilter = (
|
|||
return queryFilter;
|
||||
};
|
||||
|
||||
let formPopupWindow: Window | null = null;
|
||||
let formPopupWindow: boolean = false;
|
||||
|
||||
export const openFormPopupWindow = (url: string) => {
|
||||
if (!formPopupWindow || formPopupWindow.closed) {
|
||||
if (!formPopupWindow) {
|
||||
const height = 700;
|
||||
const width = window.innerHeight - 50;
|
||||
const left = (window.innerWidth - height) / 2;
|
||||
const top = 50;
|
||||
const features = `width=${height},height=${width},left=${left},top=${top},resizable=yes,scrollbars=yes`;
|
||||
const windowName = `form-waiting-since-${Date.now()}`;
|
||||
formPopupWindow = window.open(url, windowName, features);
|
||||
} else {
|
||||
formPopupWindow.location = url;
|
||||
formPopupWindow.focus();
|
||||
window.open(url, windowName, features);
|
||||
formPopupWindow = true;
|
||||
}
|
||||
};
|
||||
|
||||
export const closeFormPopupWindow = () => {
|
||||
formPopupWindow?.close();
|
||||
formPopupWindow = null;
|
||||
};
|
||||
export const clearPopupWindowState = () => (formPopupWindow = false);
|
||||
|
||||
export function displayForm({
|
||||
nodes,
|
||||
|
|
Loading…
Reference in a new issue