-
Notifications
You must be signed in to change notification settings - Fork 415
RI-7091 - add an environment variable to skip the eula screen #4556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
d4fbc46
8bcf860
1f4c2ed
d3c1162
a860059
f90bf2b
b0cc6e1
93dc680
e760827
40cc42a
244e662
f21c056
ea8948a
d07defd
3d1bcbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||
| import React from 'react' | ||||||
| import { EuiSwitch, EuiText } from '@elastic/eui' | ||||||
| import { EuiLink, EuiSwitch, EuiText } from '@elastic/eui' | ||||||
| import parse from 'html-react-parser' | ||||||
|
|
||||||
| import { FlexItem, Row } from 'uiSrc/components/base/layout/flex' | ||||||
|
|
@@ -14,6 +14,7 @@ interface Props { | |||||
| checked: boolean | ||||||
| isSettingsPage?: boolean | ||||||
| withoutSpacer?: boolean | ||||||
| linkToPrivacyPolicy?: boolean | ||||||
| } | ||||||
|
|
||||||
| const ConsentOption = (props: Props) => { | ||||||
|
|
@@ -23,7 +24,27 @@ const ConsentOption = (props: Props) => { | |||||
| checked, | ||||||
| isSettingsPage = false, | ||||||
| withoutSpacer = false, | ||||||
| linkToPrivacyPolicy = false, | ||||||
| } = props | ||||||
|
|
||||||
| const getText = () => ( | ||||||
| <> | ||||||
| {consent.description && parse(consent.description)} | ||||||
| {linkToPrivacyPolicy && ( | ||||||
| <> | ||||||
| <EuiLink | ||||||
| external={false} | ||||||
| target="_blank" | ||||||
| href="https://redis.io/legal/privacy-policy/?utm_source=redisinsight&utm_medium=app&utm_campaign=telemetry" | ||||||
| > | ||||||
| Privacy Policy | ||||||
| </EuiLink> | ||||||
| . | ||||||
| </> | ||||||
| )} | ||||||
| </> | ||||||
| ) | ||||||
|
|
||||||
| return ( | ||||||
| <FlexItem key={consent.agreementName} grow> | ||||||
| {isSettingsPage && consent.description && ( | ||||||
|
|
@@ -34,7 +55,7 @@ const ConsentOption = (props: Props) => { | |||||
| color="subdued" | ||||||
| style={{ marginTop: '12px' }} | ||||||
| > | ||||||
| {parse(consent.description)} | ||||||
| {getText()} | ||||||
|
||||||
| {getText()} | |
| <ItemDescription description={consent.description && parse(consent.description)} withLink={linkToPrivacyPolicy} /> |
and can define the component outside ConsentOption
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a more React way. However I am not sure creating a component that will be used only in this case and prop drill it with the data from the parent one is optimal either.
Is there another benefit of not having a function call, other than sticking to jsx?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @KrumTy suggestion
Honestly can't figure out a major benefit, but the produced code looks better and simpler, and maybe the most important part - generally sets the tone to not use it, especially on places where some things can be reused or simplified 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the produced code looks better and simpler, and maybe the most important part - generally sets the tone to not use it, especially on places where some things can be reused or simplified
I am not sure how the code looks better and simpler, but also sets the tone of not using it. This seems like a contradiction.
Anyway, I replaced a function call with 2 separate files and a folder. Even has an index.tsx to re-export it to follow all React patterns.
Uh oh!
There was an error while loading. Please reload this page.