fix(editor): Show the correct actions count in the nodes list (#6183)

Fixes N8N-6402
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-05-04 14:58:42 +00:00 committed by GitHub
parent 5abdba2304
commit 751e132968
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,7 @@ const { registerKeyHook } = useKeyboardNavigation();
const { workflowId } = useWorkflowsStore();
const activeItemId = computed(() => useKeyboardNavigation()?.activeItemId);
const actionCount = computed(() => props.elements.filter(({ type }) => type === 'action').length);
const expanded = ref(props.expanded ?? false);
function toggleExpanded() {
@ -94,7 +95,7 @@ registerKeyHook(`CategoryLeft_${props.category}`, {
:name="category"
:disabled="disabled"
:active="activeItemId === category"
:count="elements.length"
:count="actionCount"
:expanded="expanded"
:isTrigger="isTriggerCategory"
data-keyboard-nav-type="category"
@ -110,7 +111,7 @@ registerKeyHook(`CategoryLeft_${props.category}`, {
</n8n-tooltip>
</span>
</CategoryItem>
<div :class="$style.contentSlot" v-if="expanded && elements.length > 0 && $slots.default">
<div :class="$style.contentSlot" v-if="expanded && actionCount > 0 && $slots.default">
<slot />
</div>
<!-- Pass through listeners & empty slot to ItemsRenderer -->