mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
refactor(editor): Correct some prop types (no-changelog) (#10907)
This commit is contained in:
parent
769ddfdd1d
commit
60ee0d4ce7
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import AssistantIcon from '../AskAssistantIcon/AssistantIcon.vue';
|
import AssistantIcon from '../AskAssistantIcon/AssistantIcon.vue';
|
||||||
|
|
||||||
withDefaults(defineProps<{ size: 'small' | 'mini' }>(), {
|
withDefaults(defineProps<{ size?: 'small' | 'mini' }>(), {
|
||||||
size: 'small',
|
size: 'small',
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { computed } from 'vue';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
size: 'mini' | 'small' | 'medium' | 'large';
|
size?: 'mini' | 'small' | 'medium' | 'large';
|
||||||
theme: 'default' | 'blank' | 'disabled';
|
theme?: 'default' | 'blank' | 'disabled';
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
withDefaults(defineProps<{ text: string; size: 'small' | 'medium' | 'large' | 'xlarge' }>(), {
|
withDefaults(defineProps<{ text: string; size?: 'small' | 'medium' | 'large' | 'xlarge' }>(), {
|
||||||
text: '',
|
text: '',
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,12 +7,12 @@ import { useI18n } from 'n8n-design-system/composables/useI18n';
|
||||||
const MIN_LINES = 4;
|
const MIN_LINES = 4;
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
title: string;
|
title?: string;
|
||||||
content: string;
|
content?: string;
|
||||||
replacing: boolean;
|
replacing?: boolean;
|
||||||
replaced: boolean;
|
replaced?: boolean;
|
||||||
error: boolean;
|
error?: boolean;
|
||||||
streaming: boolean;
|
streaming?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
type Line =
|
type Line =
|
||||||
|
|
|
@ -8,9 +8,9 @@ import AssistantText from '../AskAssistantText/AssistantText.vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
size: 'small' | 'medium';
|
size?: 'small' | 'medium';
|
||||||
static: boolean;
|
static?: boolean;
|
||||||
asked: boolean;
|
asked?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import Avatar from 'vue-boring-avatars';
|
||||||
import { getInitials } from '../../utils/labelUtil';
|
import { getInitials } from '../../utils/labelUtil';
|
||||||
|
|
||||||
interface AvatarProps {
|
interface AvatarProps {
|
||||||
firstName: string;
|
firstName?: string;
|
||||||
lastName: string;
|
lastName?: string;
|
||||||
size?: 'xsmall' | 'small' | 'medium' | 'large';
|
size?: 'xsmall' | 'small' | 'medium' | 'large';
|
||||||
colors?: string[];
|
colors?: string[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ const sortedUsers = computed(() =>
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const setFilter = (value: string) => {
|
const setFilter = (value: string = '') => {
|
||||||
filter.value = value;
|
filter.value = value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ export function createCanvasNodeProvide({
|
||||||
} = {}) {
|
} = {}) {
|
||||||
const props = createCanvasNodeProps({ id, label, selected, readOnly, data });
|
const props = createCanvasNodeProps({ id, label, selected, readOnly, data });
|
||||||
return {
|
return {
|
||||||
[`${CanvasNodeKey}`]: {
|
[String(CanvasNodeKey)]: {
|
||||||
id: ref(props.id),
|
id: ref(props.id),
|
||||||
label: ref(props.label),
|
label: ref(props.label),
|
||||||
selected: ref(props.selected),
|
selected: ref(props.selected),
|
||||||
|
@ -136,7 +136,7 @@ export function createCanvasHandleProvide({
|
||||||
isReadOnly?: boolean;
|
isReadOnly?: boolean;
|
||||||
} = {}) {
|
} = {}) {
|
||||||
return {
|
return {
|
||||||
[`${CanvasNodeHandleKey}`]: {
|
[String(CanvasNodeHandleKey)]: {
|
||||||
label: ref(label),
|
label: ref(label),
|
||||||
mode: ref(mode),
|
mode: ref(mode),
|
||||||
type: ref(type),
|
type: ref(type),
|
||||||
|
|
|
@ -7,13 +7,13 @@ type Props = {
|
||||||
label?: string;
|
label?: string;
|
||||||
hint?: string;
|
hint?: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
copyButtonText: string;
|
copyButtonText?: string;
|
||||||
toastTitle?: string;
|
toastTitle?: string;
|
||||||
toastMessage?: string;
|
toastMessage?: string;
|
||||||
size?: 'medium' | 'large';
|
size?: 'medium' | 'large';
|
||||||
collapse?: boolean;
|
collapse?: boolean;
|
||||||
redactValue?: boolean;
|
redactValue?: boolean;
|
||||||
disableCopy: boolean;
|
disableCopy?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ICredentialType, INodeProperties, NodeParameterValue } from 'n8n-workflow';
|
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import ScopesNotice from '@/components/ScopesNotice.vue';
|
import ScopesNotice from '@/components/ScopesNotice.vue';
|
||||||
import NodeCredentials from '@/components/NodeCredentials.vue';
|
import NodeCredentials from '@/components/NodeCredentials.vue';
|
||||||
|
@ -12,7 +12,7 @@ type Props = {
|
||||||
parameter: INodeProperties;
|
parameter: INodeProperties;
|
||||||
node?: INodeUi;
|
node?: INodeUi;
|
||||||
inputSize?: 'small' | 'large' | 'mini' | 'medium' | 'xlarge';
|
inputSize?: 'small' | 'large' | 'mini' | 'medium' | 'xlarge';
|
||||||
displayValue: NodeParameterValue;
|
displayValue: string;
|
||||||
isReadOnly: boolean;
|
isReadOnly: boolean;
|
||||||
displayTitle: string;
|
displayTitle: string;
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { onMounted, reactive, toRefs, onBeforeUnmount } from 'vue';
|
||||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
placeholder: string;
|
placeholder?: string;
|
||||||
modelValue: string;
|
modelValue?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
withDefaults(defineProps<Props>(), {
|
withDefaults(defineProps<Props>(), {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import LinkItem from '../ItemTypes/LinkItem.vue';
|
||||||
import CategorizedItemsRenderer from './CategorizedItemsRenderer.vue';
|
import CategorizedItemsRenderer from './CategorizedItemsRenderer.vue';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
elements: INodeCreateElement[];
|
elements?: INodeCreateElement[];
|
||||||
activeIndex?: number;
|
activeIndex?: number;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
lazyRender?: boolean;
|
lazyRender?: boolean;
|
||||||
|
|
|
@ -55,6 +55,7 @@ const props = withDefaults(
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
isProductionExecutionPreview: false,
|
isProductionExecutionPreview: false,
|
||||||
|
readOnly: false,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ const dateTimePickerOptions = ref({
|
||||||
});
|
});
|
||||||
const isFocused = ref(false);
|
const isFocused = ref(false);
|
||||||
|
|
||||||
const displayValue = computed<string | number | boolean | null>(() => {
|
const displayValue = computed(() => {
|
||||||
if (remoteParameterOptionsLoadingIssues.value) {
|
if (remoteParameterOptionsLoadingIssues.value) {
|
||||||
if (!nodeType.value || nodeType.value?.codex?.categories?.includes(CORE_NODES_CATEGORY)) {
|
if (!nodeType.value || nodeType.value?.codex?.categories?.includes(CORE_NODES_CATEGORY)) {
|
||||||
return i18n.baseText('parameterInput.loadOptionsError');
|
return i18n.baseText('parameterInput.loadOptionsError');
|
||||||
|
|
|
@ -27,7 +27,7 @@ type Props = {
|
||||||
path: string;
|
path: string;
|
||||||
inputSize: 'small' | 'medium';
|
inputSize: 'small' | 'medium';
|
||||||
labelSize: 'small' | 'medium';
|
labelSize: 'small' | 'medium';
|
||||||
teleported: boolean;
|
teleported?: boolean;
|
||||||
dependentParametersValues?: string | null;
|
dependentParametersValues?: string | null;
|
||||||
isReadOnly?: boolean;
|
isReadOnly?: boolean;
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,7 +25,7 @@ interface TreeNode {
|
||||||
}
|
}
|
||||||
export interface Props {
|
export interface Props {
|
||||||
node: INodeUi;
|
node: INodeUi;
|
||||||
runIndex: number;
|
runIndex?: number;
|
||||||
hideTitle?: boolean;
|
hideTitle?: boolean;
|
||||||
slim?: boolean;
|
slim?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,10 @@ import { computed } from 'vue';
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
saved: boolean;
|
saved: boolean;
|
||||||
isSaving: boolean;
|
isSaving?: boolean;
|
||||||
disabled: boolean;
|
disabled?: boolean;
|
||||||
type: string;
|
type?: string;
|
||||||
withShortcut: boolean;
|
withShortcut?: boolean;
|
||||||
shortcutTooltip?: string;
|
shortcutTooltip?: string;
|
||||||
savingLabel?: string;
|
savingLabel?: string;
|
||||||
}>(),
|
}>(),
|
||||||
|
|
|
@ -10,11 +10,11 @@ import type { BaseTextKey } from '@/plugins/i18n';
|
||||||
|
|
||||||
interface TagsManagerProps {
|
interface TagsManagerProps {
|
||||||
modalKey: string;
|
modalKey: string;
|
||||||
usageLocaleKey: BaseTextKey;
|
usageLocaleKey?: BaseTextKey;
|
||||||
usageColumnTitleLocaleKey: BaseTextKey;
|
usageColumnTitleLocaleKey?: BaseTextKey;
|
||||||
titleLocaleKey: BaseTextKey;
|
titleLocaleKey?: BaseTextKey;
|
||||||
noTagsTitleLocaleKey: BaseTextKey;
|
noTagsTitleLocaleKey?: BaseTextKey;
|
||||||
noTagsDescriptionLocaleKey: BaseTextKey;
|
noTagsDescriptionLocaleKey?: BaseTextKey;
|
||||||
tags: ITag[];
|
tags: ITag[];
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
onFetchTags: () => Promise<void>;
|
onFetchTags: () => Promise<void>;
|
||||||
|
|
|
@ -22,7 +22,7 @@ import { useWorkflowResourcesLocator } from './useWorkflowResourcesLocator';
|
||||||
interface Props {
|
interface Props {
|
||||||
modelValue: INodeParameterResourceLocator;
|
modelValue: INodeParameterResourceLocator;
|
||||||
eventBus?: EventBus;
|
eventBus?: EventBus;
|
||||||
inputSize: 'small' | 'mini' | 'medium' | 'large' | 'xlarge';
|
inputSize?: 'small' | 'mini' | 'medium' | 'large' | 'xlarge';
|
||||||
isValueExpression?: boolean;
|
isValueExpression?: boolean;
|
||||||
isReadOnly?: boolean;
|
isReadOnly?: boolean;
|
||||||
path: string;
|
path: string;
|
||||||
|
|
|
@ -88,7 +88,7 @@ describe('CanvasHandleRenderer', () => {
|
||||||
},
|
},
|
||||||
global: {
|
global: {
|
||||||
provide: {
|
provide: {
|
||||||
[`${CanvasNodeHandleKey}`]: { label: ref(label) },
|
[String(CanvasNodeHandleKey)]: { label: ref(label) },
|
||||||
},
|
},
|
||||||
stubs: {
|
stubs: {
|
||||||
Handle,
|
Handle,
|
||||||
|
|
|
@ -18,8 +18,8 @@ const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
executions: ExecutionSummaryWithScopes[];
|
executions: ExecutionSummaryWithScopes[];
|
||||||
filters: ExecutionFilterType;
|
filters: ExecutionFilterType;
|
||||||
total: number;
|
total?: number;
|
||||||
estimated: boolean;
|
estimated?: boolean;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
total: 0,
|
total: 0,
|
||||||
|
|
|
@ -19,7 +19,7 @@ interface IWorkflowSaveSettings {
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
initiallyExpanded: boolean;
|
initiallyExpanded?: boolean;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
initiallyExpanded: false,
|
initiallyExpanded: false,
|
||||||
|
|
Loading…
Reference in a new issue