Skip to content

Commit ecf210a

Browse files
Merge pull request #928 from RedisInsight/feature/bugfixing
#RI-3289, #RI-3200, #RI-3133, #RI-3305
2 parents cc1e0be + e481c57 commit ecf210a

File tree

16 files changed

+60
-26
lines changed

16 files changed

+60
-26
lines changed

redisinsight/ui/src/components/cli/components/cli-body/CliBodyWrapper.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import { decode } from 'html-entities'
22
import React, { useEffect, useState } from 'react'
33
import { useSelector, useDispatch } from 'react-redux'
44
import { useHotkeys } from 'react-hotkeys-hook'
5-
import { useParams } from 'react-router-dom'
5+
import { useHistory, useParams } from 'react-router-dom'
66

77
import {
88
cliSettingsSelector,
99
createCliClientAction,
1010
setCliEnteringCommand,
1111
clearSearchingCommand,
12+
toggleCli,
1213
} from 'uiSrc/slices/cli/cli-settings'
1314
import {
1415
concatToOutput,
@@ -36,6 +37,7 @@ import styles from './CliBody/styles.module.scss'
3637
const CliBodyWrapper = () => {
3738
const [command, setCommand] = useState('')
3839

40+
const history = useHistory()
3941
const dispatch = useDispatch()
4042
const { instanceId = '' } = useParams<{ instanceId: string }>()
4143
const { data = [] } = useSelector(outputSelector)
@@ -51,7 +53,7 @@ const CliBodyWrapper = () => {
5153
const { db: currentDbIndex } = useSelector(outputSelector)
5254

5355
useEffect(() => {
54-
!cliClientUuid && dispatch(createCliClientAction())
56+
!cliClientUuid && dispatch(createCliClientAction(handleWorkbenchClick))
5557
}, [])
5658

5759
useEffect(() => {
@@ -67,6 +69,18 @@ const CliBodyWrapper = () => {
6769
clearOutput(dispatch)
6870
}
6971

72+
const handleWorkbenchClick = () => {
73+
dispatch(toggleCli())
74+
history.push(Pages.workbench(instanceId))
75+
76+
sendEventTelemetry({
77+
event: TelemetryEvent.CLI_WORKBENCH_LINK_CLICKED,
78+
eventData: {
79+
databaseId: instanceId
80+
}
81+
})
82+
}
83+
7084
const refHotkeys = useHotkeys<HTMLDivElement>('command+k,ctrl+l', handleClearOutput)
7185

7286
const handleSubmit = () => {

redisinsight/ui/src/components/monitor/Monitor/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,5 @@
206206
}
207207

208208
.time {
209-
color: var(--monitorTimeColor);
209+
color: var(--defaultGreenColor);
210210
}

redisinsight/ui/src/constants/cliOutput.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,20 @@ export enum CliOutputFormatterType {
1010
Raw = 'RAW',
1111
}
1212

13-
export const InitOutputText = (host: string = '', port: number = 0, dbIndex: number = 0) => [
13+
export const InitOutputText = (host: string = '', port: number = 0, dbIndex: number = 0, onClick: () => void) => [
14+
<span className="color-green" key={Math.random()}>
15+
{'Try '}
16+
<EuiLink
17+
onClick={onClick}
18+
className="color-green"
19+
style={{ fontSize: 'inherit', fontFamily: 'inherit' }}
20+
data-test-subj="cli-workbench-page-btn"
21+
>
22+
Workbench
23+
</EuiLink>
24+
, our advanced CLI. Check out our Quick Guides to learn more about Redis capabilities.
25+
</span>,
26+
'\n\n',
1427
'Connecting...',
1528
'\n\n',
1629
'Pinging Redis server on ',

redisinsight/ui/src/constants/storage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
enum BrowserStorageItem {
22
instancesCount = 'instancesCount',
3+
instancesSorting = 'instancesSorting',
34
theme = 'theme',
45
browserViewType = 'browserViewType',
56
cliClientUuid = 'cliClientUuid',

redisinsight/ui/src/pages/browser/components/bulk-actions/BulkActionsInfo/BulkActionsInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const BulkActionsInfo = (props: Props) => {
4949
)}
5050
{status === BulkActionsStatus.Aborted && (
5151
<EuiText color="danger" className={styles.progress}>
52-
Aborted
52+
Stopped: {getApproximateNumber((total ? scanned / total : 1) * 100)}%
5353
</EuiText>
5454
)}
5555
{status === BulkActionsStatus.Completed && (

redisinsight/ui/src/pages/browser/components/bulk-actions/BulkActionsInfo/styles.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
flex-direction: column;
1515

1616
.progressCompleted {
17-
color: var(--monitorTimeColor) !important;
17+
color: var(--defaultGreenColor) !important;
1818
}
1919
}
2020

@@ -63,7 +63,7 @@
6363
}
6464

6565
&Completed {
66-
color: var(--monitorTimeColor) !important;
66+
color: var(--defaultGreenColor) !important;
6767
}
6868
}
6969

redisinsight/ui/src/pages/browser/components/bulk-actions/BulkDelete/BulkDeleteSummary/BulkDeleteSummary.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ const BulkDeleteSummary = () => {
1717
const { duration = 0, status } = useSelector(overviewBulkActionsSelector) ?? {}
1818

1919
useEffect(() => {
20-
const approximateCount = scanned >= total ? keys.length : (keys.length * total) / scanned
21-
setTitle(`Expected amount: ~${numberWithSpaces(Math.round(approximateCount))} keys`)
20+
if (scanned < total && !keys.length) {
21+
setTitle('Expected amount: N/A')
22+
return
23+
}
24+
25+
const approximateCount = scanned < total ? (keys.length * total) / scanned : keys.length
26+
setTitle(`Expected amount: ${scanned < total ? '~' : ''}${numberWithSpaces(Math.round(approximateCount))} keys`)
2227
}, [scanned, total, keys])
2328

2429
return (

redisinsight/ui/src/pages/home/components/DatabasesListComponent/DatabasesList/DatabasesList.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { instancesSelector } from 'uiSrc/slices/instances/instances'
2121
import { Instance } from 'uiSrc/slices/interfaces'
2222
import { formatLongName, Nullable } from 'uiSrc/utils'
2323
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
24+
import { localStorageService } from 'uiSrc/services'
25+
import { BrowserStorageItem } from 'uiSrc/constants'
2426

2527
import styles from '../styles.module.scss'
2628

@@ -80,7 +82,7 @@ function DatabasesList({
8082
}
8183
}, [width])
8284

83-
const sort: PropertySort = {
85+
const sort: PropertySort = localStorageService.get(BrowserStorageItem.instancesSorting) ?? {
8486
field: 'lastConnection',
8587
direction: 'asc',
8688
}
@@ -116,6 +118,7 @@ function DatabasesList({
116118
const onTableChange = ({ sort, page }: Criteria<Instance>) => {
117119
// calls also with page changing
118120
if (sort && !page) {
121+
localStorageService.set(BrowserStorageItem.instancesSorting, sort)
119122
sendEventSortedTelemetry(sort)
120123
}
121124
}

redisinsight/ui/src/pages/pubSub/components/messages-list/MessagesList/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
.time {
17-
color: var(--monitorTimeColor);
17+
color: var(--defaultGreenColor);
1818
width: 150px;
1919
}
2020

redisinsight/ui/src/slices/cli/cli-settings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,15 @@ export default cliSettingsSlice.reducer
175175

176176
// Asynchronous thunk action
177177
export function createCliClientAction(
178+
onWorkbenchClick: () => void,
178179
onSuccessAction?: () => void,
179180
onFailAction?: (message: string) => void
180181
) {
181182
return async (dispatch: AppDispatch, stateInit: () => RootState) => {
182183
const state = stateInit()
183184
const { host, port, db } = connectedInstanceSelector(state)
184185
dispatch(processCliClient())
185-
dispatch(concatToOutput(InitOutputText(host, port, db)))
186+
dispatch(concatToOutput(InitOutputText(host, port, db, onWorkbenchClick)))
186187

187188
try {
188189
const { data, status } = await apiService.post<CreateCliClientResponse>(

0 commit comments

Comments
 (0)