chore(ui): handle description render common with util#24792
chore(ui): handle description render common with util#24792chirag-madlani merged 17 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR consolidates duplicate description column rendering logic across the codebase by introducing a reusable descriptionTableObject utility function. It also enhances the isDescriptionContentEmpty function to properly detect empty HTML content patterns like <p></p>, <p> </p>, and <p>\u00A0</p> that result from empty rich text editors. The changes reduce code duplication and provide consistent description rendering behavior across 27+ components.
Key Changes:
- Created
descriptionTableObjectutility function inTableColumn.util.tsxthat generates standardized description column configurations - Enhanced
isDescriptionContentEmptyfunction with regex-based detection of empty HTML paragraph tags, including those with whitespace and unicode non-breaking spaces - Added comprehensive test suite with 400+ test cases for the enhanced empty content detection logic
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
TableColumn.util.tsx |
Added descriptionTableObject utility function to generate description column configurations; integrates with RichTextEditorPreviewerNew component |
BlockEditorUtils.ts |
Enhanced isDescriptionContentEmpty with regex to detect empty HTML paragraphs; added console.warn for error handling |
BlockEditorUtils.test.ts |
Added comprehensive test suite covering null/undefined, empty paragraphs, whitespace, unicode characters, HTML entities, and edge cases |
ServiceMainTabContentUtils.tsx |
Replaced inline description column with utility; improved type safety by replacing any with Operation[] type |
Database.util.tsx |
Replaced inline description column with utility; removed unused viewAllPermission parameter from function signature |
ClassificationUtils.tsx |
Replaced inline description column with utility |
RichTextEditor.interface.ts |
Made markdown prop optional in PreviewerProp interface to support undefined descriptions |
StoredProcedureTab.tsx |
Replaced inline description column with utility |
RolesListPage.tsx |
Replaced inline description column with utility; removed unused NO_DATA_PLACEHOLDER import |
RolesDetailPageList.component.tsx |
Replaced inline description column with utility |
PoliciesListPage.tsx |
Replaced inline description column with utility; removed unused NO_DATA_PLACEHOLDER import |
PoliciesDetailsList.component.tsx |
Replaced inline description column with utility |
ObservabilityAlertsPage.tsx |
Replaced inline description column with utility; removed unused isEmpty import |
NotificationListPage.tsx |
Replaced inline description column with utility; removed unused isEmpty import |
MetricListPage.tsx |
Replaced inline description column with utility; removed unused isEmpty import |
SchemaTablesTab.tsx |
Replaced inline description column with utility |
KPIList.tsx |
Replaced inline description column with utility |
APIEndpointsTab.tsx |
Replaced inline description column with utility |
TeamHierarchy.tsx |
Replaced inline description column with utility; removed unused imports |
RolesAndPoliciesList.tsx |
Replaced inline description column with utility |
Services.tsx |
Replaced inline description column with utility; changed column width from 200 to 400 pixels |
CustomPropertyTable.tsx |
Replaced inline description column with utility |
BotListV1.component.tsx |
Replaced inline description column with utility |
PipelineVersion.component.tsx |
Replaced inline description column with utility |
WorkflowsTable.tsx |
Replaced inline description column with utility; removed unused Typography import |
SpreadsheetsTable.tsx |
Replaced inline description column with utility; removed unused isUndefined import |
SpreadsheetVersion.tsx |
Replaced inline description column with utility |
FilesTable.tsx |
Replaced inline description column with utility; removed unused isUndefined import |
DirectoryVersion.tsx |
Replaced inline description column with utility |
DirectoryChildrenTable.tsx |
Replaced inline description column with utility |
ContainerChildren.tsx |
Replaced inline description column with utility; extracted interface to separate file |
ContainerChildren.interface.ts |
New file containing extracted ContainerChildrenProps interface |
DatabaseSchemaTable.tsx |
Replaced inline description column with utility |
DataModelsTable.tsx |
Replaced inline description column with utility; removed unused isUndefined import |
DashboardVersion.component.tsx |
Replaced inline description column with utility |
🔍 CI failure analysis for ffe34de: Playwright tests timing out due to loading spinners that never disappear after certification operations on Directory and File entitiesIssuePlaywright CI test failures in job Root CauseThe tests are timing out because a loading spinner ( Specific failures:
DetailsThe pattern shows that certification-related operations (Add/Remove certifications) on Directory and File entities are causing the UI to enter a stuck loading state. The loader element is detected 33 times during the 30-second wait period, indicating the component is continuously rendering in a loading state without completing the operation. This issue is likely related to the PR's changes to description rendering, as the refactoring touches table components across Container, Dashboard, Drive, Database, Settings, and other areas. The Potential causes:
Code Review 👍 Approved with suggestionsSolid refactor that centralizes description column handling with comprehensive test coverage. A few minor edge case and consistency items to consider. Suggestions 💡 3 suggestionsEdge Case: descriptionTableObject render doesn't handle undefined text📄 openmetadata-ui/src/main/resources/ui/src/utils/TableColumn.util.tsx:117 The new Looking at the render: (text: string) => <RichTextEditorPreviewerNew markdown={text} />,Could be more defensive as: render: (text?: string) => <RichTextEditorPreviewerNew markdown={text ?? ''} />,This is a minor issue since the component likely handles it, but explicit handling would be safer. Code Quality: BotListV1 inconsistent with other refactored components📄 openmetadata-ui/src/main/resources/ui/src/components/Settings/Bot/BotListV1/BotListV1.component.tsx:148 The render: (_, record) => (
<RichTextEditorPreviewerNew
markdown={highlightSearchText(
record?.description || '',
searchTerm
)}
/>
),This is intentional because of the Code Quality: Added console.warn in isHTMLString catch block📄 openmetadata-ui/src/main/resources/ui/src/utils/BlockEditorUtils.ts:196 A } catch (e) {
// eslint-disable-next-line no-console
console.warn('Error parsing content to check HTML string:', e);
return false;
}While debugging information can be useful, this will produce console output in production for any parsing errors. Consider:
The eslint-disable comment also indicates this may not be the intended pattern for the codebase. What Works Well
Recommendations
Tip Comment OptionsAuto-apply is off Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | This comment will update automatically (Docs) |
|



Describe your changes:
Fixes: Remove unwanted description. Trim from all the occurrences and let the component handles it gracefully
Since we switched to HTML based description, we will always have description as
<p></p>or a similar patter for an empty lineEnhance utility function to handle all of those cases and render either no description or actual content based on the condition meet
I worked on ... because ...
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Summary by Gitar
descriptionTableObject<T>()inTableColumn.util.tsxcentralizes description column configuration across 60+ table componentsisDescriptionContentEmpty()inBlockEditorUtils.tsnow handles HTML patterns like<p></p>,<p> </p>,<p>\n</p>, and unicode non-breaking spacesRichTextEditorPreviewerNewnow checks for empty content and displays "No description" placeholder automaticallyTableColumn.util.test.tsxand enhancedBlockEditorUtils.test.tswith 400+ edge case scenariosThis will update automatically on new commits.