mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-27 10:26:09 +00:00
Minor: Bug fixes and improvements (#17121)
* Fix the empty space rendering in place of icons if no icon is present * Localization changes * Fix the entity suggestion errors when searched for entities with special characters * Update the playwright user and mlModel class to provide and update patch method * add unit test for getEntityIcon
This commit is contained in:
parent
6fd86092fa
commit
c481fec6ff
@ -17,6 +17,14 @@ import { visitEntityPage } from '../../utils/entity';
|
||||
import { EntityTypeEndpoint } from './Entity.interface';
|
||||
import { EntityClass } from './EntityClass';
|
||||
|
||||
type ResponseDataType = {
|
||||
name: string;
|
||||
displayName: string;
|
||||
description: string;
|
||||
id: string;
|
||||
fullyQualifiedName: string;
|
||||
};
|
||||
|
||||
export class MlModelClass extends EntityClass {
|
||||
service = {
|
||||
name: `pw-ml-model-service-${uuid()}`,
|
||||
@ -44,8 +52,8 @@ export class MlModelClass extends EntityClass {
|
||||
],
|
||||
};
|
||||
|
||||
serviceResponseData: unknown;
|
||||
entityResponseData: unknown;
|
||||
serviceResponseData: ResponseDataType;
|
||||
entityResponseData: ResponseDataType;
|
||||
|
||||
constructor(name?: string) {
|
||||
super(EntityTypeEndpoint.MlModel);
|
||||
@ -81,9 +89,7 @@ export class MlModelClass extends EntityClass {
|
||||
patchData: Operation[];
|
||||
}) {
|
||||
const response = await apiContext.patch(
|
||||
`/api/v1/mlmodels/${
|
||||
(this.entityResponseData as { id: string })?.id ?? ''
|
||||
}`,
|
||||
`/api/v1/mlmodels/${this.entityResponseData.id}`,
|
||||
{
|
||||
data: patchData,
|
||||
headers: {
|
||||
|
@ -11,6 +11,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { APIRequestContext, Page } from '@playwright/test';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { generateRandomUsername } from '../../utils/user';
|
||||
|
||||
type ResponseDataType = {
|
||||
@ -36,6 +37,30 @@ export class UserClass {
|
||||
return response.body;
|
||||
}
|
||||
|
||||
async patch({
|
||||
apiContext,
|
||||
patchData,
|
||||
}: {
|
||||
apiContext: APIRequestContext;
|
||||
patchData: Operation[];
|
||||
}) {
|
||||
const response = await apiContext.patch(
|
||||
`/api/v1/users/${this.responseData.id}`,
|
||||
{
|
||||
data: patchData,
|
||||
headers: {
|
||||
'Content-Type': 'application/json-patch+json',
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
this.responseData = await response.json();
|
||||
|
||||
return {
|
||||
entity: response.body,
|
||||
};
|
||||
}
|
||||
|
||||
async delete(apiContext: APIRequestContext) {
|
||||
const response = await apiContext.delete(
|
||||
`/api/v1/users/${this.responseData.id}?recursive=false&hardDelete=true`
|
||||
|
@ -0,0 +1,4 @@
|
||||
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.99995 0C4.74085 0 2.08948 2.65137 2.08948 5.91047C2.08948 6.9834 2.57066 8.13733 2.59082 8.18601C2.74624 8.55489 3.05288 9.12786 3.27401 9.46371L7.32651 15.604C7.49235 15.8557 7.7378 16 7.99995 16C8.2621 16 8.50756 15.8557 8.6734 15.6043L12.7262 9.46371C12.9477 9.12786 13.254 8.55489 13.4094 8.18601C13.4296 8.13768 13.9104 6.98375 13.9104 5.91047C13.9104 2.65137 11.2591 0 7.99995 0ZM12.7683 7.91621C12.6296 8.24685 12.3441 8.77983 12.1456 9.08092L8.09278 15.2216C8.01282 15.3429 7.98743 15.3429 7.90747 15.2216L3.85462 9.08092C3.6561 8.77983 3.37066 8.2465 3.23194 7.91586C3.22603 7.90161 2.78483 6.83946 2.78483 5.91047C2.78483 3.03485 5.12433 0.69535 7.99995 0.69535C10.8756 0.69535 13.2151 3.03485 13.2151 5.91047C13.2151 6.84085 12.7728 7.90578 12.7683 7.91621Z" fill="black"/>
|
||||
<path d="M7.99992 2.78174C6.27441 2.78174 4.87085 4.18565 4.87085 5.91081C4.87085 7.63598 6.27441 9.03989 7.99992 9.03989C9.72543 9.03989 11.129 7.63598 11.129 5.91081C11.129 4.18565 9.72543 2.78174 7.99992 2.78174ZM7.99992 8.34454C6.65825 8.34454 5.5662 7.25284 5.5662 5.91081C5.5662 4.56879 6.65825 3.47709 7.99992 3.47709C9.3416 3.47709 10.4336 4.56879 10.4336 5.91081C10.4336 7.25284 9.3416 8.34454 7.99992 8.34454Z" fill="black"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,10 @@
|
||||
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 0.8H1C0.889543 0.8 0.8 0.889543 0.8 1V11C0.8 11.1138 0.889683 11.2 0.996762 11.2H14.0003C14.1104 11.2 14.2 11.1108 14.2 11V1C14.2 0.889543 14.1105 0.8 14 0.8ZM1 0C0.447715 0 0 0.447715 0 1V11C0 11.5523 0.444477 12 0.996762 12H14.0003C14.5526 12 15 11.5523 15 11V1C15 0.447715 14.5523 0 14 0H1Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.17883 3.64217C7.37642 3.74097 7.45651 3.98124 7.35771 4.17883L5.35771 8.17883C5.25892 8.37642 5.01865 8.45651 4.82106 8.35771C4.62346 8.25892 4.54337 8.01865 4.64217 7.82106L6.64217 3.82106C6.74097 3.62346 6.98124 3.54337 7.17883 3.64217Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.28282 4.71713C4.43903 4.87334 4.43903 5.12661 4.28282 5.28282L3.56566 5.99998L4.28282 6.71713C4.43903 6.87334 4.43903 7.12661 4.28282 7.28282C4.12661 7.43903 3.87334 7.43903 3.71713 7.28282L2.71713 6.28282C2.56092 6.12661 2.56092 5.87334 2.71713 5.71713L3.71713 4.71713C3.87334 4.56092 4.12661 4.56092 4.28282 4.71713Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.71718 4.71713C7.56097 4.87334 7.56097 5.12661 7.71718 5.28282L8.43434 5.99998L7.71718 6.71713C7.56097 6.87334 7.56097 7.12661 7.71718 7.28282C7.87339 7.43903 8.12666 7.43903 8.28287 7.28282L9.28287 6.28282C9.43908 6.12661 9.43908 5.87334 9.28287 5.71713L8.28287 4.71713C8.12666 4.56092 7.87339 4.56092 7.71718 4.71713Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 2.89998H0.5V2.09998H14.5V2.89998Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.4914 7.37421C12.4693 7.25295 12.3782 7.15594 12.2585 7.1264C11.5729 6.95787 10.8565 6.95787 10.1708 7.1264C10.0511 7.15594 9.96003 7.25295 9.93795 7.37421L9.77004 8.29739C9.59592 8.37916 9.42863 8.47555 9.27068 8.58563L8.38731 8.2694C8.27102 8.22774 8.14166 8.25821 8.05616 8.34714C7.56767 8.85676 7.20948 9.47708 7.01234 10.1552C6.97814 10.2734 7.01638 10.4012 7.11028 10.4808L7.82606 11.0877C7.80989 11.2796 7.80989 11.4724 7.82606 11.6642L7.11028 12.2712C7.01638 12.3511 6.97814 12.4786 7.01234 12.597C7.20948 13.2749 7.56767 13.8952 8.05616 14.4048C8.14166 14.4937 8.27102 14.5242 8.38731 14.4829L9.27068 14.1663C9.42863 14.2764 9.59561 14.3728 9.77004 14.4546L9.93795 15.3781C9.96003 15.4993 10.0511 15.5963 10.1708 15.6256C10.8565 15.7941 11.5729 15.7941 12.2585 15.6256C12.3782 15.5963 12.4693 15.4993 12.4914 15.3781L12.6593 14.4546C12.8334 14.3728 13.0004 14.2764 13.1586 14.1663L14.042 14.4829C14.158 14.5242 14.2877 14.4937 14.3729 14.4048C14.8616 13.8952 15.2198 13.2749 15.4167 12.597C15.4512 12.4786 15.4129 12.3511 15.3187 12.2712L14.6033 11.6642C14.6194 11.4727 14.6194 11.2796 14.6033 11.0877L15.3187 10.4808C15.4129 10.4012 15.4512 10.2734 15.4167 10.1552C15.2198 9.47708 14.8616 8.85676 14.3729 8.34714C14.2877 8.25821 14.158 8.22774 14.042 8.2694L13.1583 8.58563C13.0007 8.47555 12.8334 8.37916 12.6593 8.29739L12.4914 7.37421ZM11.9136 7.69106L12.0738 8.57257C12.0931 8.67766 12.1646 8.76597 12.2635 8.80608C12.497 8.90154 12.7165 9.0284 12.9158 9.18294C13.0001 9.24823 13.1123 9.26627 13.2127 9.2302L14.0566 8.92828C14.3632 9.2843 14.6005 9.69505 14.7556 10.1388L14.0722 10.7187C13.9907 10.7877 13.95 10.8934 13.9646 10.9994C13.9988 11.2494 13.9988 11.5028 13.9646 11.7528C13.95 11.8586 13.9907 11.9646 14.0722 12.0336L14.7556 12.6132C14.6005 13.0569 14.3632 13.4677 14.0566 13.824L13.2127 13.5218C13.1123 13.486 13.0001 13.5037 12.9158 13.5693C12.7165 13.7239 12.497 13.8504 12.2635 13.9459C12.1646 13.9863 12.0931 14.0743 12.0738 14.1794L11.9136 15.0612C11.4516 15.1486 10.9774 15.1486 10.5157 15.0612L10.3552 14.1794C10.3363 14.0743 10.2647 13.9863 10.1659 13.9459C9.93236 13.8504 9.71283 13.7239 9.51352 13.5693C9.42895 13.5037 9.31701 13.486 9.21657 13.5218L8.37269 13.824C8.0658 13.4677 7.82886 13.0569 7.67371 12.6132L8.35715 12.0336C8.43861 11.9646 8.47934 11.8586 8.46473 11.7528C8.43052 11.5028 8.43052 11.2494 8.46473 10.9994C8.47934 10.8934 8.43861 10.7877 8.35715 10.7187L7.67371 10.1388C7.82886 9.69505 8.0658 9.2843 8.37269 8.92828L9.21657 9.2302C9.31701 9.26627 9.42895 9.24823 9.51352 9.18294C9.71283 9.0284 9.93236 8.90154 10.1659 8.80608C10.2647 8.76597 10.3363 8.67766 10.3552 8.57257L10.5157 7.69106C10.9774 7.60337 11.4516 7.60337 11.9136 7.69106ZM11.2147 9.47864C10.1674 9.47864 9.31732 10.3291 9.31732 11.376C9.31732 12.4232 10.1674 13.2733 11.2147 13.2733C12.2619 13.2733 13.112 12.4232 13.112 11.376C13.112 10.3291 12.2619 9.47864 11.2147 9.47864ZM11.2147 10.1039C11.9168 10.1039 12.4867 10.6739 12.4867 11.376C12.4867 12.0781 11.9168 12.6483 11.2147 12.6483C10.5126 12.6483 9.94262 12.0781 9.94262 11.376C9.94262 10.6739 10.5126 10.1039 11.2147 10.1039Z" fill="#060000"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9136 7.69106L12.0738 8.57257C12.0931 8.67766 12.1646 8.76597 12.2635 8.80608C12.497 8.90154 12.7165 9.0284 12.9158 9.18294C13.0001 9.24823 13.1123 9.26627 13.2127 9.2302L14.0566 8.92828C14.3632 9.2843 14.6005 9.69505 14.7556 10.1388L14.0722 10.7187C13.9907 10.7877 13.95 10.8934 13.9646 10.9994C13.9988 11.2494 13.9988 11.5028 13.9646 11.7528C13.95 11.8586 13.9907 11.9646 14.0722 12.0336L14.7556 12.6132C14.6005 13.0569 14.3632 13.4677 14.0566 13.824L13.2127 13.5218C13.1123 13.486 13.0001 13.5037 12.9158 13.5693C12.7165 13.7239 12.497 13.8504 12.2635 13.9459C12.1646 13.9863 12.0931 14.0743 12.0738 14.1794L11.9136 15.0612C11.4516 15.1486 10.9774 15.1486 10.5157 15.0612L10.3552 14.1794C10.3363 14.0743 10.2647 13.9863 10.1659 13.9459C9.93236 13.8504 9.71283 13.7239 9.51352 13.5693C9.42895 13.5037 9.31701 13.486 9.21657 13.5218L8.37269 13.824C8.0658 13.4677 7.82886 13.0569 7.67371 12.6132L8.35715 12.0336C8.43861 11.9646 8.47934 11.8586 8.46473 11.7528C8.43052 11.5028 8.43052 11.2494 8.46473 10.9994C8.47934 10.8934 8.43861 10.7877 8.35715 10.7187L7.67371 10.1388C7.82886 9.69505 8.0658 9.2843 8.37269 8.92828L9.21657 9.2302C9.31701 9.26627 9.42895 9.24823 9.51352 9.18294C9.71283 9.0284 9.93236 8.90154 10.1659 8.80608C10.2647 8.76597 10.3363 8.67766 10.3552 8.57257L10.5157 7.69106C10.9774 7.60337 11.4516 7.60337 11.9136 7.69106ZM9.31732 11.376C9.31732 10.3291 10.1674 9.47864 11.2147 9.47864C12.2619 9.47864 13.112 10.3291 13.112 11.376C13.112 12.4232 12.2619 13.2733 11.2147 13.2733C10.1674 13.2733 9.31732 12.4232 9.31732 11.376Z" fill="white"/>
|
||||
<path d="M11.2147 10.1039C11.9168 10.1039 12.4867 10.6739 12.4867 11.376C12.4867 12.0781 11.9168 12.6483 11.2147 12.6483C10.5126 12.6483 9.94262 12.0781 9.94262 11.376C9.94262 10.6739 10.5126 10.1039 11.2147 10.1039Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 6.5 KiB |
@ -140,16 +140,16 @@ export const FeedEditor = forwardRef<editorRef, FeedEditorProp>(
|
||||
</div>`
|
||||
: '';
|
||||
|
||||
const icon = ReactDOMServer.renderToString(
|
||||
getEntityIcon(item.type as string)
|
||||
);
|
||||
const icon = getEntityIcon(item.type as string);
|
||||
|
||||
const iconString = ReactDOMServer.renderToString(icon ?? <></>);
|
||||
|
||||
const typeSpan = !breadcrumbEle
|
||||
? `<span class="text-grey-muted text-xs">${item.type}</span>`
|
||||
: '';
|
||||
|
||||
const result = `<div class="d-flex items-center gap-2">
|
||||
<div class="flex-center mention-icon-image">${icon}</div>
|
||||
<div class="flex-center mention-icon-image">${iconString}</div>
|
||||
<div>
|
||||
${breadcrumbEle}
|
||||
<div class="d-flex flex-col">
|
||||
|
@ -136,7 +136,7 @@ const ExploreTree = ({ onFieldValueSelect }: ExploreTreeProps) => {
|
||||
|
||||
let logo = undefined;
|
||||
if (isEntityType) {
|
||||
logo = getEntityIcon(bucket.key, 'service-icon w-4 h-4');
|
||||
logo = getEntityIcon(bucket.key, 'service-icon w-4 h-4') ?? <></>;
|
||||
} else if (isServiceType) {
|
||||
const serviceIcon = serviceUtilClassBase.getServiceLogo(bucket.key);
|
||||
logo = (
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "Keine Beschreibung",
|
||||
"no-diff-available": "Keine Unterschiede verfügbar",
|
||||
"no-entity": "Keine {{entity}}",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "Keine passenden Datenanlagen gefunden",
|
||||
"no-of-test": " Nr. der Tests",
|
||||
"no-owner": "No Owner",
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "No description",
|
||||
"no-diff-available": "No diff available",
|
||||
"no-entity": "No {{entity}}",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "No matching data assets found",
|
||||
"no-of-test": " No. of Test",
|
||||
"no-owner": "No Owner",
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "Sin descripción",
|
||||
"no-diff-available": "Sin diferencia disponible",
|
||||
"no-entity": "No hay {{entity}}",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "No se encontraron activos de datos coincidentes",
|
||||
"no-of-test": "No. de prueba",
|
||||
"no-owner": "No Owner",
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "Aucune description",
|
||||
"no-diff-available": "Aucune différence disponible",
|
||||
"no-entity": "Pas de {{entity}}",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "Aucun actif de données trouvé",
|
||||
"no-of-test": " No. de Tests",
|
||||
"no-owner": "Aucun propriétaire",
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "-",
|
||||
"no-diff-available": "אין הבדל זמין",
|
||||
"no-entity": "אין {{entity}}",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "לא נמצאו נכסי נתונים תואמים",
|
||||
"no-of-test": "מספר הבדיקות",
|
||||
"no-owner": "No Owner",
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "説明がありません",
|
||||
"no-diff-available": "差分を見ることはできません",
|
||||
"no-entity": "No {{entity}}",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "マッチするデータアセットはありません",
|
||||
"no-of-test": " テスト番号",
|
||||
"no-owner": "No Owner",
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "Geen beschrijving",
|
||||
"no-diff-available": "Geen verschil beschikbaar",
|
||||
"no-entity": "Geen {{entity}}",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "Geen overeenkomende data-assets gevonden",
|
||||
"no-of-test": " Aantal tests",
|
||||
"no-owner": "No Owner",
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "Sem descrição",
|
||||
"no-diff-available": "Nenhuma diferença disponível",
|
||||
"no-entity": "Nenhum(a) {{entity}}",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "Nenhum ativo de dados correspondente encontrado",
|
||||
"no-of-test": " Nº de Teste",
|
||||
"no-owner": "No Owner",
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "Нет описания",
|
||||
"no-diff-available": "Нет различий",
|
||||
"no-entity": "{{entity}} отсутствует",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "Подходящие объекты данных не найдены",
|
||||
"no-of-test": "№ теста",
|
||||
"no-owner": "No Owner",
|
||||
|
@ -744,6 +744,7 @@
|
||||
"no-description": "无描述",
|
||||
"no-diff-available": "没有可用的差异",
|
||||
"no-entity": "没有{{entity}}",
|
||||
"no-entity-selected": "No {{entity}} Selected",
|
||||
"no-matching-data-asset": "未找到匹配的数据资产",
|
||||
"no-of-test": "测试数量",
|
||||
"no-owner": "No Owner",
|
||||
|
@ -26,6 +26,7 @@ import {
|
||||
SearchResponse,
|
||||
} from '../interface/search.interface';
|
||||
import { getSearchAPIQueryParams } from '../utils/SearchUtils';
|
||||
import { escapeESReservedCharacters } from '../utils/StringsUtils';
|
||||
import APIClient from './index';
|
||||
|
||||
export const searchData = <SI extends SearchIndex>(
|
||||
@ -264,7 +265,9 @@ export const getAggregateFieldOptions = (
|
||||
value: string,
|
||||
q: string
|
||||
) => {
|
||||
const withWildCardValue = value ? `.*${value}.*` : '.*';
|
||||
const withWildCardValue = value
|
||||
? `.*${escapeESReservedCharacters(value)}.*`
|
||||
: '.*';
|
||||
const params = {
|
||||
index,
|
||||
field,
|
||||
|
@ -879,17 +879,21 @@ export const getSourceOptionsFromResourceList = (
|
||||
showCheckbox?: boolean,
|
||||
selectedResource?: string[]
|
||||
) =>
|
||||
resources.map((resource) => ({
|
||||
label: (
|
||||
<div
|
||||
className="d-flex items-center gap-2"
|
||||
data-testid={`${resource}-option`}>
|
||||
{showCheckbox && (
|
||||
<Checkbox checked={selectedResource?.includes(resource)} />
|
||||
)}
|
||||
<div className="d-flex h-4 w-4">{getEntityIcon(resource ?? '')}</div>
|
||||
<span>{getEntityNameLabel(resource ?? '')}</span>
|
||||
</div>
|
||||
),
|
||||
value: resource ?? '',
|
||||
}));
|
||||
resources.map((resource) => {
|
||||
const sourceIcon = getEntityIcon(resource ?? '');
|
||||
|
||||
return {
|
||||
label: (
|
||||
<div
|
||||
className="d-flex items-center gap-2"
|
||||
data-testid={`${resource}-option`}>
|
||||
{showCheckbox && (
|
||||
<Checkbox checked={selectedResource?.includes(resource)} />
|
||||
)}
|
||||
{sourceIcon && <div className="d-flex h-4 w-4">{sourceIcon}</div>}
|
||||
<span>{getEntityNameLabel(resource ?? '')}</span>
|
||||
</div>
|
||||
),
|
||||
value: resource ?? '',
|
||||
};
|
||||
});
|
||||
|
@ -11,7 +11,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { TagLabel } from '../generated/entity/data/container';
|
||||
import { getTagsWithoutTier, getTierTags } from '../utils/TableUtils';
|
||||
import {
|
||||
getEntityIcon,
|
||||
getTagsWithoutTier,
|
||||
getTierTags,
|
||||
} from '../utils/TableUtils';
|
||||
|
||||
describe('TableUtils', () => {
|
||||
it('getTierTags should return the correct usage percentile', () => {
|
||||
@ -39,5 +43,9 @@ describe('TableUtils', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
// Add more tests for other functions in TableUtils...
|
||||
it('getEntityIcon should return null if no icon is found', () => {
|
||||
const result = getEntityIcon('entity');
|
||||
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
});
|
||||
|
@ -65,6 +65,8 @@ import { ReactComponent as IconNotNull } from '../assets/svg/icon-not-null.svg';
|
||||
import { ReactComponent as RoleIcon } from '../assets/svg/icon-role-grey.svg';
|
||||
import { ReactComponent as IconUniqueLineThrough } from '../assets/svg/icon-unique-line-through.svg';
|
||||
import { ReactComponent as IconUnique } from '../assets/svg/icon-unique.svg';
|
||||
import { ReactComponent as LocationIcon } from '../assets/svg/location.svg';
|
||||
import { ReactComponent as MetadataServiceIcon } from '../assets/svg/metadata-service.svg';
|
||||
import { ReactComponent as NotificationIcon } from '../assets/svg/notification.svg';
|
||||
import { ReactComponent as PolicyIcon } from '../assets/svg/policies.svg';
|
||||
import { ReactComponent as ServicesIcon } from '../assets/svg/services.svg';
|
||||
@ -202,6 +204,7 @@ export const getEntityIcon = (
|
||||
const entityIconMapping: Record<string, SvgComponent> = {
|
||||
[SearchIndex.DATABASE]: DatabaseIcon,
|
||||
[EntityType.DATABASE]: DatabaseIcon,
|
||||
[SearchIndex.DATABASE_SERVICE]: DatabaseIcon,
|
||||
[EntityType.DATABASE_SERVICE]: DatabaseIcon,
|
||||
[SearchIndex.DATABASE_SCHEMA]: SchemaIcon,
|
||||
[EntityType.DATABASE_SCHEMA]: SchemaIcon,
|
||||
@ -242,6 +245,7 @@ export const getEntityIcon = (
|
||||
[EntityType.CHART]: ChartIcon,
|
||||
[SearchIndex.TABLE]: TableIcon,
|
||||
[EntityType.TABLE]: TableIcon,
|
||||
[EntityType.METADATA_SERVICE]: MetadataServiceIcon,
|
||||
[SearchIndex.DATA_PRODUCT]: DataProductIcon,
|
||||
[EntityType.DATA_PRODUCT]: DataProductIcon,
|
||||
[EntityType.TEST_CASE]: IconTestSuite,
|
||||
@ -266,6 +270,7 @@ export const getEntityIcon = (
|
||||
['services']: ServicesIcon,
|
||||
['automator']: AutomatorBotIcon,
|
||||
['notification']: NotificationIcon,
|
||||
['location']: LocationIcon,
|
||||
};
|
||||
|
||||
switch (indexType) {
|
||||
@ -284,7 +289,8 @@ export const getEntityIcon = (
|
||||
break;
|
||||
}
|
||||
|
||||
return Icon ? <Icon className={className} style={style} /> : <></>;
|
||||
// If icon is not found, return null
|
||||
return Icon ? <Icon className={className} style={style} /> : null;
|
||||
};
|
||||
|
||||
export const getServiceIcon = (source: SourceType) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user