mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Making parameter input components label configurable (#5195)
fix(editor): Making parameter input component label configurable
This commit is contained in:
parent
736e700902
commit
9ce526e784
|
@ -15,6 +15,7 @@
|
||||||
:value="credentialData[parameter.name]"
|
:value="credentialData[parameter.name]"
|
||||||
:documentationUrl="documentationUrl"
|
:documentationUrl="documentationUrl"
|
||||||
:showValidationWarnings="showValidationWarnings"
|
:showValidationWarnings="showValidationWarnings"
|
||||||
|
:label="label"
|
||||||
eventSource="credentials"
|
eventSource="credentials"
|
||||||
@change="valueChanged"
|
@change="valueChanged"
|
||||||
/>
|
/>
|
||||||
|
@ -24,9 +25,8 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
import { IParameterLabel } from 'n8n-workflow';
|
||||||
import { IUpdateInformation } from '../../Interface';
|
import { IUpdateInformation } from '@/Interface';
|
||||||
|
|
||||||
import ParameterInputExpanded from '../ParameterInputExpanded.vue';
|
import ParameterInputExpanded from '../ParameterInputExpanded.vue';
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
|
@ -40,6 +40,13 @@ export default Vue.extend({
|
||||||
components: {
|
components: {
|
||||||
ParameterInputExpanded,
|
ParameterInputExpanded,
|
||||||
},
|
},
|
||||||
|
data(): { label: IParameterLabel } {
|
||||||
|
return {
|
||||||
|
label: {
|
||||||
|
size: 'medium',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
valueChanged(parameterData: IUpdateInformation) {
|
valueChanged(parameterData: IUpdateInformation) {
|
||||||
const name = parameterData.name.split('.').pop();
|
const name = parameterData.name.split('.').pop();
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
:showTooltip="focused"
|
:showTooltip="focused"
|
||||||
:showOptions="menuExpanded"
|
:showOptions="menuExpanded"
|
||||||
:data-test-id="parameter.name"
|
:data-test-id="parameter.name"
|
||||||
|
:size="label.size"
|
||||||
>
|
>
|
||||||
<template #options>
|
<template #options>
|
||||||
<parameter-options
|
<parameter-options
|
||||||
|
@ -60,7 +61,7 @@ import ParameterOptions from './ParameterOptions.vue';
|
||||||
import Vue, { PropType } from 'vue';
|
import Vue, { PropType } from 'vue';
|
||||||
import ParameterInputWrapper from './ParameterInputWrapper.vue';
|
import ParameterInputWrapper from './ParameterInputWrapper.vue';
|
||||||
import { isValueExpression } from '@/utils';
|
import { isValueExpression } from '@/utils';
|
||||||
import { INodeParameterResourceLocator, INodeProperties } from 'n8n-workflow';
|
import { INodeParameterResourceLocator, INodeProperties, IParameterLabel } from 'n8n-workflow';
|
||||||
import { mapStores } from 'pinia';
|
import { mapStores } from 'pinia';
|
||||||
import { useWorkflowsStore } from '@/stores/workflows';
|
import { useWorkflowsStore } from '@/stores/workflows';
|
||||||
|
|
||||||
|
@ -84,6 +85,12 @@ export default Vue.extend({
|
||||||
eventSource: {
|
eventSource: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
label: {
|
||||||
|
type: Object as PropType<IParameterLabel>,
|
||||||
|
default: () => ({
|
||||||
|
size: 'small',
|
||||||
|
}),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
:showTooltip="focused"
|
:showTooltip="focused"
|
||||||
:showOptions="menuExpanded || focused || forceShowExpression"
|
:showOptions="menuExpanded || focused || forceShowExpression"
|
||||||
:bold="false"
|
:bold="false"
|
||||||
size="small"
|
:size="label.size"
|
||||||
color="text-dark"
|
color="text-dark"
|
||||||
>
|
>
|
||||||
<template #options>
|
<template #options>
|
||||||
|
@ -85,7 +85,7 @@ import {
|
||||||
isValueExpression,
|
isValueExpression,
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
import ParameterInputWrapper from '@/components/ParameterInputWrapper.vue';
|
import ParameterInputWrapper from '@/components/ParameterInputWrapper.vue';
|
||||||
import { INodeParameters, INodeProperties, INodePropertyMode } from 'n8n-workflow';
|
import { INodeParameters, INodeProperties, INodePropertyMode, IParameterLabel } from 'n8n-workflow';
|
||||||
import { BaseTextKey } from '@/plugins/i18n';
|
import { BaseTextKey } from '@/plugins/i18n';
|
||||||
import { mapStores } from 'pinia';
|
import { mapStores } from 'pinia';
|
||||||
import { useNDVStore } from '@/stores/ndv';
|
import { useNDVStore } from '@/stores/ndv';
|
||||||
|
@ -133,6 +133,12 @@ export default mixins(showMessage).extend({
|
||||||
value: {
|
value: {
|
||||||
type: [Number, String, Boolean, Array, Object] as PropType<INodeParameters>,
|
type: [Number, String, Boolean, Array, Object] as PropType<INodeParameters>,
|
||||||
},
|
},
|
||||||
|
label: {
|
||||||
|
type: Object as PropType<IParameterLabel>,
|
||||||
|
default: () => ({
|
||||||
|
size: 'small',
|
||||||
|
}),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const mappingTooltipDismissHandler = this.onMappingTooltipDismissed.bind(this);
|
const mappingTooltipDismissHandler = this.onMappingTooltipDismissed.bind(this);
|
||||||
|
|
|
@ -1132,6 +1132,10 @@ export interface IParameterDependencies {
|
||||||
[key: string]: string[];
|
[key: string]: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type IParameterLabel = {
|
||||||
|
size?: 'small' | 'medium';
|
||||||
|
};
|
||||||
|
|
||||||
export interface IPollResponse {
|
export interface IPollResponse {
|
||||||
closeFunction?: () => Promise<void>;
|
closeFunction?: () => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue