mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-24 15:25:10 +00:00
Fixed add tag ui and in-database search (#1129)
This commit is contained in:
parent
3b74484989
commit
f1c1bc070c
@ -418,12 +418,8 @@ const DashboardDetails = ({
|
||||
/>
|
||||
</button>
|
||||
) : (
|
||||
<span className="tw-opacity-0 group-hover:tw-opacity-100">
|
||||
<Tags
|
||||
className="tw-border-main"
|
||||
tag="+ Add tag"
|
||||
type="outlined"
|
||||
/>
|
||||
<span className="tw-opacity-60 group-hover:tw-opacity-100 tw-text-grey-muted group-hover:tw-text-primary">
|
||||
<Tags tag="+ Add tag" type="outlined" />
|
||||
</span>
|
||||
)}
|
||||
</TagsContainer>
|
||||
|
||||
@ -64,6 +64,7 @@ const DatabaseDetails: FunctionComponent = () => {
|
||||
const { databaseFQN } = useParams() as Record<string, string>;
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [database, setDatabase] = useState<Database>();
|
||||
const [serviceName, setServiceName] = useState<string>();
|
||||
const [data, setData] = useState<Array<Table>>([]);
|
||||
|
||||
const [databaseName, setDatabaseName] = useState<string>(
|
||||
@ -115,6 +116,7 @@ const DatabaseDetails: FunctionComponent = () => {
|
||||
|
||||
getServiceById('databaseServices', service?.id).then(
|
||||
(resService: AxiosResponse) => {
|
||||
setServiceName(resService.data.name);
|
||||
setSlashedTableName([
|
||||
{
|
||||
name: resService.data.name,
|
||||
@ -210,7 +212,7 @@ const DatabaseDetails: FunctionComponent = () => {
|
||||
history.push(
|
||||
`${getExplorePathWithSearch(
|
||||
appState.inPageSearchText
|
||||
)}?database=${databaseName}`
|
||||
)}?database=${databaseName}&service=${serviceName}`
|
||||
);
|
||||
}
|
||||
}, [appState.inPageSearchText]);
|
||||
|
||||
@ -44,7 +44,11 @@ import { getFilterString } from '../../utils/FilterUtils';
|
||||
import { getTotalEntityCountByService } from '../../utils/ServiceUtils';
|
||||
|
||||
const ExplorePage: FunctionComponent = () => {
|
||||
const initialFilter = getFilterString(getQueryParam(location.search));
|
||||
const initialFilter = getFilterString(
|
||||
getQueryParam(location.search),
|
||||
[],
|
||||
true
|
||||
);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [isLoadingForData, setIsLoadingForData] = useState(true);
|
||||
const [error, setError] = useState<string>('');
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
export const getFilterString = (filters, excludeFilters = []) => {
|
||||
export const getFilterString = (
|
||||
filters,
|
||||
excludeFilters = [],
|
||||
restrictKeyModification = false
|
||||
) => {
|
||||
const modifiedFilters = {};
|
||||
for (const key in filters) {
|
||||
if (excludeFilters.includes(key)) {
|
||||
@ -7,7 +11,8 @@ export const getFilterString = (filters, excludeFilters = []) => {
|
||||
const modifiedFilter = [];
|
||||
const filter = filters[key];
|
||||
filter.forEach((value) => {
|
||||
const modifiedKey = key === 'service' ? 'service type' : key;
|
||||
const modifiedKey =
|
||||
!restrictKeyModification && key === 'service' ? 'service type' : key;
|
||||
modifiedFilter.push(`${modifiedKey.split(' ').join('_')}:${value}`);
|
||||
});
|
||||
modifiedFilters[key] = modifiedFilter;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user