minor fixes

This commit is contained in:
karanh37 2025-09-26 16:14:52 +05:30
parent fe11aa22d1
commit 56a44c5463
5 changed files with 16 additions and 15 deletions

View File

@ -123,7 +123,7 @@ const DataProductListPage = () => {
});
const { pageHeader } = usePageHeader({
titleKey: 'label.data-product',
titleKey: 'label.data-product-plural',
descriptionMessageKey: 'message.data-product-description',
createPermission: true,
addButtonLabelKey: 'label.add-data-product',

View File

@ -122,7 +122,7 @@ const DomainListPage = () => {
});
const { pageHeader } = usePageHeader({
titleKey: 'label.domain',
titleKey: 'label.domain-plural',
descriptionMessageKey: 'message.domain-description',
createPermission: true,
addButtonLabelKey: 'label.add-domain',

View File

@ -32,11 +32,9 @@ const MUIDomainSelect: FC<MUIDomainSelectProps> = ({
multiple = false,
value,
onChange,
showAllDomains = true,
hasPermission = true,
onBlur,
onFocus,
className,
'data-testid': dataTestId,
}) => {
const convertDomainToTreeNode = useCallback(
@ -61,7 +59,7 @@ const MUIDomainSelect: FC<MUIDomainSelectProps> = ({
hasChildren,
lazyLoad: false,
children: hasChildren
? (domain as Domain).children?.map(convertDomainToTreeNode)
? domain.children?.map(convertDomainToTreeNode)
: undefined,
allowSelection: hasPermission,
};
@ -72,10 +70,8 @@ const MUIDomainSelect: FC<MUIDomainSelectProps> = ({
const fetchData = useCallback(
async ({
searchTerm,
parentId,
}: {
searchTerm?: string;
parentId?: string;
}): Promise<TreeDataResponse> => {
try {
if (searchTerm) {

View File

@ -13,6 +13,7 @@
import { AxiosError } from 'axios';
import { useCallback, useState } from 'react';
import { EntityFields } from '../../../../enums/AdvancedSearch.enum';
import { SearchIndex } from '../../../../enums/search.enum';
import { Aggregations } from '../../../../interface/search.interface';
import { searchQuery } from '../../../../rest/searchAPI';
@ -60,7 +61,7 @@ export const useDataFetching = <T extends { id: string }>(
// Build Elasticsearch query from filters
const buildESQuery = useCallback(
(filters: Record<string, string[]>): any => {
(filters: Record<string, string[]>): Record<string, unknown> => {
// Parse baseFilter if it exists
let query = baseFilter ? JSON.parse(baseFilter) : null;
@ -88,19 +89,28 @@ export const useDataFetching = <T extends { id: string }>(
// Add filters to the must array
Object.entries(filters).forEach(([filterKey, values]) => {
// TODO : Explicit type casting, need to revisit once backend has
// two separate fields for glossary and tags
const filterUpdatedKey = [
EntityFields.GLOSSARY_TERMS,
EntityFields.CLASSIFICATION_TAGS,
].includes(filterKey as EntityFields)
? EntityFields.TAG
: filterKey;
if (values && values.length > 0) {
if (values.length === 1) {
// Single value - use term query
query.query.bool.must.push({
term: {
[filterKey]: values[0],
[filterUpdatedKey]: values[0],
},
});
} else {
// Multiple values - use terms query
query.query.bool.must.push({
terms: {
[filterKey]: values,
[filterUpdatedKey]: values,
},
});
}

View File

@ -19,7 +19,6 @@ export const DATAPRODUCT_DEFAULT_QUICK_FILTERS = [
EntityFields.DOMAINS,
EntityFields.CLASSIFICATION_TAGS,
EntityFields.GLOSSARY_TERMS,
EntityFields.DOMAIN_TYPE,
];
export const DATAPRODUCT_FILTERS = [
@ -39,8 +38,4 @@ export const DATAPRODUCT_FILTERS = [
label: i18n.t('label.glossary-term-plural'),
key: EntityFields.GLOSSARY_TERMS,
},
{
label: i18n.t('label.domain-type'),
key: EntityFields.DOMAIN_TYPE,
},
];