Skip to content

Commit d448f27

Browse files
committed
feat(ui): update the visual of the clear slow log popover
re #RI-7437
1 parent 497fb8f commit d448f27

File tree

3 files changed

+36
-86
lines changed

3 files changed

+36
-86
lines changed

redisinsight/ui/src/pages/slow-log/components/Actions/Actions.styles.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ export const StyledInfoIcon = styled.span`
55
align-self: center;
66
cursor: pointer;
77
`
8+
9+
export const StyledDatabaseName = styled.span`
10+
color: ${({ theme }) => theme.semantic.color.text.primary500};
11+
`

redisinsight/ui/src/pages/slow-log/components/Actions/Actions.tsx

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,24 @@ import { AutoRefresh } from 'uiSrc/components'
88
import { RiPopover, RiTooltip } from 'uiSrc/components/base'
99
import { Nullable } from 'uiSrc/utils'
1010
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
11-
import { FlexItem, Row } from 'uiSrc/components/base/layout/flex'
11+
import {
12+
Col,
13+
FlexGroup,
14+
FlexItem,
15+
Row,
16+
} from 'uiSrc/components/base/layout/flex'
1217
import { Spacer } from 'uiSrc/components/base/layout/spacer'
1318
import { EraserIcon, SettingsIcon } from 'uiSrc/components/base/icons'
1419
import {
1520
DestructiveButton,
1621
IconButton,
1722
SecondaryButton,
1823
} from 'uiSrc/components/base/forms/buttons'
19-
import { Text } from 'uiSrc/components/base/text'
24+
import { Text, Title } from 'uiSrc/components/base/text'
2025
import { RiIcon } from 'uiSrc/components/base/icons/RiIcon'
2126

2227
import SlowLogConfig from '../SlowLogConfig'
23-
import styles from './styles.module.scss'
24-
import { StyledInfoIcon } from './Actions.styles'
28+
import { StyledDatabaseName, StyledInfoIcon } from './Actions.styles'
2529

2630
export interface Props {
2731
width: number
@@ -99,37 +103,32 @@ const Actions = (props: Props) => {
99103
}
100104

101105
const ToolTipContent = (
102-
<div className={styles.popoverContainer}>
103-
<RiIcon
104-
type="ToastDangerIcon"
105-
color="attention600"
106-
className={styles.warningIcon}
107-
/>
108-
<div>
109-
<Text size="m" component="div">
110-
<h4 className={styles.popoverTitle}>
111-
<b>Clear Slow Log?</b>
112-
</h4>
113-
<Text size="xs" color="subdued">
106+
<FlexGroup direction="column" gap="l">
107+
<Col gap="m">
108+
<Title size="S" color="primary">
109+
Clear Slow Log?
110+
</Title>
111+
<Col>
112+
<Text size="m" color="primary">
114113
Slow Log will be cleared for&nbsp;
115-
<span className={styles.popoverDBName}>{name}</span>
116-
<br />
114+
<StyledDatabaseName>{name}</StyledDatabaseName>
115+
</Text>
116+
<Text size="xs" color="secondary">
117117
NOTE: This is server configuration
118118
</Text>
119-
</Text>
120-
<div className={styles.popoverFooter}>
121-
<DestructiveButton
122-
size="small"
123-
icon={EraserIcon}
124-
onClick={() => handleClearClick()}
125-
className={styles.popoverDeleteBtn}
126-
data-testid="reset-confirm-btn"
127-
>
128-
Clear
129-
</DestructiveButton>
130-
</div>
131-
</div>
132-
</div>
119+
</Col>
120+
</Col>
121+
<Row justify="end">
122+
<DestructiveButton
123+
size="small"
124+
icon={EraserIcon}
125+
onClick={() => handleClearClick()}
126+
data-testid="reset-confirm-btn"
127+
>
128+
Clear
129+
</DestructiveButton>
130+
</Row>
131+
</FlexGroup>
133132
)
134133

135134
return (
@@ -140,7 +139,6 @@ const Actions = (props: Props) => {
140139
loading={loading}
141140
displayText={width > HIDE_REFRESH_LABEL_WIDTH}
142141
lastRefreshTime={lastRefreshTime}
143-
containerClassName={styles.refreshContainer}
144142
onRefresh={() => onRefresh()}
145143
onEnableAutoRefresh={handleEnableAutoRefresh}
146144
onChangeAutoRefreshRate={handleChangeAutoRefreshRate}
@@ -184,11 +182,7 @@ const Actions = (props: Props) => {
184182
closePopover={closePopoverClear}
185183
panelPaddingSize="m"
186184
button={
187-
<RiTooltip
188-
position="left"
189-
content="Clear Slow Log"
190-
anchorClassName={styles.icon}
191-
>
185+
<RiTooltip position="left" content="Clear Slow Log">
192186
<IconButton
193187
icon={EraserIcon}
194188
aria-label="Clear Slow Log"

redisinsight/ui/src/pages/slow-log/components/Actions/styles.module.scss

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)