-
Notifications
You must be signed in to change notification settings - Fork 1.3k
GetAuthenticatedUser in Dashboard #19142
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 all commits
6dd745d
ab37461
ea9051c
1037a9f
47dd751
e770692
da87c48
d6e1ace
7007259
6cc550b
6071bd0
ba3410a
538c31b
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 |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
import { FC, lazy } from "react"; | ||
import { useShowDedicatedSetup } from "../dedicated-setup/use-show-dedicated-setup"; | ||
import { useCurrentUser } from "../user-context"; | ||
import { MigrationPage, useShouldSeeMigrationPage } from "../whatsnew/MigrationPage"; | ||
import { useShowUserOnboarding } from "../onboarding/use-show-user-onboarding"; | ||
import { useHistory } from "react-router"; | ||
import { useCurrentOrg } from "../data/organizations/orgs-query"; | ||
|
@@ -22,7 +21,6 @@ export const AppBlockingFlows: FC = ({ children }) => { | |
const history = useHistory(); | ||
const user = useCurrentUser(); | ||
const org = useCurrentOrg(); | ||
const shouldSeeMigrationPage = useShouldSeeMigrationPage(); | ||
const showDedicatedSetup = useShowDedicatedSetup(); | ||
const showUserOnboarding = useShowUserOnboarding(); | ||
|
||
|
@@ -31,11 +29,6 @@ export const AppBlockingFlows: FC = ({ children }) => { | |
return <></>; | ||
} | ||
|
||
// If orgOnlyAttribution is enabled and the user hasn't been migrated, yet, we need to show the migration page | ||
if (shouldSeeMigrationPage) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you elaborate on this change? I'm not familiar. I want to understand why it is ok to remove now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the Org migration path dried out by now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't make sense to update code unused. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I'm not the best person if you want some confirmation :) |
||
return <MigrationPage />; | ||
} | ||
|
||
// Handle dedicated setup if necessary | ||
if (showDedicatedSetup.showSetup) { | ||
return ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Copyright (c) 2023 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 { useQuery } from "@tanstack/react-query"; | ||
import { userClient } from "../../service/public-api"; | ||
import { GetAuthenticatedUserRequest, User } from "@gitpod/public-api/lib/gitpod/v1/user_pb"; | ||
|
||
export const useAuthenticatedUser = () => { | ||
const query = useQuery<User>({ | ||
queryKey: getAuthenticatedUserQueryKey(), | ||
AlexTugarev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
queryFn: async () => { | ||
AlexTugarev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const params = new GetAuthenticatedUserRequest(); | ||
const response = await userClient.getAuthenticatedUser(params); | ||
return response.user!; | ||
}, | ||
}); | ||
return query; | ||
}; | ||
|
||
export const getAuthenticatedUserQueryKey = () => ["authenticated-user", {}]; |
Uh oh!
There was an error while loading. Please reload this page.