Skip to content

Commit f15d089

Browse files
Merge branch 'main' into feature/e2e-test-fixes
2 parents 3bf2317 + 5767a82 commit f15d089

File tree

15 files changed

+230
-212
lines changed

15 files changed

+230
-212
lines changed
Lines changed: 3 additions & 3 deletions
Loading
Lines changed: 3 additions & 3 deletions
Loading

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ export default {
109109
),
110110
}
111111
},
112-
INSTALLED_NEW_UPDATE: (updateDownloadedVersion: string) => ({
112+
INSTALLED_NEW_UPDATE: (updateDownloadedVersion: string, onClickLink?: () => void) => ({
113113
title: 'Application updated',
114114
message: (
115115
<>
116116
<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>
117+
<a href={EXTERNAL_LINKS.releaseNotes} onClick={() => onClickLink?.()} className="link-underline" target="_blank" rel="noreferrer">Release Notes.</a>
118118
</>
119119
),
120120
group: 'upgrade'

redisinsight/ui/src/constants/durationUnits.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const DURATION_UNITS: EuiSuperSelectOption<DurationUnits>[] = [
1818

1919
export const MINUS_ONE = -1
2020
export const DEFAULT_SLOWLOG_MAX_LEN = 128
21-
export const DEFAULT_SLOWLOG_SLOWER_THAN = 10000
21+
export const DEFAULT_SLOWLOG_SLOWER_THAN = 10_000
2222
export const DEFAULT_SLOWLOG_DURATION_UNIT = DurationUnits.microSeconds
2323

2424
export default DURATION_UNITS

redisinsight/ui/src/electron/utils/ipcCheckUpdates.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export const ipcCheckUpdates = async (serverInfo: GetServerInfoResponse, dispatc
2222

2323
if (isUpdateDownloaded && !isUpdateAvailable) {
2424
if (serverInfo.appVersion === updateDownloadedVersion) {
25-
dispatch(addMessageNotification(successMessages.INSTALLED_NEW_UPDATE(updateDownloadedVersion)))
25+
dispatch(addMessageNotification(
26+
successMessages.INSTALLED_NEW_UPDATE(updateDownloadedVersion, () => dispatch(setReleaseNotesViewed(true)))
27+
))
2628
}
2729

2830
await ipcRenderer.invoke(IpcEvent.deleteStoreValue, ElectronStorageItem.updateDownloaded)

redisinsight/ui/src/pages/browser/components/rejson-details/JSONScalar/JSONScalar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ const JSONScalar = (props: Props) => {
5858
path = keyName.includes('"') ? `${parentPath}['${keyName}']` : `${parentPath}["${keyName}"]`
5959
}
6060

61-
let changedValue = value
61+
let val = value
6262
if (value === null) {
63-
changedValue = JSON.stringify(value)
63+
val = JSON.stringify(value)
6464
}
6565
if (typeof value === 'string') {
66-
changedValue = `"${value}"`
66+
val = `"${value}"`
6767
}
6868

69-
setChangedValue(changedValue)
69+
setChangedValue(val)
7070
setPath(path)
71-
}, [parentPath, keyName])
71+
}, [parentPath, keyName, value])
7272

7373
const validateJSONValue = (value: JSONScalarValue) => {
7474
let error: string = ''
@@ -208,7 +208,7 @@ const JSONScalar = (props: Props) => {
208208
updateLoading={false}
209209
showPopover={(item) => setDeleting(`${item}scalar`)}
210210
handleDeleteItem={() => handleSubmitRemoveKey(path, keyName.toString())}
211-
/>
211+
/>
212212
</div>
213213
</div>
214214
</div>

redisinsight/ui/src/pages/browser/components/rejson-details/RejsonDetailsWrapper.tsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,27 @@ const RejsonDetailsWrapper = () => {
7676
data-testid="progress-key-json"
7777
/>
7878
)}
79-
<RejsonDetails
80-
selectedKey={selectedKey}
81-
dbNumber={0}
82-
dataType={type || ''}
83-
deleteMsg=""
84-
instanceId={123}
85-
resultTableKeyMap={{}}
86-
handleSubmitJsonUpdateValue={handleSubmitJsonUpdateValue}
87-
onJSONPropertyDeleted={reportJSONPropertyDeleted}
88-
data={data}
89-
onJSONKeyExpandAndCollapse={reportJSONKeyExpandAndCollapse}
90-
onJSONPropertyAdded={reportJSONPropertyAdded}
91-
onJSONPropertyEdited={reportJSONPropertyEdited}
92-
shouldRejsonDataBeDownloaded={!downloaded}
93-
handleSubmitUpdateValue={handleEditValueUpdate}
94-
handleDeleteKeyDialogOpen={() => {}}
95-
handleOpenExpiryDialog={() => {}}
96-
keyProperty={{}}
97-
/>
79+
{!(loading && data === undefined) && (
80+
<RejsonDetails
81+
selectedKey={selectedKey}
82+
dbNumber={0}
83+
dataType={type || ''}
84+
deleteMsg=""
85+
instanceId={123}
86+
resultTableKeyMap={{}}
87+
handleSubmitJsonUpdateValue={handleSubmitJsonUpdateValue}
88+
onJSONPropertyDeleted={reportJSONPropertyDeleted}
89+
data={data}
90+
onJSONKeyExpandAndCollapse={reportJSONKeyExpandAndCollapse}
91+
onJSONPropertyAdded={reportJSONPropertyAdded}
92+
onJSONPropertyEdited={reportJSONPropertyEdited}
93+
shouldRejsonDataBeDownloaded={!downloaded}
94+
handleSubmitUpdateValue={handleEditValueUpdate}
95+
handleDeleteKeyDialogOpen={() => {}}
96+
handleOpenExpiryDialog={() => {}}
97+
keyProperty={{}}
98+
/>
99+
)}
98100
</div>
99101
)
100102
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,12 @@ const StreamDetailsWrapper = (props: Props) => {
190190
return (
191191
<div>
192192
<PopoverDelete
193+
header={id}
193194
text={(
194195
<>
195-
Entry {id} will be removed from
196-
<br />
197-
{key}
196+
will be removed from
197+
{' '}
198+
<b>{key}</b>
198199
</>
199200
)}
200201
item={id}

redisinsight/ui/src/pages/slowLog/SlowLogPage.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ import { EmptySlowLog, SlowLogTable, Actions } from './components'
3333

3434
import styles from './styles.module.scss'
3535

36+
const HIDE_TIMESTAMP_FROM_WIDTH = 850
3637
const DEFAULT_COUNT_VALUE = '50'
3738
const countOptions: EuiSuperSelectOption<string>[] = [
3839
{ value: '10', inputDisplay: '10' },
3940
{ value: '25', inputDisplay: '25' },
4041
{ value: '50', inputDisplay: '50' },
4142
{ value: '100', inputDisplay: '100' },
42-
{ value: '-1', inputDisplay: 'Max' },
43+
{ value: '-1', inputDisplay: 'Max available' },
4344
]
4445

4546
const SlowLogPage = () => {
@@ -124,7 +125,7 @@ const SlowLogPage = () => {
124125
<EuiFlexGroup responsive={false} alignItems="center" gutterSize="xs">
125126
<EuiFlexItem grow={false}>
126127
<EuiText color="subdued">
127-
{connectionType === ConnectionType.Cluster ? 'Display per node:' : 'Display:'}
128+
{connectionType === ConnectionType.Cluster ? 'Display per node:' : 'Display up to:'}
128129
</EuiText>
129130
</EuiFlexItem>
130131
<EuiFlexItem grow={false}>
@@ -137,12 +138,14 @@ const SlowLogPage = () => {
137138
data-testid="count-select"
138139
/>
139140
</EuiFlexItem>
140-
<EuiFlexItem grow={false} style={{ marginLeft: 12 }}>
141-
<EuiText size="xs" color="subdued" data-testid="entries-from-timestamp">
142-
({data.length} entries
143-
{lastTimestamp && (<>&nbsp;from {format(lastTimestamp * 1000, DATE_FORMAT)}</>)})
144-
</EuiText>
145-
</EuiFlexItem>
141+
{width > HIDE_TIMESTAMP_FROM_WIDTH && (
142+
<EuiFlexItem grow={false} style={{ marginLeft: 12 }}>
143+
<EuiText size="xs" color="subdued" data-testid="entries-from-timestamp">
144+
({data.length} entries
145+
{lastTimestamp && (<>&nbsp;from {format(lastTimestamp * 1000, DATE_FORMAT)}</>)})
146+
</EuiText>
147+
</EuiFlexItem>
148+
)}
146149
</EuiFlexGroup>
147150
</EuiFlexItem>
148151
<EuiFlexItem grow={false}>

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
7070
}
7171

7272
const calculateSlowlogLogSlowerThan = (initSlowerThan: string) => {
73+
if (initSlowerThan === '') {
74+
return DEFAULT_SLOWLOG_SLOWER_THAN
75+
}
76+
if (initSlowerThan === `${MINUS_ONE}`) {
77+
return MINUS_ONE
78+
}
7379
if (initSlowerThan === `${MINUS_ONE}`) {
7480
return MINUS_ONE
7581
}
@@ -81,7 +87,7 @@ const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
8187
dispatch(patchSlowLogConfigAction(
8288
instanceId,
8389
{
84-
slowlogMaxLen: +maxLen,
90+
slowlogMaxLen: maxLen ? toNumber(maxLen) : DEFAULT_SLOWLOG_MAX_LEN,
8591
slowlogLogSlowerThan,
8692
},
8793
durationUnit,
@@ -96,7 +102,7 @@ const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
96102
closePopover()
97103
}
98104

99-
const disabledApplyBtn = () => errorValidateNegativeInteger(`${slowerThan}`) || loading
105+
const disabledApplyBtn = () => (errorValidateNegativeInteger(`${slowerThan}`) && !!slowerThan) || loading
100106

101107
const clusterContent = () => (
102108
<>
@@ -124,6 +130,14 @@ const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
124130
)
125131

126132
const unitConverter = () => {
133+
if (Number.isNaN(toNumber(slowerThan))) {
134+
return `- ${DurationUnits.milliSeconds}`
135+
}
136+
137+
if (slowerThan === `${MINUS_ONE}`) {
138+
return `-1 ${DurationUnits.milliSeconds}`
139+
}
140+
127141
if (durationUnit === DurationUnits.microSeconds) {
128142
const value = numberWithSpaces(convertNumberByUnits(toNumber(slowerThan), DurationUnits.milliSeconds))
129143
return `${value} ${DurationUnits.milliSeconds}`
@@ -150,11 +164,11 @@ const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
150164
name="slowerThan"
151165
id="slowerThan"
152166
className={styles.input}
153-
placeholder={`${slowlogLogSlowerThan}`}
154167
value={slowerThan}
155168
onChange={(e: ChangeEvent<HTMLInputElement>) => {
156169
setSlowerThan(validateNumber(e.target.value.trim(), Infinity, -1))
157170
}}
171+
placeholder={`${convertNumberByUnits(DEFAULT_SLOWLOG_SLOWER_THAN, durationUnit)}`}
158172
autoComplete="off"
159173
data-testid="slower-than-input"
160174
/>
@@ -184,7 +198,7 @@ const SlowLogConfig = ({ closePopover, onRefresh }: Props) => {
184198
name="maxLen"
185199
id="maxLen"
186200
className={styles.input}
187-
placeholder={`${slowlogMaxLen}`}
201+
placeholder={`${DEFAULT_SLOWLOG_MAX_LEN}`}
188202
value={maxLen}
189203
onChange={(e: ChangeEvent<HTMLInputElement>) => { setMaxLen(validateNumber(e.target.value.trim())) }}
190204
autoComplete="off"

0 commit comments

Comments
 (0)