mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
🔃Add unction getCurrentNodeParameters to get currents parameters in loading function
This commit is contained in:
@@ -53,8 +53,6 @@ declare module 'jsplumb' {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// EndpointOptions from jsplumb seems incomplete and wrong so we define an own one
|
||||
export interface IEndpointOptions {
|
||||
anchor?: any; // tslint:disable-line:no-any
|
||||
@@ -353,7 +351,6 @@ export interface IPushDataExecutionStarted {
|
||||
workflowName?: string;
|
||||
}
|
||||
|
||||
|
||||
export interface IPushDataExecutionFinished {
|
||||
data: IRun;
|
||||
executionIdActive: string;
|
||||
|
||||
@@ -400,10 +400,9 @@ export default mixins(
|
||||
},
|
||||
methods: {
|
||||
async loadRemoteParameterOptions () {
|
||||
if (this.node === null || this.remoteMethod === undefined) {
|
||||
if (this.node === null || this.remoteMethod === undefined || this.remoteParameterOptionsLoading) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.remoteParameterOptionsLoadingIssues = null;
|
||||
this.remoteParameterOptionsLoading = true;
|
||||
this.remoteParameterOptions.length = 0;
|
||||
@@ -513,6 +512,28 @@ export default mixins(
|
||||
this.$watch(() => this.node!.credentials, () => {
|
||||
this.loadRemoteParameterOptions();
|
||||
}, { deep: true, immediate: true });
|
||||
|
||||
// Reload function on change element from
|
||||
// displayOptions.typeOptions.reloadOnChange parameters
|
||||
if (this.parameter.typeOptions && this.parameter.typeOptions.reloadOnChange) {
|
||||
// Get all paramter in reloadOnChange property
|
||||
// This reload when parameters in reloadOnChange is updated
|
||||
const paramtersOnChange : string[] = this.parameter.typeOptions.reloadOnChange;
|
||||
for (let i = 0; i < paramtersOnChange.length; i++) {
|
||||
const parameter = paramtersOnChange[i] as string;
|
||||
if (parameter in this.node.parameters) {
|
||||
this.$watch(() => {
|
||||
if (this.node && this.node.parameters && this.node.parameters[parameter]) {
|
||||
return this.node.parameters![parameter];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}, () => {
|
||||
this.loadRemoteParameterOptions();
|
||||
}, { deep: true, immediate: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -157,8 +157,8 @@ export const restApi = Vue.extend({
|
||||
nodeType,
|
||||
methodName,
|
||||
credentials,
|
||||
currentNodeParameters : this.$store.getters.activeNode.parameters,
|
||||
};
|
||||
|
||||
return self.restApi().makeRestApiRequest('GET', '/node-parameter-options', sendData);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user