Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { EntityReferenceFields } from '../enums/AdvancedSearch.enum';

export const GLOSSARY_ENTITY_FIELDS_KEYS: EntityReferenceFields[] = [
EntityReferenceFields.REVIEWERS,
EntityReferenceFields.UPDATED_BY,
EntityReferenceFields.SYNONYMS,
EntityReferenceFields.RELATED_TERMS,
];

export const TABLE_ENTITY_FIELDS_KEYS: EntityReferenceFields[] = [
Expand All @@ -34,5 +35,7 @@ export const COMMON_ENTITY_FIELDS_KEYS: EntityReferenceFields[] = [
EntityReferenceFields.DATA_PRODUCTS,
EntityReferenceFields.EXTENSION,
EntityReferenceFields.UPDATED_AT,
EntityReferenceFields.UPDATED_BY,
EntityReferenceFields.VERSION,
EntityReferenceFields.ENTITY_STATUS,
Comment thread
siddhant1 marked this conversation as resolved.
];
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,7 @@ export enum EntityReferenceFields {
DELETED = 'deleted',
UPDATED_AT = 'updatedAt',
VERSION = 'version',
RELATED_TERMS = 'relatedTerms',
SYNONYMS = 'synonyms',
ENTITY_STATUS = 'entityStatus',
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
} from '@react-awesome-query-builder/antd';
import { get, sortBy, toLower } from 'lodash';
import {
LIST_VALUE_OPERATORS,
MULTISELECT_FIELD_OPERATORS,
RANGE_FIELD_OPERATORS,
TEXT_FIELD_DESCRIPTION_OPERATORS,
} from '../constants/AdvancedSearch.constants';
Expand All @@ -36,6 +38,7 @@ import {
EntityReferenceFields,
} from '../enums/AdvancedSearch.enum';
import { SearchIndex } from '../enums/search.enum';
import { EntityStatus } from '../generated/entity/data/glossaryTerm';
import { searchQuery } from '../rest/searchAPI';
import { getTags } from '../rest/tagAPI';
import advancedSearchClassBase from './AdvancedSearchClassBase';
Expand Down Expand Up @@ -412,6 +415,22 @@ class JSONLogicSearchClassBase {
},
},

[EntityReferenceFields.ENTITY_STATUS]: {
label: t('label.status'),
type: 'select',
operators: LIST_VALUE_OPERATORS,
mainWidgetProps: this.mainWidgetProps,
valueSources: ['value'],
fieldSettings: {
listValues: Object.values(EntityStatus).map((status) => ({
value: status,
title: status,
})),
showSearch: true,
useAsyncSearch: false,
},
},

[EntityReferenceFields.REVIEWERS]: {
label: t('label.reviewer-plural'),
type: '!group',
Expand All @@ -438,6 +457,51 @@ class JSONLogicSearchClassBase {
},
},
},
[EntityReferenceFields.SYNONYMS]: {
label: t('label.synonym-plural'),
type: 'multiselect',
preferWidgets: ['multiselect'],
defaultOperator: 'like',
mainWidgetProps: this.mainWidgetProps,
operators: ['like', 'not_like', 'is_null', 'is_not_null'],
widgets: {
multiselect: {
operators: ['like', 'not_like', 'is_null', 'is_not_null'],
widgetProps: {
customProps: {
open: false,
},
},
},
},
fieldSettings: {
allowCustomValues: true,
showSearch: false,
},
},
[EntityReferenceFields.RELATED_TERMS]: {
label: t('label.related-term-plural'),
type: '!group',
mode: 'some',
defaultField: EntityFields.FULLY_QUALIFIED_NAME,
subfields: {
[EntityFields.FULLY_QUALIFIED_NAME]: {
label: 'Related Terms',
type: 'multiselect',
defaultOperator: 'multiselect_equals',
mainWidgetProps: this.mainWidgetProps,
operators: MULTISELECT_FIELD_OPERATORS,
fieldSettings: {
asyncFetch: this.searchAutocomplete({
searchIndex: SearchIndex.GLOSSARY_TERM,
fieldName: 'fullyQualifiedName',
fieldLabel: 'name',
}),
useAsyncSearch: true,
},
},
},
},
[EntityReferenceFields.UPDATED_BY]: {
label: t('label.updated-by'),
type: 'select',
Expand Down