Skip to content

Commit 604867d

Browse files
committed
* #RIVS-279 - [Regression] Cluster databases has 'i' icon before Host on Edit db view without tooltip
* #RIVS-280 - [Regression] CLI returns errors for cluster db
1 parent 0299a70 commit 604867d

File tree

4 files changed

+31
-33
lines changed

4 files changed

+31
-33
lines changed

l10n/bundle.l10n.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@
294294
"Database Name from Provider:": "Database Name from Provider:",
295295
"Host:": "Host:",
296296
"Database Index:": "Database Index:",
297+
"Modules:": "Modules:",
297298
"Select Logical Database": "Select Logical Database",
298299
"Database Index": "Database Index",
299300
"Enter Database Index": "Enter Database Index",

src/webviews/src/components/database-form/DbInfo.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import cx from 'classnames'
44
import * as l10n from '@vscode/l10n'
55
// import { DatabaseListModules } from 'uiSrc/components'
66
import { VscInfo } from 'react-icons/vsc'
7-
import Popup from 'reactjs-popup'
87
import { ConnectionType, Nullable } from 'uiSrc/interfaces'
98
import { AdditionalRedisModule, Endpoint } from 'uiSrc/store'
109
import { DatabaseModules } from 'uiSrc/components'
10+
import { Tooltip } from 'uiSrc/ui'
1111
import styles from './styles.module.scss'
1212

1313
export interface Props {
@@ -25,20 +25,22 @@ const DbInfo = (props: Props) => {
2525
const { connectionType, nameFromProvider, nodes = null, host, port, db, modules, isFromCloud } = props
2626

2727
const AppendEndpoints = () => (
28-
<Popup
29-
position="top center"
30-
on={['hover']}
31-
trigger={<VscInfo />}
28+
<Tooltip
29+
content={(
30+
<>
31+
<h2 className="font-bold pb-1">{l10n.t('Host:port')}</h2>
32+
<ul className={styles.endpointsList}>
33+
{nodes?.map(({ host: eHost, port: ePort }) => (
34+
<li key={host + port}>
35+
<div>{eHost}:{ePort};</div>
36+
</li>
37+
))}
38+
</ul>
39+
</>
40+
)}
3241
>
33-
<span>{l10n.t('Host:port')}</span>
34-
<ul className={styles.endpointsList}>
35-
{nodes?.map(({ host: eHost, port: ePort }) => (
36-
<li key={host + port}>
37-
<div>{eHost}:{ePort};</div>
38-
</li>
39-
))}
40-
</ul>
41-
</Popup>
42+
<div className="pl-1 cursor-pointer"><VscInfo /></div>
43+
</Tooltip>
4244
)
4345

4446
return (
@@ -65,15 +67,13 @@ const DbInfo = (props: Props) => {
6567
</div>
6668
)}
6769
<div className="flex">
68-
<>
69-
{!!nodes?.length && <AppendEndpoints />}
70-
<div>
71-
{l10n.t('Host:')}
72-
</div>
73-
<div color="default" className={styles.dbInfoListValue} data-testid="db-info-host">
74-
{host}
75-
</div>
76-
</>
70+
<div>
71+
{l10n.t('Host:')}
72+
</div>
73+
<div color="default" className={styles.dbInfoListValue} data-testid="db-info-host">
74+
{host}
75+
</div>
76+
{!!nodes?.length && <AppendEndpoints />}
7777
</div>
7878

7979
{!!db && (
@@ -88,9 +88,9 @@ const DbInfo = (props: Props) => {
8888
)}
8989

9090
{!!modules?.length && (
91-
<div className="flex items-center">
91+
<div className="flex">
9292
<div>
93-
Modules:
93+
{l10n.t('Modules:')}
9494
</div>
9595
<div className={cx(styles.dbInfoListValue, styles.dbInfoModules)}>
9696
<DatabaseModules modules={modules} />

src/webviews/src/components/database-form/styles.module.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@
3232
padding: 16px;
3333
padding-bottom: 4px;
3434
border-radius: 4px;
35+
36+
> div {
37+
@apply mb-3 items-center;
38+
}
3539
}
3640

3741
.dbInfoListValue {
3842
margin-left: 12px;
39-
margin-bottom: 12px;
4043
@apply text-vscode-foreground;
4144
}
4245

@@ -47,7 +50,6 @@
4750
& > div {
4851
display: inline-block;
4952
line-height: 20px;
50-
margin-top: 5px;
5153
vertical-align: top;
5254
}
5355
}

src/webviews/src/modules/cli/hooks/cli-output/useCliOutputThunks.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,7 @@ export function sendCliClusterCommandAction(
9595

9696
state.sendCliCommand()
9797

98-
const {
99-
data: [
100-
{ response, status: dataStatus },
101-
] = [],
102-
status,
103-
} = await apiService.post<any[]>(
98+
const { data: { response, status: dataStatus }, status } = await apiService.post<any>(
10499
getUrl(
105100
ApiEndpoints.CLI,
106101
cliClientUuid,

0 commit comments

Comments
 (0)