-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring back version check & beacon reporting (#7211)
Co-authored-by: Restyled.io <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
49277d2
commit 349cd5d
Showing
17 changed files
with
324 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React, { useState } from "react"; | ||
import Card from "antd/lib/card"; | ||
import Button from "antd/lib/button"; | ||
import Typography from "antd/lib/typography"; | ||
import { clientConfig } from "@/services/auth"; | ||
import Link from "@/components/Link"; | ||
import HelpTrigger from "@/components/HelpTrigger"; | ||
import DynamicComponent from "@/components/DynamicComponent"; | ||
import OrgSettings from "@/services/organizationSettings"; | ||
|
||
const Text = Typography.Text; | ||
|
||
function BeaconConsent() { | ||
const [hide, setHide] = useState(false); | ||
|
||
if (!clientConfig.showBeaconConsentMessage || hide) { | ||
return null; | ||
} | ||
|
||
const hideConsentCard = () => { | ||
clientConfig.showBeaconConsentMessage = false; | ||
setHide(true); | ||
}; | ||
|
||
const confirmConsent = (confirm) => { | ||
let message = "🙏 Thank you."; | ||
|
||
if (!confirm) { | ||
message = "Settings Saved."; | ||
} | ||
|
||
OrgSettings.save({ beacon_consent: confirm }, message) | ||
// .then(() => { | ||
// // const settings = get(response, 'settings'); | ||
// // this.setState({ settings, formValues: { ...settings } }); | ||
// }) | ||
.finally(hideConsentCard); | ||
}; | ||
|
||
return ( | ||
<DynamicComponent name="BeaconConsent"> | ||
<div className="m-t-10 tiled"> | ||
<Card | ||
title={ | ||
<> | ||
Would you be ok with sharing anonymous usage data with the Redash team?{" "} | ||
<HelpTrigger type="USAGE_DATA_SHARING" /> | ||
</> | ||
} | ||
bordered={false} | ||
> | ||
<Text>Help Redash improve by automatically sending anonymous usage data:</Text> | ||
<div className="m-t-5"> | ||
<ul> | ||
<li> Number of users, queries, dashboards, alerts, widgets and visualizations.</li> | ||
<li> Types of data sources, alert destinations and visualizations.</li> | ||
</ul> | ||
</div> | ||
<Text>All data is aggregated and will never include any sensitive or private data.</Text> | ||
<div className="m-t-5"> | ||
<Button type="primary" className="m-r-5" onClick={() => confirmConsent(true)}> | ||
Yes | ||
</Button> | ||
<Button type="default" onClick={() => confirmConsent(false)}> | ||
No | ||
</Button> | ||
</div> | ||
<div className="m-t-15"> | ||
<Text type="secondary"> | ||
You can change this setting anytime from the <Link href="settings/general">Settings</Link> page. | ||
</Text> | ||
</div> | ||
</Card> | ||
</div> | ||
</DynamicComponent> | ||
); | ||
} | ||
|
||
export default BeaconConsent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
client/app/pages/settings/components/GeneralSettings/BeaconConsentSettings.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from "react"; | ||
import Form from "antd/lib/form"; | ||
import Checkbox from "antd/lib/checkbox"; | ||
import Skeleton from "antd/lib/skeleton"; | ||
import HelpTrigger from "@/components/HelpTrigger"; | ||
import DynamicComponent from "@/components/DynamicComponent"; | ||
import { SettingsEditorPropTypes, SettingsEditorDefaultProps } from "../prop-types"; | ||
|
||
export default function BeaconConsentSettings(props) { | ||
const { values, onChange, loading } = props; | ||
|
||
return ( | ||
<DynamicComponent name="OrganizationSettings.BeaconConsentSettings" {...props}> | ||
<Form.Item | ||
label={ | ||
<span> | ||
Anonymous Usage Data Sharing | ||
<HelpTrigger className="m-l-5 m-r-5" type="USAGE_DATA_SHARING" /> | ||
</span> | ||
} | ||
> | ||
{loading ? ( | ||
<Skeleton title={{ width: 300 }} paragraph={false} active /> | ||
) : ( | ||
<Checkbox | ||
name="beacon_consent" | ||
checked={values.beacon_consent} | ||
onChange={(e) => onChange({ beacon_consent: e.target.checked })} | ||
> | ||
Help Redash improve by automatically sending anonymous usage data | ||
</Checkbox> | ||
)} | ||
</Form.Item> | ||
</DynamicComponent> | ||
); | ||
} | ||
|
||
BeaconConsentSettings.propTypes = SettingsEditorPropTypes; | ||
|
||
BeaconConsentSettings.defaultProps = SettingsEditorDefaultProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.