Skip to content

Commit 82e29cd

Browse files
committed
* #RIVS-321 - Keys count is not updated for logical db
* #RIVS-324 - There is no common refresh for the logical db * #RIVS-317 - Filters not saved when switching between extensions * #RIVS-316 - Filters/sorting dropdown can be overlapped * #RIVS-322 - databaseId is null for TREE_VIEW_KEY_ADDED * #RIVS-323 - Show TTL checkbox doesn't work * #RIVS-325 - Edit String key button not disabled for not loaded key with > 5000 characters
1 parent 8868301 commit 82e29cd

File tree

22 files changed

+243
-51
lines changed

22 files changed

+243
-51
lines changed

scripts/downloadBackend.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ async function downloadRedisBackendArchive(
8282
})
8383
}
8484

85-
function getNormalizedString(string: string) {
86-
return string?.startsWith('D:')
85+
function getNormalizedCIString(string: string) {
86+
return string?.startsWith('D:') && process.env.CI
8787
? upath.normalize(string).replace('D:', '/d')
8888
: string
8989
}
@@ -96,9 +96,9 @@ function unzipRedisServer(redisInsideArchivePath: string, extractDir: string) {
9696

9797
cp.spawnSync('tar', [
9898
'-xf',
99-
getNormalizedString(redisInsideArchivePath),
99+
getNormalizedCIString(redisInsideArchivePath),
100100
'-C',
101-
getNormalizedString(extractDir),
101+
getNormalizedCIString(extractDir),
102102
'--strip-components',
103103
'1',
104104
'api',
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as useCliSettingsThunks from 'uiSrc/modules/cli/hooks/cli-settings/useCliSettingsThunks'
2+
import { constants } from 'testSrc/helpers'
3+
import { processCliAction } from 'uiSrc/actions'
4+
5+
vi.spyOn(useCliSettingsThunks, 'addCli')
6+
7+
beforeEach(() => {
8+
vi.stubGlobal('ri', { })
9+
})
10+
11+
describe('processCliAction', () => {
12+
it('should call addCli', () => {
13+
processCliAction(constants.VSCODE_CLI_ACTION)
14+
expect(useCliSettingsThunks.addCli).toBeCalled()
15+
})
16+
})
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as useSelectedKey from 'uiSrc/store/hooks/use-selected-key-store/useSelectedKeyStore'
2+
import { selectKeyAction } from 'uiSrc/actions'
3+
import { constants } from 'testSrc/helpers'
4+
5+
6+
vi.spyOn(useSelectedKey, 'fetchKeyInfo')
7+
8+
9+
beforeEach(() => {
10+
vi.stubGlobal('ri', { })
11+
12+
useSelectedKey.useSelectedKeyStore.setState((state) => ({
13+
...state,
14+
data: constants.KEY_INFO,
15+
}))
16+
})
17+
18+
describe('selectKeyAction', () => {
19+
it('should call fetchKeyInfo', () => {
20+
selectKeyAction(constants.VSCODE_SELECT_KEY_ACTION)
21+
expect(useSelectedKey.fetchKeyInfo).toBeCalled()
22+
})
23+
})

src/webviews/src/components/auto-refresh/AutoRefresh.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ const AutoRefresh = React.memo(({
199199
</Tooltip>
200200

201201
<Popover
202+
closeOnEscape
203+
closeOnDocumentClick
202204
repositionOnResize
203205
keepTooltipInside={false}
204206
open={isPopoverOpen}

src/webviews/src/components/auto-refresh/styles.module.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121

2222
:global(.popover-auto-refresh-content) {
23-
@apply max-w-[225px] w-[225px] #{!important};
24-
23+
@apply pr-[26px] #{!important};
2524
}
2625

2726
.switch {

src/webviews/src/constants/core/storage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ enum StorageItem {
3232
databaseId = 'databaseId',
3333
openTreeNode = 'openTreeNode',
3434
openTreeDatabase = 'openTreeDatabase',
35+
keysTreeFilter = 'keysTreeFilter',
3536
}
3637

3738
export { StorageItem }

src/webviews/src/modules/key-details-header/KeyDetailsHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const KeyDetailsHeader = ({
157157
</div>
158158
)}
159159
</AutoSizer>
160-
{(loading || refreshing) && <div className="table-loading" />}
160+
{(loading || refreshing) && <div className="data-loading" />}
161161
</div>
162162
)
163163
}

src/webviews/src/modules/key-details/components/hash-details/HashDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const HashDetails = (props: Props) => {
8484
),
8585
children,
8686
<AddItemsAction key={3} title={l10n.t('Add Fields')} openAddItemPanel={openAddItemPanel} />,
87-
]), [])
87+
]), [showTtl, isExpireFieldsAvailable])
8888

8989
return (
9090
<div className="fluid flex-column relative">

src/webviews/src/modules/key-details/components/string-details/StringDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const StringDetails = (props: Props) => {
103103
setEditItem(!editItem)
104104
}}
105105
/>,
106-
]), [])
106+
]), [isStringEditable, isEditable])
107107

108108
return (
109109
<div className="fluid flex-column relative">

src/webviews/src/modules/keys-tree/components/database-wrapper/DatabaseWrapper.spec.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { apiService, vscodeApi } from 'uiSrc/services'
88
import * as useContext from 'uiSrc/store/hooks/use-context/useContext'
99
import * as useSelectedKeyStore from 'uiSrc/store/hooks/use-selected-key-store/useSelectedKeyStore'
1010
import { Database } from 'uiSrc/store'
11+
import * as useDatabasesStore from 'uiSrc/store'
1112
import { constants, fireEvent, render, waitForStack } from 'testSrc/helpers'
1213
import { DatabaseWrapper, Props } from './DatabaseWrapper'
1314
import * as useKeys from '../../hooks/useKeys'
@@ -39,12 +40,23 @@ const resetKeysTreeMock = vi.fn();
3940
resetKeysTree: resetKeysTreeMock,
4041
}))
4142

43+
vi.spyOn(useDatabasesStore, 'fetchDatabaseOverviewById')
44+
4245
describe('DatabaseWrapper', () => {
4346
it('should render', () => {
4447
expect(render(<DatabaseWrapper {...mockedProps} />)).toBeTruthy()
4548
})
4649

47-
it('should call fetchPatternKeysAction action after click on refresh icon', async () => {
50+
it('should call fetchDatabaseOverviewById action after click on refresh icon', async () => {
51+
const { queryByTestId } = render(<DatabaseWrapper {...mockedProps} />)
52+
53+
fireEvent.click(queryByTestId('refresh-databases')!)
54+
await waitForStack()
55+
56+
expect(useDatabasesStore.fetchDatabaseOverviewById).toBeCalled()
57+
})
58+
59+
it('should call fetchPatternKeysAction action after click on logical database refresh icon', async () => {
4860
const { queryByTestId } = render(<DatabaseWrapper {...mockedProps} />)
4961

5062
fireEvent.click(queryByTestId(`database-${mockDatabase.id}`)!)

0 commit comments

Comments
 (0)