Skip to content

Commit 622aeaa

Browse files
#RI-3742-update styles and error handling in worbench
1 parent 19f3ea6 commit 622aeaa

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ $marginIcon: 12px;
4141

4242
.titleWrapper {
4343
width: calc(100% - 490px);
44+
min-width: calc(100% - 490px);
4445

45-
@media (min-width: $breakpoint-s) {
46-
width: calc(100% - 529px);
46+
@media (min-width: $breakpoint-m) {
47+
width: calc(100% - 582px);
48+
min-width: calc(100% - 582px);
4749
}
4850

49-
@media (min-width: $breakpoint-m) {
50-
width: calc(100% - 651px);
51+
@media (min-width: $breakpoint-l) {
52+
width: calc(100% - 633px);
53+
min-width: calc(100% - 633px);
5154
}
5255
}
5356

@@ -146,21 +149,16 @@ $marginIcon: 12px;
146149
min-width: 13px;
147150
width: 13px;
148151

149-
@media (min-width: $breakpoint-s) {
152+
@media (min-width: $breakpoint-l) {
150153
min-width: 58px;
151154
width: 58px;
152155
}
153-
154-
@media (min-width: $breakpoint-m) {
155-
min-width: 70px;
156-
width: 70px;
157-
}
158156
}
159157

160158
.executionTimeValue {
161159
display: none;
162160

163-
@media (min-width: $breakpoint-s) {
161+
@media (min-width: $breakpoint-l) {
164162
display: initial;
165163
overflow: hidden;
166164
text-overflow: ellipsis;

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22
@import "@elastic/eui/src/components/table/mixins";
33
@import "@elastic/eui/src/global_styling/index";
44

5+
$breakpoint-l: 1300px;
6+
$breakpoint-m: 1050px;
7+
58
.containerWrapper {
6-
min-width: 590px;
9+
min-width: 560px;
10+
@media (min-width: $breakpoint-m) {
11+
min-width: 650px;
12+
}
13+
@media (min-width: $breakpoint-l) {
14+
min-width: 720px;
15+
}
716
&:nth-of-type(even) {
817
background-color: var(--euiColorEmptyShade) !important;
918
}

redisinsight/ui/src/slices/workbench/wb-results.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
isStatusSuccessful,
1414
} from 'uiSrc/utils'
1515
import { WORKBENCH_HISTORY_MAX_LENGTH } from 'uiSrc/pages/workbench/constants'
16+
import { CommandExecutionStatus } from 'uiSrc/slices/interfaces/cli'
1617
import { CreateCommandExecutionsDto } from 'apiSrc/modules/workbench/dto/create-command-executions.dto'
1718

1819
import { AppDispatch, RootState } from '../store'
@@ -63,9 +64,25 @@ const workbenchResultsSlice = createSlice({
6364
})
6465
},
6566

66-
// temporary solution, need improve on BE how we handle errors
6767
processWBCommandsFailure: (state, { payload }: { payload: { commandsId: string[], error: string } }) => {
68-
state.items = [...state.items].filter((item) => payload.commandsId.indexOf(item?.id as string) === -1)
68+
state.items = [...state.items].map((item) => {
69+
let newItem = item
70+
payload.commandsId.forEach(() => {
71+
if (payload.commandsId.indexOf(item?.id as string) !== -1) {
72+
newItem = {
73+
...item,
74+
result: [{
75+
response: payload.error,
76+
status: CommandExecutionStatus.Fail,
77+
}],
78+
loading: false,
79+
isOpen: true,
80+
error: '',
81+
}
82+
}
83+
})
84+
return newItem
85+
})
6986
state.loading = false
7087
state.processing = false
7188
},

0 commit comments

Comments
 (0)