Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,20 @@ describe('getTagAssetsQueryFilter', () => {

expect(result).toEqual(queryFilter);
});

it('returns common query filter when classification name ends with "Tier"', () => {
const tagFQN = 'DataTier.Bronze';
const result = getTagAssetsQueryFilter(tagFQN);
const queryFilter = getTermQuery({ 'tags.tagFQN': tagFQN });

expect(result).toEqual(queryFilter);
});

it('returns common query filter when classification name ends with "Certification"', () => {
const tagFQN = 'DataCertification.Gold';
const result = getTagAssetsQueryFilter(tagFQN);
const queryFilter = getTermQuery({ 'tags.tagFQN': tagFQN });

expect(result).toEqual(queryFilter);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,9 @@ export const getExcludedIndexesBasedOnEntityTypeEditTagPermission = (
export const getTagAssetsQueryFilter = (fqn: string) => {
let fieldName = 'tags.tagFQN';

if (fqn.includes('Tier.')) {
if (fqn.startsWith(`Tier${FQN_SEPARATOR_CHAR}`)) {
fieldName = 'tier.tagFQN';
} else if (fqn.includes('Certification.')) {
} else if (fqn.startsWith(`Certification${FQN_SEPARATOR_CHAR}`)) {
fieldName = 'certification.tagLabel.tagFQN';
}

Expand Down
Loading