Skip to content
Open
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 @@ -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,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: EntityStatus from glossary model used for all entity types

EntityStatus is imported from '../generated/entity/data/glossaryTerm' and used in the ENTITY_STATUS field definition. However, ENTITY_STATUS was added to COMMON_ENTITY_FIELDS_KEYS, meaning it will appear as an available field for all entity types (tables, test suites, etc.), not just glossary terms.

If EntityStatus values (e.g., "Approved", "Draft", etc.) are specific to glossary terms, showing them for entities like test suites or tables would be misleading — users would select a status value that doesn't exist on those entities, producing incorrect workflow conditions.

Suggested fix: Either:

  1. Move ENTITY_STATUS from COMMON_ENTITY_FIELDS_KEYS to GLOSSARY_ENTITY_FIELDS_KEYS if the status field is glossary-specific, or
  2. Verify that all entity types share the same EntityStatus values and document this assumption with a comment.

Was this helpful? React with 👍 / 👎

];
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,7 @@ import {
} from '@react-awesome-query-builder/antd';
import { get, sortBy, toLower } from 'lodash';
import {
LIST_VALUE_OPERATORS,
RANGE_FIELD_OPERATORS,
TEXT_FIELD_DESCRIPTION_OPERATORS,
} from '../constants/AdvancedSearch.constants';
Expand All @@ -36,6 +37,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 +414,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 +456,50 @@ 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: 'select',
mainWidgetProps: this.mainWidgetProps,
operators: this.defaultSelectOperators,
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