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