feat: NDV notify if community node has update (#17146)

Co-authored-by: Roman Davydchuk <roman.davydchuk@n8n.io>
This commit is contained in:
Michael Kret
2025-07-17 13:15:25 +03:00
committed by GitHub
parent 8a2756368b
commit 0237d8b8ec
7 changed files with 115 additions and 5 deletions

View File

@@ -3,9 +3,9 @@ import type { ITab } from '@/Interface';
import { COMMUNITY_NODES_INSTALLATION_DOCS_URL } from '@/constants';
import { useNDVStore } from '@/stores/ndv.store';
import { useWorkflowsStore } from '@/stores/workflows.store';
import type { INodeTypeDescription } from 'n8n-workflow';
import type { INodeTypeDescription, PublicInstalledPackage } from 'n8n-workflow';
import { NodeConnectionTypes } from 'n8n-workflow';
import { computed } from 'vue';
import { computed, onMounted, ref } from 'vue';
import { useExternalHooks } from '@/composables/useExternalHooks';
import { useI18n } from '@n8n/i18n';
@@ -13,6 +13,8 @@ import { useTelemetry } from '@/composables/useTelemetry';
import { isCommunityPackageName } from '@/utils/nodeTypesUtils';
import { N8nTabs } from '@n8n/design-system';
import { useNodeDocsUrl } from '@/composables/useNodeDocsUrl';
import { useCommunityNodesStore } from '@/stores/communityNodes.store';
import { useUsersStore } from '@/stores/users.store';
export type Tab = 'settings' | 'params' | 'communityNode' | 'docs';
type Props = {
@@ -37,9 +39,12 @@ const workflowsStore = useWorkflowsStore();
const i18n = useI18n();
const telemetry = useTelemetry();
const { docsUrl } = useNodeDocsUrl({ nodeType: () => props.nodeType });
const communityNodesStore = useCommunityNodesStore();
const activeNode = computed(() => ndvStore.activeNode);
const installedPackage = ref<PublicInstalledPackage | undefined>(undefined);
const isCommunityNode = computed(() => {
const nodeType = props.nodeType;
if (nodeType) {
@@ -67,6 +72,7 @@ const options = computed(() => {
{
label: i18n.baseText('nodeSettings.settings'),
value: 'settings',
notification: installedPackage.value?.updateAvailable ? true : undefined,
},
];
@@ -129,6 +135,12 @@ function onTooltipClick(tab: string | number, event: MouseEvent) {
telemetry.track('user clicked cnr docs link', { source: 'node details view' });
}
}
onMounted(async () => {
if (isCommunityNode.value && useUsersStore().isInstanceOwner) {
installedPackage.value = await communityNodesStore.getInstalledPackage(packageName.value);
}
});
</script>
<template>