mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-07 22:44:08 +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.fill(descriptionBox, description);
|
||||||
|
|
||||||
await page.click('[data-testid="save"]');
|
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[]) => {
|
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 SuccessBadgeIcon } from '../..//assets/svg/success-badge.svg';
|
||||||
import { ReactComponent as FailBadgeIcon } from '../../assets/svg/fail-badge.svg';
|
import { ReactComponent as FailBadgeIcon } from '../../assets/svg/fail-badge.svg';
|
||||||
import { TableTypePropertyValueType } from '../../components/common/CustomPropertyTable/CustomPropertyTable.interface';
|
import { TableTypePropertyValueType } from '../../components/common/CustomPropertyTable/CustomPropertyTable.interface';
|
||||||
|
import RichTextEditorPreviewerV1 from '../../components/common/RichTextEditor/RichTextEditorPreviewerV1';
|
||||||
import {
|
import {
|
||||||
ExtensionDataProps,
|
ExtensionDataProps,
|
||||||
ExtensionDataTypes,
|
ExtensionDataTypes,
|
||||||
@ -55,12 +56,7 @@ export const COLUMNS_WIDTH: Record<string, number> = {
|
|||||||
status: 70,
|
status: 70,
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusRenderer = ({
|
const statusRenderer = (value: Status) => {
|
||||||
value,
|
|
||||||
}: {
|
|
||||||
value: Status;
|
|
||||||
data: { details: string };
|
|
||||||
}) => {
|
|
||||||
return value === Status.Failure ? (
|
return value === Status.Failure ? (
|
||||||
<FailBadgeIcon
|
<FailBadgeIcon
|
||||||
className="m-t-xss"
|
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 = (
|
export const getColumnConfig = (
|
||||||
column: string,
|
column: string,
|
||||||
entityType: EntityType
|
entityType: EntityType
|
||||||
@ -91,7 +112,7 @@ export const getColumnConfig = (
|
|||||||
sortable: false,
|
sortable: false,
|
||||||
renderEditor: csvUtilsClassBase.getEditor(colType, entityType),
|
renderEditor: csvUtilsClassBase.getEditor(colType, entityType),
|
||||||
minWidth: COLUMNS_WIDTH[colType] ?? 180,
|
minWidth: COLUMNS_WIDTH[colType] ?? 180,
|
||||||
render: column === 'status' ? statusRenderer : undefined,
|
render: (recordData) => renderColumnDataEditor(column, recordData),
|
||||||
} as TypeColumn;
|
} as TypeColumn;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user