Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dashboards listing and details page css fixes #5672

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 75 additions & 33 deletions frontend/src/container/ListOfDashboard/DashboardList.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;

min-height: 24px;

Expand All @@ -59,13 +60,35 @@
align-items: center;
gap: 6px;
line-height: 20px;
width: 60%;

.dashboard-icon {
display: inline-block;
margin-top: 4px;
margin-right: 4px;
line-height: 20px;
}

.dot {
min-height: 6px;
min-width: 6px;
border-radius: 50%;
}

.title {
color: var(--bg-vanilla-100);
font-size: var(--font-size-sm);
font-style: normal;
font-weight: var(--font-weight-medium);
line-height: 20px;
letter-spacing: -0.07px;

display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}

.ant-typography {
color: var(--bg-vanilla-100);
font-size: var(--font-size-sm);
Expand All @@ -86,6 +109,45 @@
display: none;
}
}

.tags-with-actions {
display: flex;
align-items: center;
width: 40%;
justify-content: flex-end;

.dashboard-tags {
display: flex;
flex-wrap: wrap;
gap: 8px;
justify-content: flex-end;

.tag {
display: flex;
padding: 4px 8px;
justify-content: center;
align-items: center;
gap: 4px;
height: 28px;
border-radius: 20px;
border: 1px solid rgba(173, 127, 88, 0.2);
background: rgba(173, 127, 88, 0.1);
color: var(--bg-sienna-400);
text-align: center;
font-family: Inter;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px; /* 142.857% */
letter-spacing: -0.07px;
margin-inline-end: 0px !important;
}
}
}
}

.dashboard-action-icon {
margin-left: 16px;
}

.dashboard-details {
Expand Down Expand Up @@ -525,35 +587,6 @@
cursor: pointer;
}
}

.tags-with-actions {
display: flex;
align-items: center;

.dashboard-tags {
display: flex;

.tag {
display: flex;
padding: 4px 8px;
justify-content: center;
align-items: center;
gap: 4px;
height: 28px;
border-radius: 20px;
border: 1px solid rgba(173, 127, 88, 0.2);
background: rgba(173, 127, 88, 0.1);
color: var(--bg-sienna-400);
text-align: center;
font-family: Inter;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px; /* 142.857% */
letter-spacing: -0.07px;
}
}
}
}

.new-dashboard-menu {
Expand Down Expand Up @@ -681,13 +714,13 @@

.action-btn {
display: flex;
padding: 14px;
padding: 8px;
height: unset;
align-items: center;
gap: 6px;
color: var(--bg-vanilla-400);
font-family: Inter;
font-size: 14px;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: normal;
Expand All @@ -706,12 +739,12 @@

.ant-typography {
display: flex;
padding: 14px;
padding: 12px 8px;
align-items: center;
gap: 6px;
color: var(--bg-cherry-400) !important;
font-family: Inter;
font-size: 14px;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: normal;
Expand Down Expand Up @@ -1321,3 +1354,12 @@
}
}
}

.title-toolip {
.ant-tooltip-content {
.ant-tooltip-inner {
height: 400px;
overflow: auto;
}
}
}
137 changes: 76 additions & 61 deletions frontend/src/container/ListOfDashboard/DashboardsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,79 +449,94 @@ function DashboardsList(): JSX.Element {
<div className="dashboard-list-item" onClick={onClickHandler}>
<div className="title-with-action">
<div className="dashboard-title">
<img
src={dashboard?.image || Base64Icons[0]}
style={{ height: '14px', width: '14px' }}
alt="dashboard-image"
/>
<Typography.Text data-testid={`dashboard-title-${index}`}>
<Link to={getLink()} className="dashboard-title">
{dashboard.name}
</Link>
</Typography.Text>
<Tooltip
title={dashboard?.name?.length > 50 ? dashboard?.name : ''}
placement="left"
overlayClassName="title-toolip"
>
<Typography.Text data-testid={`dashboard-title-${index}`}>
<Link to={getLink()} className="title">
<img
src={dashboard?.image || Base64Icons[0]}
style={{ height: '14px', width: '14px' }}
alt="dashboard-image"
className="dashboard-icon"
/>
{dashboard.name}
</Link>
</Typography.Text>
</Tooltip>
</div>

<div className="tags-with-actions">
{dashboard?.tags && dashboard.tags.length > 0 && (
<div className="dashboard-tags">
{dashboard.tags.map((tag) => (
{dashboard.tags.slice(0, 3).map((tag) => (
<Tag className="tag" key={tag}>
{tag}
</Tag>
))}

{dashboard.tags.length > 3 && (
<Tag className="tag" key={dashboard.tags[3]}>
+ <span> {dashboard.tags.length - 3} </span>
</Tag>
)}
</div>
)}
{action && (
<Popover
trigger="click"
content={
<div className="dashboard-action-content">
<section className="section-1">
<Button
type="text"
className="action-btn"
icon={<Expand size={14} />}
onClick={onClickHandler}
>
View
</Button>
<Button
type="text"
className="action-btn"
icon={<Link2 size={14} />}
onClick={(e): void => {
e.stopPropagation();
e.preventDefault();
setCopy(`${window.location.origin}${getLink()}`);
}}
>
Copy Link
</Button>
</section>
<section className="section-2">
<DeleteButton
name={dashboard.name}
id={dashboard.id}
isLocked={dashboard.isLocked}
createdBy={dashboard.createdBy}
/>
</section>
</div>
}
placement="bottomRight"
arrow={false}
rootClassName="dashboard-actions"
>
<EllipsisVertical
size={14}
onClick={(e): void => {
e.stopPropagation();
e.preventDefault();
}}
/>
</Popover>
)}
</div>

{action && (
<Popover
trigger="click"
content={
<div className="dashboard-action-content">
<section className="section-1">
<Button
type="text"
className="action-btn"
icon={<Expand size={12} />}
onClick={onClickHandler}
>
View
</Button>
<Button
type="text"
className="action-btn"
icon={<Link2 size={12} />}
onClick={(e): void => {
e.stopPropagation();
e.preventDefault();
setCopy(`${window.location.origin}${getLink()}`);
}}
>
Copy Link
</Button>
</section>
<section className="section-2">
<DeleteButton
name={dashboard.name}
id={dashboard.id}
isLocked={dashboard.isLocked}
createdBy={dashboard.createdBy}
/>
</section>
</div>
}
placement="bottomRight"
arrow={false}
rootClassName="dashboard-actions"
>
<EllipsisVertical
className="dashboard-action-icon"
size={14}
onClick={(e): void => {
e.stopPropagation();
e.preventDefault();
}}
/>
</Popover>
)}
</div>
<div className="dashboard-details">
<div className="dashboard-created-at">
Expand Down
Loading
Loading