Skip to content

Commit 21e06f5

Browse files
committed
Merge branch 'main' into e2e/feature/workbench-raw-mode
# Conflicts: # tests/e2e/tests/critical-path/database/clone-databases.e2e.ts # tests/e2e/tests/critical-path/notifications/notification-center.e2e.ts
2 parents 1bd3252 + a0636ee commit 21e06f5

File tree

31 files changed

+526
-203
lines changed

31 files changed

+526
-203
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ Check out the [release notes](https://docs.redis.com/latest/ri/release-notes/).
3939

4040
## Get started with RedisInsight
4141

42-
This repository includes the code for RedisInsight 2.0, Currently available in public preview. Check out the [blogpost](https://redis.com/blog/introducing-redisinsight-2/) announcing it.
43-
44-
The current GA version of RedisInsight is 1.11. You can install RedisInsight 2.0 along with the GA version.
42+
This repository includes the code for the GA version of RedisInsight 2.0. Check out the [blogpost](https://redis.com/blog/introducing-redisinsight-2/) announcing it.
4543

4644
### Installable
47-
Available to download for free from [here](https://redis.com/redis-enterprise/redis-insight/#insight-form).
45+
Available to download for free from [here](https://redis.com/redis-enterprise/redis-insight/#insight-form).
4846

4947
### Build
5048
Alternatively you can also build from source. See our wiki for instructions.

redisinsight/api/config/production.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export default {
2222
server: {
2323
env: 'production',
2424
},
25+
analytics: {
26+
writeKey: process.env.SEGMENT_WRITE_KEY || 'lK5MNZgHbxj6vQwFgqZxygA0BiDQb32n',
27+
},
2528
db: {
2629
database: join(homedir, 'redisinsight.db'),
2730
},

redisinsight/api/config/staging.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export default {
2222
server: {
2323
env: 'staging',
2424
},
25+
analytics: {
26+
writeKey: process.env.SEGMENT_WRITE_KEY || 'Ba1YuGnxzsQN9zjqTSvzPc6f3AvmH1mj',
27+
},
2528
db: {
2629
database: join(homedir, 'redisinsight.db'),
2730
},

redisinsight/ui/src/components/cli/CliWrapper.spec.tsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { cloneDeep } from 'lodash'
22
import React from 'react'
3-
import { processCliClient, setCliEnteringCommand } from 'uiSrc/slices/cli/cli-settings'
4-
import { cleanup, mockedStore, render } from 'uiSrc/utils/test-utils'
3+
import { InitOutputText } from 'uiSrc/constants/cliOutput'
4+
import { concatToOutput } from 'uiSrc/slices/cli/cli-output'
5+
import { setCliEnteringCommand } from 'uiSrc/slices/cli/cli-settings'
6+
import { cleanup, clearStoreActions, mockedStore, render } from 'uiSrc/utils/test-utils'
57
import CliWrapper from './CliWrapper'
68

7-
jest.mock('uiSrc/slices/cli/cli-output', () => ({
8-
...jest.requireActual('uiSrc/slices/cli/cli-output'),
9-
concatToOutput: () => jest.fn(),
10-
}))
11-
129
const redisCommandsPath = 'uiSrc/slices/app/redis-commands'
1310

11+
let mathRandom: jest.SpyInstance<number>
12+
const random = 0.91911
1413
let store: typeof mockedStore
1514
beforeEach(() => {
1615
cleanup()
@@ -32,6 +31,14 @@ jest.mock(redisCommandsPath, () => {
3231
})
3332

3433
describe('CliWrapper', () => {
34+
beforeAll(() => {
35+
mathRandom = jest.spyOn(Math, 'random').mockImplementation(() => random)
36+
})
37+
38+
afterAll(() => {
39+
mathRandom.mockRestore()
40+
})
41+
3542
it('should render', () => {
3643
expect(render(<CliWrapper />)).toBeTruthy()
3744
})
@@ -40,7 +47,12 @@ describe('CliWrapper', () => {
4047

4148
unmount()
4249

43-
const expectedActions = [processCliClient(), setCliEnteringCommand()]
44-
expect(store.getActions().slice(-2)).toEqual(expectedActions)
50+
const handleWorkbenchClick = () => {}
51+
52+
const expectedActions = [
53+
concatToOutput(InitOutputText('', 0, 0, true, handleWorkbenchClick)),
54+
setCliEnteringCommand(),
55+
]
56+
expect(clearStoreActions(store.getActions().slice(-2))).toEqual(clearStoreActions(expectedActions))
4557
})
4658
})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const CliBodyWrapper = () => {
5353
const { db: currentDbIndex } = useSelector(outputSelector)
5454

5555
useEffect(() => {
56-
!cliClientUuid && dispatch(createCliClientAction(handleWorkbenchClick))
56+
!cliClientUuid && dispatch(createCliClientAction(instanceId, handleWorkbenchClick))
5757
}, [])
5858

5959
useEffect(() => {

redisinsight/ui/src/components/navigation-menu/components/notifications-center/Notification/Notification.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const Notification = (props: Props) => {
4444
<EuiBadge
4545
className={styles.category}
4646
style={{ backgroundColor: notification.categoryColor ?? '#666' }}
47+
data-testid="notification-category"
4748
>
4849
{truncateText(notification.category, 32)}
4950
</EuiBadge>

redisinsight/ui/src/components/query-card/QueryCard.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface Props {
3030
result: Maybe<CommandExecutionResult[]>
3131
activeMode: RunQueryMode
3232
mode: RunQueryMode
33+
emptyCommand: boolean
3334
createdAt?: Date
3435
loading?: boolean
3536
onQueryDelete: () => void
@@ -52,7 +53,8 @@ const QueryCard = (props: Props) => {
5253
onQueryOpen,
5354
onQueryDelete,
5455
onQueryReRun,
55-
loading
56+
loading,
57+
emptyCommand,
5658
} = props
5759

5860
const { visualizations = [] } = useSelector(appPluginsSelector)
@@ -146,6 +148,7 @@ const QueryCard = (props: Props) => {
146148
selectedValue={selectedViewValue}
147149
activeMode={activeMode}
148150
mode={mode}
151+
emptyCommand={emptyCommand}
149152
toggleOpen={toggleOpen}
150153
toggleFullScreen={toggleFullScreen}
151154
setSelectedValue={changeViewTypeSelected}

redisinsight/ui/src/components/query-card/QueryCardHeader/QueryCardHeader.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface Props {
4343
queryType: WBQueryType
4444
selectedValue: string
4545
loading?: boolean
46+
emptyCommand: boolean
4647
toggleOpen: () => void
4748
toggleFullScreen: () => void
4849
setSelectedValue: (type: WBQueryType, value: string) => void
@@ -63,6 +64,7 @@ const QueryCardHeader = (props: Props) => {
6364
mode,
6465
activeMode,
6566
selectedValue,
67+
emptyCommand,
6668
setSelectedValue,
6769
onQueryDelete,
6870
onQueryReRun,
@@ -302,7 +304,13 @@ const QueryCardHeader = (props: Props) => {
302304
content="Run again"
303305
position="left"
304306
>
305-
<EuiButtonIcon iconType="play" aria-label="Re-run command" data-testid="re-run-command" onClick={handleQueryReRun} />
307+
<EuiButtonIcon
308+
disabled={emptyCommand}
309+
iconType="play"
310+
aria-label="Re-run command"
311+
data-testid="re-run-command"
312+
onClick={handleQueryReRun}
313+
/>
306314
</EuiToolTip>
307315
</EuiFlexItem>
308316
)}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export const bulkReplyCommands = ['LOLWUT', 'INFO', 'CLIENT', 'CLUSTER', 'MEMORY', 'MONITOR', 'PSUBSCRIBE']
2+
3+
export const EMPTY_COMMAND = 'Encrypted data'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { DefaultBodyType, MockedRequest, RestHandler } from 'msw'
2+
3+
import info from './infoHandlers'
4+
5+
const handlers: RestHandler<MockedRequest<DefaultBodyType>>[] = [].concat(info)
6+
export default handlers

0 commit comments

Comments
 (0)