@@ -12,7 +12,9 @@ import {
12
12
EuiToolTip ,
13
13
EuiForm ,
14
14
EuiHorizontalRule ,
15
+ EuiCallOut ,
15
16
} from '@elastic/eui'
17
+ import cx from 'classnames'
16
18
import parse from 'html-react-parser'
17
19
18
20
import { compareConsents } from 'uiSrc/utils'
@@ -149,34 +151,38 @@ const ConsentsSettings = ({ liveEditMode = false }: Props) => {
149
151
150
152
return (
151
153
< EuiForm component = "form" onSubmit = { formik . handleSubmit } data-testid = "consents-settings-form" >
152
- { ! ! nonRequiredConsents . length && (
153
- < >
154
- < EuiSpacer size = "s" />
155
- < EuiText size = "s" color = "subdued" >
156
- To improve your experience, we use third party tools in RedisInsight. All data collected
157
- are completely anonymized, but we will not use these data for any purpose that you do
158
- not consent to.
159
- </ EuiText >
160
- < EuiSpacer size = "xl" />
161
- </ >
162
- ) }
163
- {
164
- nonRequiredConsents
165
- . map ( ( consent : IConsent ) => renderConsentOption ( consent , nonRequiredConsents . length > 1 ) )
166
- }
167
-
168
- { ! liveEditMode && (
169
- < >
170
- < EuiText size = "s" color = "subdued" >
171
- While adding new plugins for Workbench, use files only from trusted authors
172
- to avoid automatic execution of malicious code.
173
- </ EuiText >
174
- < EuiHorizontalRule margin = "l" />
175
- </ >
176
- ) }
177
-
154
+ < div className = { styles . consentsWrapper } >
155
+ { ! ! nonRequiredConsents . length && (
156
+ < >
157
+ < EuiSpacer size = "s" />
158
+ < EuiText size = "s" color = "subdued" >
159
+ To improve your experience, we use third party tools in RedisInsight. All data collected
160
+ are completely anonymized, but we will not use these data for any purpose that you do
161
+ not consent to.
162
+ </ EuiText >
163
+ < EuiSpacer size = "xl" />
164
+ </ >
165
+ ) }
166
+ {
167
+ nonRequiredConsents
168
+ . map ( ( consent : IConsent ) => renderConsentOption ( consent , nonRequiredConsents . length > 1 ) )
169
+ }
170
+
171
+ { ! liveEditMode && (
172
+ < >
173
+ < EuiCallOut >
174
+ < EuiText size = "s" >
175
+ While adding new visualization plugins, use files only from trusted authors
176
+ to avoid automatic execution of malicious code.
177
+ </ EuiText >
178
+ </ EuiCallOut >
179
+ < EuiHorizontalRule margin = "l" className = { cx ( { [ styles . pluginWarningHR ] : ! ! requiredConsents . length } ) } />
180
+ </ >
181
+ ) }
182
+ </ div >
178
183
{ ! ! requiredConsents . length && (
179
184
< >
185
+ < EuiSpacer size = "l" />
180
186
< EuiText color = "subdued" size = "s" >
181
187
To use RedisInsight, please accept the terms and conditions:
182
188
</ EuiText >
@@ -185,39 +191,42 @@ const ConsentsSettings = ({ liveEditMode = false }: Props) => {
185
191
) }
186
192
187
193
{ requiredConsents . map ( ( consent : IConsent ) => renderConsentOption ( consent ) ) }
194
+
188
195
{ ! liveEditMode && (
189
- < EuiFlexGroup justifyContent = "flexEnd" responsive = { false } >
190
- < EuiSpacer size = "l" />
191
- < EuiFlexItem grow = { false } >
192
- < EuiToolTip
193
- position = "top"
194
- anchorClassName = "euiToolTip__btn-disabled"
195
- content = {
196
- submitIsDisabled ( ) ? (
197
- < span className = "euiToolTip__content" >
198
- { Object . values ( errors ) . map ( ( err ) => [
199
- spec ?. agreements [ err as string ] ?. requiredText ,
200
- < br key = { err } /> ,
201
- ] ) }
202
- </ span >
203
- ) : null
204
- }
205
- >
206
- < EuiButton
207
- fill
208
- color = "secondary"
209
- className = "btn-add"
210
- type = "submit"
211
- onClick = { ( ) => { } }
212
- disabled = { submitIsDisabled ( ) }
213
- iconType = { submitIsDisabled ( ) ? 'iInCircle' : undefined }
214
- data-testid = "btn-submit"
196
+ < >
197
+ { ! requiredConsents . length && ( < EuiSpacer size = "l" /> ) }
198
+ < EuiFlexGroup justifyContent = "flexEnd" responsive = { false } >
199
+ < EuiFlexItem grow = { false } >
200
+ < EuiToolTip
201
+ position = "top"
202
+ anchorClassName = "euiToolTip__btn-disabled"
203
+ content = {
204
+ submitIsDisabled ( ) ? (
205
+ < span className = "euiToolTip__content" >
206
+ { Object . values ( errors ) . map ( ( err ) => [
207
+ spec ?. agreements [ err as string ] ?. requiredText ,
208
+ < br key = { err } /> ,
209
+ ] ) }
210
+ </ span >
211
+ ) : null
212
+ }
215
213
>
216
- Submit
217
- </ EuiButton >
218
- </ EuiToolTip >
219
- </ EuiFlexItem >
220
- </ EuiFlexGroup >
214
+ < EuiButton
215
+ fill
216
+ color = "secondary"
217
+ className = "btn-add"
218
+ type = "submit"
219
+ onClick = { ( ) => { } }
220
+ disabled = { submitIsDisabled ( ) }
221
+ iconType = { submitIsDisabled ( ) ? 'iInCircle' : undefined }
222
+ data-testid = "btn-submit"
223
+ >
224
+ Submit
225
+ </ EuiButton >
226
+ </ EuiToolTip >
227
+ </ EuiFlexItem >
228
+ </ EuiFlexGroup >
229
+ </ >
221
230
) }
222
231
</ EuiForm >
223
232
)
0 commit comments