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