Skip to content

Commit

Permalink
[GSoC2024] Add tooltip to long project card name (#7550)
Browse files Browse the repository at this point in the history
  • Loading branch information
syedbarimanjan authored Mar 14, 2024
1 parent ae7999b commit f22322f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Added

- Tooltips for long names on cards (projects, tasks, cloud storages, and models)
(<https://github.com/opencv/cvat/pull/7550>)
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function CloudStorageItemComponent(props: Props): JSX.Element {
>
<Meta
title={(
<Paragraph>
<Paragraph ellipsis={{ tooltip: displayName }}>
<Text strong>{`#${id}: `}</Text>
<Text>{displayName}</Text>
</Paragraph>
Expand Down
4 changes: 2 additions & 2 deletions cvat-ui/src/components/models-page/deployed-model-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ export default function DeployedModelItem(props: Props): JSX.Element {
>
<Meta
title={(
<span onClick={onOpenModel} className='cvat-models-item-title' aria-hidden>
<Text ellipsis={{ tooltip: model.name }} onClick={onOpenModel} className='cvat-models-item-title' aria-hidden>
{model.name}
</span>
</Text>
)}
description={(
<div className='cvat-models-item-description'>
Expand Down
9 changes: 7 additions & 2 deletions cvat-ui/src/components/projects-page/project-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ export default function ProjectItemComponent(props: Props): JSX.Element {
>
<Meta
title={(
<span onClick={onOpenProject} className='cvat-projects-project-item-title' aria-hidden>
<Text
ellipsis={{ tooltip: instance.name }}
onClick={onOpenProject}
className='cvat-projects-project-item-title'
aria-hidden
>
{instance.name}
</span>
</Text>
)}
description={(
<div className='cvat-projects-project-item-description'>
Expand Down
12 changes: 5 additions & 7 deletions cvat-ui/src/components/tasks-page/task-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Dropdown from 'antd/lib/dropdown';
import Progress from 'antd/lib/progress';
import Badge from 'antd/lib/badge';
import moment from 'moment';

import { Task, RQStatus } from 'cvat-core-wrapper';
import ActionsMenuContainer from 'containers/actions-menu/actions-menu';
import Preview from 'components/common/preview';
Expand Down Expand Up @@ -116,14 +115,13 @@ class TaskItemComponent extends React.PureComponent<TaskItemProps & RouteCompone
const updated = moment(taskInstance.updatedDate).fromNow();
const created = moment(taskInstance.createdDate).format('MMMM Do YYYY');

// Get and truncate a task name
const name = `${taskInstance.name.substring(0, 70)}${taskInstance.name.length > 70 ? '...' : ''}`;

return (
<Col span={10} className='cvat-task-item-description'>
<Text strong type='secondary' className='cvat-item-task-id'>{`#${id}: `}</Text>
<Text strong className='cvat-item-task-name'>
{name}
<Text ellipsis={{ tooltip: taskInstance.name }}>
<Text strong type='secondary' className='cvat-item-task-id'>{`#${id}: `}</Text>
<Text strong className='cvat-item-task-name'>
{taskInstance.name}
</Text>
</Text>
<br />
{owner && (
Expand Down

0 comments on commit f22322f

Please sign in to comment.