mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-26 17:34:41 +00:00
Fix(ui): Failing Playwright Custom Property (#22680)
This commit is contained in:
parent
5057f29efc
commit
8aef65148f
@ -13,12 +13,13 @@
|
|||||||
import {
|
import {
|
||||||
Config,
|
Config,
|
||||||
Field,
|
Field,
|
||||||
|
FieldOrGroup,
|
||||||
ImmutableTree,
|
ImmutableTree,
|
||||||
OldJsonTree,
|
OldJsonTree,
|
||||||
Utils as QbUtils,
|
Utils as QbUtils,
|
||||||
ValueSource,
|
ValueSource,
|
||||||
} from '@react-awesome-query-builder/antd';
|
} from '@react-awesome-query-builder/antd';
|
||||||
import { isEmpty, isEqual, isNil, isString } from 'lodash';
|
import { get, isEmpty, isEqual, isNil, isString } from 'lodash';
|
||||||
import Qs from 'qs';
|
import Qs from 'qs';
|
||||||
import {
|
import {
|
||||||
createContext,
|
createContext,
|
||||||
@ -29,6 +30,7 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
import { EntityType } from '../../../enums/entity.enum';
|
||||||
import { SearchIndex } from '../../../enums/search.enum';
|
import { SearchIndex } from '../../../enums/search.enum';
|
||||||
import useCustomLocation from '../../../hooks/useCustomLocation/useCustomLocation';
|
import useCustomLocation from '../../../hooks/useCustomLocation/useCustomLocation';
|
||||||
import { TabsInfoData } from '../../../pages/ExplorePage/ExplorePage.interface';
|
import { TabsInfoData } from '../../../pages/ExplorePage/ExplorePage.interface';
|
||||||
@ -224,14 +226,18 @@ export const AdvanceSearchProvider = ({
|
|||||||
}, [navigate, location.pathname]);
|
}, [navigate, location.pathname]);
|
||||||
|
|
||||||
const fetchCustomPropertyType = async () => {
|
const fetchCustomPropertyType = async () => {
|
||||||
const subfields: Record<string, Field> = {};
|
const subfields: Record<string, FieldOrGroup> = {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await getAllCustomProperties();
|
const res = await getAllCustomProperties();
|
||||||
|
|
||||||
Object.entries(res).forEach(([resEntityType, fields]) => {
|
Object.entries(res).forEach(([resEntityType, fields]) => {
|
||||||
// If entityType is specified, only include custom properties for that entity type
|
// If entityType is specified, only include custom properties for that entity type
|
||||||
if (entityType && resEntityType !== entityType) {
|
if (
|
||||||
|
entityType &&
|
||||||
|
entityType !== EntityType.ALL &&
|
||||||
|
resEntityType !== entityType
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,8 +269,11 @@ export const AdvanceSearchProvider = ({
|
|||||||
resEntityType.charAt(0).toUpperCase() +
|
resEntityType.charAt(0).toUpperCase() +
|
||||||
resEntityType.slice(1),
|
resEntityType.slice(1),
|
||||||
type: '!group',
|
type: '!group',
|
||||||
subfields: entitySubfields,
|
subfields: {
|
||||||
} as Field;
|
...get(subfields[resEntityType], 'subfields', {}),
|
||||||
|
...entitySubfields,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user