mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Avoid passing around static state like default timezone (no-changelog) (#7221)
This commit is contained in:
committed by
GitHub
parent
62c096710f
commit
35bb42c1b9
@@ -37,6 +37,8 @@ import type { Workflow } from '@/Workflow';
|
||||
import { WorkflowDataProxy } from '@/WorkflowDataProxy';
|
||||
import { WorkflowHooks } from '@/WorkflowHooks';
|
||||
import * as NodeHelpers from '@/NodeHelpers';
|
||||
import { deepCopy } from '@/utils';
|
||||
import { getGlobalState } from '@/GlobalState';
|
||||
|
||||
export interface INodeTypesObject {
|
||||
[key: string]: INodeType;
|
||||
@@ -127,7 +129,6 @@ export function getNodeParameter(
|
||||
parameterName: string,
|
||||
itemIndex: number,
|
||||
mode: WorkflowExecuteMode,
|
||||
timezone: string,
|
||||
additionalKeys: IWorkflowDataProxyAdditionalKeys,
|
||||
executeData: IExecuteData,
|
||||
fallbackValue?: any,
|
||||
@@ -153,7 +154,6 @@ export function getNodeParameter(
|
||||
node.name,
|
||||
connectionInputData,
|
||||
mode,
|
||||
timezone,
|
||||
additionalKeys,
|
||||
);
|
||||
} catch (e) {
|
||||
@@ -240,7 +240,6 @@ export function getExecuteFunctions(
|
||||
parameterName,
|
||||
itemIndex,
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
{},
|
||||
fallbackValue,
|
||||
);
|
||||
@@ -255,7 +254,7 @@ export function getExecuteFunctions(
|
||||
return additionalData.restApiUrl;
|
||||
},
|
||||
getTimezone: (): string => {
|
||||
return additionalData.timezone;
|
||||
return workflow.settings.timezone ?? getGlobalState().defaultTimezone;
|
||||
},
|
||||
getExecuteData: (): IExecuteData => {
|
||||
return executeData;
|
||||
@@ -277,7 +276,6 @@ export function getExecuteFunctions(
|
||||
connectionInputData,
|
||||
{},
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
{},
|
||||
executeData,
|
||||
);
|
||||
@@ -421,7 +419,7 @@ export function getExecuteSingleFunctions(
|
||||
return additionalData.restApiUrl;
|
||||
},
|
||||
getTimezone: (): string => {
|
||||
return additionalData.timezone;
|
||||
return workflow.settings.timezone ?? getGlobalState().defaultTimezone;
|
||||
},
|
||||
getExecuteData: (): IExecuteData => {
|
||||
return executeData;
|
||||
@@ -444,7 +442,6 @@ export function getExecuteSingleFunctions(
|
||||
parameterName,
|
||||
itemIndex,
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
{},
|
||||
fallbackValue,
|
||||
);
|
||||
@@ -466,7 +463,6 @@ export function getExecuteSingleFunctions(
|
||||
connectionInputData,
|
||||
{},
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
{},
|
||||
executeData,
|
||||
);
|
||||
@@ -679,7 +675,6 @@ export function WorkflowExecuteAdditionalData(): IWorkflowExecuteAdditionalData
|
||||
executeWorkflow: async (workflowInfo: IExecuteWorkflowInfo): Promise<any> => {},
|
||||
sendDataToUI: (message: string) => {},
|
||||
restApiUrl: '',
|
||||
timezone: 'America/New_York',
|
||||
webhookBaseUrl: 'webhook',
|
||||
webhookWaitingBaseUrl: 'webhook-waiting',
|
||||
webhookTestBaseUrl: 'webhook-test',
|
||||
|
||||
Reference in New Issue
Block a user