refactor(editor): Correct some prop types (no-changelog) (#10907)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-09-23 09:19:37 +02:00 committed by GitHub
parent 769ddfdd1d
commit 60ee0d4ce7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 43 additions and 42 deletions

View file

@ -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>

View file

@ -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',

View file

@ -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',
});

View file

@ -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 =

View file

@ -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>(), {

View file

@ -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[];
}

View file

@ -70,7 +70,7 @@ const sortedUsers = computed(() =>
}),
);
const setFilter = (value: string) => {
const setFilter = (value: string = '') => {
filter.value = value;
};

View file

@ -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),

View file

@ -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>(), {

View file

@ -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;
};

View file

@ -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>(), {

View file

@ -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;

View file

@ -55,6 +55,7 @@ const props = withDefaults(
}>(),
{
isProductionExecutionPreview: false,
readOnly: false,
},
);

View file

@ -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');

View file

@ -27,7 +27,7 @@ type Props = {
path: string;
inputSize: 'small' | 'medium';
labelSize: 'small' | 'medium';
teleported: boolean;
teleported?: boolean;
dependentParametersValues?: string | null;
isReadOnly?: boolean;
};

View file

@ -25,7 +25,7 @@ interface TreeNode {
}
export interface Props {
node: INodeUi;
runIndex: number;
runIndex?: number;
hideTitle?: boolean;
slim?: boolean;
}

View file

@ -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;
}>(),

View file

@ -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>;

View file

@ -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;

View file

@ -88,7 +88,7 @@ describe('CanvasHandleRenderer', () => {
},
global: {
provide: {
[`${CanvasNodeHandleKey}`]: { label: ref(label) },
[String(CanvasNodeHandleKey)]: { label: ref(label) },
},
stubs: {
Handle,

View file

@ -18,8 +18,8 @@ const props = withDefaults(
defineProps<{
executions: ExecutionSummaryWithScopes[];
filters: ExecutionFilterType;
total: number;
estimated: boolean;
total?: number;
estimated?: boolean;
}>(),
{
total: 0,

View file

@ -19,7 +19,7 @@ interface IWorkflowSaveSettings {
const props = withDefaults(
defineProps<{
initiallyExpanded: boolean;
initiallyExpanded?: boolean;
}>(),
{
initiallyExpanded: false,