Skip to content

Commit 1ccaa20

Browse files
authored
Merge pull request #791 from RedisInsight/bugfix/RI-3084
#RI-3084 - remove number of clients from publish message for cluster dbs
2 parents cc15f5f + 7ad608b commit 1ccaa20

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

redisinsight/ui/src/pages/pubSub/components/publish-message/PublishMessage.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import React, { ChangeEvent, FormEvent, useEffect, useRef, useState } from 'reac
1313
import { useDispatch, useSelector } from 'react-redux'
1414
import { useParams } from 'react-router-dom'
1515
import { appContextPubSub, setPubSubFieldsContext } from 'uiSrc/slices/app/context'
16+
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
17+
import { ConnectionType } from 'uiSrc/slices/interfaces'
1618
import { publishMessageAction } from 'uiSrc/slices/pubsub/pubsub'
1719
import { ReactComponent as UserIcon } from 'uiSrc/assets/img/icons/user.svg'
1820

@@ -22,6 +24,8 @@ const HIDE_BADGE_TIMER = 3000
2224

2325
const PublishMessage = () => {
2426
const { channel: channelContext, message: messageContext } = useSelector(appContextPubSub)
27+
const { connectionType } = useSelector(connectedInstanceSelector)
28+
2529
const [channel, setChannel] = useState<string>(channelContext)
2630
const [message, setMessage] = useState<string>(messageContext)
2731
const [isShowBadge, setIsShowBadge] = useState<boolean>(false)
@@ -100,8 +104,12 @@ const PublishMessage = () => {
100104
/>
101105
<EuiBadge className={cx(styles.badge, { [styles.show]: isShowBadge })} data-testid="affected-clients-badge">
102106
<EuiIcon className={styles.iconCheckBadge} type="check" />
103-
<span data-testid="affected-clients">{affectedClients}</span>
104-
<EuiIcon className={styles.iconUserBadge} type={UserIcon || 'user'} />
107+
{connectionType !== ConnectionType.Cluster && (
108+
<>
109+
<span className={styles.affectedClients} data-testid="affected-clients">{affectedClients}</span>
110+
<EuiIcon className={styles.iconUserBadge} type={UserIcon || 'user'} />
111+
</>
112+
)}
105113
</EuiBadge>
106114
</>
107115
</EuiFormRow>

redisinsight/ui/src/pages/pubSub/components/publish-message/styles.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
align-items: center;
3535
}
3636

37-
.iconCheckBadge {
38-
margin-right: 6px;
37+
.affectedClients {
38+
margin-left: 6px;
3939
}
4040

4141
.iconUserBadge {

0 commit comments

Comments
 (0)