|
1 | 1 | import React, { useContext, useEffect, useState } from 'react'
|
2 | 2 | import cx from 'classnames'
|
3 |
| -import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiToolTip } from '@elastic/eui' |
| 3 | +import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiToolTip } from '@elastic/eui' |
4 | 4 | import MoreInfoPopover from 'uiSrc/components/database-overview/components/MoreInfoPopover'
|
5 | 5 | import { Theme } from 'uiSrc/constants'
|
6 | 6 | import { ThemeContext } from 'uiSrc/contexts/themeContext'
|
7 | 7 | import { sortModulesByName } from 'uiSrc/utils/modules'
|
8 | 8 |
|
9 | 9 | 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' |
11 | 11 | 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' |
13 | 15 |
|
14 | 16 | import { RedisModuleDto } from 'apiSrc/modules/instances/dto/database-instance.dto'
|
15 | 17 | import { getResolutionLimits } from './utils/resolutionHelper'
|
@@ -67,8 +69,14 @@ const DatabaseOverview = (props: Props) => {
|
67 | 69 |
|
68 | 70 | const RediStackLogo = (
|
69 | 71 | <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 | + /> |
72 | 80 | </div>
|
73 | 81 | )
|
74 | 82 |
|
@@ -120,7 +128,8 @@ const DatabaseOverview = (props: Props) => {
|
120 | 128 | styles.itemContainer,
|
121 | 129 | styles.overview,
|
122 | 130 | { [styles.noModules]: !modules.visible?.length, [styles.RediStack]: isRediStack }
|
123 |
| - )}> |
| 131 | + )} |
| 132 | + > |
124 | 133 | <EuiFlexGroup gutterSize="none" responsive={false}>
|
125 | 134 | {
|
126 | 135 | metrics.visible.map((overviewItem) => (
|
@@ -166,16 +175,23 @@ const DatabaseOverview = (props: Props) => {
|
166 | 175 | { [styles.noModules]: !modules.visible?.length, [styles.RediStack]: isRediStack }
|
167 | 176 | )}
|
168 | 177 | >
|
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} />)} |
179 | 195 | <MoreInfoPopover
|
180 | 196 | metrics={metrics.hidden}
|
181 | 197 | modules={modules.hidden}
|
|
0 commit comments