From f4c4f191141cc15daf7d7385455abc5b4ad8768a Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Thu, 3 Oct 2024 11:38:45 +0530 Subject: [PATCH] Revert "MINOR: fix custom property layout issues (#18065)" This reverts commit 778900305fa6e5f3be3d90ce0995d505f067ee87. --- .../CustomPropertyTable.tsx | 71 ++++++++-------- .../PropertyValue.test.tsx | 2 +- .../CustomPropertyTable/PropertyValue.tsx | 84 ++++++++----------- .../CustomPropertyTable/property-value.less | 25 ++---- .../ResizablePanels/ResizablePanels.tsx | 2 +- .../RichTextEditor.interface.ts | 1 - .../RichTextEditorPreviewer.tsx | 7 +- .../src/main/resources/ui/src/styles/app.less | 8 -- 8 files changed, 78 insertions(+), 122 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.tsx index 534e6963f642..220d269b373d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/CustomPropertyTable.tsx @@ -245,45 +245,40 @@ export const CustomPropertyTable = ({ <> {!isEmpty(entityTypeDetail.customProperties) && ( <> +
+ + {t('label.custom-property-plural')} + + {viewAllBtn} +
+ {isRenderedInRightPanel ? ( - <> -
- - {t('label.custom-property-plural')} - - {viewAllBtn} -
-
- {dataSource.map((record, index) => ( - -
- -
- {index !== dataSource.length - 1 && ( - - )} -
- ))} -
- +
+ {dataSource.map((record, index) => ( + +
+ +
+ {index !== dataSource.length - 1 && ( + + )} +
+ ))} +
) : ( {dataSource.map((record) => ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.test.tsx index 9b3f21183a7f..710697513b1e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.test.tsx @@ -317,7 +317,7 @@ describe('Test PropertyValue Component', () => { const iconElement = await screen.findByTestId('edit-icon'); expect(await screen.findByTestId('time-interval-value')).toHaveTextContent( - 'label.start-entity: 1736255200000label.end-entity: 1736255200020' + 'StartTime: 1736255200000EndTime: 1736255200020' ); await act(async () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx index ab23bfd442e5..d8838d060dac 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx @@ -11,7 +11,7 @@ * limitations under the License. */ -import Icon from '@ant-design/icons'; +import Icon, { DownOutlined, UpOutlined } from '@ant-design/icons'; import { Button, Card, @@ -29,7 +29,6 @@ import { } from 'antd'; import { ColumnsType } from 'antd/lib/table'; import { AxiosError } from 'axios'; -import classNames from 'classnames'; import { t } from 'i18next'; import { isArray, @@ -51,7 +50,6 @@ import React, { useState, } from 'react'; import { Link } from 'react-router-dom'; -import { ReactComponent as ArrowIconComponent } from '../../../assets/svg/drop-down.svg'; import { ReactComponent as EditIconComponent } from '../../../assets/svg/edit-new.svg'; import { DE_ACTIVE_COLOR, @@ -867,7 +865,7 @@ export const PropertyValue: FC = ({ isTeam={item.type === 'team'} name={item.name ?? ''} type="circle" - width="18" + width="20" /> ) : ( searchClassBase.getEntityIcon(item.type) @@ -876,7 +874,7 @@ export const PropertyValue: FC = ({ } type="text"> {getEntityName(item)} @@ -918,7 +916,7 @@ export const PropertyValue: FC = ({ isTeam={item.type === 'team'} name={item.name ?? ''} type="circle" - width="18" + width="20" /> ) : ( searchClassBase.getEntityIcon(item.type) @@ -927,7 +925,7 @@ export const PropertyValue: FC = ({ } type="text"> {getEntityName(item)} @@ -949,17 +947,13 @@ export const PropertyValue: FC = ({ className="break-all" data-testid="time-interval-value"> - {`${t('label.start-entity', { - entity: t('label.time'), - })}: `} - + {`StartTime: `} + {timeInterval.start} - {`${t('label.end-entity', { - entity: t('label.time'), - })}: `} - + {`EndTime: `} + {timeInterval.end} @@ -979,7 +973,7 @@ export const PropertyValue: FC = ({ default: return ( {value} @@ -1018,10 +1012,10 @@ export const PropertyValue: FC = ({ const customPropertyInlineElement = (
-
+
{getEntityName(property)} @@ -1045,6 +1039,11 @@ export const PropertyValue: FC = ({ )}
+
); @@ -1052,9 +1051,9 @@ export const PropertyValue: FC = ({ - + {getEntityName(property)} @@ -1073,30 +1072,18 @@ export const PropertyValue: FC = ({ )} - {!isRenderedInRightPanel && ( - - - - )} + + + -
+
= ({ {showInput ? getPropertyInput() : getValueElement()}
{isOverflowing && !showInput && ( - + size="small" + type="text" + onClick={toggleExpand}> + {isExpanded ? : } + )}
@@ -1125,7 +1111,7 @@ export const PropertyValue: FC = ({ if (isRenderedInRightPanel) { return (
{isInlineProperty ? customPropertyInlineElement : customPropertyElement}
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/property-value.less b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/property-value.less index 07e9881f0e0f..6dcbfa1f9cb4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/property-value.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/property-value.less @@ -31,17 +31,14 @@ } } -.custom-property-value-toggle-btn { - svg { +.ant-btn-text.custom-property-value-toggle-btn { + border-radius: 100%; + background: @btn-bg-color; + border-color: transparent; + height: 30px; + width: 30px; + .anticon { vertical-align: middle; - width: 14px; - transition: 0.3s ease-in-out; - } -} - -.custom-property-value-toggle-btn.active { - svg { - transform: rotate(180deg); } } @@ -62,14 +59,6 @@ .ant-card-body { overflow-x: scroll; } - - .property-name { - font-weight: 400; - } - - .property-value { - font-weight: 500; - } } .custom-property-card-right-panel { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/ResizablePanels/ResizablePanels.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/ResizablePanels/ResizablePanels.tsx index ad8263961a52..a5c5af1d7e93 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/ResizablePanels/ResizablePanels.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/ResizablePanels/ResizablePanels.tsx @@ -111,7 +111,7 @@ const ResizablePanels: React.FC = ({ }}> {!hideSecondPanel && ( -
{secondPanel.children}
+ {secondPanel.children}
)} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditor.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditor.interface.ts index 9dddec599d89..3e60eb16063d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditor.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditor.interface.ts @@ -37,7 +37,6 @@ export interface PreviewerProp { showReadMoreBtn?: boolean; isDescriptionExpanded?: boolean; textVariant?: TextVariant; - reducePreviewLineClass?: string; } export type PreviewStyle = 'tab' | 'vertical'; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditorPreviewer.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditorPreviewer.tsx index a0cc205b9876..edab1db6c926 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditorPreviewer.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditorPreviewer.tsx @@ -35,7 +35,6 @@ const RichTextEditorPreviewer = ({ showReadMoreBtn = true, maxLength = DESCRIPTION_MAX_PREVIEW_CHARACTERS, isDescriptionExpanded = false, - reducePreviewLineClass, }: PreviewerProp) => { const { t, i18n } = useTranslation(); const [content, setContent] = useState(''); @@ -111,11 +110,7 @@ const RichTextEditorPreviewer = ({ data-testid="viewer-container" dir={i18n.dir()}>