Skip to content

Commit ebcec24

Browse files
Merge pull request #160 from RedisInsight/main
a new release candidate
2 parents e693118 + fa77bcb commit ebcec24

File tree

16 files changed

+54
-21
lines changed

16 files changed

+54
-21
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/AddInstanceControls.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const AddInstanceControls = ({ onAddInstance, direction, welcomePage = false }:
6666
HELP_LINKS.createRedisCloud.event,
6767
{ source: HELP_LINKS.createRedisCloud.sources[welcomePage ? 'welcome' : 'databaseList'] }
6868
)}
69+
data-testid="promo-btn"
6970
>
7071
<EuiText className={styles.createTitle}>
7172
{HELP_LINKS.createRedisCloud.label}

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/home/constants/help-links.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export enum HelpLink {
1010
export const HELP_LINKS = {
1111
[HelpLink.CreateRedisCloud]: {
1212
label: 'Limited offer: Up to 6 months free with $200 credits.',
13-
link: 'https://redis.com/try-free/?utm_source=redis&utm_medium=app&utm_campaign=redisinsight',
13+
link: 'https://redis.com/try-free/?utm_source=redis&utm_medium=app&utm_campaign=redisinsight_offer_jan',
1414
event: TelemetryEvent.CREATE_FREE_CLOUD_DATABASE_CLICKED,
1515
sources: {
1616
welcome: 'Welcome page',

redisinsight/ui/src/pages/workbench/components/module-not-loaded/ModuleNotLoaded.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ const ModuleNotLoaded = ({ content = {} }: Props) => {
8080
HELP_LINKS.createRedisCloud.event,
8181
{ source: HELP_LINKS.createRedisCloud.sources.redisearch }
8282
)}
83+
data-testid="promo-btn"
8384
>
8485
<EuiText className={styles.createTitle}>
8586
{HELP_LINKS.createRedisCloud.label}

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_redisearch',
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,

0 commit comments

Comments
 (0)