Skip to content

Commit 2c591be

Browse files
authored
RI-7527 update visuals of Workbench result action buttons (#5015)
- added popover tooltips for all action buttons - sync the colors of the icons - fix the alignment of all action buttons
1 parent 0d5472c commit 2c591be

File tree

3 files changed

+49
-69
lines changed

3 files changed

+49
-69
lines changed

redisinsight/ui/src/components/query/query-card/QueryCardHeader/QueryCardHeader.tsx

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ const ProfileSelect = styled(RiSelect)`
109109
width: 46px;
110110
padding: inherit !important;
111111
112+
&.profiler {
113+
width: 50px;
114+
}
115+
116+
&.toggle-view {
117+
width: 40px;
118+
}
119+
112120
& ~ div {
113121
right: 0;
114122
@@ -385,7 +393,7 @@ const QueryCardHeader = (props: Props) => {
385393
</div>
386394
</FlexItem>
387395
<FlexItem className={styles.controls}>
388-
<Row align="center" justify="end" gap="l">
396+
<Row align="center" justify="end" gap="s">
389397
<FlexItem
390398
className={styles.time}
391399
data-testid="command-execution-date-time"
@@ -440,24 +448,21 @@ const QueryCardHeader = (props: Props) => {
440448
onClick={onDropDownViewClick}
441449
>
442450
{isOpen && canCommandProfile && !summaryText && (
443-
<div className={styles.dropdownWrapper}>
444-
<div className={styles.dropdown}>
445-
<ProfileSelect
446-
placeholder={profileOptions[0].inputDisplay}
447-
onChange={(value: ProfileQueryType | string) =>
448-
onQueryProfile(value as ProfileQueryType)
449-
}
450-
options={profileOptions}
451-
data-testid="run-profile-type"
452-
valueRender={({ option, isOptionValue }) => {
453-
if (isOptionValue) {
454-
return option.dropdownDisplay as JSX.Element
455-
}
456-
return option.inputDisplay as JSX.Element
457-
}}
458-
/>
459-
</div>
460-
</div>
451+
<ProfileSelect
452+
placeholder={profileOptions[0].inputDisplay}
453+
onChange={(value: ProfileQueryType | string) =>
454+
onQueryProfile(value as ProfileQueryType)
455+
}
456+
className="profiler"
457+
options={profileOptions}
458+
data-testid="run-profile-type"
459+
valueRender={({ option, isOptionValue }) => {
460+
if (isOptionValue) {
461+
return option.dropdownDisplay as JSX.Element
462+
}
463+
return option.inputDisplay as JSX.Element
464+
}}
465+
/>
461466
)}
462467
</FlexItem>
463468
)}
@@ -467,22 +472,19 @@ const QueryCardHeader = (props: Props) => {
467472
onClick={onDropDownViewClick}
468473
>
469474
{isOpen && options.length > 1 && !summaryText && (
470-
<div className={styles.dropdownWrapper}>
471-
<div className={styles.dropdown}>
472-
<ProfileSelect
473-
options={modifiedOptions}
474-
valueRender={({ option, isOptionValue }) => {
475-
if (isOptionValue) {
476-
return option.dropdownDisplay as JSX.Element
477-
}
478-
return option.inputDisplay as JSX.Element
479-
}}
480-
value={selectedValue}
481-
onChange={(value: string) => onChangeView(value)}
482-
data-testid="select-view-type"
483-
/>
484-
</div>
485-
</div>
475+
<ProfileSelect
476+
options={modifiedOptions}
477+
valueRender={({ option, isOptionValue }) => {
478+
if (isOptionValue) {
479+
return option.dropdownDisplay as JSX.Element
480+
}
481+
return option.inputDisplay as JSX.Element
482+
}}
483+
value={selectedValue}
484+
onChange={(value: string) => onChangeView(value)}
485+
className="toggle-view"
486+
data-testid="select-view-type"
487+
/>
486488
)}
487489
</FlexItem>
488490
)}
@@ -498,13 +500,15 @@ const QueryCardHeader = (props: Props) => {
498500
)}
499501
</FlexItem>
500502
<FlexItem className={styles.buttonIcon}>
501-
<IconButton
502-
disabled={loading || clearing}
503-
icon={DeleteIcon}
504-
aria-label="Delete command"
505-
data-testid="delete-command"
506-
onClick={handleQueryDelete}
507-
/>
503+
<RiTooltip content="Clear result" position="left">
504+
<IconButton
505+
disabled={loading || clearing}
506+
icon={DeleteIcon}
507+
aria-label="Delete command"
508+
data-testid="delete-command"
509+
onClick={handleQueryDelete}
510+
/>
511+
</RiTooltip>
508512
</FlexItem>
509513
{!isFullScreen && (
510514
<FlexItem className={cx(styles.buttonIcon, styles.playIcon)}>

redisinsight/ui/src/components/query/query-card/QueryCardHeader/styles.module.scss

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,6 @@ $marginIcon: 12px;
9494
flex: 1;
9595
}
9696

97-
.dropdownWrapper {
98-
position: relative;
99-
height: 40px;
100-
}
101-
10297
.dropdownProfileIcon {
10398
padding: inherit !important;
10499
:global {
@@ -120,24 +115,6 @@ $marginIcon: 12px;
120115
}
121116
}
122117

123-
.dropdown {
124-
width: 168px;
125-
position: absolute;
126-
z-index: 1;
127-
128-
// move a little bit left to align with dropdown options icons
129-
left: -21px;
130-
131-
:global {
132-
.euiFormControlLayout__childrenWrapper {
133-
width: 46px;
134-
position: relative;
135-
// move right to align self
136-
left: 21px;
137-
}
138-
}
139-
}
140-
141118
.executionTime {
142119
min-width: 13px;
143120
width: 13px;
@@ -197,8 +174,8 @@ $marginIcon: 12px;
197174
}
198175

199176
.iconDropdownOption {
200-
width: 20px !important;
201-
height: 20px !important;
177+
width: auto;
178+
height: 16px;
202179
}
203180

204181
.iconExecutingTime {
@@ -272,7 +249,6 @@ $marginIcon: 12px;
272249

273250
.buttonIcon {
274251
padding: 0 4px;
275-
width: 32px;
276252
min-width: 32px;
277253
position: relative;
278254
z-index: 2;
Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)