Skip to content

Commit 2d01f11

Browse files
committed
#RI-2567 - update tooltips for redis stack
1 parent 15a109c commit 2d01f11

File tree

9 files changed

+190
-93
lines changed

9 files changed

+190
-93
lines changed
Lines changed: 16 additions & 0 deletions
Loading
Lines changed: 16 additions & 0 deletions
Loading

redisinsight/ui/src/components/database-overview/DatabaseOverview.tsx

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import React, { useContext, useEffect, useState } from 'react'
22
import cx from 'classnames'
3-
import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiToolTip } from '@elastic/eui'
3+
import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiToolTip } from '@elastic/eui'
44
import MoreInfoPopover from 'uiSrc/components/database-overview/components/MoreInfoPopover'
55
import { Theme } from 'uiSrc/constants'
66
import { ThemeContext } from 'uiSrc/contexts/themeContext'
77
import { sortModulesByName } from 'uiSrc/utils/modules'
88

99
import RediStackDark from 'uiSrc/assets/img/modules/redistack/RediStackDark.svg'
10-
import RediStackDarkLogo from 'uiSrc/assets/img/modules/redistack/RediStackDark-min.svg'
10+
import RediStackDarkMin from 'uiSrc/assets/img/modules/redistack/RediStackDark-min.svg'
1111
import RediStackLight from 'uiSrc/assets/img/modules/redistack/RediStackLight.svg'
12-
import RediStackLightLogo from 'uiSrc/assets/img/modules/redistack/RediStackLight-min.svg'
12+
import RediStackLightMin from 'uiSrc/assets/img/modules/redistack/RediStackLight-min.svg'
13+
import RediStackLightLogo from 'uiSrc/assets/img/modules/redistack/RedisStackLogoLight.svg'
14+
import RediStackDarkLogo from 'uiSrc/assets/img/modules/redistack/RedisStackLogoDark.svg'
1315

1416
import { RedisModuleDto } from 'apiSrc/modules/instances/dto/database-instance.dto'
1517
import { getResolutionLimits } from './utils/resolutionHelper'
@@ -67,8 +69,14 @@ const DatabaseOverview = (props: Props) => {
6769

6870
const RediStackLogo = (
6971
<div className={styles.RediStackLogoWrapper} data-testid="redis-stack-logo">
70-
<EuiIcon type={theme === Theme.Dark ? RediStackDark : RediStackLight} className={styles.redistackIcon}/>
71-
<EuiIcon type={theme === Theme.Dark ? RediStackDarkLogo : RediStackLightLogo} className={styles.redistackLogoIcon}/>
72+
<EuiIcon
73+
type={theme === Theme.Dark ? RediStackDark : RediStackLight}
74+
className={styles.redistackIcon}
75+
/>
76+
<EuiIcon
77+
type={theme === Theme.Dark ? RediStackDarkMin : RediStackLightMin}
78+
className={styles.redistackLogoIcon}
79+
/>
7280
</div>
7381
)
7482

@@ -120,7 +128,8 @@ const DatabaseOverview = (props: Props) => {
120128
styles.itemContainer,
121129
styles.overview,
122130
{ [styles.noModules]: !modules.visible?.length, [styles.RediStack]: isRediStack }
123-
)}>
131+
)}
132+
>
124133
<EuiFlexGroup gutterSize="none" responsive={false}>
125134
{
126135
metrics.visible.map((overviewItem) => (
@@ -166,16 +175,23 @@ const DatabaseOverview = (props: Props) => {
166175
{ [styles.noModules]: !modules.visible?.length, [styles.RediStack]: isRediStack }
167176
)}
168177
>
169-
{isRediStack
170-
? (
171-
<DatabaseListModules
172-
content={isRediStack ? RediStackLogo : undefined}
173-
modules={modulesProps}
174-
withoutStyles
175-
/>
176-
)
177-
: !!modules.visible?.length && (<DatabaseListModules dark inCircle modules={modules.visible} />)
178-
}
178+
{isRediStack ? (
179+
<DatabaseListModules
180+
content={isRediStack ? RediStackLogo : undefined}
181+
modules={modulesProps}
182+
tooltipTitle={isRediStack ? (
183+
<>
184+
<EuiIcon
185+
type={theme === Theme.Dark ? RediStackDarkLogo : RediStackLightLogo}
186+
className={styles.tooltipLogo}
187+
data-testid="tooltip-redis-stack-icon"
188+
/>
189+
<EuiText color="subdued" style={{ marginTop: 4, marginBottom: -4 }}>Includes</EuiText>
190+
</>
191+
) : undefined}
192+
withoutStyles
193+
/>
194+
) : !!modules.visible?.length && (<DatabaseListModules dark inCircle modules={modules.visible} />)}
179195
<MoreInfoPopover
180196
metrics={metrics.hidden}
181197
modules={modules.hidden}

redisinsight/ui/src/components/database-overview/styles.module.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,12 @@
112112
}
113113
}
114114

115+
.tooltipLogo {
116+
width: 88px !important;
117+
height: 18px !important;
118+
119+
@media only screen and (min-width: 1124px) {
120+
display: none;
121+
}
122+
}
123+

redisinsight/ui/src/components/query/DedicatedEditor/DedicatedEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const DedicatedEditor = (props: Props) => {
109109
const { editor } = monacoObjects?.current || {}
110110
const val = editor?.getValue()
111111
.split('\n')
112-
.map((line: string, i: number) => (i > 0 && !notCommandRegEx.test(line)) ? `\t${line}` : line)
112+
.map((line: string, i: number) => ((i > 0 && !notCommandRegEx.test(line)) ? `\t${line}` : line))
113113
.join('\n')
114114
onSubmit(val || '')
115115
}

0 commit comments

Comments
 (0)