mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 13:13:10 +00:00
fix(ui): incorrect field data showing in data type for search indexes (#13654)
* fixed wrong field showing in data type for search indexes * added tests for the new changes
This commit is contained in:
parent
1bd833d9a2
commit
2d3b4603a3
@ -22,7 +22,6 @@ export const MOCK_SEARCH_INDEX_FIELDS: SearchIndexField[] = [
|
||||
{
|
||||
name: 'name',
|
||||
dataType: DataType.Text,
|
||||
dataTypeDisplay: 'text',
|
||||
description: 'Table Entity Name.',
|
||||
fullyQualifiedName: 'elasticsearch_sample.table_search_index.name',
|
||||
tags: [
|
||||
|
@ -94,4 +94,16 @@ describe('SearchIndexFieldsTable component', () => {
|
||||
expect(screen.queryByText('description')).toBeNull();
|
||||
expect(screen.queryByText('column_description')).toBeNull();
|
||||
});
|
||||
|
||||
it('SearchIndexFieldsTable should show value from dataType field when there is no dataTypeDisplay is present', () => {
|
||||
render(
|
||||
<SearchIndexFieldsTable
|
||||
{...mockProps}
|
||||
searchedFields={mockSearchedFields}
|
||||
/>
|
||||
);
|
||||
const dataTypeFieldForColumnName = screen.getByTestId('name-data-type');
|
||||
|
||||
expect(dataTypeFieldForColumnName).toHaveTextContent('text');
|
||||
});
|
||||
});
|
||||
|
@ -111,7 +111,7 @@ const SearchIndexFieldsTable = ({
|
||||
> = useCallback(
|
||||
(dataTypeDisplay, record) => {
|
||||
const displayValue = isEmpty(dataTypeDisplay)
|
||||
? record.name
|
||||
? record.dataType
|
||||
: dataTypeDisplay;
|
||||
|
||||
if (isEmpty(displayValue)) {
|
||||
@ -119,7 +119,7 @@ const SearchIndexFieldsTable = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div data-testid={`${record.name}-data-type`}>
|
||||
{isReadOnly ||
|
||||
(displayValue && displayValue.length < 25 && !isReadOnly) ? (
|
||||
toLower(displayValue)
|
||||
@ -130,7 +130,7 @@ const SearchIndexFieldsTable = ({
|
||||
</Typography.Text>
|
||||
</Tooltip>
|
||||
)}
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
[isReadOnly]
|
||||
|
Loading…
x
Reference in New Issue
Block a user