mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
refactor(editor): Improve linting for component and prop names (no-changelog) (#8169)
This commit is contained in:
committed by
GitHub
parent
639afcd7a5
commit
68cff4c59e
@@ -7,17 +7,17 @@
|
||||
trigger="manual"
|
||||
data-test-id="resource-locator-dropdown"
|
||||
>
|
||||
<div :class="$style.messageContainer" v-if="errorView">
|
||||
<div v-if="errorView" :class="$style.messageContainer">
|
||||
<slot name="error"></slot>
|
||||
</div>
|
||||
<div :class="$style.searchInput" v-if="filterable && !errorView" @keydown="onKeyDown">
|
||||
<div v-if="filterable && !errorView" :class="$style.searchInput" @keydown="onKeyDown">
|
||||
<n8n-input
|
||||
:modelValue="filter"
|
||||
:clearable="true"
|
||||
@update:modelValue="onFilterInput"
|
||||
ref="search"
|
||||
:model-value="filter"
|
||||
:clearable="true"
|
||||
:placeholder="$locale.baseText('resourceLocator.search.placeholder')"
|
||||
data-test-id="rlc-search"
|
||||
@update:modelValue="onFilterInput"
|
||||
>
|
||||
<template #prefix>
|
||||
<font-awesome-icon :class="$style.searchIcon" icon="search" />
|
||||
@@ -28,8 +28,8 @@
|
||||
{{ $locale.baseText('resourceLocator.mode.list.searchRequired') }}
|
||||
</div>
|
||||
<div
|
||||
:class="$style.messageContainer"
|
||||
v-else-if="!errorView && sortedResources.length === 0 && !loading"
|
||||
:class="$style.messageContainer"
|
||||
>
|
||||
{{ $locale.baseText('resourceLocator.mode.list.noResults') }}
|
||||
</div>
|
||||
@@ -42,6 +42,7 @@
|
||||
<div
|
||||
v-for="(result, i) in sortedResources"
|
||||
:key="result.value"
|
||||
:ref="`item-${i}`"
|
||||
:class="{
|
||||
[$style.resourceItem]: true,
|
||||
[$style.selected]: result.value === modelValue,
|
||||
@@ -51,7 +52,6 @@
|
||||
@click="() => onItemClick(result.value)"
|
||||
@mouseenter="() => onItemHover(i)"
|
||||
@mouseleave="() => onItemHoverLeave()"
|
||||
:ref="`item-${i}`"
|
||||
>
|
||||
<div :class="$style.resourceNameContainer">
|
||||
<span>{{ result.name }}</span>
|
||||
@@ -88,7 +88,7 @@ const SEARCH_BAR_HEIGHT_PX = 40;
|
||||
const SCROLL_MARGIN_PX = 10;
|
||||
|
||||
export default defineComponent({
|
||||
name: 'resource-locator-dropdown',
|
||||
name: 'ResourceLocatorDropdown',
|
||||
props: {
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
@@ -132,12 +132,6 @@ export default defineComponent({
|
||||
showHoverUrl: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.eventBus.on('keyDown', this.onKeyDown);
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.eventBus.off('keyDown', this.onKeyDown);
|
||||
},
|
||||
computed: {
|
||||
sortedResources(): IResourceLocatorResultExpanded[] {
|
||||
const seen = new Set();
|
||||
@@ -169,6 +163,29 @@ export default defineComponent({
|
||||
return notSelected;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
show(value) {
|
||||
if (value) {
|
||||
this.hoverIndex = 0;
|
||||
this.showHoverUrl = false;
|
||||
|
||||
setTimeout(() => {
|
||||
if (value && this.filterable && this.$refs.search) {
|
||||
(this.$refs.search as HTMLElement).focus();
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
loading() {
|
||||
setTimeout(() => this.onResultsEnd(), 0); // in case of filtering
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.eventBus.on('keyDown', this.onKeyDown);
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.eventBus.off('keyDown', this.onKeyDown);
|
||||
},
|
||||
methods: {
|
||||
openUrl(event: MouseEvent, url: string) {
|
||||
event.preventDefault();
|
||||
@@ -245,23 +262,6 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
show(value) {
|
||||
if (value) {
|
||||
this.hoverIndex = 0;
|
||||
this.showHoverUrl = false;
|
||||
|
||||
setTimeout(() => {
|
||||
if (value && this.filterable && this.$refs.search) {
|
||||
(this.$refs.search as HTMLElement).focus();
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
loading() {
|
||||
setTimeout(() => this.onResultsEnd(), 0); // in case of filtering
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user