Skip to content

Commit e31b3b7

Browse files
committed
Merge branch 'main' into feature/RI-4481_hide_database_security_fields
2 parents f6a41c6 + fa554d8 commit e31b3b7

File tree

198 files changed

+3481
-2531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+3481
-2531
lines changed

.circleci/config.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ jobs:
372372
- run:
373373
name: .AppImage tests
374374
command: |
375-
cd tests/e2e && export TEST_FILES=$(circleci tests glob "tests/**/*.e2e.ts" | circleci tests split --split-by=timings) && cd ../..
375+
cd tests/e2e && export TEST_FILES=$(circleci tests glob "tests/electron/**/*.e2e.ts" | circleci tests split --split-by=timings) && cd ../..
376376
.circleci/e2e/test.app-image.sh
377377
- when:
378378
condition:
@@ -409,7 +409,7 @@ jobs:
409409
- run: choco install nodejs --version=18.15.0
410410
- run:
411411
command: |
412-
cd tests/e2e && export TEST_FILES=$(circleci tests glob "tests/**/*.e2e.ts" | circleci tests split --split-by=timings) && cd ../..
412+
cd tests/e2e && export TEST_FILES=$(circleci tests glob "tests/electron/**/*.e2e.ts" | circleci tests split --split-by=timings) && cd ../..
413413
.circleci/e2e/test.exe.cmd
414414
shell: bash.exe
415415
- when:
@@ -460,7 +460,7 @@ jobs:
460460
- run:
461461
name: Run tests
462462
command: |
463-
cd tests/e2e && export TEST_FILES=$(circleci tests glob "tests/**/*.e2e.ts" | circleci tests split --split-by=timings) && cd ../..
463+
cd tests/e2e && export TEST_FILES=$(circleci tests glob "tests/web/**/*.e2e.ts" | circleci tests split --split-by=timings) && cd ../..
464464
TEST_BIG_DB_DUMP=$TEST_BIG_DB_DUMP \
465465
docker-compose \
466466
-f tests/e2e/rte.docker-compose.yml \
@@ -474,7 +474,7 @@ jobs:
474474
- run:
475475
name: Run tests
476476
command: |
477-
cd tests/e2e && export TEST_FILES=$(circleci tests glob "tests/**/*.e2e.ts" | circleci tests split --split-by=timings) && cd ../..
477+
cd tests/e2e && export TEST_FILES=$(circleci tests glob "tests/web/**/*.e2e.ts" | circleci tests split --split-by=timings) && cd ../..
478478
TEST_BIG_DB_DUMP=$TEST_BIG_DB_DUMP \
479479
docker-compose \
480480
-f tests/e2e/rte.docker-compose.yml \
@@ -1208,6 +1208,18 @@ workflows:
12081208
requires:
12091209
- itest-code
12101210
# E2E tests
1211+
- setup-sign-certificates:
1212+
name: Setup sign certificates (stage)
1213+
requires:
1214+
- Start All Tests
1215+
- setup-build:
1216+
name: Setup build (stage)
1217+
requires:
1218+
- Setup sign certificates (stage)
1219+
- linux:
1220+
name: Build app - Linux (stage)
1221+
requires:
1222+
- Setup build (stage)
12111223
- docker:
12121224
name: Build docker image
12131225
requires:
@@ -1218,6 +1230,11 @@ workflows:
12181230
parallelism: 4
12191231
requires:
12201232
- Build docker image
1233+
- e2e-app-image:
1234+
name: E2ETest (AppImage)
1235+
parallelism: 2
1236+
requires:
1237+
- Build app - Linux (stage)
12211238
# Approve to build
12221239
- approve:
12231240
name: Build App

redisinsight/api/src/__mocks__/cloud-user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const mockCloudApiCsrfToken: ICloudApiCsrfToken = {
6565
export const mockCloudApiAuthDto: ICloudApiCredentials = {
6666
accessToken: 'at_p6vA6A5tF36Jf6twH2cBOqtt7n',
6767
csrf: mockCloudApiCsrfToken.csrf_token,
68-
apiSessionId: 'asid_p6vA6A5tF36Jf6twH2cBOqtt7n',
68+
apiSessionId: 'asid_p6v-A6A5tF36J-f6twH2cB!@#$_^&*()Oqtt7n',
6969
};
7070

7171
export const mockCloudUserAccount = Object.assign(new CloudUserAccount(), {

redisinsight/api/src/modules/cloud/user/providers/cloud-user.api.provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class CloudUserApiProvider extends CloudApiProvider {
4949
return get(headers, 'set-cookie', []).find(
5050
(header) => header.indexOf('JSESSIONID=') > -1,
5151
)
52-
?.match(/JSESSIONID=(\w+)/)?.[1];
52+
?.match(/JSESSIONID=([^;]+)/)?.[1];
5353
} catch (e) {
5454
throw wrapCloudApiError(e);
5555
}

redisinsight/ui/src/components/multi-search/MultiSearch.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export interface Props {
3232
onDelete: (ids: string[]) => void
3333
loading?: boolean
3434
}
35-
optionalButton?: React.ReactNode
3635
onChange: (value: string) => void
3736
onChangeOptions?: (options: string[]) => void
3837
onClear?: () => void
@@ -53,7 +52,6 @@ const MultiSearch = (props: Props) => {
5352
onChange,
5453
onKeyDown,
5554
onClear = () => {},
56-
optionalButton,
5755
className,
5856
compressed,
5957
...rest
@@ -251,7 +249,6 @@ const MultiSearch = (props: Props) => {
251249
/>
252250
</EuiToolTip>
253251
)}
254-
{optionalButton}
255252
{!!suggestionOptions?.length && (
256253
<EuiToolTip
257254
content={suggestions?.buttonTooltipTitle}

redisinsight/ui/src/constants/storage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ enum BrowserStorageItem {
44
theme = 'theme',
55
browserViewType = 'browserViewType',
66
browserSearchMode = 'browserSearchMode',
7-
browserExactMatch = 'browserExactMatch',
87
cliClientUuid = 'cliClientUuid',
98
cliResizableContainer = 'cliResizableContainer',
109
cliInputHistory = 'cliInputHistory',

redisinsight/ui/src/pages/browser/components/search-key-list/SearchKeyList.spec.tsx

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,10 @@ import {
1010
screen,
1111
act,
1212
} from 'uiSrc/utils/test-utils'
13-
import {
14-
changeExactMatch,
15-
keysSelector,
16-
loadKeys,
17-
loadSearchHistory,
18-
setFilter,
19-
setPatternSearchMatch
20-
} from 'uiSrc/slices/browser/keys'
13+
import { keysSelector, loadKeys, loadSearchHistory, setFilter, setPatternSearchMatch } from 'uiSrc/slices/browser/keys'
2114

2215
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
2316
import { KeyViewType, SearchMode } from 'uiSrc/slices/interfaces/keys'
24-
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
2517
import SearchKeyList from './SearchKeyList'
2618

2719
jest.mock('uiSrc/slices/browser/keys', () => ({
@@ -55,11 +47,6 @@ jest.mock('uiSrc/slices/browser/redisearch', () => ({
5547
}),
5648
}))
5749

58-
jest.mock('uiSrc/telemetry', () => ({
59-
...jest.requireActual('uiSrc/telemetry'),
60-
sendEventTelemetry: jest.fn(),
61-
}))
62-
6350
let store: typeof mockedStore
6451
beforeEach(() => {
6552
cleanup()
@@ -150,51 +137,4 @@ describe('SearchKeyList', () => {
150137
clearStoreActions([...afterRenderActions])
151138
)
152139
})
153-
154-
it('should change exact match after click on button', () => {
155-
keysSelector.mockImplementation(() => ({
156-
searchMode: SearchMode.Pattern,
157-
viewType: KeyViewType.Browser,
158-
isSearch: false,
159-
isFiltered: false,
160-
}))
161-
162-
render(<SearchKeyList />)
163-
164-
const afterRenderActions = [...store.getActions()]
165-
166-
fireEvent.click(screen.getByTestId('exact-match-button'))
167-
168-
expect(clearStoreActions(store.getActions())).toEqual(
169-
clearStoreActions([...afterRenderActions, changeExactMatch(true)])
170-
)
171-
})
172-
173-
it('should call proper telemetry after click exact match button', () => {
174-
keysSelector.mockImplementation(() => ({
175-
searchMode: SearchMode.Pattern,
176-
viewType: KeyViewType.Browser,
177-
isSearch: false,
178-
isFiltered: false,
179-
}))
180-
181-
const sendEventTelemetryMock = jest.fn();
182-
(sendEventTelemetry as jest.Mock).mockImplementation(() => sendEventTelemetryMock)
183-
184-
render(<SearchKeyList />)
185-
186-
fireEvent.click(screen.getByTestId('exact-match-button'))
187-
188-
expect(sendEventTelemetry).toBeCalledWith({
189-
event: TelemetryEvent.BROWSER_FILTER_PER_PATTERN_CLICKED,
190-
eventData: {
191-
databaseId: 'instanceId',
192-
current: 'Exact',
193-
previous: 'Pattern',
194-
view: KeyViewType.Browser
195-
}
196-
});
197-
198-
(sendEventTelemetry as jest.Mock).mockRestore()
199-
})
200140
})

redisinsight/ui/src/pages/browser/components/search-key-list/SearchKeyList.tsx

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { EuiButtonIcon, EuiToolTip, keys } from '@elastic/eui'
1+
import { keys } from '@elastic/eui'
22
import React, { useEffect, useState } from 'react'
33
import { useDispatch, useSelector } from 'react-redux'
44
import cx from 'classnames'
55

6-
import { useParams } from 'react-router-dom'
76
import MultiSearch from 'uiSrc/components/multi-search/MultiSearch'
87
import { SCAN_COUNT_DEFAULT, SCAN_TREE_COUNT_DEFAULT } from 'uiSrc/constants/api'
98
import { replaceSpaces } from 'uiSrc/utils'
109
import {
11-
changeExactMatch,
1210
deleteSearchHistoryAction,
1311
fetchKeys,
1412
fetchSearchHistoryAction,
@@ -17,11 +15,13 @@ import {
1715
setFilter,
1816
setSearchMatch
1917
} from 'uiSrc/slices/browser/keys'
20-
import { KeyViewType, SearchHistoryItem, SearchMode } from 'uiSrc/slices/interfaces/keys'
21-
import { redisearchHistorySelector, redisearchSelector } from 'uiSrc/slices/browser/redisearch'
18+
import { SearchMode, KeyViewType, SearchHistoryItem } from 'uiSrc/slices/interfaces/keys'
19+
import {
20+
redisearchHistorySelector,
21+
redisearchSelector
22+
} from 'uiSrc/slices/browser/redisearch'
2223

2324
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
24-
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
2525
import styles from './styles.module.scss'
2626

2727
const placeholders = {
@@ -31,7 +31,7 @@ const placeholders = {
3131

3232
const SearchKeyList = () => {
3333
const { id } = useSelector(connectedInstanceSelector)
34-
const { search, viewType, searchMode, exactMatch } = useSelector(keysSelector)
34+
const { search, viewType, searchMode } = useSelector(keysSelector)
3535
const { search: redisearchQuery, selectedIndex } = useSelector(redisearchSelector)
3636
const { data: rediSearchHistory, loading: rediSearchHistoryLoading } = useSelector(redisearchHistorySelector)
3737
const { data: searchHistory, loading: searchHistoryLoading } = useSelector(keysSearchHistorySelector)
@@ -40,7 +40,6 @@ const SearchKeyList = () => {
4040
const [disableSubmit, setDisableSubmit] = useState(false)
4141

4242
const dispatch = useDispatch()
43-
const { instanceId } = useParams<{ instanceId: string }>()
4443

4544
useEffect(() => {
4645
if (id) {
@@ -115,23 +114,6 @@ const SearchKeyList = () => {
115114
handleApply('')
116115
}
117116

118-
const handleChangeExactMatch = () => {
119-
sendEventTelemetry({
120-
event: TelemetryEvent.BROWSER_FILTER_PER_PATTERN_CLICKED,
121-
eventData: {
122-
databaseId: instanceId,
123-
view: viewType,
124-
previous: exactMatch ? 'Exact' : 'Pattern',
125-
current: exactMatch ? 'Pattern' : 'Exact',
126-
}
127-
})
128-
dispatch(changeExactMatch(!exactMatch))
129-
130-
if (value) {
131-
handleApply()
132-
}
133-
}
134-
135117
return (
136118
<div className={cx(styles.container, { [styles.redisearchMode]: searchMode === SearchMode.Redisearch })}>
137119
<MultiSearch
@@ -148,24 +130,6 @@ const SearchKeyList = () => {
148130
onApply: handleApplySuggestion,
149131
onDelete: handleDeleteSuggestions,
150132
}}
151-
optionalButton={searchMode === SearchMode.Pattern ? (
152-
<EuiToolTip
153-
title="Exact Search"
154-
content={exactMatch ? 'Disable to see keys matching your pattern' : 'Enable to see keys that exactly match your pattern'}
155-
position="bottom"
156-
>
157-
<EuiButtonIcon
158-
display="empty"
159-
iconType="bullseye"
160-
color="primary"
161-
size="xs"
162-
onClick={handleChangeExactMatch}
163-
aria-label="exact match button"
164-
className={cx(styles.exactSearchIcon, { [styles.disabled]: !exactMatch })}
165-
data-testid="exact-match-button"
166-
/>
167-
</EuiToolTip>
168-
) : null}
169133
disableSubmit={disableSubmit}
170134
placeholder={placeholders[searchMode]}
171135
className={styles.input}

redisinsight/ui/src/pages/browser/components/search-key-list/styles.module.scss

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,3 @@
3131
margin-right: 50px;
3232
word-break: break-all;
3333
}
34-
35-
.exactSearchIcon {
36-
margin-left: 8px;
37-
margin-right: -4px;
38-
39-
&.disabled {
40-
opacity: 0.5;
41-
}
42-
}

redisinsight/ui/src/slices/browser/keys.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export const initialState: KeysStore = {
8080
isBrowserFullScreen: false,
8181
searchMode: localStorageService?.get(BrowserStorageItem.browserSearchMode) ?? SearchMode.Pattern,
8282
viewType: localStorageService?.get(BrowserStorageItem.browserViewType) ?? KeyViewType.Browser,
83-
exactMatch: localStorageService?.get(BrowserStorageItem.browserExactMatch) ?? true,
8483
data: {
8584
total: 0,
8685
scanned: 0,
@@ -356,11 +355,6 @@ const keysSlice = createSlice({
356355
state.searchMode = payload
357356
},
358357

359-
changeExactMatch: (state, { payload }: { payload: boolean }) => {
360-
state.exactMatch = payload
361-
localStorageService?.set(BrowserStorageItem.browserExactMatch, payload)
362-
},
363-
364358
resetAddKey: (state) => {
365359
state.addKey = cloneDeep(initialState.addKey)
366360
},
@@ -463,7 +457,6 @@ export const {
463457
toggleBrowserFullScreen,
464458
setViewFormat,
465459
changeSearchMode,
466-
changeExactMatch,
467460
loadSearchHistory,
468461
loadSearchHistorySuccess,
469462
loadSearchHistoryFailure,
@@ -520,17 +513,16 @@ export function fetchPatternKeysAction(
520513
sourceKeysFetch = CancelToken.source()
521514

522515
const state = stateInit()
523-
const { search: match, filter: type, exactMatch } = state.browser.keys
516+
const { search: match, filter: type } = state.browser.keys
524517
const { encoding } = state.app.info
525-
const withExactMatch = exactMatch ? match : `*${match}*`
526518

527519
const { data, status } = await apiService.post<GetKeysWithDetailsResponse[]>(
528520
getUrl(
529521
state.connections.instances?.connectedInstance?.id ?? '',
530522
ApiEndpoints.KEYS
531523
),
532524
{
533-
cursor, count, type, match: withExactMatch || DEFAULT_SEARCH_MATCH, keysInfo: false,
525+
cursor, count, type, match: match || DEFAULT_SEARCH_MATCH, keysInfo: false,
534526
},
535527
{
536528
params: { encoding },

redisinsight/ui/src/slices/interfaces/keys.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export interface KeysStore {
3232
isBrowserFullScreen: boolean
3333
viewType: KeyViewType
3434
searchMode: SearchMode
35-
exactMatch: boolean
3635
data: KeysStoreData
3736
selectedKey: {
3837
loading: boolean

0 commit comments

Comments
 (0)