Skip to content

Commit

Permalink
fix(search): tag/term should filter for both entity and field level (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal authored and tusharm committed Jun 20, 2023
1 parent 84eb7b8 commit 634d67e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useHistory } from 'react-router-dom';
import { RecommendationContent, GlossaryTerm } from '../../../../types.generated';
import { navigateToSearchUrl } from '../../../search/utils/navigateToSearchUrl';
import { useEntityRegistry } from '../../../useEntityRegistry';
import { UnionType } from '../../../search/utils/constants';

const TermSearchListContainer = styled.div`
display: flex;
Expand Down Expand Up @@ -55,8 +56,13 @@ export const GlossaryTermSearchList = ({ content, onClick }: Props) => {
field: 'glossaryTerms',
values: [term.urn],
},
{
field: 'fieldGlossaryTerms',
values: [term.urn],
},
],
history,
unionType: UnionType.OR,
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useHistory } from 'react-router-dom';
import styled from 'styled-components';
import { EntityType, RecommendationContent, Tag } from '../../../../types.generated';
import { StyledTag } from '../../../entity/shared/components/styled/StyledTag';
import { UnionType } from '../../../search/utils/constants';
import { navigateToSearchUrl } from '../../../search/utils/navigateToSearchUrl';
import { useEntityRegistry } from '../../../useEntityRegistry';

Expand Down Expand Up @@ -46,8 +47,13 @@ export const TagSearchList = ({ content, onClick }: Props) => {
field: 'tags',
values: [tag.urn],
},
{
field: 'fieldTags',
values: [tag.urn],
},
],
history,
unionType: UnionType.OR,
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const SearchResultsRecommendations = ({ userUrn, query, filters }: Props)
return (
<>
{recommendationModules && !!recommendationModules.length && (
<RecommendationsContainer>
<RecommendationsContainer data-testid="recommendation-container-id">
<RecommendationTitle level={3}>More you may be interested in</RecommendationTitle>
{recommendationModules &&
recommendationModules.map((module) => (
Expand Down

0 comments on commit 634d67e

Please sign in to comment.