mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
✨ Make it possible to define dependencies for loadOptions
This commit is contained in:
@@ -116,6 +116,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import { get } from 'lodash';
|
||||
|
||||
import {
|
||||
INodeUi,
|
||||
@@ -206,11 +207,34 @@ export default mixins(
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
dependentParametersValues () {
|
||||
// Reload the remote parameters whenever a parameter
|
||||
// on which the current field depends on changes
|
||||
this.loadRemoteParameterOptions();
|
||||
},
|
||||
value () {
|
||||
this.tempValue = this.displayValue as string;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
dependentParametersValues (): string | null {
|
||||
const loadOptionsDependsOn = this.getArgument('loadOptionsDependsOn') as string[] | undefined;
|
||||
|
||||
if (loadOptionsDependsOn === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get the resolved parameter values of the current node
|
||||
const currentNodeParameters = this.$store.getters.activeNode.parameters;
|
||||
const resolvedNodeParameters = this.getResolveNodeParameters(currentNodeParameters);
|
||||
|
||||
let returnValues: string[] = [];
|
||||
for (const parameterPath of loadOptionsDependsOn) {
|
||||
returnValues.push(get(resolvedNodeParameters, parameterPath));
|
||||
}
|
||||
|
||||
return returnValues.join('|');
|
||||
},
|
||||
node (): INodeUi | null {
|
||||
if (this.isCredential === true) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user