mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-01 11:09:14 +00:00
* fix the description renderer in glossary import * added test for the same
This commit is contained in:
parent
68c324679a
commit
c406cceb9a
@ -51,7 +51,10 @@ export const fillDescriptionDetails = async (
|
||||
await page.fill(descriptionBox, description);
|
||||
|
||||
await page.click('[data-testid="save"]');
|
||||
await page.click('.InovuaReactDataGrid__cell--cell-active');
|
||||
|
||||
await expect(
|
||||
page.locator('.InovuaReactDataGrid__cell--cell-active')
|
||||
).not.toContainText('<p>');
|
||||
};
|
||||
|
||||
export const fillOwnerDetails = async (page: Page, owners: string[]) => {
|
||||
|
||||
@ -23,6 +23,7 @@ import React from 'react';
|
||||
import { ReactComponent as SuccessBadgeIcon } from '../..//assets/svg/success-badge.svg';
|
||||
import { ReactComponent as FailBadgeIcon } from '../../assets/svg/fail-badge.svg';
|
||||
import { TableTypePropertyValueType } from '../../components/common/CustomPropertyTable/CustomPropertyTable.interface';
|
||||
import RichTextEditorPreviewerV1 from '../../components/common/RichTextEditor/RichTextEditorPreviewerV1';
|
||||
import {
|
||||
ExtensionDataProps,
|
||||
ExtensionDataTypes,
|
||||
@ -55,12 +56,7 @@ export const COLUMNS_WIDTH: Record<string, number> = {
|
||||
status: 70,
|
||||
};
|
||||
|
||||
const statusRenderer = ({
|
||||
value,
|
||||
}: {
|
||||
value: Status;
|
||||
data: { details: string };
|
||||
}) => {
|
||||
const statusRenderer = (value: Status) => {
|
||||
return value === Status.Failure ? (
|
||||
<FailBadgeIcon
|
||||
className="m-t-xss"
|
||||
@ -78,6 +74,31 @@ const statusRenderer = ({
|
||||
);
|
||||
};
|
||||
|
||||
const renderColumnDataEditor = (
|
||||
column: string,
|
||||
recordData: {
|
||||
value: string;
|
||||
data: { details: string };
|
||||
}
|
||||
) => {
|
||||
const { value } = recordData;
|
||||
switch (column) {
|
||||
case 'status':
|
||||
return statusRenderer(value as Status);
|
||||
case 'description':
|
||||
return (
|
||||
<RichTextEditorPreviewerV1
|
||||
enableSeeMoreVariant={false}
|
||||
markdown={value}
|
||||
reducePreviewLineClass="max-one-line"
|
||||
/>
|
||||
);
|
||||
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
export const getColumnConfig = (
|
||||
column: string,
|
||||
entityType: EntityType
|
||||
@ -91,7 +112,7 @@ export const getColumnConfig = (
|
||||
sortable: false,
|
||||
renderEditor: csvUtilsClassBase.getEditor(colType, entityType),
|
||||
minWidth: COLUMNS_WIDTH[colType] ?? 180,
|
||||
render: column === 'status' ? statusRenderer : undefined,
|
||||
render: (recordData) => renderColumnDataEditor(column, recordData),
|
||||
} as TypeColumn;
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user