Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dca55b4
remove check for not empty ssh passphrase to avoid validation error i…
Nov 21, 2023
ac4b2ad
force update file-stream-rotator in the winston-daily-rotate-file to …
Nov 21, 2023
02fabf7
Merge pull request #2793 from RedisInsight/be/bugfix/RI-5165-fix-pass…
Nov 21, 2023
34236e9
fix validation error on UI side + rollback BE changes
Nov 22, 2023
64bce12
2.38.0
vlad-dargel Nov 24, 2023
619d103
check failed tests on ci
vlad-dargel Nov 27, 2023
f25db67
fix
vlad-dargel Nov 27, 2023
f721f8d
eslint fixes
vlad-dargel Nov 27, 2023
50de863
update for formatters from RI-5206
vlad-dargel Nov 28, 2023
ceb0c26
fix for formatters
vlad-dargel Nov 28, 2023
42de2da
Merge pull request #2817 from RedisInsight/e2e/bugfix/nightly-failed
vlad-dargel Nov 28, 2023
eb033f5
#RI-5206 - fix button state for editing
rsergeenko Nov 28, 2023
5126121
fix for zset formatter
vlad-dargel Nov 28, 2023
8b9b140
Merge pull request #2794 from RedisInsight/bugfix/feature/RI-5165-fix…
vlad-dargel Nov 28, 2023
d401c51
#RI-5213, #RI-5212 - fix tooltip appearing
rsergeenko Nov 29, 2023
c90a784
#RI-5213 - fix tooltip position, fix scroll
rsergeenko Nov 29, 2023
322d6db
Merge pull request #2820 from RedisInsight/fe/bugfix/regression_2.38
vlad-dargel Nov 29, 2023
a282105
Merge pull request #2821 from RedisInsight/e2e/bugfix/nightly-failed
vlad-dargel Nov 29, 2023
28bbb41
scan in lower batches for tree-view
Nov 30, 2023
3eeb79f
Merge pull request #2829 from RedisInsight/be/bugfix/workaround-for-r…
vlad-dargel Nov 30, 2023
a44ad24
add afterEach to return back scan value
vlad-dargel Nov 30, 2023
b515166
Merge pull request #2830 from RedisInsight/e2e/bugfix/fix-e2e-release
vlad-dargel Nov 30, 2023
2359c2e
fix
vlad-dargel Nov 30, 2023
b57cafd
fix2
vlad-dargel Nov 30, 2023
2995601
Merge pull request #2831 from RedisInsight/e2e/bugfix/fix-e2e-release
vlad-dargel Nov 30, 2023
80a927a
Merge pull request #2832 from RedisInsight/release/2.38.0
vlad-dargel Nov 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion redisinsight/api/config/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
tlsKey: process.env.SERVER_TLS_KEY,
staticContent: !!process.env.SERVER_STATIC_CONTENT || false,
buildType: process.env.BUILD_TYPE || 'ELECTRON',
appVersion: process.env.APP_VERSION || '2.36.0',
appVersion: process.env.APP_VERSION || '2.38.0',
requestTimeout: parseInt(process.env.REQUEST_TIMEOUT, 10) || 25000,
excludeRoutes: [],
excludeAuthRoutes: [],
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/api/config/swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const SWAGGER_CONFIG: Omit<OpenAPIObject, 'paths'> = {
info: {
title: 'RedisInsight Backend API',
description: 'RedisInsight Backend API',
version: '2.36.0',
version: '2.38.0',
},
tags: [],
};
Expand Down
5 changes: 3 additions & 2 deletions redisinsight/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redisinsight-api",
"version": "2.36.0",
"version": "2.38.0",
"description": "RedisInsight API",
"private": true,
"author": {
Expand Down Expand Up @@ -42,7 +42,8 @@
"word-wrap": "1.2.4",
"mocha/minimatch": "^3.0.5",
"@nestjs/platform-socket.io/socket.io": "^4.7.1",
"**/semver": "^7.5.2"
"**/semver": "^7.5.2",
"winston-daily-rotate-file/**/file-stream-rotator": "^1.0.0"
},
"dependencies": {
"@nestjs/common": "^9.0.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,40 @@ describe('Standalone Scanner Strategy', () => {
null,
);
});
it('should scan 2000 items when count provided more then 2k', async () => {
const args = { ...getKeysDto, count: 10_000, match: '*' };
jest.spyOn(Utils, 'getTotal').mockResolvedValue(mockGetTotalResponse_1);

when(browserTool.execCommand)
.calledWith(
mockBrowserClientMetadata,
BrowserToolKeysCommands.Scan,
expect.anything(),
null,
)
.mockResolvedValue([0, [getKeyInfoResponse.name]]);

strategy.getKeysInfo = jest.fn().mockResolvedValue([getKeyInfoResponse]);

const result = await strategy.getKeys(mockBrowserClientMetadata, args);

expect(result).toEqual([
{
...mockNodeEmptyResult,
total: 1,
scanned: 2000,
keys: [getKeyInfoResponse],
},
]);
expect(strategy.getKeysInfo).toHaveBeenCalled();
expect(browserTool.execCommand).toHaveBeenNthCalledWith(
1,
mockBrowserClientMetadata,
BrowserToolKeysCommands.Scan,
['0', 'MATCH', args.match, 'COUNT', 2000],
null,
);
});
it('should return keys names and type only', async () => {
const args = {
...getKeysDto, type: 'string', match: 'pattern*', keysInfo: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export class StandaloneStrategy extends AbstractStrategy {
count: number,
type?: RedisDataType,
): Promise<void> {
const COUNT = Math.min(2000, count);

let fullScanned = false;
// todo: remove settings from here. threshold should be part of query?
const settings = await this.settingsService.getAppSettings('1');
Expand All @@ -97,7 +99,7 @@ export class StandaloneStrategy extends AbstractStrategy {
node.scanned < settings.scanThreshold
)
) {
let commandArgs = [`${node.cursor}`, 'MATCH', match, 'COUNT', count];
let commandArgs = [`${node.cursor}`, 'MATCH', match, 'COUNT', COUNT];
if (type) {
commandArgs = [...commandArgs, 'TYPE', type];
}
Expand All @@ -112,7 +114,7 @@ export class StandaloneStrategy extends AbstractStrategy {
// eslint-disable-next-line no-param-reassign
node.cursor = parseInt(nextCursor, 10);
// eslint-disable-next-line no-param-reassign
node.scanned += count;
node.scanned += COUNT;
node.keys.push(...keys);
fullScanned = node.cursor === 0;
}
Expand Down
15 changes: 4 additions & 11 deletions redisinsight/api/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3919,12 +3919,10 @@ file-entry-cache@^6.0.1:
dependencies:
flat-cache "^3.0.4"

file-stream-rotator@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/file-stream-rotator/-/file-stream-rotator-0.6.1.tgz#007019e735b262bb6c6f0197e58e5c87cb96cec3"
integrity sha512-u+dBid4PvZw17PmDeRcNOtCP9CCK/9lRN2w+r1xIS7yOL9JFrIBKTvrYsxT4P0pGtThYTn++QS5ChHaUov3+zQ==
dependencies:
moment "^2.29.1"
file-stream-rotator@^0.6.1, file-stream-rotator@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/file-stream-rotator/-/file-stream-rotator-1.0.0.tgz#de58379321a1ea6d2938ed5f5a2eff3b7f8b2780"
integrity sha512-qg5mQO7o+vhS7NPqkrkfJS8qqhz0d17Tnewmb5sUTUKwYe27LKaDtbTuRAtQWkBn6jROuFPVIDF5DtckzokFTQ==

file-type@^16.5.4:
version "16.5.4"
Expand Down Expand Up @@ -6201,11 +6199,6 @@ mocha@^8.4.0:
yargs-parser "20.2.4"
yargs-unparser "2.0.0"

moment@^2.29.1:
version "2.29.4"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108"
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==

ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/desktop/src/lib/aboutPanel/aboutPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ICON_PATH = app.isPackaged

export const AboutPanelOptions = {
applicationName: 'RedisInsight',
applicationVersion: `${app.getVersion() || '2.36.0'}${
applicationVersion: `${app.getVersion() || '2.38.0'}${
!config.isProduction ? `-dev-${process.getCreationTime()}` : ''
}`,
copyright: `Copyright © ${new Date().getFullYear()} Redis Ltd.`,
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "redisinsight",
"productName": "RedisInsight",
"private": true,
"version": "2.36.0",
"version": "2.38.0",
"description": "RedisInsight",
"main": "./dist/main/main.js",
"author": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { instance, mock } from 'ts-mockito'
import { render, screen } from 'uiSrc/utils/test-utils'
import { stringDataSelector } from 'uiSrc/slices/browser/string'
import { stringDataSelector, stringSelector } from 'uiSrc/slices/browser/string'
import { Props, StringDetails } from './StringDetails'

const mockedProps = mock<Props>()
Expand All @@ -15,6 +15,9 @@ jest.mock('uiSrc/slices/browser/string', () => ({
data: [49, 50, 51, 52],
}
}),
stringSelector: jest.fn().mockReturnValue({
isCompressed: false
})
}))

jest.mock('uiSrc/slices/browser/keys', () => ({
Expand Down Expand Up @@ -64,6 +67,22 @@ describe('StringDetails', () => {
expect(editValueBtn).toHaveProperty('disabled', true)
})

it('should not be able to change value (compressed)', () => {
const stringSelectorMock = jest.fn().mockReturnValue({
isCompressed: true
})
stringSelector.mockImplementation(stringSelectorMock)

render(
<StringDetails
{...mockedProps}
/>
)

const editValueBtn = screen.getByTestId(`${EDIT_VALUE_BTN_TEST_ID}`)
expect(editValueBtn).toHaveProperty('disabled', true)
})

it('"edit-key-value-btn" should render', () => {
const { queryByTestId } = render(<StringDetails {...instance(mockedProps)} />)
expect(queryByTestId('edit-key-value-btn')).toBeInTheDocument()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const StringDetails = (props: Props) => {
<EditItemAction
title="Edit Value"
tooltipContent={editToolTip}
isEditable={isStringEditable}
isEditable={isStringEditable && isEditable}
onEditItem={() => setEditItem(!editItem)}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ import { IFetchKeyArgs } from 'uiSrc/constants/prop-types/keys'

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

const MAX_ROWS = 25
const MIN_ROWS = 4
const MIN_ROWS = 8
const APPROXIMATE_WIDTH_OF_SIGN = 8.6
const MAX_LENGTH = STRING_MAX_LENGTH + 1

Expand All @@ -72,7 +71,7 @@ const StringDetailsTable = (props: Props) => {
const { name: key, type: keyType, length } = useSelector(selectedKeyDataSelector) ?? { name: '' }
const { viewFormat: viewFormatProp } = useSelector(selectedKeySelector)

const [rows, setRows] = useState<number>(5)
const [rows, setRows] = useState<number>(MIN_ROWS)
const [value, setValue] = useState<JSX.Element | string>('')
const [areaValue, setAreaValue] = useState<string>('')
const [viewFormat, setViewFormat] = useState(viewFormatProp)
Expand All @@ -83,6 +82,7 @@ const StringDetailsTable = (props: Props) => {

const textAreaRef: Ref<HTMLTextAreaElement> = useRef(null)
const viewValueRef: Ref<HTMLPreElement> = useRef(null)
const containerRef: Ref<HTMLDivElement> = useRef(null)

const dispatch = useDispatch()

Expand Down Expand Up @@ -125,16 +125,9 @@ const StringDetailsTable = (props: Props) => {
return
}
const calculatedRows = calculateTextareaLines(areaValue, textAreaRef.current.clientWidth, APPROXIMATE_WIDTH_OF_SIGN)

if (calculatedRows > MAX_ROWS) {
setRows(MAX_ROWS)
return
if (calculatedRows > MIN_ROWS) {
setRows(calculatedRows)
}
if (calculatedRows < MIN_ROWS) {
setRows(MIN_ROWS)
return
}
setRows(calculatedRows)
}, [viewValueRef, isEditItem])

useMemo(() => {
Expand Down Expand Up @@ -188,7 +181,7 @@ const StringDetailsTable = (props: Props) => {

return (
<>
<div className={styles.container} data-testid="string-details">
<div className={styles.container} ref={containerRef} data-testid="string-details">
{isLoading && (
<EuiProgress
color="primary"
Expand All @@ -198,27 +191,24 @@ const StringDetailsTable = (props: Props) => {
/>
)}
{!isEditItem && (
<EuiText
onClick={() => isEditable && setIsEdit(true)}
style={{ whiteSpace: 'break-spaces' }}
data-testid="string-value"
<EuiToolTip
title={!isValid ? noEditableText : undefined}
anchorClassName={styles.tooltipAnchor}
className={styles.tooltip}
position="left"
data-testid="string-value-tooltip"
>
{areaValue !== ''
? (isValid
<EuiText
className={styles.stringValue}
onClick={() => isEditable && setIsEdit(true)}
style={{ whiteSpace: 'break-spaces' }}
data-testid="string-value"
>
{areaValue !== ''
? value
: (
<EuiToolTip
title={noEditableText}
className={styles.tooltip}
position="bottom"
data-testid="string-value-tooltip"
>
<>{value}</>
</EuiToolTip>
)
)
: (!isLoading && (<span style={{ fontStyle: 'italic' }}>Empty</span>))}
</EuiText>
: (!isLoading && (<span style={{ fontStyle: 'italic' }}>Empty</span>))}
</EuiText>
</EuiToolTip>
)}
{isEditItem && (
<InlineItemEditor
Expand Down Expand Up @@ -253,6 +243,7 @@ const StringDetailsTable = (props: Props) => {
disabled={loading}
inputRef={textAreaRef}
className={cx(styles.stringTextArea, { [styles.areaWarning]: isDisabled })}
style={{ maxHeight: containerRef.current ? containerRef.current?.clientHeight - 80 : '100%' }}
data-testid="string-value"
/>
</InlineItemEditor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ $outer-height: 220px;
$outer-height-mobile: 340px;

.container {
@include euiScrollBar;
padding: 20px 16px 20px;

max-height: calc(100vh - #{$outer-height});
overflow-y: auto;
overflow-x: hidden;
word-break: break-word;

overflow: hidden;
color: var(--euiTextSubduedColor);
flex: 1;
position: relative;
Expand All @@ -29,10 +25,12 @@ $outer-height-mobile: 340px;
}

.stringValue {
font: inherit !important;
color: inherit !important;
padding: 0 !important;
background: inherit !important;
@include euiScrollBar;
overflow-y: auto;
overflow-x: hidden;
word-break: break-word;
line-height: 1.2;
width: 100%;

pre {
background-color: transparent !important;
Expand All @@ -41,17 +39,19 @@ $outer-height-mobile: 340px;
}

.stringTextArea {
max-height: calc(100vh - #{$outer-height} - 55px);
@media only screen and (max-width: 767px) {
max-height: calc(100vh - #{$outer-height-mobile} - 55px);
}

&.areaWarning {
border-color: var(--euiColorWarningLight) !important;
background-image: none !important;
}
}

.tooltipAnchor {
display: inline-flex !important;
height: auto;
max-height: 100%;
width: 100%;
}

.stringFooterBtn {
&:global(.euiButton) {
color: var(--euiTextSubduedColor) !important;
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/ui/src/utils/comparisons/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const getFormUpdates = (obj1: UnknownObject = {}, obj2: UnknownObject = {
obj1,
(result: UnknownObject, value, key) => {
if (isObject(value)) {
const diff = getFormUpdates(value, obj2[key])
const diff = getFormUpdates(value, obj2[key] || {})

if (Object.keys(diff).length) {
result[key] = diff
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/common-actions/workbench-actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {t, Selector} from 'testcafe';
import { t, Selector } from 'testcafe';
import { WorkbenchPage } from '../pageObjects';

const workbenchPage = new WorkbenchPage();
Expand Down
Loading