Skip to content

Commit 0299a70

Browse files
committed
* #RIVS-280 - [Regression] CLI returns errors for cluster db
* #RIVS-277 - [Regression] Incorrect displaying in white theme * #RIVS-281 - [Regression]Text in add key button is not fitted
1 parent d07a82c commit 0299a70

File tree

10 files changed

+19
-18
lines changed

10 files changed

+19
-18
lines changed
Lines changed: 1 addition & 1 deletion
Loading

src/webviews/src/components/no-keys-message/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.addKey {
2-
@apply mr-4 min-w-[68px] max-h-[22px];
2+
@apply mr-4 min-w-[72px] max-h-[22px];
33

44
&::part(control) {
55
@apply px-2 py-0.5;

src/webviews/src/modules/cli/components/cli-body/CliBodyWrapper.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
// Pages
1515
} from 'uiSrc/constants'
1616
import { getCommandRepeat, isRepeatCountCorrect, sendEventTelemetry, TelemetryEvent } from 'uiSrc/utils'
17-
import { ClusterNodeRole } from 'uiSrc/interfaces'
1817
import { checkUnsupportedCommand, clearOutput, cliCommandOutput } from 'uiSrc/modules/cli/utils/cliHelper'
1918
import { useDatabasesStore } from 'uiSrc/store'
2019

@@ -62,7 +61,7 @@ export const CliBodyWrapper = () => {
6261
}
6362

6463
useEffect(() => {
65-
!cliClientUuid && createCliClientAction(database!)
64+
!cliClientUuid && database && createCliClientAction(database!)
6665
resetCommand()
6766
return () => {
6867
removeCliClient()

src/webviews/src/modules/cli/hooks/cli-output/tests/useCliOutput.spec.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ describe('thunks', () => {
216216
})
217217

218218
describe('Single Node Cluster Cli command', () => {
219-
it.only('call both sendCliClusterCommandAction and sendCliCommandSuccess when response status is successed', async () => {
219+
it('call both sendCliClusterCommandAction and sendCliCommandSuccess when response status is successed', async () => {
220220
// Arrange
221221
const command = constants.COMMAND
222222
const data: any[] = [
@@ -234,10 +234,8 @@ describe('thunks', () => {
234234
sendCliClusterCommandAction(command)
235235
await waitForStack()
236236

237-
console.log(useCliOutputStore.getState().data[0])
238-
239237
// Assert
240-
expect(useCliOutputStore.getState().data[0]).toContain('(nil)')
238+
expect((useCliOutputStore.getState().data[0] as any).props?.children).toEqual('"(nil)"')
241239
})
242240

243241
it('call both sendCliClusterCommandAction and sendCliCommandSuccess when response status is fail', async () => {
@@ -259,9 +257,7 @@ describe('thunks', () => {
259257
await waitForStack()
260258

261259
// Assert
262-
expect(useCliOutputStore.getState().data[0].toString()).toEqual(
263-
'-> Redirected to slot [6918] located at 127.0.0.1:7002'
264-
)
260+
expect((useCliOutputStore.getState().data[0] as any).props?.children).toEqual('(nil)')
265261
})
266262

267263
it('call both updateCliClientAction on ClientNotFound error', async () => {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function sendCliCommandAction(
2323
onSuccessAction?: () => void,
2424
onFailAction?: () => void,
2525
) {
26-
return useCliOutputStore.setState(async (state) => {
26+
useCliOutputStore.setState(async (state) => {
2727
let cliClientUuid
2828
try {
2929
cliClientUuid = useCliSettingsStore.getState().cliClientUuid
@@ -82,7 +82,7 @@ export function sendCliClusterCommandAction(
8282
onSuccessAction?: () => void,
8383
onFailAction?: () => void,
8484
) {
85-
return useCliOutputStore.setState(async (state) => {
85+
useCliOutputStore.setState(async (state) => {
8686
let cliClientUuid
8787
try {
8888
const outputFormat = CliOutputFormatterType.Raw

src/webviews/src/pages/WelcomePage/WelcomePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const WelcomePage: FC = () => {
8181
<div className={styles.data}>
8282
<h3>{l10n.t('Recommended')}</h3>
8383
{contentGithub && (
84-
<PromoLink Icon={GithubIcon} {...contentGithub} />
84+
<PromoLink Icon={GithubIcon} className={styles.github} {...contentGithub} />
8585
)}
8686
{contentRI && (
8787
<PromoLink Icon={ShortLogoSvg} {...contentRI} />

src/webviews/src/pages/WelcomePage/styles.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@
1717
.data {
1818
@apply max-w-[300px];
1919
}
20+
21+
.github svg path {
22+
fill: var(--vscode-foreground);
23+
}

src/webviews/src/styles/base/_select.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vscode-dropdown {
1414
@apply bg-vscode-input-background h-9;
1515

1616
&__option {
17-
@apply bg-vscode-input-background h-9 pl-2 items-center #{!important};
17+
@apply bg-vscode-input-background h-9 pl-2 items-center text-vscode-foreground #{!important};
1818
}
1919

2020
&::part(listbox) {

src/webviews/src/ui/promo-link/PromoLink.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
import React, { FunctionComponent, SVGProps } from 'react'
2+
import cx from 'classnames'
23

34
import { ContentFeatureCreateRedis } from 'uiSrc/store/hooks/use-app-info-store/interface'
45
import styles from './styles.module.scss'
56

67
export interface Props extends ContentFeatureCreateRedis {
78
onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void
89
testId?: string
10+
className?: string
911
Icon?: FunctionComponent<SVGProps<SVGSVGElement>>
1012
styles?: any
1113
}
1214

1315
export const PromoLink = (props: Props) => {
14-
const { title, description, links, onClick, testId, Icon, styles: linkStyles } = props
16+
const { title, description, links, onClick, testId, Icon, styles: linkStyles, className = '' } = props
1517

1618
return (
1719
<a
18-
className={styles.link}
20+
className={cx(styles.link, className)}
1921
href={links?.main.url}
2022
target="_blank"
2123
rel="noreferrer"

src/webviews/src/utils/formatters/textFormatters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// remove line break and encode angular brackets
22
const parsePastedText = (text: string = '') =>
3-
text.replace(/\n/gi, '').replace(/</gi, '<').replace(/>/gi, '>')
3+
text.replace(/(\r?\n)/gi, '').replace(/</gi, '<').replace(/>/gi, '>')
44

55
export {
66
parsePastedText,

0 commit comments

Comments
 (0)