From a91a07a38fef8ec997018c7584bcfeed0eb192d2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:47:33 +0200 Subject: [PATCH] Restyled by prettier (#7212) Co-authored-by: Restyled.io --- client/app/components/BeaconConsent.jsx | 5 +++-- client/app/components/HelpTrigger.jsx | 21 +++++++++++-------- client/app/pages/home/Home.jsx | 7 ++++--- .../GeneralSettings/BeaconConsentSettings.jsx | 6 ++++-- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/client/app/components/BeaconConsent.jsx b/client/app/components/BeaconConsent.jsx index fea8d4cce1..4da6337de9 100644 --- a/client/app/components/BeaconConsent.jsx +++ b/client/app/components/BeaconConsent.jsx @@ -22,7 +22,7 @@ function BeaconConsent() { setHide(true); }; - const confirmConsent = confirm => { + const confirmConsent = (confirm) => { let message = "🙏 Thank you."; if (!confirm) { @@ -47,7 +47,8 @@ function BeaconConsent() { } - bordered={false}> + bordered={false} + > Help Redash improve by automatically sending anonymous usage data:
    diff --git a/client/app/components/HelpTrigger.jsx b/client/app/components/HelpTrigger.jsx index 8d0a779dfb..b0833e3d70 100644 --- a/client/app/components/HelpTrigger.jsx +++ b/client/app/components/HelpTrigger.jsx @@ -101,7 +101,7 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName clearTimeout(this.iframeLoadingTimeout); } - loadIframe = url => { + loadIframe = (url) => { clearTimeout(this.iframeLoadingTimeout); this.setState({ loading: true, error: false }); @@ -116,8 +116,8 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName clearTimeout(this.iframeLoadingTimeout); }; - onPostMessageReceived = event => { - if (!some(allowedDomains, domain => startsWith(event.origin, domain))) { + onPostMessageReceived = (event) => { + if (!some(allowedDomains, (domain) => startsWith(event.origin, domain))) { return; } @@ -134,7 +134,7 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName return helpTriggerType ? helpTriggerType[0] : this.props.href; }; - openDrawer = e => { + openDrawer = (e) => { // keep "open in new tab" behavior if (!e.shiftKey && !e.ctrlKey && !e.metaKey) { e.preventDefault(); @@ -144,7 +144,7 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName } }; - closeDrawer = event => { + closeDrawer = (event) => { if (event) { event.preventDefault(); } @@ -161,7 +161,7 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName const tooltip = get(types, `${this.props.type}[1]`, this.props.title); const className = cx("help-trigger", this.props.className); const url = this.state.currentUrl; - const isAllowedDomain = some(allowedDomains, domain => startsWith(url || targetUrl, domain)); + const isAllowedDomain = some(allowedDomains, (domain) => startsWith(url || targetUrl, domain)); const shouldRenderAsLink = this.props.renderAsLink || !isAllowedDomain; return ( @@ -180,13 +180,15 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName )} ) : null - }> + } + > {} : this.openDrawer}> + onClick={shouldRenderAsLink ? () => {} : this.openDrawer} + > {this.props.children} @@ -197,7 +199,8 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName visible={this.state.visible} className={cx("help-drawer", drawerClassName)} destroyOnClose - width={400}> + width={400} + >
    {url && ( diff --git a/client/app/pages/home/Home.jsx b/client/app/pages/home/Home.jsx index c6f55d646d..530e1e4963 100644 --- a/client/app/pages/home/Home.jsx +++ b/client/app/pages/home/Home.jsx @@ -31,7 +31,8 @@ function DeprecatedEmbedFeatureAlert() { + rel="noopener noreferrer" + > Read more . @@ -43,7 +44,7 @@ function DeprecatedEmbedFeatureAlert() { function EmailNotVerifiedAlert() { const verifyEmail = () => { - axios.post("verification_email/").then(data => { + axios.post("verification_email/").then((data) => { notification.success(data.message); }); }; @@ -100,6 +101,6 @@ routes.register( routeWithUserSession({ path: "/", title: "Redash", - render: pageProps => , + render: (pageProps) => , }) ); diff --git a/client/app/pages/settings/components/GeneralSettings/BeaconConsentSettings.jsx b/client/app/pages/settings/components/GeneralSettings/BeaconConsentSettings.jsx index 9dd998f4ff..d56487ebff 100644 --- a/client/app/pages/settings/components/GeneralSettings/BeaconConsentSettings.jsx +++ b/client/app/pages/settings/components/GeneralSettings/BeaconConsentSettings.jsx @@ -17,14 +17,16 @@ export default function BeaconConsentSettings(props) { Anonymous Usage Data Sharing - }> + } + > {loading ? ( ) : ( onChange({ beacon_consent: e.target.checked })}> + onChange={(e) => onChange({ beacon_consent: e.target.checked })} + > Help Redash improve by automatically sending anonymous usage data )}