mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-11 16:31:57 +00:00
fix: remove hardcoded SubDomain conditional logic from EntityAvatar
- Remove special case handling for SubDomain icons
- Remove unused SubDomainIcon import
- Let getDefaultIconForEntityType handle all entity types uniformly
- Ensures consistent icon selection across all entity types
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f891d09724
commit
192ccb6cf1
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
import { Avatar, useTheme } from '@mui/material';
|
import { Avatar, useTheme } from '@mui/material';
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
import { ReactComponent as SubDomainIcon } from '../../../assets/svg/ic-subdomain.svg';
|
|
||||||
import {
|
import {
|
||||||
getDefaultIconForEntityType,
|
getDefaultIconForEntityType,
|
||||||
ICON_MAP,
|
ICON_MAP,
|
||||||
@ -48,9 +47,6 @@ export const EntityAvatar: FC<EntityAvatarProps> = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const bgColor = entity.style?.color || theme.palette.allShades.brand[600];
|
const bgColor = entity.style?.color || theme.palette.allShades.brand[600];
|
||||||
|
|
||||||
// Check if it's a sub-domain
|
|
||||||
const isSubDomain = entity.parent?.type === 'domain';
|
|
||||||
|
|
||||||
// Check if it's a URL (for Avatar src prop)
|
// Check if it's a URL (for Avatar src prop)
|
||||||
const isUrl =
|
const isUrl =
|
||||||
entity.style?.iconURL &&
|
entity.style?.iconURL &&
|
||||||
@ -100,12 +96,7 @@ export const EntityAvatar: FC<EntityAvatarProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Default icons when no iconURL is provided
|
// Default icons when no iconURL is provided
|
||||||
let DefaultIcon;
|
const DefaultIcon = getDefaultIconForEntityType(entity.entityType);
|
||||||
if (isSubDomain) {
|
|
||||||
DefaultIcon = SubDomainIcon;
|
|
||||||
} else {
|
|
||||||
DefaultIcon = getDefaultIconForEntityType(entity.entityType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Avatar
|
<Avatar
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user