Skip to content

Commit b903e1e

Browse files
committed
* #RI-2241 - CLI and Command helper icons are not in blue when hidden
* #RI-2245 - Background is not fully displayed inside of the button * #RI-2246 - Link to the Cloud is not correct
1 parent 178d87e commit b903e1e

File tree

13 files changed

+51
-20
lines changed

13 files changed

+51
-20
lines changed

redisinsight/ui/src/components/bottom-group-components/components/bottom-group-minimized/BottomGroupMinimized.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@ import {
1010
cliSettingsSelector,
1111
clearSearchingCommand,
1212
setCliEnteringCommand,
13+
toggleHideCliHelper,
1314
} from 'uiSrc/slices/cli/cli-settings'
1415
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
1516

1617
import styles from '../../styles.module.scss'
1718

1819
const BottomGroupMinimized = () => {
19-
const { isShowHelper, isShowCli } = useSelector(cliSettingsSelector)
2020
const { instanceId = '' } = useParams<{ instanceId: string }>()
21+
const {
22+
isShowCli,
23+
cliClientUuid,
24+
isShowHelper,
25+
isMinimizedHelper,
26+
} = useSelector(cliSettingsSelector)
2127
const dispatch = useDispatch()
2228

2329
useEffect(() =>
@@ -43,6 +49,7 @@ const BottomGroupMinimized = () => {
4349
databaseId: instanceId
4450
}
4551
})
52+
isMinimizedHelper && dispatch(toggleHideCliHelper())
4653
dispatch(toggleCliHelper())
4754
}
4855

@@ -60,7 +67,7 @@ const BottomGroupMinimized = () => {
6067
onClick={handleExpandCli}
6168
data-testid="expand-cli"
6269
>
63-
<EuiBadge className={cx(styles.componentBadge, { [styles.active]: isShowCli })}>
70+
<EuiBadge className={cx(styles.componentBadge, { [styles.active]: isShowCli || cliClientUuid })}>
6471
<EuiIcon type="console" size="m" />
6572
<span>CLI</span>
6673
</EuiBadge>
@@ -71,7 +78,11 @@ const BottomGroupMinimized = () => {
7178
onClick={handleExpandHelper}
7279
data-testid="expand-command-helper"
7380
>
74-
<EuiBadge className={cx(styles.componentBadge, { [styles.active]: isShowHelper })}>
81+
<EuiBadge className={cx(
82+
styles.componentBadge,
83+
{ [styles.active]: isShowHelper || isMinimizedHelper }
84+
)}
85+
>
7586
<EuiIcon type="documents" size="m" />
7687
<span>Command Helper</span>
7788
</EuiBadge>

redisinsight/ui/src/components/command-helper/CommandHelperHeader/CommandHelperHeader.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
render,
77
screen,
88
} from 'uiSrc/utils/test-utils'
9-
import { resetCliHelperSettings, toggleCliHelper } from 'uiSrc/slices/cli/cli-settings'
9+
import { resetCliHelperSettings, toggleCliHelper, toggleHideCliHelper } from 'uiSrc/slices/cli/cli-settings'
1010
import CommandHelperHeader from './CommandHelperHeader'
1111

1212
let store: typeof mockedStore
@@ -33,7 +33,7 @@ describe('CommandHelperHeader', () => {
3333
render(<CommandHelperHeader />)
3434
fireEvent.click(screen.getByTestId('hide-command-helper'))
3535

36-
const expectedActions = [toggleCliHelper()]
36+
const expectedActions = [toggleCliHelper(), toggleHideCliHelper()]
3737
expect(store.getActions()).toEqual(expectedActions)
3838
})
3939
})

redisinsight/ui/src/components/command-helper/CommandHelperHeader/CommandHelperHeader.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
EuiIcon,
1212
} from '@elastic/eui'
1313
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
14-
import { resetCliHelperSettings, toggleCliHelper } from 'uiSrc/slices/cli/cli-settings'
14+
import { resetCliHelperSettings, toggleCliHelper, toggleHideCliHelper } from 'uiSrc/slices/cli/cli-settings'
1515

1616
import styles from './styles.module.scss'
1717

@@ -37,6 +37,7 @@ const CommandHelperHeader = () => {
3737
}
3838
})
3939
dispatch(toggleCliHelper())
40+
dispatch(toggleHideCliHelper())
4041
}
4142

4243
return (

redisinsight/ui/src/pages/home/components/AddInstanceControls/styles.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
width: 413px;
4343
height: 64px;
4444
padding-right: 40px;
45+
background: url(../../../../assets/img/NYbg.jpg) center;
46+
background-size: cover;
4547

4648
&::before {
4749
content: '';
@@ -50,9 +52,7 @@
5052
right: 0px;
5153
bottom: 0px;
5254
left: 0px;
53-
opacity: .9;
54-
background: url(../../../../assets/img/NYbg.jpg) center;
55-
background-size: cover;
55+
background-color: var(--overlayPromoNYColor);
5656
}
5757

5858
&:hover {

redisinsight/ui/src/pages/workbench/components/module-not-loaded/styles.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
width: 413px;
5454
height: 64px;
5555
padding-right: 40px;
56+
background: url(../../../../assets/img/NYbg.jpg) center;
57+
background-size: cover;
5658

5759
&::before {
5860
content: '';
@@ -61,9 +63,7 @@
6163
right: 0px;
6264
bottom: 0px;
6365
left: 0px;
64-
opacity: .9;
65-
background: url(../../../../assets/img/NYbg.jpg) center;
66-
background-size: cover;
66+
background-color: var(--overlayPromoNYColor);
6767
}
6868

6969
&:hover {

redisinsight/ui/src/pages/workbench/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export enum ModuleCommandPrefix {
3131
export const RSNotLoadedContent: IModuleNotLoadedContent = {
3232
output: 'RediSearch module is not loaded for this database',
3333
createCloudBtnText: 'Create your free Redis database with RediSearch on Redis Cloud​',
34-
createCloudBtnHref: 'https://redis.com/try-free/?utm_source=redis&utm_medium=app&utm_campaign=redisinsight_offer_jan',
34+
createCloudBtnHref: 'https://redis.com/try-free/?utm_source=redis&utm_medium=app&utm_campaign=redisinsight_redisearch_offer_jan',
3535
summaryText: 'RedisInsight supports RediSearch and allows you to:<br/><br/>'
3636
+ '<ul><li>Build and execute queries</li><li>Browse, analyse and export results</li></ul></br>'
3737
+ 'As a benefit you get faster turnarounds when building your application using Redis and RediSearch.',

redisinsight/ui/src/slices/cli/cli-settings.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createSlice } from '@reduxjs/toolkit'
2-
import { apiService, localStorageService, sessionStorageService } from 'uiSrc/services'
2+
import { apiService, sessionStorageService } from 'uiSrc/services'
33
import { ApiEndpoints, BrowserStorageItem } from 'uiSrc/constants'
44
import { getApiErrorMessage, getUrl, isStatusSuccessful } from 'uiSrc/utils'
55
import { CreateCliClientResponse, DeleteClientResponse } from 'apiSrc/modules/cli/dto/cli.dto'
@@ -8,6 +8,7 @@ import { AppDispatch, RootState } from '../store'
88
import { StateCliSettings } from '../interfaces/cli'
99

1010
export const initialState: StateCliSettings = {
11+
isMinimizedHelper: false,
1112
isShowHelper: false,
1213
isShowCli: false,
1314
loading: false,
@@ -35,10 +36,12 @@ const cliSettingsSlice = createSlice({
3536
},
3637
// collapse / uncollapse CLI Helper
3738
toggleCliHelper: (state) => {
38-
const isShowHelper = !state.isShowHelper
39-
state.isShowHelper = isShowHelper
40-
41-
localStorageService?.set(BrowserStorageItem.cliIsShowHelper, isShowHelper)
39+
state.isShowHelper = !state.isShowHelper
40+
state.isMinimizedHelper = !state.isMinimizedHelper
41+
},
42+
// hide / unhide CLI Helper
43+
toggleHideCliHelper: (state) => {
44+
state.isMinimizedHelper = !state.isMinimizedHelper
4245
},
4346

4447
setMatchedCommand: (state, { payload }: { payload: string }) => {
@@ -121,6 +124,7 @@ const cliSettingsSlice = createSlice({
121124
state.isShowHelper = false
122125
state.isSearching = false
123126
state.isEnteringCommand = false
127+
state.isMinimizedHelper = false
124128
state.matchedCommand = ''
125129
state.searchingCommand = ''
126130
state.searchedCommand = ''
@@ -134,6 +138,7 @@ export const {
134138
setCliSettingsInitialState,
135139
toggleCli,
136140
toggleCliHelper,
141+
toggleHideCliHelper,
137142
setMatchedCommand,
138143
setSearchedCommand,
139144
setSearchingCommand,

redisinsight/ui/src/slices/interfaces/cli.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export enum ClusterNodeRole {
1010
}
1111

1212
export interface StateCliSettings {
13+
isMinimizedHelper: boolean;
1314
isShowCli: boolean;
1415
isShowHelper: boolean;
1516
cliClientUuid: string;

redisinsight/ui/src/slices/tests/cli/cli-settings.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ describe('cliSettings slice', () => {
4848
const state: typeof initialState = {
4949
...initialState,
5050
isShowHelper: false,
51+
isMinimizedHelper: false,
5152
}
5253

5354
expect(cliSettingsSelector(initialStateDefault)).toEqual(state)
@@ -58,6 +59,7 @@ describe('cliSettings slice', () => {
5859
const state: typeof initialState = {
5960
...initialState,
6061
isShowHelper: true,
62+
isMinimizedHelper: true,
6163
}
6264

6365
// Act
@@ -79,6 +81,7 @@ describe('cliSettings slice', () => {
7981
const state: typeof initialState = {
8082
...initialState,
8183
isShowCli: true,
84+
isMinimizedHelper: false,
8285
}
8386

8487
// Act
@@ -95,7 +98,7 @@ describe('cliSettings slice', () => {
9598
})
9699

97100
describe('setMatchedCommand', () => {
98-
it('should properly set !isShowCli', () => {
101+
it('should properly set matchedCommand', () => {
99102
// Arrange
100103
const matchedCommand = 'get'
101104
const state: typeof initialState = {
@@ -117,7 +120,7 @@ describe('cliSettings slice', () => {
117120
})
118121

119122
describe('setCliEnteringCommand', () => {
120-
it('should properly set !isShowCli', () => {
123+
it('should properly set isEnteringCommand = true', () => {
121124
// Arrange
122125
const state: typeof initialState = {
123126
...initialState,
@@ -281,6 +284,7 @@ describe('cliSettings slice', () => {
281284
isShowHelper: true,
282285
isSearching: true,
283286
isEnteringCommand: true,
287+
isMinimizedHelper: true,
284288
matchedCommand: '123',
285289
searchingCommand: '123',
286290
searchedCommand: '123',
@@ -292,6 +296,7 @@ describe('cliSettings slice', () => {
292296
isShowHelper: false,
293297
isSearching: false,
294298
isEnteringCommand: false,
299+
isMinimizedHelper: false,
295300
matchedCommand: '',
296301
searchingCommand: '',
297302
searchedCommand: '',

redisinsight/ui/src/styles/themes/dark_theme/_dark_theme.lazy.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
--moduleBackgroundColor: #{$commandGroupBadgeColor};
110110
--callOutBackgroundColor: #{$euiTooltipBackgroundColor};
111111

112+
--overlayPromoNYColor: #{$overlayPromoNYColor};
113+
112114
// KeyTypes
113115
--typeHashColor: #{$typeHashColor};
114116
--typeListColor: #{$typeListColor};

0 commit comments

Comments
 (0)