fix(editor): Fix node icon in node creator header (#9782)

This commit is contained in:
Elias Meire
2024-06-18 10:05:18 +02:00
committed by GitHub
parent 08c6e9b571
commit b7d356f49c
3 changed files with 26 additions and 16 deletions

View File

@@ -19,7 +19,12 @@
import type { IVersionNode, SimplifiedNodeType } from '@/Interface';
import { useRootStore } from '@/stores/n8nRoot.store';
import { useUIStore } from '@/stores/ui.store';
import { getBadgeIconUrl, getNodeIcon, getNodeIconUrl } from '@/utils/nodeTypesUtils';
import {
getBadgeIconUrl,
getNodeIcon,
getNodeIconColor,
getNodeIconUrl,
} from '@/utils/nodeTypesUtils';
import type { INodeTypeDescription } from 'n8n-workflow';
import { computed } from 'vue';
@@ -75,14 +80,7 @@ const iconType = computed(() => {
return 'unknown';
});
const color = computed(() => {
const nodeType = props.nodeType;
if (nodeType && 'iconColor' in nodeType && nodeType.iconColor) {
return `var(--color-node-icon-${nodeType.iconColor})`;
}
return nodeType?.defaults?.color?.toString() ?? props.colorDefault ?? '';
});
const color = computed(() => getNodeIconColor(props.nodeType) ?? props.colorDefault ?? '');
const iconSource = computed<NodeIconSource>(() => {
const nodeType = props.nodeType;