mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(editor): Fix typing $
in inline expression field reloading node parameters form (#6374)
* fix(editor): Fix typing `$` in inline expression field reloading node parameters form
* ⚡ Setting resource mapper empty field values to empty strings
This commit is contained in:
parent
f61b776bea
commit
4c0d4ebd99
|
@ -514,10 +514,10 @@ export default defineComponent({
|
|||
};
|
||||
},
|
||||
watch: {
|
||||
dependentParametersValues() {
|
||||
async dependentParametersValues() {
|
||||
// Reload the remote parameters whenever a parameter
|
||||
// on which the current field depends on changes
|
||||
void this.loadRemoteParameterOptions();
|
||||
await this.loadRemoteParameterOptions();
|
||||
},
|
||||
value() {
|
||||
if (this.parameter.type === 'color' && this.getArgument('showAlpha') === true) {
|
||||
|
|
|
@ -129,7 +129,12 @@
|
|||
import { defineComponent } from 'vue';
|
||||
import type { PropType } from 'vue';
|
||||
import { mapStores } from 'pinia';
|
||||
import type { INodeParameters, INodeProperties, NodeParameterValue } from 'n8n-workflow';
|
||||
import type {
|
||||
INodeParameters,
|
||||
INodeProperties,
|
||||
INodeTypeDescription,
|
||||
NodeParameterValue,
|
||||
} from 'n8n-workflow';
|
||||
import { deepCopy } from 'n8n-workflow';
|
||||
|
||||
import type { INodeUi, IUpdateInformation } from '@/Interface';
|
||||
|
@ -236,7 +241,7 @@ export default defineComponent({
|
|||
return index < this.filteredParameters.length ? index : this.filteredParameters.length - 1;
|
||||
},
|
||||
mainNodeAuthField(): INodeProperties | null {
|
||||
return getMainAuthField(this.nodeType || undefined);
|
||||
return getMainAuthField(this.nodeType || null);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -456,9 +456,15 @@ export default defineComponent({
|
|||
this.$emit('input', { ...this.value, __regex: mode.extractValue.regex });
|
||||
}
|
||||
},
|
||||
dependentParametersValues() {
|
||||
dependentParametersValues(currentValue, oldValue) {
|
||||
const isUpdated = oldValue !== null && currentValue !== null && oldValue !== currentValue;
|
||||
// Reset value if dependent parameters change
|
||||
if (this.value && isResourceLocatorValue(this.value) && this.value.value !== '') {
|
||||
if (
|
||||
isUpdated &&
|
||||
this.value &&
|
||||
isResourceLocatorValue(this.value) &&
|
||||
this.value.value !== ''
|
||||
) {
|
||||
this.$emit('input', {
|
||||
...this.value,
|
||||
cachedResultName: '',
|
||||
|
|
|
@ -186,10 +186,10 @@ function getFieldDescription(field: ResourceMapperField): string {
|
|||
return '';
|
||||
}
|
||||
|
||||
function getParameterValue(parameterName: string) {
|
||||
function getParameterValue(parameterName: string): string | number | boolean | null {
|
||||
const fieldName = parseResourceMapperFieldName(parameterName);
|
||||
if (fieldName && props.paramValue.value) {
|
||||
return props.paramValue.value[fieldName];
|
||||
return props.paramValue.value[fieldName] || '';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -19,14 +19,14 @@ import { fieldCannotBeDeleted, isResourceMapperValue, parseResourceMapperFieldNa
|
|||
import { i18n as locale } from '@/plugins/i18n';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
|
||||
interface Props {
|
||||
type Props = {
|
||||
parameter: INodeProperties;
|
||||
node: INode | null;
|
||||
path: string;
|
||||
inputSize: string;
|
||||
labelSize: string;
|
||||
dependentParametersValues: string | null;
|
||||
}
|
||||
dependentParametersValues?: string | null;
|
||||
};
|
||||
|
||||
const nodeTypesStore = useNodeTypesStore();
|
||||
const ndvStore = useNDVStore();
|
||||
|
|
Loading…
Reference in a new issue