Skip to content

Commit

Permalink
refactor(alert timeline): update TopContributorsCard and Table styles (
Browse files Browse the repository at this point in the history
…#5881)

* refactor(alert timeline): update TopContributorsCard and Table styles

- Update hover styles for collapsed section rows in TopContributorsCard
- Update text and icon colors on hover in TopContributorsCard
- Remove unnecessary styles for value column in Table
- Update font size and alignment for table headers in Table
- Update font size and alignment for created at column in Table
- Add actions column with ellipsis button in Table

* feat(alert history styles): update alert popover and top contributors card styles
  • Loading branch information
sharpshooter90 authored Sep 7, 2024
1 parent afc9751 commit 7b5ff54
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
.alert-popover {
.alert-popover-trigger-action {
cursor: pointer;
}

.alert-history-popover {
.ant-popover-inner {
border: 1px solid var(--bg-slate-400);

.lightMode & {
background: var(--bg-vanilla-100) !important;
border: 1px solid var(--bg-vanilla-300);
}
}
.ant-popover-arrow {
&::before {
.lightMode & {
background: var(--bg-vanilla-100);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ function AlertPopover({
relatedLogsLink,
}: Props): JSX.Element {
return (
<div className="alert-popover">
<div className="alert-popover-trigger-action">
<Popover
showArrow={false}
placement="bottom"
color="linear-gradient(139deg, rgba(18, 19, 23, 1) 0%, rgba(18, 19, 23, 1) 98.68%)"
destroyTooltipOnHide
rootClassName="alert-history-popover"
content={
<PopoverContent
relatedTracesLink={relatedTracesLink}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
.contributor-row-popover-buttons {
display: flex;
flex-direction: column;
border: 1px solid var(--bg-slate-400);

&__button {
display: flex;
Expand All @@ -133,13 +132,36 @@
width: 160px;
cursor: pointer;

.text,
.icon {
color: var(--text-vanilla-100);

.lightMode & {
color: var(--text-ink-500);
}
}

&:hover {
background: var(--bg-slate-400);

.text,
.icon {
color: var(--text-vanilla-100);

.lightMode & {
color: var(--text-ink-500);
}
}
}

.icon {
display: flex;
}

.lightMode & {
background: var(--bg-vanilla-100);
border-color: var(--bg-vanilla-400);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,9 @@
font-size: 12px;
font-weight: 500;
padding: 12px 16px 8px !important;
&:last-of-type
// TODO(shaheer): uncomment when we display value column
// ,
// &:nth-last-of-type(2)
{
text-align: right;
}
}
&-tbody > tr > td {
border: none;
&:last-of-type,
&:nth-last-of-type(2) {
text-align: right;
}
}
}

Expand All @@ -52,15 +41,15 @@
}
.alert-rule {
&-value,
&-created-at {
&__created-at {
font-size: 14px;
color: var(--text-vanilla-400);
}
&-value {
font-weight: 500;
line-height: 20px;
}
&-created-at {
&__created-at {
line-height: 18px;
letter-spacing: -0.07px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { EllipsisOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { ConditionalAlertPopover } from 'container/AlertHistory/AlertPopover/AlertPopover';
import AlertLabels from 'pages/AlertDetails/AlertHeader/AlertLabels/AlertLabels';
Expand All @@ -10,43 +12,42 @@ export const timelineTableColumns = (): ColumnsType<AlertRuleTimelineTableRespon
title: 'STATE',
dataIndex: 'state',
sorter: true,
width: '12.5%',
render: (value, record): JSX.Element => (
<ConditionalAlertPopover
relatedTracesLink={record.relatedTracesLink}
relatedLogsLink={record.relatedLogsLink}
>
<div className="alert-rule-state">
<AlertState state={value} showLabel />
</div>
</ConditionalAlertPopover>
width: 140,
render: (value): JSX.Element => (
<div className="alert-rule-state">
<AlertState state={value} showLabel />
</div>
),
},
{
title: 'LABELS',
dataIndex: 'labels',
width: '54.5%',
render: (labels, record): JSX.Element => (
<ConditionalAlertPopover
relatedTracesLink={record.relatedTracesLink}
relatedLogsLink={record.relatedLogsLink}
>
<div className="alert-rule-labels">
<AlertLabels labels={labels} />
</div>
</ConditionalAlertPopover>
render: (labels): JSX.Element => (
<div className="alert-rule-labels">
<AlertLabels labels={labels} />
</div>
),
},
{
title: 'CREATED AT',
dataIndex: 'unixMilli',
width: '32.5%',
render: (value, record): JSX.Element => (
width: 200,
render: (value): JSX.Element => (
<div className="alert-rule__created-at">{formatEpochTimestamp(value)}</div>
),
},
{
title: 'ACTIONS',
width: 140,
align: 'right',
render: (record): JSX.Element => (
<ConditionalAlertPopover
relatedTracesLink={record.relatedTracesLink}
relatedLogsLink={record.relatedLogsLink}
>
<div className="alert-rule-created-at">{formatEpochTimestamp(value)}</div>
<Button type="text" ghost>
<EllipsisOutlined className="dropdown-icon" />
</Button>
</ConditionalAlertPopover>
),
},
Expand Down

0 comments on commit 7b5ff54

Please sign in to comment.