Skip to content

Commit 8a6f39e

Browse files
Merge pull request #734 from RedisInsight/feature/bugfix
#RI-3004, #RI-3006
2 parents d8ed96d + 1614086 commit 8a6f39e

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

redisinsight/ui/src/pages/browser/components/stream-details/constants.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
import React from 'react'
12
import { StreamViewType } from 'uiSrc/slices/interfaces/stream'
23

3-
export const streamViewTypeTabs = [
4+
interface StreamTabs {
5+
id: StreamViewType,
6+
label: string,
7+
separator?: React.ReactElement
8+
}
9+
10+
export const streamViewTypeTabs: StreamTabs[] = [
411
{
512
id: StreamViewType.Data,
613
label: 'Stream data',

redisinsight/ui/src/pages/browser/components/stream-details/stream-tabs/StreamTabs.tsx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useCallback } from 'react'
2-
import { EuiTab, EuiTabs } from '@elastic/eui'
2+
import { EuiIcon, EuiTab, EuiTabs } from '@elastic/eui'
33
import { useDispatch, useSelector } from 'react-redux'
44

55
import {
@@ -14,6 +14,8 @@ import { StreamViewType } from 'uiSrc/slices/interfaces/stream'
1414

1515
import { streamViewTypeTabs } from '../constants'
1616

17+
import styles from './styles.module.scss'
18+
1719
const StreamTabs = () => {
1820
const { viewType } = useSelector(streamSelector)
1921
const { data: groups = [] } = useSelector(streamGroupsSelector)
@@ -36,25 +38,30 @@ const StreamTabs = () => {
3638
tabs.push({
3739
id: StreamViewType.Consumers,
3840
label: selectedGroupName,
41+
separator: <EuiIcon type="arrowRight" className={styles.separator} />
3942
})
4043
}
4144

4245
if (selectedConsumerName && viewType === StreamViewType.Messages) {
4346
tabs.push({
4447
id: StreamViewType.Messages,
45-
label: selectedConsumerName
48+
label: selectedConsumerName,
49+
separator: <EuiIcon type="arrowRight" className={styles.separator} />
4650
})
4751
}
4852

49-
return tabs.map(({ id, label }) => (
50-
<EuiTab
51-
isSelected={viewType === id}
52-
onClick={() => onSelectedTabChanged(id)}
53-
key={id}
54-
data-testid={`stream-tab-${id}`}
55-
>
56-
{label}
57-
</EuiTab>
53+
return tabs.map(({ id, label, separator = '' }) => (
54+
<>
55+
{separator}
56+
<EuiTab
57+
isSelected={viewType === id}
58+
onClick={() => onSelectedTabChanged(id)}
59+
key={id}
60+
data-testid={`stream-tab-${id}`}
61+
>
62+
{label}
63+
</EuiTab>
64+
</>
5865
))
5966
}, [viewType, selectedGroupName, selectedConsumerName])
6067

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.separator {
2+
position: relative;
3+
margin-top: 10px;
4+
width: 12px !important;
5+
height: 12px !important;
6+
margin-left: 2px;
7+
margin-right: 2px;
8+
}

0 commit comments

Comments
 (0)