File tree Expand file tree Collapse file tree 3 files changed +18
-36
lines changed
public-api/typescript-common/src Expand file tree Collapse file tree 3 files changed +18
-36
lines changed Original file line number Diff line number Diff line change 7
7
import { useCurrentUser } from "../user-context" ;
8
8
import { useQueryParams } from "../hooks/use-query-params" ;
9
9
import { FORCE_ONBOARDING_PARAM , FORCE_ONBOARDING_PARAM_VALUE } from "./UserOnboarding" ;
10
- import { isOnboardingUser , isOrganizationOwned } from "@gitpod/public-api-common/lib/user-utils" ;
10
+ import { isOrganizationOwned } from "@gitpod/public-api-common/lib/user-utils" ;
11
+ import { User } from "@gitpod/public-api/lib/gitpod/v1/user_pb" ;
11
12
12
13
export const useShowUserOnboarding = ( ) => {
13
14
const user = useCurrentUser ( ) ;
@@ -25,3 +26,19 @@ export const useShowUserOnboarding = () => {
25
26
26
27
return showUserOnboarding ;
27
28
} ;
29
+
30
+ export function hasPreferredIde ( user : User ) {
31
+ return ! ! user ?. editorSettings ?. name || ! ! user ?. editorSettings ?. version ;
32
+ }
33
+
34
+ export function isOnboardingUser ( user : User ) {
35
+ if ( isOrganizationOwned ( user ) ) {
36
+ return false ;
37
+ }
38
+ // If a user has already been onboarded
39
+ // Also, used to rule out "admin-user"
40
+ if ( ! ! user . profile ?. onboardedTimestamp ) {
41
+ return false ;
42
+ }
43
+ return ! hasPreferredIde ( user ) ;
44
+ }
Original file line number Diff line number Diff line change @@ -123,25 +123,6 @@ export namespace User {
123
123
return undefined ;
124
124
}
125
125
126
- export function hasPreferredIde ( user : User ) {
127
- return (
128
- typeof user ?. additionalData ?. ideSettings ?. defaultIde !== "undefined" ||
129
- typeof user ?. additionalData ?. ideSettings ?. useLatestVersion !== "undefined"
130
- ) ;
131
- }
132
-
133
- export function isOnboardingUser ( user : User ) {
134
- if ( isOrganizationOwned ( user ) ) {
135
- return false ;
136
- }
137
- // If a user has already been onboarded
138
- // Also, used to rule out "admin-user"
139
- if ( ! ! user . additionalData ?. profile ?. onboardedTimestamp ) {
140
- return false ;
141
- }
142
- return ! hasPreferredIde ( user ) ;
143
- }
144
-
145
126
export function isOrganizationOwned ( user : User ) {
146
127
return ! ! user . organizationId ;
147
128
}
Original file line number Diff line number Diff line change @@ -61,22 +61,6 @@ export function getName(user: User): string | undefined {
61
61
return undefined ;
62
62
}
63
63
64
- export function hasPreferredIde ( user : User ) {
65
- return ! ! user ?. editorSettings ?. name || ! ! user ?. editorSettings ?. version ;
66
- }
67
-
68
- export function isOnboardingUser ( user : User ) {
69
- if ( isOrganizationOwned ( user ) ) {
70
- return false ;
71
- }
72
- // If a user has already been onboarded
73
- // Also, used to rule out "admin-user"
74
- if ( ! ! user . profile ?. onboardedTimestamp ) {
75
- return false ;
76
- }
77
- return ! hasPreferredIde ( user ) ;
78
- }
79
-
80
64
export function isOrganizationOwned ( user : User ) {
81
65
return ! ! user . organizationId ;
82
66
}
You can’t perform that action at this time.
0 commit comments