mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-02 04:13:17 +00:00
Fix (uI): Domain truncate issue || consistent Domain UX (#21574)
* fixed domain truncate * improved domain ux * fixed sonar cases * removed unnecessary states * addressed comments * applied max width (cherry picked from commit 407eb24baf9276a9d2e7146098937b60dd3e4034)
This commit is contained in:
parent
940dd3cddb
commit
cdd8c3cb45
@ -75,16 +75,22 @@
|
|||||||
color: @primary-heading-color;
|
color: @primary-heading-color;
|
||||||
max-width: 200px;
|
max-width: 200px;
|
||||||
}
|
}
|
||||||
.owner-label-container {
|
.owner-label-container,
|
||||||
|
.domain-label-container {
|
||||||
max-width: 148px;
|
max-width: 148px;
|
||||||
}
|
}
|
||||||
.domain-link-text.render-domain-lebel-style {
|
.domain-link-container {
|
||||||
color: @grey-700;
|
//consistent width for data-asset-header
|
||||||
display: inline-block;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
max-width: 148px;
|
max-width: 148px;
|
||||||
|
|
||||||
|
.domain-link-text.render-domain-lebel-style {
|
||||||
|
color: @grey-700;
|
||||||
|
display: inline-block;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
max-width: 148px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
a.source-url-link {
|
a.source-url-link {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@ -26,6 +26,7 @@ import { getDataAssetsVersionHeaderInfo } from '../../../utils/DataAssetsVersion
|
|||||||
import serviceUtilClassBase from '../../../utils/ServiceUtilClassBase';
|
import serviceUtilClassBase from '../../../utils/ServiceUtilClassBase';
|
||||||
import TitleBreadcrumb from '../../common/TitleBreadcrumb/TitleBreadcrumb.component';
|
import TitleBreadcrumb from '../../common/TitleBreadcrumb/TitleBreadcrumb.component';
|
||||||
import { EntitiesWithDomainField } from '../DataAssetsHeader/DataAssetsHeader.interface';
|
import { EntitiesWithDomainField } from '../DataAssetsHeader/DataAssetsHeader.interface';
|
||||||
|
import './data-asset-version-header.less';
|
||||||
import { DataAssetsVersionHeaderProps } from './DataAssetsVersionHeader.interface';
|
import { DataAssetsVersionHeaderProps } from './DataAssetsVersionHeader.interface';
|
||||||
|
|
||||||
function DataAssetsVersionHeader({
|
function DataAssetsVersionHeader({
|
||||||
@ -64,7 +65,10 @@ function DataAssetsVersionHeader({
|
|||||||
}, [currentVersionData]);
|
}, [currentVersionData]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={[8, 12]} justify="space-between">
|
<Row
|
||||||
|
className="version-header-container"
|
||||||
|
gutter={[8, 12]}
|
||||||
|
justify="space-between">
|
||||||
<Col className="self-center" span={21}>
|
<Col className="self-center" span={21}>
|
||||||
<Row gutter={[16, 12]}>
|
<Row gutter={[16, 12]}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
@ -80,7 +84,7 @@ function DataAssetsVersionHeader({
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<div className="d-flex no-wrap">
|
<div className="d-flex version-domain-container no-wrap">
|
||||||
{entityType !== EntityType.METADATA_SERVICE && (
|
{entityType !== EntityType.METADATA_SERVICE && (
|
||||||
<>
|
<>
|
||||||
<DomainLabel
|
<DomainLabel
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2025 Collate.
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
.version-header-container {
|
||||||
|
.domain-label-container {
|
||||||
|
//same as data-asset-header
|
||||||
|
max-width: 148px;
|
||||||
|
}
|
||||||
|
}
|
@ -243,7 +243,7 @@ export const DomainLabel = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="d-flex flex-col gap-2 justify-start">
|
<div className="d-flex flex-col domain-label-container gap-2 justify-start">
|
||||||
{headerLayout && (
|
{headerLayout && (
|
||||||
<div
|
<div
|
||||||
className="d-flex text-sm gap-1 font-medium items-center "
|
className="d-flex text-sm gap-1 font-medium items-center "
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
@import (reference) '../../../styles/variables.less';
|
@import (reference) '../../../styles/variables.less';
|
||||||
|
.domain-label-container {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
.domain-link.ant-typography {
|
.domain-link.ant-typography {
|
||||||
color: @primary-heading-color;
|
color: @primary-heading-color;
|
||||||
}
|
}
|
||||||
@ -21,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.domain-link-container {
|
.domain-link-container {
|
||||||
max-width: 148px;
|
max-width: 100%;
|
||||||
.domain-link-text {
|
.domain-link-text {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { Button, Empty, Space, Tree, Typography } from 'antd';
|
import { Button, Empty, Space, Spin, Tree, Typography } from 'antd';
|
||||||
import Search from 'antd/lib/input/Search';
|
import Search from 'antd/lib/input/Search';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
@ -105,8 +105,11 @@ const DomainSelectablTree: FC<DomainSelectableTreeProps> = ({
|
|||||||
);
|
);
|
||||||
retn = [domain];
|
retn = [domain];
|
||||||
}
|
}
|
||||||
await onSubmit(retn);
|
try {
|
||||||
setIsSubmitLoading(false);
|
await onSubmit(retn);
|
||||||
|
} finally {
|
||||||
|
setIsSubmitLoading(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
onCancel();
|
onCancel();
|
||||||
}
|
}
|
||||||
@ -211,23 +214,25 @@ const DomainSelectablTree: FC<DomainSelectableTreeProps> = ({
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<Tree
|
<Spin indicator={<Loader size="small" />} spinning={isSubmitLoading}>
|
||||||
blockNode
|
<Tree
|
||||||
checkStrictly
|
blockNode
|
||||||
defaultExpandAll
|
checkStrictly
|
||||||
showLine
|
defaultExpandAll
|
||||||
autoExpandParent={Boolean(searchTerm)}
|
showLine
|
||||||
checkable={isMultiple}
|
autoExpandParent={Boolean(searchTerm)}
|
||||||
className="domain-selectable-tree"
|
checkable={isMultiple}
|
||||||
defaultCheckedKeys={isMultiple ? value : []}
|
className="domain-selectable-tree"
|
||||||
defaultExpandedKeys={value}
|
defaultCheckedKeys={isMultiple ? value : []}
|
||||||
defaultSelectedKeys={isMultiple ? [] : value}
|
defaultExpandedKeys={value}
|
||||||
multiple={isMultiple}
|
defaultSelectedKeys={isMultiple ? [] : value}
|
||||||
switcherIcon={switcherIcon}
|
multiple={isMultiple}
|
||||||
treeData={treeData}
|
switcherIcon={switcherIcon}
|
||||||
onCheck={onCheck}
|
treeData={treeData}
|
||||||
onSelect={onSelect}
|
onCheck={onCheck}
|
||||||
/>
|
onSelect={onSelect}
|
||||||
|
/>
|
||||||
|
</Spin>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [isLoading, treeData, value, onSelect, isMultiple, searchTerm]);
|
}, [isLoading, treeData, value, onSelect, isMultiple, searchTerm]);
|
||||||
@ -238,6 +243,13 @@ const DomainSelectablTree: FC<DomainSelectableTreeProps> = ({
|
|||||||
fetchAPI();
|
fetchAPI();
|
||||||
}
|
}
|
||||||
}, [visible]);
|
}, [visible]);
|
||||||
|
const handleAllDomainKeyPress = (e: React.KeyboardEvent<HTMLDivElement>) => {
|
||||||
|
// To pass Sonar test
|
||||||
|
if (e.key === 'Enter' || e.key === ' ') {
|
||||||
|
e.preventDefault();
|
||||||
|
handleMyDomainsClick();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-sm" data-testid="domain-selectable-tree">
|
<div className="p-sm" data-testid="domain-selectable-tree">
|
||||||
@ -259,7 +271,10 @@ const DomainSelectablTree: FC<DomainSelectableTreeProps> = ({
|
|||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
data-testid="all-domains-selector"
|
data-testid="all-domains-selector"
|
||||||
onClick={handleMyDomainsClick}>
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
|
onClick={handleMyDomainsClick}
|
||||||
|
onKeyDown={handleAllDomainKeyPress}>
|
||||||
<DomainIcon height={20} name="domain" width={20} />
|
<DomainIcon height={20} name="domain" width={20} />
|
||||||
<Typography.Text
|
<Typography.Text
|
||||||
className={classNames({
|
className={classNames({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user