Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import {
EuiToolTip,
EuiForm,
EuiHorizontalRule,
EuiCallOut,
} from '@elastic/eui'
import cx from 'classnames'
import parse from 'html-react-parser'

import { compareConsents } from 'uiSrc/utils'
Expand Down Expand Up @@ -149,34 +151,38 @@ const ConsentsSettings = ({ liveEditMode = false }: Props) => {

return (
<EuiForm component="form" onSubmit={formik.handleSubmit} data-testid="consents-settings-form">
{!!nonRequiredConsents.length && (
<>
<EuiSpacer size="s" />
<EuiText size="s" color="subdued">
To improve your experience, we use third party tools in RedisInsight. All data collected
are completely anonymized, but we will not use these data for any purpose that you do
not consent to.
</EuiText>
<EuiSpacer size="xl" />
</>
)}
{
nonRequiredConsents
.map((consent: IConsent) => renderConsentOption(consent, nonRequiredConsents.length > 1))
}

{!liveEditMode && (
<>
<EuiText size="s" color="subdued">
While adding new plugins for Workbench, use files only from trusted authors
to avoid automatic execution of malicious code.
</EuiText>
<EuiHorizontalRule margin="l" />
</>
)}

<div className={styles.consentsWrapper}>
{!!nonRequiredConsents.length && (
<>
<EuiSpacer size="s" />
<EuiText size="s" color="subdued">
To improve your experience, we use third party tools in RedisInsight. All data collected
are completely anonymized, but we will not use these data for any purpose that you do
not consent to.
</EuiText>
<EuiSpacer size="xl" />
</>
)}
{
nonRequiredConsents
.map((consent: IConsent) => renderConsentOption(consent, nonRequiredConsents.length > 1))
}

{!liveEditMode && (
<>
<EuiCallOut>
<EuiText size="s">
While adding new visualization plugins, use files only from trusted authors
to avoid automatic execution of malicious code.
</EuiText>
</EuiCallOut>
<EuiHorizontalRule margin="l" className={cx({ [styles.pluginWarningHR]: !!requiredConsents.length })} />
</>
)}
</div>
{!!requiredConsents.length && (
<>
<EuiSpacer size="l" />
<EuiText color="subdued" size="s">
To use RedisInsight, please accept the terms and conditions:
</EuiText>
Expand All @@ -185,39 +191,42 @@ const ConsentsSettings = ({ liveEditMode = false }: Props) => {
)}

{requiredConsents.map((consent: IConsent) => renderConsentOption(consent))}

{!liveEditMode && (
<EuiFlexGroup justifyContent="flexEnd" responsive={false}>
<EuiSpacer size="l" />
<EuiFlexItem grow={false}>
<EuiToolTip
position="top"
anchorClassName="euiToolTip__btn-disabled"
content={
submitIsDisabled() ? (
<span className="euiToolTip__content">
{Object.values(errors).map((err) => [
spec?.agreements[err as string]?.requiredText,
<br key={err} />,
])}
</span>
) : null
}
>
<EuiButton
fill
color="secondary"
className="btn-add"
type="submit"
onClick={() => {}}
disabled={submitIsDisabled()}
iconType={submitIsDisabled() ? 'iInCircle' : undefined}
data-testid="btn-submit"
<>
{!requiredConsents.length && (<EuiSpacer size="l" />)}
<EuiFlexGroup justifyContent="flexEnd" responsive={false}>
<EuiFlexItem grow={false}>
<EuiToolTip
position="top"
anchorClassName="euiToolTip__btn-disabled"
content={
submitIsDisabled() ? (
<span className="euiToolTip__content">
{Object.values(errors).map((err) => [
spec?.agreements[err as string]?.requiredText,
<br key={err} />,
])}
</span>
) : null
}
>
Submit
</EuiButton>
</EuiToolTip>
</EuiFlexItem>
</EuiFlexGroup>
<EuiButton
fill
color="secondary"
className="btn-add"
type="submit"
onClick={() => {}}
disabled={submitIsDisabled()}
iconType={submitIsDisabled() ? 'iInCircle' : undefined}
data-testid="btn-submit"
>
Submit
</EuiButton>
</EuiToolTip>
</EuiFlexItem>
</EuiFlexGroup>
</>
)}
</EuiForm>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiTitle,
EuiSpacer,
EuiText,
} from '@elastic/eui'

import { Theme } from 'uiSrc/constants'
Expand All @@ -35,7 +33,12 @@ const ConsentsSettingsPopup = () => {
<EuiOverlayMask>
<EuiModal className={styles.consentsPopup} onClose={() => {}} data-testid="consents-settings-popup">
<EuiModalHeader className={styles.modalHeader}>
<EuiFlexGroup justifyContent="flexEnd">
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<EuiTitle size="s">
<h3 className={styles.consentsPopupTitle}>EULA and Privacy Settings</h3>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiIcon
className={styles.redisIcon}
Expand All @@ -46,11 +49,6 @@ const ConsentsSettingsPopup = () => {
</EuiFlexGroup>
</EuiModalHeader>
<EuiModalBody>
<EuiTitle size="xs">
<EuiText className={styles.consentsPopupTitle}>EULA and Privacy Settings</EuiText>
</EuiTitle>
<EuiSpacer size="xl" />

<ConsentsSettings />
</EuiModalBody>
</EuiModal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@import '@elastic/eui/src/global_styling/mixins/helpers';
@import '@elastic/eui/src/global_styling/index';

.redisIcon {
width: 140px;
height: auto;
Expand All @@ -13,6 +16,9 @@
.euiModal__closeIcon {
display: none;
}
.euiModal__flex {
max-height: 84vh !important;
}
}

a {
Expand All @@ -28,9 +34,21 @@
padding-bottom: 4px;
}

.consentsWrapper {
@include euiScrollBar;
overflow-x: hidden;
overflow-y: auto;
max-height: calc(84vh - 260px);
}

.pluginWarningHR {
margin-bottom: 0 !important;
}

.consentsPopupTitle {
color: var(--euiTextSubduedColorHover);
font-weight: 500 !important;
font-size: 18px !important;
}

.switchOption {
Expand Down
4 changes: 4 additions & 0 deletions redisinsight/ui/src/styles/base/_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@
margin-bottom: 0 !important;
}
}

.euiOverlayMask {
padding-bottom: 0 !important;
}
11 changes: 11 additions & 0 deletions redisinsight/ui/src/styles/components/_callout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.euiCallOut {
padding: 12px 24px !important;
&--primary {
background-color: var(--euiTooltipBackgroundColor) !important;
border-color: var(--euiColorPrimary) !important;
.euiText {
color: var(--euiTooltipTextColor) !important;
line-height: 24px;
}
}
}
1 change: 1 addition & 0 deletions redisinsight/ui/src/styles/components/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
@import 'resizable_container';
@import 'database';
@import 'switch';
@import "callout";