Skip to content

Commit 9533420

Browse files
authored
Merge pull request #3470 from RedisInsight/fe/feature/RI-5379-hash-fields-ttl
#RI-5379 - hash fields expire
2 parents 2ba616c + 3e721ca commit 9533420

Some content is hidden

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

57 files changed

+1186
-654
lines changed

redisinsight/ui/src/components/virtual-table/styles.module.scss

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,7 @@ $footerHeight: 38px;
183183
:global(.key-details-table) {
184184
height: calc(100% - 94px);
185185
position: relative;
186-
&:global(.footerOpened) {
187-
:global(.ReactVirtualized__Table__Grid) {
188-
padding-bottom: 254px;
189-
overflow-y: auto !important;
190-
}
191-
&:global(.footerOpened--short) {
192-
:global(.ReactVirtualized__Table__Grid) {
193-
padding-bottom: 134px;
194-
overflow-y: auto !important;
195-
}
196-
}
197-
}
186+
198187
:global(.ReactVirtualized__Table__row) {
199188
font-size: 13px;
200189
align-items: normal;
@@ -206,6 +195,12 @@ $footerHeight: 38px;
206195
overflow: visible !important;
207196
// fix border alignment, need to investigate why this happens
208197
margin-right: 1px !important;
198+
199+
&:global(.actions.singleAction) {
200+
.tableRowCell {
201+
padding: 4px 8px !important;
202+
}
203+
}
209204
}
210205

211206
:global(.ReactVirtualized__Table__Grid) {
@@ -246,8 +241,6 @@ $footerHeight: 38px;
246241

247242
:global {
248243
.value-table-actions {
249-
margin-right: 5px;
250-
251244
.editFieldBtn {
252245
margin-right: 10px;
253246
}

redisinsight/ui/src/constants/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum ApiEndpoints {
4444
HASH = 'hash',
4545
HASH_FIELDS = 'hash/fields',
4646
HASH_GET_FIELDS = 'hash/get-fields',
47+
HASH_TTL = 'hash/ttl',
4748

4849
LIST = 'list',
4950
LIST_GET_ELEMENTS = 'list/get-elements',

redisinsight/ui/src/constants/commandsVersions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ export const CommandsVersions = {
88
SPUBLISH_NOT_SUPPORTED: {
99
since: '7.0',
1010
},
11+
HASH_TTL: {
12+
since: '7.4'
13+
},
1114
}

redisinsight/ui/src/constants/featureFlags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export enum FeatureFlags {
44
cloudSsoRecommendedSettings = 'cloudSsoRecommendedSettings',
55
databaseChat = 'databaseChat',
66
documentationChat = 'documentationChat',
7+
hashFieldExpiration = 'hashFieldExpiration',
78
}

redisinsight/ui/src/pages/browser/BrowserPage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,14 @@ const BrowserPage = () => {
235235
<div className={`browserPage ${styles.container}`}>
236236
{arePanelsCollapsed && isRightPanelOpen && !isBrowserFullScreen && (
237237
<EuiButton
238-
fill
239238
color="secondary"
240239
iconType="arrowLeft"
241240
size="s"
242241
onClick={closePanel}
243242
className={styles.backBtn}
244243
data-testid="back-right-panel-btn"
245244
>
246-
Browser
245+
Back
247246
</EuiButton>
248247
)}
249248
<div className={cx({

redisinsight/ui/src/pages/browser/components/add-key/AddKey.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ import { isContainJSONModule, Maybe, stringToBuffer } from 'uiSrc/utils'
2020
import { RedisResponseBuffer } from 'uiSrc/slices/interfaces'
2121

2222
import { ADD_KEY_TYPE_OPTIONS } from './constants/key-type-options'
23-
import AddKeyHash from './AddKeyHash/AddKeyHash'
24-
import AddKeyZset from './AddKeyZset/AddKeyZset'
25-
import AddKeyString from './AddKeyString/AddKeyString'
26-
import AddKeySet from './AddKeySet/AddKeySet'
27-
import AddKeyList from './AddKeyList/AddKeyList'
28-
import AddKeyReJSON from './AddKeyReJSON/AddKeyReJSON'
29-
import AddKeyStream from './AddKeyStream/AddKeyStream'
23+
import AddKeyHash from './AddKeyHash'
24+
import AddKeyZset from './AddKeyZset'
25+
import AddKeyString from './AddKeyString'
26+
import AddKeySet from './AddKeySet'
27+
import AddKeyList from './AddKeyList'
28+
import AddKeyReJSON from './AddKeyReJSON'
29+
import AddKeyStream from './AddKeyStream'
3030

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

@@ -134,7 +134,7 @@ const AddKey = (props: Props) => {
134134
</EuiToolTip>
135135
)}
136136
</EuiFlexItem>
137-
<div className="eui-yScroll">
137+
<div className={cx('eui-yScroll', styles.scrollContainer)}>
138138
<div className={styles.contentFields}>
139139
<AddKeyCommonFields
140140
typeSelected={typeSelected}

redisinsight/ui/src/pages/browser/components/add-key/AddKeyHash/AddKeyHash.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
2-
import { fireEvent, render, screen } from 'uiSrc/utils/test-utils'
32
import { instance, mock } from 'ts-mockito'
3+
import { fireEvent, render, screen } from 'uiSrc/utils/test-utils'
44
import AddKeyHash, { Props } from './AddKeyHash'
55

66
const mockedProps = mock<Props>()
@@ -32,12 +32,12 @@ describe('AddKeyHash', () => {
3232

3333
it('should render add button', () => {
3434
render(<AddKeyHash {...instance(mockedProps)} />)
35-
expect(screen.getByTestId('add-new-item')).toBeTruthy()
35+
expect(screen.getByTestId('add-item')).toBeTruthy()
3636
})
3737

3838
it('should render one more field name & value inputs after click add item', () => {
3939
render(<AddKeyHash {...instance(mockedProps)} />)
40-
fireEvent.click(screen.getByTestId('add-new-item'))
40+
fireEvent.click(screen.getByTestId('add-item'))
4141

4242
expect(screen.getAllByTestId('field-name')).toHaveLength(2)
4343
expect(screen.getAllByTestId('field-value')).toHaveLength(2)
@@ -55,7 +55,7 @@ describe('AddKeyHash', () => {
5555
fieldValue,
5656
{ target: { value: 'val' } }
5757
)
58-
fireEvent.click(screen.getByLabelText(/clear item/i))
58+
fireEvent.click(screen.getByTestId('remove-item'))
5959

6060
expect(fieldName).toHaveValue('')
6161
expect(fieldValue).toHaveValue('')

0 commit comments

Comments
 (0)