Skip to content

Commit 14605b2

Browse files
Merge pull request #669 from RedisInsight/feature/bugfix
#RI-2909, #RI-2910, #RI-2908, #RI-2926, #RI-2292, #RI-2805
2 parents e577667 + 27b1514 commit 14605b2

File tree

8 files changed

+54
-49
lines changed

8 files changed

+54
-49
lines changed

redisinsight/ui/src/components/notifications/success-messages.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import { EXTERNAL_LINKS } from 'uiSrc/constants/links'
23
import { formatNameShort, Maybe } from 'uiSrc/utils'
34
import styles from './styles.module.scss'
45

@@ -110,8 +111,12 @@ export default {
110111
},
111112
INSTALLED_NEW_UPDATE: (updateDownloadedVersion: string) => ({
112113
title: 'Application updated',
113-
message: `Your application has been updated to ${updateDownloadedVersion}. Find more
114-
information in Release Notes.`,
114+
message: (
115+
<>
116+
<span>{`Your application has been updated to ${updateDownloadedVersion}. Find more information in `}</span>
117+
<a href={EXTERNAL_LINKS.releaseNotes} className="link-underline" target="_blank" rel="noreferrer">Release Notes.</a>
118+
</>
119+
),
115120
group: 'upgrade'
116121
}),
117122
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const EXTERNAL_LINKS = {
22
githubRepo: 'https://github.com/RedisInsight/RedisInsight',
33
githubIssues: 'https://github.com/RedisInsight/RedisInsight/issues',
4-
releaseNotes: 'https://docs.redis.com/staging/release-ri-v2.0/ri/release-notes/',
4+
releaseNotes: 'https://github.com/RedisInsight/RedisInsight/releases',
55
}

redisinsight/ui/src/pages/browser/components/auto-refresh/AutoRefresh.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState } from 'react'
2-
import { EuiButtonIcon, EuiPopover, EuiSwitch, EuiTextColor, EuiToolTip } from '@elastic/eui'
2+
import { EuiButtonIcon, EuiIcon, EuiPopover, EuiSwitch, EuiTextColor, EuiToolTip } from '@elastic/eui'
33
import cx from 'classnames'
44

55
import {
@@ -216,6 +216,7 @@ const AutoRefresh = ({
216216
data-testid="refresh-rate"
217217
>
218218
{`${refreshRate} s`}
219+
<div className={styles.refreshRatePencil}><EuiIcon type="pencil" /></div>
219220
</EuiTextColor>
220221
)}
221222
{editingRate && (

redisinsight/ui/src/pages/browser/components/auto-refresh/styles.module.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.container {
22
position: relative;
3+
white-space: nowrap;
34
}
45

56
.btn {
@@ -116,6 +117,21 @@
116117
}
117118
}
118119

120+
.refreshRatePencil {
121+
display: none;
122+
right: 61px;
123+
margin-bottom: 3px;
124+
background-color: var(--browserTableRowEven);
125+
width: 26px !important;
126+
height: 28px !important;
127+
padding: 5px;
128+
position: absolute;
129+
130+
svg {
131+
margin-top: -16px !important;
132+
}
133+
}
134+
119135
.refreshRateText {
120136
display: inline-block;
121137
width: 80px;
@@ -126,5 +142,9 @@
126142
&:hover {
127143
padding-left: 5px;
128144
border-color: var(--controlsBorderColor);
145+
146+
.refreshRatePencil {
147+
display: inline-block !important;
148+
}
129149
}
130150
}

redisinsight/ui/src/pages/browser/components/key-details-header/KeyDetailsHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const initialKeyInfo = {
5454
}
5555

5656
const PADDING_WRAPPER_SIZE = 36
57-
const HIDE_LAST_REFRESH = 770 - PADDING_WRAPPER_SIZE
57+
const HIDE_LAST_REFRESH = 750 - PADDING_WRAPPER_SIZE
5858
const MIDDLE_SCREEN_RESOLUTION = 640 - PADDING_WRAPPER_SIZE
5959

6060
const KeyDetailsHeader = ({

redisinsight/ui/src/pages/slowLog/components/SlowLogConfig/SlowLogConfig.tsx

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { toNumber } from 'lodash'
1212
import React, { ChangeEvent, useState } from 'react'
1313
import { useDispatch, useSelector } from 'react-redux'
14-
import { useHistory, useParams } from 'react-router-dom'
14+
import { useParams } from 'react-router-dom'
1515
import cx from 'classnames'
1616
import {
1717
DEFAULT_SLOWLOG_DURATION_UNIT,
@@ -20,15 +20,13 @@ import {
2020
DurationUnits,
2121
DURATION_UNITS,
2222
MINUS_ONE,
23-
Pages
2423
} from 'uiSrc/constants'
2524
import { ConnectionType } from 'uiSrc/slices/interfaces'
2625
import { ConfigDBStorageItem } from 'uiSrc/constants/storage'
2726
import { setDBConfigStorageField } from 'uiSrc/services'
2827
import { patchSlowLogConfigAction, slowLogConfigSelector, slowLogSelector } from 'uiSrc/slices/slowlog/slowlog'
2928
import { errorValidateNegativeInteger, validateNumber } from 'uiSrc/utils'
3029
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
31-
import { openCli } from 'uiSrc/slices/cli/cli-settings'
3230
import { numberWithSpaces } from 'uiSrc/utils/numbers'
3331
import { convertNumberByUnits } from '../../utils'
3432
import styles from './styles.module.scss'
@@ -40,7 +38,6 @@ export interface Props {
4038

4139
const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
4240
const options = DURATION_UNITS
43-
const history = useHistory()
4441
const { instanceId } = useParams<{ instanceId: string }>()
4542
const { connectionType } = useSelector(connectedInstanceSelector)
4643
const { loading, durationUnit: durationUnitStore } = useSelector(slowLogSelector)
@@ -99,46 +96,18 @@ const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
9996
closePopover()
10097
}
10198

102-
const handleGoWorkbenchPage = (e: React.MouseEvent) => {
103-
e.preventDefault()
104-
history.push(Pages.workbench(instanceId))
105-
}
106-
107-
const handleOpenCli = (e: React.MouseEvent) => {
108-
e.preventDefault()
109-
dispatch(openCli())
110-
}
111-
112-
const disabledApplyBtn = () => errorValidateNegativeInteger(`${slowerThan}`)
99+
const disabledApplyBtn = () => errorValidateNegativeInteger(`${slowerThan}`) || loading
113100

114101
const clusterContent = () => (
115102
<>
116103
<EuiText color="subdued" className={styles.clusterText}>
117-
{'Each node can have different Slow Log configuration in a clustered database. Use '}
118-
<a
119-
tabIndex={0}
120-
onClick={handleOpenCli}
121-
className={styles.link}
122-
data-testid="internal-cli-link"
123-
onKeyDown={() => ({})}
124-
role="link"
125-
rel="noreferrer"
126-
>
127-
CLI
128-
</a>
104+
Each node can have different Slow Log configuration in a clustered database.
105+
<EuiSpacer size="s" />
106+
{'Use '}
107+
<code>CONFIG SET slowlog-log-slower-than</code>
129108
{' or '}
130-
<a
131-
tabIndex={0}
132-
onClick={handleGoWorkbenchPage}
133-
className={styles.link}
134-
data-testid="internal-workbench-link"
135-
onKeyDown={() => ({})}
136-
role="link"
137-
rel="noreferrer"
138-
>
139-
Workbench
140-
</a>
141-
{' to configure it.'}
109+
<code>CONFIG SET slowlog-max-len</code>
110+
{' specific node in redis-cli to configure it.'}
142111
</EuiText>
143112

144113
<EuiSpacer size="xs" />
@@ -186,7 +155,6 @@ const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
186155
onChange={(e: ChangeEvent<HTMLInputElement>) => {
187156
setSlowerThan(validateNumber(e.target.value.trim(), Infinity, -1))
188157
}}
189-
isLoading={loading}
190158
autoComplete="off"
191159
data-testid="slower-than-input"
192160
/>
@@ -219,12 +187,11 @@ const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
219187
placeholder={`${slowlogMaxLen}`}
220188
value={maxLen}
221189
onChange={(e: ChangeEvent<HTMLInputElement>) => { setMaxLen(validateNumber(e.target.value.trim())) }}
222-
isLoading={loading}
223190
autoComplete="off"
224191
data-testid="max-len-input"
225192
/>
226193
<div className={styles.helpText}>
227-
The length of the Slow Log.When a new command is logged the oldest
194+
The length of the Slow Log. When a new command is logged the oldest
228195
<br />
229196
one is removed from the queue of logged commands.
230197
</div>

redisinsight/ui/src/pages/slowLog/components/SlowLogConfig/styles.module.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
.containerCluster {
99
width: 394px;
10-
height: 88px;
10+
height: 150px;
1111
}
1212

1313
.selectWrapper {
@@ -105,6 +105,18 @@
105105
a {
106106
color: var(--euiColorFullShade) !important;
107107
}
108+
109+
code {
110+
font-size: 13px;
111+
line-height: 18px;
112+
padding-left: 4px;
113+
padding-right: 4px;
114+
color: var(--inputTextColor);
115+
116+
&:last-of-type {
117+
padding-left: 0 !important;
118+
}
119+
}
108120
}
109121

110122
.clusterBtn {

redisinsight/ui/src/utils/validations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const validateRefreshRateNumber = (initValue: string) => {
9191
return MAX_REFRESH_RATE.toString()
9292
}
9393

94-
if (+value < 0 || (+value === 0 && initValue !== '0')) {
94+
if (+value < 0) {
9595
return ''
9696
}
9797

0 commit comments

Comments
 (0)