Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Making parameter input components label configurable #5195

Merged
merged 1 commit into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:value="credentialData[parameter.name]"
:documentationUrl="documentationUrl"
:showValidationWarnings="showValidationWarnings"
:label="label"
eventSource="credentials"
@change="valueChanged"
/>
Expand All @@ -24,9 +25,8 @@

<script lang="ts">
import Vue from 'vue';

import { IUpdateInformation } from '../../Interface';

import { IParameterLabel } from 'n8n-workflow';
import { IUpdateInformation } from '@/Interface';
import ParameterInputExpanded from '../ParameterInputExpanded.vue';

export default Vue.extend({
Expand All @@ -40,6 +40,13 @@ export default Vue.extend({
components: {
ParameterInputExpanded,
},
data(): { label: IParameterLabel } {
return {
label: {
size: 'medium',
},
};
},
methods: {
valueChanged(parameterData: IUpdateInformation) {
const name = parameterData.name.split('.').pop();
Expand Down
9 changes: 8 additions & 1 deletion packages/editor-ui/src/components/ParameterInputExpanded.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:showTooltip="focused"
:showOptions="menuExpanded"
:data-test-id="parameter.name"
:size="label.size"
>
<template #options>
<parameter-options
Expand Down Expand Up @@ -60,7 +61,7 @@ import ParameterOptions from './ParameterOptions.vue';
import Vue, { PropType } from 'vue';
import ParameterInputWrapper from './ParameterInputWrapper.vue';
import { isValueExpression } from '@/utils';
import { INodeParameterResourceLocator, INodeProperties } from 'n8n-workflow';
import { INodeParameterResourceLocator, INodeProperties, IParameterLabel } from 'n8n-workflow';
import { mapStores } from 'pinia';
import { useWorkflowsStore } from '@/stores/workflows';

Expand All @@ -84,6 +85,12 @@ export default Vue.extend({
eventSource: {
type: String,
},
label: {
type: Object as PropType<IParameterLabel>,
default: () => ({
size: 'small',
}),
},
},
data() {
return {
Expand Down
10 changes: 8 additions & 2 deletions packages/editor-ui/src/components/ParameterInputFull.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:showTooltip="focused"
:showOptions="menuExpanded || focused || forceShowExpression"
:bold="false"
size="small"
:size="label.size"
color="text-dark"
>
<template #options>
Expand Down Expand Up @@ -85,7 +85,7 @@ import {
isValueExpression,
} from '@/utils';
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 { mapStores } from 'pinia';
import { useNDVStore } from '@/stores/ndv';
Expand Down Expand Up @@ -133,6 +133,12 @@ export default mixins(showMessage).extend({
value: {
type: [Number, String, Boolean, Array, Object] as PropType<INodeParameters>,
},
label: {
type: Object as PropType<IParameterLabel>,
default: () => ({
size: 'small',
}),
},
},
created() {
const mappingTooltipDismissHandler = this.onMappingTooltipDismissed.bind(this);
Expand Down
4 changes: 4 additions & 0 deletions packages/workflow/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,10 @@ export interface IParameterDependencies {
[key: string]: string[];
}

export type IParameterLabel = {
size?: 'small' | 'medium';
};

export interface IPollResponse {
closeFunction?: () => Promise<void>;
}
Expand Down