Skip to content

Commit f9b746b

Browse files
authored
fix(ui): add spacing betwеen the key details in the header (#5037)
* fix(ui): add spacing between the key details in the header * fix(ui): added spacing between action buttons in edit json key * fix(ui): update ttl input placement in key details header
1 parent 05335fc commit f9b746b

File tree

6 files changed

+43
-37
lines changed

6 files changed

+43
-37
lines changed

redisinsight/ui/src/pages/browser/modules/key-details-header/KeyDetailsHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const KeyDetailsHeader = ({
172172
align="start"
173173
justify="between"
174174
>
175-
<Row>
175+
<Row gap="l">
176176
<KeyDetailsHeaderSizeLength width={width} />
177177
<KeyDetailsHeaderTTL onEditTTL={handleEditTTL} />
178178
</Row>

redisinsight/ui/src/pages/browser/modules/key-details-header/components/key-details-header-ttl/KeyDetailsHeaderTTL.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,15 @@ const KeyDetailsHeaderTTL = ({ onEditTTL }: Props) => {
9696
<Grid
9797
columns={2}
9898
responsive={false}
99-
gap="none"
99+
gap="s"
100100
className={styles.ttlGridComponent}
101101
data-testid="edit-ttl-grid"
102102
>
103103
<FlexItem>
104-
<Text size="s" className={styles.subtitleText}>
104+
<Text
105+
size="s"
106+
className={cx(styles.subtitleText, styles.subtitleTextTTL)}
107+
>
105108
TTL:
106109
</Text>
107110
</FlexItem>
@@ -139,7 +142,7 @@ const KeyDetailsHeaderTTL = ({ onEditTTL }: Props) => {
139142
)}
140143
<Text
141144
size="s"
142-
className={cx(styles.subtitleText, {
145+
className={cx(styles.subtitleTextTTL, {
143146
[styles.hidden]: ttlIsEditing || ttlIsHovering,
144147
})}
145148
data-testid="key-ttl-text"

redisinsight/ui/src/pages/browser/modules/key-details-header/components/key-details-header-ttl/styles.module.scss

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
padding: 6px 2px 6px 0;
33
}
44

5+
.subtitleTextTTL {
6+
height: 26px;
7+
line-height: 26px;
8+
padding: 0;
9+
}
10+
511
.controlsKey {
612
right: 25px;
713
}
@@ -21,21 +27,27 @@
2127

2228
.ttlInput {
2329
min-width: 106px;
24-
font-size: 13px !important;
25-
height: 25px !important;
30+
font-size: 12px !important;
31+
height: 24px !important;
32+
padding: 2px 0 0 9px !important;
2633
}
2734

2835
.ttlGridComponent,
2936
.classNameGridComponent {
3037
position: relative;
3138
}
3239

40+
.ttlGridComponent {
41+
height: 24px;
42+
line-height: 24px;
43+
}
44+
3345
.hidden {
3446
display: none;
3547
}
3648

3749
.ttlTextValue {
38-
padding-left: 11px;
50+
padding-left: 14px;
3951
}
4052

4153
@include global.insights-open {

redisinsight/ui/src/pages/browser/modules/key-details/components/rejson-details/monaco-editor/MonacoEditor.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { render, screen } from '@testing-library/react'
2+
import { render, screen } from 'uiSrc/utils/test-utils'
33
import { configureStore } from '@reduxjs/toolkit'
44
import { Provider } from 'react-redux'
55

redisinsight/ui/src/pages/browser/modules/key-details/components/rejson-details/monaco-editor/MonacoEditor.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useRef, useState } from 'react'
22
import { useDispatch } from 'react-redux'
3-
import { EuiFlexItem } from '@elastic/eui'
43
import { monaco } from 'react-monaco-editor'
54
import JSONbig from 'json-bigint'
65

@@ -13,6 +12,8 @@ import {
1312
PrimaryButton,
1413
SecondaryButton,
1514
} from 'uiSrc/components/base/forms/buttons'
15+
import { Row } from 'uiSrc/components/base/layout/flex'
16+
import { Spacer } from 'uiSrc/components/base/layout'
1617
import { BaseProps } from '../interfaces'
1718
import { useChangeEditorType } from '../../change-editor-type-button'
1819

@@ -64,8 +65,8 @@ const MonacoEditor = (props: BaseProps) => {
6465
editorWrapperClassName={styles.editorWrapper}
6566
onEditorDidMount={onEditorDidMount}
6667
/>
67-
68-
<EuiFlexItem className={styles.actions}>
68+
<Spacer size="m" />
69+
<Row justify="end" gap="m" className={styles.actions}>
6970
<SecondaryButton
7071
onClick={switchEditorType}
7172
data-testid="json-data-cancel-btn"
@@ -80,7 +81,7 @@ const MonacoEditor = (props: BaseProps) => {
8081
>
8182
Overwrite Data
8283
</PrimaryButton>
83-
</EuiFlexItem>
84+
</Row>
8485
</div>
8586
)
8687
}

redisinsight/ui/src/pages/browser/modules/key-details/components/rejson-details/styles.module.scss

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
position: relative;
1414

1515
input {
16-
font-family: "Graphik", sans-serif !important;
16+
font-family: 'Graphik', sans-serif !important;
1717
}
1818

1919
:global {
@@ -56,7 +56,7 @@
5656
.jsonData {
5757
font-size: 14px;
5858
line-height: 25px;
59-
font-family: "Inconsolata", monospace !important;
59+
font-family: 'Inconsolata', monospace !important;
6060
letter-spacing: 0.15px;
6161
flex-grow: 1;
6262

@@ -69,7 +69,7 @@
6969
.monacoEditorJsonData {
7070
font-size: 14px;
7171
line-height: 25px;
72-
font-family: "Inconsolata", monospace !important;
72+
font-family: 'Inconsolata', monospace !important;
7373
letter-spacing: 0.15px;
7474
flex-grow: 1;
7575
width: 100%;
@@ -78,7 +78,7 @@
7878
}
7979

8080
.defaultFont {
81-
font-family: "Graphik", sans-serif !important;
81+
font-family: 'Graphik', sans-serif !important;
8282
}
8383

8484
.errorMessage {
@@ -95,7 +95,8 @@
9595
z-index: 2;
9696
display: flex;
9797
align-items: center;
98-
justify-content: center;gap:12px;
98+
justify-content: center;
99+
gap: 12px;
99100
box-shadow: 0 3px 3px var(--controlsBoxShadowColor);
100101

101102
&.controls {
@@ -123,7 +124,7 @@
123124
align-items: center;
124125

125126
&:before {
126-
content: "";
127+
content: '';
127128
display: block;
128129
position: absolute;
129130
height: 100%;
@@ -142,7 +143,9 @@
142143
background: var(--hoverInListColor);
143144
}
144145

145-
> div, span, button {
146+
> div,
147+
span,
148+
button {
146149
z-index: 1;
147150
}
148151
}
@@ -189,7 +192,7 @@
189192
.jsonValue {
190193
font-size: 14px;
191194
line-height: 25px;
192-
font-family: "Inconsolata", monospace;
195+
font-family: 'Inconsolata', monospace;
193196
letter-spacing: 0.15px;
194197
padding: 0 8px;
195198
max-width: 1000px;
@@ -240,7 +243,8 @@
240243
}
241244
}
242245

243-
.actionButtons, .deleteBtn {
246+
.actionButtons,
247+
.deleteBtn {
244248
margin-left: 1em;
245249
display: flex;
246250
align-items: center;
@@ -269,22 +273,8 @@
269273
max-width: none;
270274
}
271275

272-
.actions {
273-
margin-top: 1em;
274-
display: flex;
275-
flex-direction: row !important;
276-
width: 100%;
277-
justify-content: flex-end;
278-
279-
button {
280-
281-
&:first-of-type {
282-
margin-right: 1em;
283-
}
284-
}
285-
}
286-
287-
.editor, .editorWrapper {
276+
.editor,
277+
.editorWrapper {
288278
// Using 100% height starts a weird Monaco animation,
289279
// which causes the editor to overflow its container.
290280
// Probably it's related to the borders of the inside elements.

0 commit comments

Comments
 (0)