Skip to content

Commit 042ac17

Browse files
Merge pull request #151 from RedisInsight/feature/RI-2218_New_year_promo
#RI-2218 - Add information about limited time offer
2 parents 6878560 + f48b236 commit 042ac17

File tree

11 files changed

+174
-91
lines changed

11 files changed

+174
-91
lines changed

redisinsight/splash.html

Lines changed: 9 additions & 25 deletions
Large diffs are not rendered by default.
24.9 KB
Loading

redisinsight/ui/src/pages/home/HomePage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,12 @@ const HomePage = () => {
188188
{(resizeRef) => (
189189
<EuiPage>
190190
<EuiPageBody component="div">
191-
<AddInstanceControls key="instance-controls" onAddInstance={handleAddInstance} direction={Direction.row} />
191+
<AddInstanceControls
192+
key="instance-controls"
193+
onAddInstance={handleAddInstance}
194+
direction={Direction.row}
195+
welcomePage={!instances.length}
196+
/>
192197
{dialogIsOpen ? (
193198
<div key="homePage" className="homePage">
194199
<EuiResizableContainer style={{ height: '100%' }}>

redisinsight/ui/src/pages/home/components/AddInstanceControls/AddInstanceControls.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,23 @@ export enum Direction {
2424
interface Props {
2525
onAddInstance: () => void;
2626
direction: Direction;
27+
welcomePage?: boolean;
2728
}
2829

29-
const AddInstanceControls = ({ onAddInstance, direction }: Props) => {
30+
const AddInstanceControls = ({ onAddInstance, direction, welcomePage = false }: Props) => {
3031
const handleOnAddDatabase = () => {
3132
sendEventTelemetry({
3233
event: TelemetryEvent.CONFIG_DATABASES_CLICKED,
3334
})
3435
onAddInstance()
3536
}
3637

37-
const handleClickLink = (event: TelemetryEvent) => {
38+
const handleClickLink = (event: TelemetryEvent, eventData: any = {}) => {
3839
sendEventTelemetry({
3940
event,
41+
eventData: {
42+
...eventData
43+
}
4044
})
4145
}
4246

@@ -58,13 +62,16 @@ const AddInstanceControls = ({ onAddInstance, direction }: Props) => {
5862
href={HELP_LINKS.createRedisCloud.link}
5963
target="_blank"
6064
rel="noreferrer"
61-
onClick={() => handleClickLink(HELP_LINKS.createRedisCloud.event)}
65+
onClick={() => handleClickLink(
66+
HELP_LINKS.createRedisCloud.event,
67+
{ source: HELP_LINKS.createRedisCloud.sources[welcomePage ? 'welcome' : 'databaseList'] }
68+
)}
6269
>
6370
<EuiText className={styles.createTitle}>
6471
{HELP_LINKS.createRedisCloud.label}
6572
</EuiText>
6673
<EuiText className={styles.createText}>
67-
Free managed database up to 30MB, with modules support.
74+
Try Redis Cloud with enhanced database capabilities.
6875
</EuiText>
6976
<EuiIcon type="arrowRight" size="m" className={styles.arrowRight} />
7077
</a>

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

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,65 @@
2222
}
2323
}
2424

25+
.arrowRight {
26+
display: block !important;
27+
position: absolute;
28+
right: 14px;
29+
top: calc(50% - 11px);
30+
color: #ffffff;
31+
width: 20px;
32+
height: 20px;
33+
}
34+
2535
.createBtn {
2636
border: 2px solid var(--euiColorSecondary);
2737
padding: 9px 24px;
38+
letter-spacing: normal;
2839
border-radius: 4px;
2940
text-align: left;
3041
position: relative;
42+
width: 413px;
43+
height: 64px;
44+
padding-right: 40px;
45+
46+
&::before {
47+
content: '';
48+
position: absolute;
49+
top: 0px;
50+
right: 0px;
51+
bottom: 0px;
52+
left: 0px;
53+
opacity: .9;
54+
background: url(../../../../assets/img/NYbg.jpg) center;
55+
background-size: cover;
56+
}
57+
3158
&:hover {
3259
transform: translateY(-1px);
3360
}
34-
}
3561

36-
.createTitle {
37-
padding-top: 0;
38-
color: var(--euiTextColor) !important;
39-
line-height: 16px;
40-
}
62+
.createTitle {
63+
padding-top: 3px;
64+
line-height: 16px;
65+
color: #ffffff !important;
66+
position: relative;
67+
font-weight: 500 !important;
68+
}
4169

42-
.createText {
43-
font-size: 12px !important;
44-
color: var(--euiTextColor) !important;
45-
opacity: 0.7;
46-
margin-top: -3px;
70+
.createText {
71+
font-size: 12px !important;
72+
color: #ffffff !important;
73+
position: relative;
74+
}
75+
76+
.arrowRight {
77+
position: absolute;
78+
right: 14px;
79+
top: calc(50% - 11px);
80+
color: #ffffff;
81+
width: 20px;
82+
height: 20px;
83+
}
4784
}
4885

4986
.followText {
@@ -83,39 +120,7 @@
83120
}
84121
}
85122

86-
.arrowRight {
87-
display: none !important;
88-
}
89-
90123
.containerDl {
91-
92-
.arrowRight {
93-
display: block !important;
94-
position: absolute;
95-
right: 14px;
96-
top: calc(50% - 11px);
97-
color: var(--euiTextColor);
98-
width: 20px;
99-
height: 20px;
100-
}
101-
102-
.createBtn {
103-
height: 64px;
104-
padding-right: 40px;
105-
letter-spacing: normal;
106-
width: 412px;
107-
}
108-
109-
.createTitle {
110-
margin-top: -1px;
111-
padding-top: 0;
112-
font-weight: 500;
113-
}
114-
115-
.createText {
116-
margin-top: -5px;
117-
}
118-
119124
.links {
120125
max-width: 330px;
121126
display: none;

redisinsight/ui/src/pages/home/components/WelcomeComponent/WelcomeComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const Welcome = ({ onAddInstance }: Props) => {
6969

7070
<div className={styles.controls}>
7171
<AddInstanceControls
72+
welcomePage
7273
onAddInstance={onAddInstance}
7374
direction={Direction.column}
7475
/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
.controls {
3030
margin: 7vh auto 0;
31-
max-width: 390px;
31+
max-width: 414px;
3232
}
3333

3434
.logo {

redisinsight/ui/src/pages/home/constants/help-links.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ export enum HelpLink {
99

1010
export const HELP_LINKS = {
1111
[HelpLink.CreateRedisCloud]: {
12-
label: 'Create a free Redis Database on Redis Cloud',
12+
label: 'Limited offer: Up to 6 months free with $200 credits.',
1313
link: 'https://redis.com/try-free/?utm_source=redis&utm_medium=app&utm_campaign=redisinsight',
14-
event: TelemetryEvent.CONFIG_DATABASES_GET_REDIS_CLOUD_ACCOUNT_CLICKED
14+
event: TelemetryEvent.CREATE_FREE_CLOUD_DATABASE_CLICKED,
15+
sources: {
16+
welcome: 'Welcome page',
17+
databaseList: 'My Redis databases',
18+
redisearch: 'RediSearch is not loaded'
19+
}
1520
},
1621
[HelpLink.BuildRedisFromSource]: {
1722
label: 'Build from source',

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

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
import React, { useContext } from 'react'
22
import cx from 'classnames'
33
import {
4-
EuiBasicTableColumn, EuiButton,
5-
EuiFlexGroup, EuiFlexItem, EuiIcon, EuiInMemoryTable, EuiTextColor
4+
EuiBasicTableColumn,
5+
EuiFlexGroup,
6+
EuiFlexItem,
7+
EuiIcon,
8+
EuiInMemoryTable,
9+
EuiText,
10+
EuiTextColor,
611
} from '@elastic/eui'
712
import parse from 'html-react-parser'
813

914
import { ThemeContext } from 'uiSrc/contexts/themeContext'
1015
import { Theme } from 'uiSrc/constants'
16+
import { HELP_LINKS } from 'uiSrc/pages/home/constants/help-links'
17+
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
1118
import styles from './styles.module.scss'
1219

1320
interface IContentColumn {
@@ -54,6 +61,36 @@ const ModuleNotLoaded = ({ content = {} }: Props) => {
5461

5562
const item = columns.reduce((obj, { text }, i) => ({ ...obj, [`text${i}`]: text }), {})
5663

64+
const handleClickLink = (event: TelemetryEvent, eventData: any = {}) => {
65+
sendEventTelemetry({
66+
event,
67+
eventData: {
68+
...eventData
69+
}
70+
})
71+
}
72+
73+
const CreateCloudBtn = () => (
74+
<a
75+
className={styles.createCloudBtn}
76+
href={createCloudBtnHref}
77+
target="_blank"
78+
rel="noreferrer"
79+
onClick={() => handleClickLink(
80+
HELP_LINKS.createRedisCloud.event,
81+
{ source: HELP_LINKS.createRedisCloud.sources.redisearch }
82+
)}
83+
>
84+
<EuiText className={styles.createTitle}>
85+
{HELP_LINKS.createRedisCloud.label}
86+
</EuiText>
87+
<EuiText className={styles.createText}>
88+
Try Redis Cloud with enhanced database capabilities.
89+
</EuiText>
90+
<EuiIcon type="arrowRight" size="m" className={styles.arrowRight} />
91+
</a>
92+
)
93+
5794
return (
5895
<div className={cx(styles.container)}>
5996
<EuiFlexGroup direction="column" gutterSize="s">
@@ -79,17 +116,7 @@ const ModuleNotLoaded = ({ content = {} }: Props) => {
79116
)}
80117
{!!createCloudBtnText && (
81118
<EuiFlexItem grow={false} data-testid="query-card-no-module-button">
82-
<EuiButton
83-
fill
84-
size="s"
85-
color="secondary"
86-
fullWidth={false}
87-
className={cx(styles.createCloudBtn)}
88-
href={createCloudBtnHref}
89-
target="_blank"
90-
>
91-
{createCloudBtnText}
92-
</EuiButton>
119+
<CreateCloudBtn />
93120
</EuiFlexItem>
94121
) }
95122
{(!!summaryText || !!summaryImgPath || !!summaryImgDark || !!summaryImgLight) && (

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

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,56 @@
4343
}
4444

4545
.createCloudBtn {
46-
margin: 16px 0;
47-
max-width: 420px !important;
46+
border: 2px solid var(--euiColorSecondary);
47+
padding: 9px 24px;
48+
margin: 20px 0;
49+
letter-spacing: normal;
50+
border-radius: 4px;
51+
text-align: left;
52+
position: relative;
53+
width: 413px;
54+
height: 64px;
55+
padding-right: 40px;
56+
57+
&::before {
58+
content: '';
59+
position: absolute;
60+
top: 0px;
61+
right: 0px;
62+
bottom: 0px;
63+
left: 0px;
64+
opacity: .9;
65+
background: url(../../../../assets/img/NYbg.jpg) center;
66+
background-size: cover;
67+
}
68+
69+
&:hover {
70+
transform: translateY(-1px);
71+
}
72+
73+
.createTitle {
74+
padding-top: 3px;
75+
line-height: 16px;
76+
color: #ffffff !important;
77+
position: relative;
78+
font-weight: 500 !important;
79+
}
80+
81+
.createText {
82+
font-size: 12px !important;
83+
color: #ffffff !important;
84+
position: relative;
85+
}
86+
87+
.arrowRight {
88+
display: block;
89+
position: absolute;
90+
right: 14px;
91+
top: calc(50% - 11px);
92+
color: #ffffff;
93+
width: 20px;
94+
height: 20px;
95+
}
4896
}
4997

5098

0 commit comments

Comments
 (0)