-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Dashboard]: add send telemetry to admin settings #7732
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
Merged
Merged
Changes from all commits
Commits
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 hidden or 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 hidden or 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,26 @@ | ||
/** | ||
* Copyright (c) 2022 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License-AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import React, { createContext, useState } from 'react'; | ||
import { InstallationAdminSettings } from "@gitpod/gitpod-protocol"; | ||
|
||
const AdminContext = createContext<{ | ||
adminSettings?: InstallationAdminSettings, | ||
setAdminSettings: React.Dispatch<InstallationAdminSettings>, | ||
}>({ | ||
setAdminSettings: () => null, | ||
}); | ||
|
||
const AdminContextProvider: React.FC = ({ children }) => { | ||
const [adminSettings, setAdminSettings] = useState<InstallationAdminSettings>(); | ||
return ( | ||
<AdminContext.Provider value={{ adminSettings, setAdminSettings }}> | ||
{children} | ||
</AdminContext.Provider> | ||
); | ||
}; | ||
|
||
export { AdminContext, AdminContextProvider }; |
This file contains hidden or 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,37 @@ | ||
/** | ||
* Copyright (c) 2022 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License-AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import { useContext } from "react"; | ||
import { InstallationAdminSettings } from "@gitpod/gitpod-protocol"; | ||
import { AdminContext } from "../admin-context"; | ||
import CheckBox from "../components/CheckBox"; | ||
import { PageWithSubMenu } from "../components/PageWithSubMenu"; | ||
import { getGitpodService } from "../service/service"; | ||
import { adminMenu } from "./admin-menu"; | ||
|
||
export default function Settings() { | ||
const { adminSettings, setAdminSettings } = useContext(AdminContext); | ||
|
||
const actuallySetTelemetryPrefs = async (value: InstallationAdminSettings) => { | ||
await getGitpodService().server.adminUpdateSettings(value); | ||
setAdminSettings(value); | ||
} | ||
|
||
return ( | ||
<div> | ||
<PageWithSubMenu subMenu={adminMenu} title="Settings" subtitle="Configure settings for your Gitpod cluster."> | ||
<h3>Usage Statistics</h3> | ||
<CheckBox | ||
mrsimonemms marked this conversation as resolved.
Show resolved
Hide resolved
|
||
title="Enable Service Ping" | ||
desc={<span>This is used to provide insights on how you use your cluster so we can provide a better overall experience. <a className="gp-link" href="https://www.gitpod.io/privacy">Read our Privacy Policy</a></span>} | ||
checked={adminSettings?.sendTelemetry ?? false} | ||
onChange={(evt) => actuallySetTelemetryPrefs({ | ||
sendTelemetry: evt.target.checked, | ||
})} /> | ||
</PageWithSubMenu> | ||
</div > | ||
) | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
issue(non-blocking): Just wanted to add a comment that I could not access the admin panel even after trying to add a user as an admin using this documentation[1]. This is probably missing a section heading for the settings but I could not verify using the preview environment. However, shipping this as is for now sounds also ok. ➿
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.
I'm not sure about adding a user as admin. In my environment where my user is an admin by default, it shows ok. As you say, I think it's probably ok as there will always be the initial admin. We can always raise as a bugfix if a wider problem
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.
Yes, the first user always becomes an admin. That was more like an observation that I could not test this in the preview environment properly either because the script to make someone admin does not work or because we could improve our code review process.
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.
I've raised PR #7840 with a fix for leeway