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