-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Allow users to share aggregated usage information with us #4108
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
46c6987
Initial commit of BeaconConsent component
arikfr a06b019
Add comment about being able to change setting
arikfr 8506d20
Use <Text> correctly
arikfr 40b7845
Final version of consent screen
arikfr 6cbc28b
Show beacon consent message on homepage only if it wasn't enabled alr…
arikfr 4f1ad90
Add consent setting to organization settings screen.
arikfr b98cf41
Add support for custom message in OrgSetting.save.
arikfr e6b4b4f
Implmenet consent saving.
arikfr 0684a54
If consent given, send extra data
arikfr db89adb
Add HelpTrigger
arikfr 09391d1
Make CodeClimate happy
arikfr 0c824de
Wrap everything with DynamicComponent
arikfr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import React, { useState } from 'react'; | ||
import { react2angular } from 'react2angular'; | ||
import Card from 'antd/lib/card'; | ||
import Button from 'antd/lib/button'; | ||
import Typography from 'antd/lib/typography'; | ||
import { clientConfig } from '@/services/auth'; | ||
import { HelpTrigger } from '@/components/HelpTrigger'; | ||
import DynamicComponent from '@/components/DynamicComponent'; | ||
import OrgSettings from '@/services/organizationSettings'; | ||
|
||
const Text = Typography.Text; | ||
|
||
export 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 <a href="settings/organization">Organization Settings</a> page. | ||
</Text> | ||
</div> | ||
</Card> | ||
</div> | ||
</DynamicComponent> | ||
); | ||
} | ||
|
||
export default function init(ngModule) { | ||
ngModule.component('beaconConsent', react2angular(BeaconConsent)); | ||
} | ||
|
||
init.init = true; |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since this is not only checking for a new version anymore, should we rename it to something like "diagnostics" or something that will look less fishy when we send out info?
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 shows that we check for consent and such, so not sure it will seem fishy. I don't mind changing the name but it should be better than
diagnostics
;-)Going to merge this, but we can still rename it in a follow up.