UI :- Remove ellipses component (#7971)

* Remove ellipses component

* changes as per comments

* remove tailwind css from ellipses component

* fix unit test issue
This commit is contained in:
Ashish Gupta 2022-10-06 20:01:39 +05:30 committed by GitHub
parent d3cb6d52ed
commit 12d97423f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 152 additions and 145 deletions

View File

@ -17,7 +17,6 @@ import { Link } from 'react-router-dom';
import { EntityReference } from '../../generated/type/entityReference'; import { EntityReference } from '../../generated/type/entityReference';
import { getEntityName } from '../../utils/CommonUtils'; import { getEntityName } from '../../utils/CommonUtils';
import { getEntityIcon, getEntityLink } from '../../utils/TableUtils'; import { getEntityIcon, getEntityLink } from '../../utils/TableUtils';
import Ellipses from '../common/Ellipses/Ellipses';
import { leftPanelAntCardStyle } from '../containers/PageLayout'; import { leftPanelAntCardStyle } from '../containers/PageLayout';
interface Prop { interface Prop {
entityList: Array<EntityReference>; entityList: Array<EntityReference>;
@ -113,9 +112,11 @@ export const EntityListWithAntd: FunctionComponent<AntdEntityListProp> = ({
className="tw-text-grey-body hover:tw-text-primary-hover hover:tw-underline" className="tw-text-grey-body hover:tw-text-primary-hover hover:tw-underline"
title={getEntityName(item as unknown as EntityReference)} title={getEntityName(item as unknown as EntityReference)}
type="text"> type="text">
<Ellipses className="tw-w-48 tw-text-left"> <Typography.Text
className="ant-typography-ellipsis-custom w-48 text-left"
ellipsis={{ tooltip: true }}>
{getEntityName(item as unknown as EntityReference)} {getEntityName(item as unknown as EntityReference)}
</Ellipses> </Typography.Text>
</Button> </Button>
</Link> </Link>
</div> </div>

View File

@ -11,7 +11,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Card, Col, Row, Statistic } from 'antd'; import { Card, Col, Row, Statistic, Typography } from 'antd';
import { AxiosError } from 'axios'; import { AxiosError } from 'axios';
import { sortBy } from 'lodash'; import { sortBy } from 'lodash';
import moment from 'moment'; import moment from 'moment';
@ -30,7 +30,6 @@ import { getTableFQNFromColumnFQN } from '../../../utils/CommonUtils';
import { updateTestResults } from '../../../utils/DataQualityAndProfilerUtils'; import { updateTestResults } from '../../../utils/DataQualityAndProfilerUtils';
import { generateEntityLink } from '../../../utils/TableUtils'; import { generateEntityLink } from '../../../utils/TableUtils';
import { showErrorToast } from '../../../utils/ToastUtils'; import { showErrorToast } from '../../../utils/ToastUtils';
import Ellipses from '../../common/Ellipses/Ellipses';
import { TableTestsType } from '../../TableProfiler/TableProfiler.interface'; import { TableTestsType } from '../../TableProfiler/TableProfiler.interface';
import { import {
MetricChartType, MetricChartType,
@ -226,9 +225,12 @@ const ProfilerTab: React.FC<ProfilerTabProps> = ({
<Row gutter={16}> <Row gutter={16}>
<Col span={16}> <Col span={16}>
<p className="tw-font-medium tw-text-base">Column summary</p> <p className="tw-font-medium tw-text-base">Column summary</p>
<Ellipses className="tw-text-grey-muted" rows={4}>
<Typography.Paragraph
className="ant-typography-ellipsis-custom tw-text-grey-muted"
ellipsis={{ tooltip: true, rows: 4 }}>
{activeColumnDetails.description || 'No Description'} {activeColumnDetails.description || 'No Description'}
</Ellipses> </Typography.Paragraph>
</Col> </Col>
<Col span={8}> <Col span={8}>
<Statistic <Statistic

View File

@ -74,9 +74,6 @@ jest.mock('antd', () => ({
jest.mock('../../../utils/CommonUtils', () => ({ jest.mock('../../../utils/CommonUtils', () => ({
formatNumberWithComma: jest.fn(), formatNumberWithComma: jest.fn(),
})); }));
jest.mock('../../common/Ellipses/Ellipses', () => {
return jest.fn().mockImplementation(({ children }) => <div>{children}</div>);
});
jest.mock('../../common/searchbar/Searchbar', () => { jest.mock('../../common/searchbar/Searchbar', () => {
return jest return jest
.fn() .fn()

View File

@ -36,7 +36,6 @@ import {
} from '../../../utils/RouterUtils'; } from '../../../utils/RouterUtils';
import { getEncodedFqn } from '../../../utils/StringsUtils'; import { getEncodedFqn } from '../../../utils/StringsUtils';
import SVGIcons, { Icons } from '../../../utils/SvgUtils'; import SVGIcons, { Icons } from '../../../utils/SvgUtils';
import Ellipses from '../../common/Ellipses/Ellipses';
import Searchbar from '../../common/searchbar/Searchbar'; import Searchbar from '../../common/searchbar/Searchbar';
import TestIndicator from '../../common/TestIndicator/TestIndicator'; import TestIndicator from '../../common/TestIndicator/TestIndicator';
import { ProfilerDashboardTab } from '../../ProfilerDashboard/profilerDashboard.interface'; import { ProfilerDashboardTab } from '../../ProfilerDashboard/profilerDashboard.interface';
@ -82,9 +81,11 @@ const ColumnProfileTable: FC<ColumnProfileTableProps> = ({
key: 'dataType', key: 'dataType',
render: (dataTypeDisplay: string) => { render: (dataTypeDisplay: string) => {
return ( return (
<Ellipses tooltip className="tw-w-24"> <Typography.Text
className="ant-typography-ellipsis-custom w-24"
ellipsis={{ tooltip: true }}>
{dataTypeDisplay || 'N/A'} {dataTypeDisplay || 'N/A'}
</Ellipses> </Typography.Text>
); );
}, },
sorter: (col1, col2) => col1.dataType.localeCompare(col2.dataType), sorter: (col1, col2) => col1.dataType.localeCompare(col2.dataType),

View File

@ -75,7 +75,6 @@ import {
import { showErrorToast } from '../../utils/ToastUtils'; import { showErrorToast } from '../../utils/ToastUtils';
import { Button } from '../buttons/Button/Button'; import { Button } from '../buttons/Button/Button';
import Description from '../common/description/Description'; import Description from '../common/description/Description';
import Ellipses from '../common/Ellipses/Ellipses';
import ManageButton from '../common/entityPageInfo/ManageButton/ManageButton'; import ManageButton from '../common/entityPageInfo/ManageButton/ManageButton';
import EntitySummaryDetails from '../common/EntitySummaryDetails/EntitySummaryDetails'; import EntitySummaryDetails from '../common/EntitySummaryDetails/EntitySummaryDetails';
import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder'; import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder';
@ -821,9 +820,9 @@ const TeamDetailsV1 = ({
</div> </div>
) : ( ) : (
<div className="tw-flex tw-group" data-testid="team-heading"> <div className="tw-flex tw-group" data-testid="team-heading">
<Ellipses tooltip rows={1}> <Typography.Title ellipsis={{ rows: 1, tooltip: true }} level={5}>
{heading} {heading}
</Ellipses> </Typography.Title>
{isActionAllowed() && ( {isActionAllowed() && (
<div className={classNames('tw-w-5 tw-min-w-max')}> <div className={classNames('tw-w-5 tw-min-w-max')}>
<Tooltip <Tooltip

View File

@ -68,7 +68,6 @@ import ActivityFeedList from '../ActivityFeed/ActivityFeedList/ActivityFeedList'
import { filterListTasks } from '../ActivityFeed/ActivityFeedList/ActivityFeedList.util'; import { filterListTasks } from '../ActivityFeed/ActivityFeedList/ActivityFeedList.util';
import { Button } from '../buttons/Button/Button'; import { Button } from '../buttons/Button/Button';
import Description from '../common/description/Description'; import Description from '../common/description/Description';
import Ellipses from '../common/Ellipses/Ellipses';
import ProfilePicture from '../common/ProfilePicture/ProfilePicture'; import ProfilePicture from '../common/ProfilePicture/ProfilePicture';
import { reactSingleSelectCustomStyle } from '../common/react-select-component/reactSelectCustomStyle'; import { reactSingleSelectCustomStyle } from '../common/react-select-component/reactSelectCustomStyle';
import TabsPane from '../common/TabsPane/TabsPane'; import TabsPane from '../common/TabsPane/TabsPane';
@ -387,9 +386,11 @@ const Users = ({
data-testid={team.name} data-testid={team.name}
key={i}> key={i}>
<SVGIcons alt="icon" className="tw-w-4" icon={Icons.TEAMS_GREY} /> <SVGIcons alt="icon" className="tw-w-4" icon={Icons.TEAMS_GREY} />
<Ellipses tooltip className="tw-w-48"> <Typography.Text
className="ant-typography-ellipsis-custom w-48"
ellipsis={{ tooltip: true }}>
{getEntityName(team)} {getEntityName(team)}
</Ellipses> </Typography.Text>
</div> </div>
))} ))}
{isEmpty(userData.teams) && ( {isEmpty(userData.teams) && (
@ -520,9 +521,11 @@ const Users = ({
{userData.roles?.map((role, i) => ( {userData.roles?.map((role, i) => (
<div className="tw-mb-2 tw-flex tw-items-center tw-gap-2" key={i}> <div className="tw-mb-2 tw-flex tw-items-center tw-gap-2" key={i}>
<SVGIcons alt="icon" className="tw-w-4" icon={Icons.USERS} /> <SVGIcons alt="icon" className="tw-w-4" icon={Icons.USERS} />
<Ellipses tooltip className="tw-w-48"> <Typography.Text
className="ant-typography-ellipsis-custom w-48"
ellipsis={{ tooltip: true }}>
{getEntityName(role)} {getEntityName(role)}
</Ellipses> </Typography.Text>
</div> </div>
))} ))}
{!userData.isAdmin && isEmpty(userData.roles) && ( {!userData.isAdmin && isEmpty(userData.roles) && (
@ -660,9 +663,12 @@ const Users = ({
className="tw-mb-2 tw-flex tw-items-center tw-gap-2" className="tw-mb-2 tw-flex tw-items-center tw-gap-2"
key={i}> key={i}>
<SVGIcons alt="icon" className="tw-w-4" icon={Icons.USERS} /> <SVGIcons alt="icon" className="tw-w-4" icon={Icons.USERS} />
<Ellipses tooltip className="tw-w-48">
<Typography.Text
className="ant-typography-ellipsis-custom w-48"
ellipsis={{ tooltip: true }}>
{getEntityName(inheritedRole)} {getEntityName(inheritedRole)}
</Ellipses> </Typography.Text>
</div> </div>
))} ))}
</div> </div>

View File

@ -11,6 +11,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Typography } from 'antd';
import { AxiosError } from 'axios'; import { AxiosError } from 'axios';
import { CookieStorage } from 'cookie-storage'; import { CookieStorage } from 'cookie-storage';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
@ -43,7 +44,6 @@ import {
} from '../../utils/CommonUtils'; } from '../../utils/CommonUtils';
import SVGIcons, { Icons } from '../../utils/SvgUtils'; import SVGIcons, { Icons } from '../../utils/SvgUtils';
import { showErrorToast } from '../../utils/ToastUtils'; import { showErrorToast } from '../../utils/ToastUtils';
import Ellipses from '../common/Ellipses/Ellipses';
import { COOKIE_VERSION } from '../Modals/WhatsNewModal/whatsNewData'; import { COOKIE_VERSION } from '../Modals/WhatsNewModal/whatsNewData';
import NavBar from '../nav-bar/NavBar'; import NavBar from '../nav-bar/NavBar';
@ -147,9 +147,12 @@ const Appbar: React.FC = (): JSX.Element => {
<div> <div>
<div className="tw-text-grey-muted tw-text-xs">{name}</div> <div className="tw-text-grey-muted tw-text-xs">{name}</div>
{userRoleArr.map((userRole, i) => ( {userRoleArr.map((userRole, i) => (
<Ellipses tooltip className="tw-font-medium" key={i}> <Typography.Paragraph
className="ant-typography-ellipsis-custom font-medium"
ellipsis={{ tooltip: true }}
key={i}>
{userRole} {userRole}
</Ellipses> </Typography.Paragraph>
))} ))}
<hr className="tw-my-1.5" /> <hr className="tw-my-1.5" />
</div> </div>
@ -185,13 +188,11 @@ const Appbar: React.FC = (): JSX.Element => {
data-testid="user-name" data-testid="user-name"
to={getUserPath(currentUser?.name as string)}> to={getUserPath(currentUser?.name as string)}>
{' '} {' '}
<Ellipses <Typography.Paragraph
tooltip className="ant-typography-ellipsis-custom font-medium cursor-pointer text-primary"
className="tw-font-medium tw-cursor-pointer" ellipsis={{ rows: 1, tooltip: true }}>
rows={1}
style={{ color: '#7147E8' }}>
{name} {name}
</Ellipses> </Typography.Paragraph>
</Link> </Link>
<hr className="tw-my-1.5" /> <hr className="tw-my-1.5" />
{roles.length > 0 ? getUsersRoles(roles, 'Roles') : null} {roles.length > 0 ? getUsersRoles(roles, 'Roles') : null}
@ -202,11 +203,14 @@ const Appbar: React.FC = (): JSX.Element => {
<div> <div>
<span className="tw-text-grey-muted tw-text-xs">Teams</span> <span className="tw-text-grey-muted tw-text-xs">Teams</span>
{teams.map((t, i) => ( {teams.map((t, i) => (
<Ellipses tooltip className="tw-text-xs" key={i}> <Typography.Paragraph
className="ant-typography-ellipsis-custom text-xs"
ellipsis={{ tooltip: true }}
key={i}>
<Link to={getTeamAndUserDetailsPath(t.name as string)}> <Link to={getTeamAndUserDetailsPath(t.name as string)}>
{t.displayName || t.name} {t.displayName || t.name}
</Link> </Link>
</Ellipses> </Typography.Paragraph>
))} ))}
<hr className="tw-mt-1.5" /> <hr className="tw-mt-1.5" />
</div> </div>

View File

@ -1,36 +0,0 @@
/*
* Copyright 2021 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.
*/
import { Typography } from 'antd';
import { EllipsisConfig } from 'antd/lib/typography/Base';
import classNames from 'classnames';
import React, { CSSProperties, FC } from 'react';
interface Props extends EllipsisConfig {
children: React.ReactNode;
className?: string;
style?: CSSProperties;
}
const Ellipses: FC<Props> = ({ children, className, style, ...props }) => {
return (
<Typography.Paragraph
className={classNames('ant-typography-ellipsis-custom', className)}
ellipsis={props}
style={style}>
{children}
</Typography.Paragraph>
);
};
export default Ellipses;

View File

@ -40,12 +40,6 @@ const mockColumnData = {
ordinalPosition: 2, ordinalPosition: 2,
} as Column; } as Column;
jest.mock('../../../components/common/Ellipses/Ellipses', () =>
jest.fn().mockImplementation(({ children }) => {
return <p>{children}</p>;
})
);
describe('Test column detail component', () => { describe('Test column detail component', () => {
it('Should render the component', async () => { it('Should render the component', async () => {
render(<ColumnDetail column={mockColumnData} />); render(<ColumnDetail column={mockColumnData} />);

View File

@ -11,9 +11,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { Typography } from 'antd';
import { isEmpty, isUndefined } from 'lodash'; import { isEmpty, isUndefined } from 'lodash';
import React from 'react'; import React from 'react';
import Ellipses from '../../../components/common/Ellipses/Ellipses';
import { Column } from '../../../generated/entity/data/table'; import { Column } from '../../../generated/entity/data/table';
import SVGIcons from '../../../utils/SvgUtils'; import SVGIcons from '../../../utils/SvgUtils';
@ -26,9 +26,11 @@ const ColumnDetail = ({ column }: { column: Column }) => {
data-testid="column-type"> data-testid="column-type">
Column type: Column type:
</span>{' '} </span>{' '}
<Ellipses tooltip rows={1}> <Typography.Paragraph
className="ant-typography-ellipsis-custom"
ellipsis={{ rows: 1, tooltip: true }}>
{column.dataTypeDisplay} {column.dataTypeDisplay}
</Ellipses> </Typography.Paragraph>
</div> </div>
{column.tags && column.tags.length ? ( {column.tags && column.tags.length ? (
<div className="tw-flex tw-mt-4" data-testid="column-tags"> <div className="tw-flex tw-mt-4" data-testid="column-tags">

View File

@ -16,7 +16,6 @@ import { ColumnsType } from 'antd/lib/table';
import React, { useEffect, useMemo, useState } from 'react'; import React, { useEffect, useMemo, useState } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { getListTestSuites } from '../../axiosAPIs/testAPI'; import { getListTestSuites } from '../../axiosAPIs/testAPI';
import Ellipses from '../../components/common/Ellipses/Ellipses';
import NextPrevious from '../../components/common/next-previous/NextPrevious'; import NextPrevious from '../../components/common/next-previous/NextPrevious';
import { import {
INITIAL_PAGING_VALUE, INITIAL_PAGING_VALUE,
@ -70,9 +69,11 @@ const TestSuitePage = () => {
key: 'description', key: 'description',
width: 300, width: 300,
render: (_, record) => ( render: (_, record) => (
<Ellipses tooltip className="tw-w-11/12"> <Typography.Paragraph
className="ant-typography-ellipsis-custom w-11-12"
ellipsis={{ tooltip: true }}>
{record.description} {record.description}
</Ellipses> </Typography.Paragraph>
), ),
}, },
{ {

View File

@ -12,7 +12,7 @@
*/ */
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Button, Tooltip } from 'antd'; import { Button, Tooltip, Typography } from 'antd';
import { AxiosError } from 'axios'; import { AxiosError } from 'axios';
import { isEmpty, isUndefined, toLower } from 'lodash'; import { isEmpty, isUndefined, toLower } from 'lodash';
import { FormErrorData, LoadingState } from 'Models'; import { FormErrorData, LoadingState } from 'Models';
@ -28,7 +28,6 @@ import {
updateTagCategory, updateTagCategory,
} from '../../axiosAPIs/tagAPI'; } from '../../axiosAPIs/tagAPI';
import Description from '../../components/common/description/Description'; import Description from '../../components/common/description/Description';
import Ellipses from '../../components/common/Ellipses/Ellipses';
import ErrorPlaceHolder from '../../components/common/error-with-placeholder/ErrorPlaceHolder'; import ErrorPlaceHolder from '../../components/common/error-with-placeholder/ErrorPlaceHolder';
import LeftPanelCard from '../../components/common/LeftPanelCard/LeftPanelCard'; import LeftPanelCard from '../../components/common/LeftPanelCard/LeftPanelCard';
import RichTextEditorPreviewer from '../../components/common/rich-text-editor/RichTextEditorPreviewer'; import RichTextEditorPreviewer from '../../components/common/rich-text-editor/RichTextEditorPreviewer';
@ -494,14 +493,12 @@ const TagsPage = () => {
onClick={() => { onClick={() => {
history.push(getTagPath(category.name)); history.push(getTagPath(category.name));
}}> }}>
<Ellipses <Typography.Paragraph
tooltip className="ant-typography-ellipsis-custom tag-category label-category self-center w-32"
className="tag-category label-category tw-self-center tw-w-32"
data-testid="tag-name" data-testid="tag-name"
rows={1}> ellipsis={{ rows: 1, tooltip: true }}>
{getEntityName(category as unknown as EntityReference)} {getEntityName(category as unknown as EntityReference)}
</Ellipses> </Typography.Paragraph>
{getCountBadge( {getCountBadge(
currentCategory?.name === category.name currentCategory?.name === category.name
? currentCategory.children?.length ? currentCategory.children?.length

View File

@ -11,10 +11,10 @@
* limitations under the License. * limitations under the License.
*/ */
import { Typography } from 'antd';
import { toLower } from 'lodash'; import { toLower } from 'lodash';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Button } from '../../components/buttons/Button/Button'; import { Button } from '../../components/buttons/Button/Button';
import Ellipses from '../../components/common/Ellipses/Ellipses';
import Searchbar from '../../components/common/searchbar/Searchbar'; import Searchbar from '../../components/common/searchbar/Searchbar';
import { EntityReference as UserTeams } from '../../generated/entity/teams/user'; import { EntityReference as UserTeams } from '../../generated/entity/teams/user';
import { getEntityName } from '../../utils/CommonUtils'; import { getEntityName } from '../../utils/CommonUtils';
@ -98,9 +98,11 @@ const AddUsersModal = ({
<div className="tw-modal-backdrop" /> <div className="tw-modal-backdrop" />
<div className="tw-modal-container tw-max-h-90vh tw-max-w-3xl"> <div className="tw-modal-container tw-max-h-90vh tw-max-w-3xl">
<div className="tw-modal-header" data-testid="header"> <div className="tw-modal-header" data-testid="header">
<Ellipses tooltip className="tw-modal-title"> <Typography.Text
className="ant-typography-ellipsis-custom tw-modal-title"
ellipsis={{ tooltip: true }}>
{header} {header}
</Ellipses> </Typography.Text>
</div> </div>
<div className="tw-modal-body"> <div className="tw-modal-body">
<Searchbar <Searchbar

View File

@ -11,12 +11,12 @@
* limitations under the License. * limitations under the License.
*/ */
import { Typography } from 'antd';
import { AxiosError } from 'axios'; import { AxiosError } from 'axios';
import { toLower } from 'lodash'; import { toLower } from 'lodash';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { getUsers } from '../../axiosAPIs/userAPI'; import { getUsers } from '../../axiosAPIs/userAPI';
import { Button } from '../../components/buttons/Button/Button'; import { Button } from '../../components/buttons/Button/Button';
import Ellipses from '../../components/common/Ellipses/Ellipses';
import Searchbar from '../../components/common/searchbar/Searchbar'; import Searchbar from '../../components/common/searchbar/Searchbar';
import Loader from '../../components/Loader/Loader'; import Loader from '../../components/Loader/Loader';
import { API_RES_MAX_SIZE } from '../../constants/constants'; import { API_RES_MAX_SIZE } from '../../constants/constants';
@ -158,9 +158,11 @@ const AddUsersModalV1 = ({
<div className="tw-modal-backdrop" /> <div className="tw-modal-backdrop" />
<div className="tw-modal-container tw-max-h-90vh tw-max-w-3xl"> <div className="tw-modal-container tw-max-h-90vh tw-max-w-3xl">
<div className="tw-modal-header" data-testid="header"> <div className="tw-modal-header" data-testid="header">
<Ellipses tooltip className="tw-modal-title"> <Typography.Text
className="ant-typography-ellipsis-custom tw-modal-title"
ellipsis={{ tooltip: true }}>
{header} {header}
</Ellipses> </Typography.Text>
</div> </div>
<div className="tw-modal-body"> <div className="tw-modal-body">
<Searchbar <Searchbar

View File

@ -12,12 +12,11 @@
*/ */
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Button, Tooltip } from 'antd'; import { Button, Tooltip, Typography } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import { capitalize } from 'lodash'; import { capitalize } from 'lodash';
import React, { Fragment, useMemo } from 'react'; import React, { Fragment, useMemo } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import Ellipses from '../../components/common/Ellipses/Ellipses';
import ProfilePicture from '../../components/common/ProfilePicture/ProfilePicture'; import ProfilePicture from '../../components/common/ProfilePicture/ProfilePicture';
import { usePermissionProvider } from '../../components/PermissionProvider/PermissionProvider'; import { usePermissionProvider } from '../../components/PermissionProvider/PermissionProvider';
import { ResourceEntity } from '../../components/PermissionProvider/PermissionProvider.interface'; import { ResourceEntity } from '../../components/PermissionProvider/PermissionProvider.interface';
@ -202,7 +201,11 @@ const UserCard = ({
onClick={() => { onClick={() => {
onTitleClick?.(item.fqn); onTitleClick?.(item.fqn);
}}> }}>
<Ellipses tooltip>{item.displayName}</Ellipses> <Typography.Text
className="ant-typography-ellipsis-custom"
ellipsis={{ tooltip: true }}>
{item.displayName}
</Typography.Text>
</span> </span>
{item.name && item.name !== item.displayName && ( {item.name && item.name !== item.displayName && (
<span <span
@ -210,9 +213,11 @@ const UserCard = ({
isActionVisible ? 'tw-w-32' : 'tw-w-52' isActionVisible ? 'tw-w-32' : 'tw-w-52'
)} )}
title={isIconVisible ? item.name : capitalize(item.name)}> title={isIconVisible ? item.name : capitalize(item.name)}>
<Ellipses tooltip> <Typography.Text
className="ant-typography-ellipsis-custom"
ellipsis={{ tooltip: true }}>
{isIconVisible ? item.name : capitalize(item.name)} {isIconVisible ? item.name : capitalize(item.name)}
</Ellipses> </Typography.Text>
</span> </span>
)} )}
</Fragment> </Fragment>

View File

@ -16,6 +16,14 @@
@primary: #7147e8; @primary: #7147e8;
@primary-light: rgb(244, 240, 253); @primary-light: rgb(244, 240, 253);
//font weight
.font-medium {
font-weight: 500;
}
.text-600 {
font-weight: 600;
}
// font size // font size
.text-xs { .text-xs {
font-size: 12px; font-size: 12px;
@ -32,19 +40,76 @@
color: #ff4c3b; color: #ff4c3b;
} }
// text alignment
.text-center {
text-align: center;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
// Width // Width
.w-8 { .w-8 {
width: 32px; width: 32px;
} }
.w-16 { .w-16 {
width: 64px; width: 64px;
} }
.w-24 {
width: 6rem;
}
.w-32 {
width: 8rem;
}
.w-48 {
width: 12rem;
}
.w-11-12 {
width: 91.666667%;
}
.w-min-0 {
min-width: 0;
}
.w-max-20 {
max-width: 20%;
}
.w-max-200 {
max-width: 200px;
}
.w-max-500 {
max-width: 500px;
}
.w-500 {
width: 500px;
}
.w-300 {
width: 300px;
}
.w-60 {
width: 60%;
}
.w-full {
width: 100%;
}
//Height //Height
.h-7 { .h-7 {
height: 28px; height: 28px;
} }
.h-min-100 {
min-height: 100vh;
}
.h-min-50 {
min-height: 50vh;
}
.h-full {
height: 100%;
}
// Text alignment // Text alignment
.text-left { .text-left {
@ -73,6 +138,9 @@
.justify-center { .justify-center {
justify-content: center; justify-content: center;
} }
.self-center {
align-self: center;
}
.flex-col { .flex-col {
flex-direction: column; flex-direction: column;
} }
@ -94,50 +162,10 @@
font-weight: 500; font-weight: 500;
} }
.h-min-100 {
min-height: 100vh;
}
.h-min-50 {
min-height: 50vh;
}
.w-min-0 {
min-width: 0;
}
.w-max-20 {
max-width: 20%;
}
.w-max-200 {
max-width: 200px;
}
.w-max-500 {
max-width: 500px;
}
.w-500 {
width: 500px;
}
.w-300 {
width: 300px;
}
.w-60 {
width: 60%;
}
.w-full {
width: 100%;
}
.h-full {
height: 100%;
}
.border-l-2 { .border-l-2 {
border-left: 2px; border-left: 2px;
} }
.mr-2 {
margin-right: 8px;
}
.border-primary { .border-primary {
border-color: @primary; border-color: @primary;
} }
@ -152,6 +180,8 @@
font-weight: 600; font-weight: 600;
} }
// Margin
.mt-0 { .mt-0 {
margin-top: 0; margin-top: 0;
} }
@ -204,6 +234,9 @@
.m-52 { .m-52 {
margin: 13rem; margin: 13rem;
} }
.mr-2 {
margin-right: 8px;
}
// padding // padding
.p-16 { .p-16 {
@ -222,9 +255,6 @@
.opacity-60 { .opacity-60 {
opacity: 0.6; opacity: 0.6;
} }
.text-600 {
font-weight: 600;
}
.cursor-pointer { .cursor-pointer {
cursor: pointer; cursor: pointer;