@@ -15,6 +15,7 @@ import PillLabel from "../components/PillLabel";
15
15
import { ProjectContext } from "./project-context" ;
16
16
import SelectWorkspaceClass from "../settings/selectClass" ;
17
17
import { BillingMode } from "@gitpod/gitpod-protocol/lib/billing-mode" ;
18
+ import Alert from "../components/Alert" ;
18
19
19
20
export function getProjectSettingsMenu ( project ?: Project , team ?: Team ) {
20
21
const teamOrUserSlug = ! ! team ? "t/" + team . slug : "projects" ;
@@ -48,12 +49,14 @@ export function ProjectSettingsPage(props: { project?: Project; children?: React
48
49
49
50
export default function ( ) {
50
51
const { project, setProject } = useContext ( ProjectContext ) ;
51
- const [ teamBillingMode , setTeamBillingMode ] = useState < BillingMode | undefined > ( undefined ) ;
52
+ const [ billingMode , setBillingMode ] = useState < BillingMode | undefined > ( undefined ) ;
52
53
const { teams } = useContext ( TeamsContext ) ;
53
54
const team = getCurrentTeam ( useLocation ( ) , teams ) ;
54
55
useEffect ( ( ) => {
55
56
if ( team ) {
56
- getGitpodService ( ) . server . getBillingModeForTeam ( team . id ) . then ( setTeamBillingMode ) ;
57
+ getGitpodService ( ) . server . getBillingModeForTeam ( team . id ) . then ( setBillingMode ) ;
58
+ } else {
59
+ getGitpodService ( ) . server . getBillingModeForUser ( ) . then ( setBillingMode ) ;
57
60
}
58
61
} , [ team ] ) ;
59
62
@@ -156,13 +159,38 @@ export default function () {
156
159
</ div >
157
160
</ div >
158
161
</ div >
159
- { BillingMode . canSetWorkspaceClass ( teamBillingMode ) && (
160
- < SelectWorkspaceClass
161
- workspaceClass = { project . settings ?. workspaceClasses ?. regular }
162
- enabled = { BillingMode . canSetWorkspaceClass ( teamBillingMode ) }
163
- setWorkspaceClass = { setWorkspaceClass }
164
- />
165
- ) }
162
+ < div >
163
+ < h3 className = "mt-12" > Workspaces</ h3 >
164
+ < p className = "text-base text-gray-500 dark:text-gray-400" >
165
+ Choose the workspace machine type for your workspaces.
166
+ </ p >
167
+ { BillingMode . canSetWorkspaceClass ( billingMode ) ? (
168
+ < SelectWorkspaceClass
169
+ workspaceClass = { project . settings ?. workspaceClasses ?. regular }
170
+ setWorkspaceClass = { setWorkspaceClass }
171
+ />
172
+ ) : (
173
+ < Alert type = "message" className = "mt-4" >
174
+ < div className = "flex flex-col" >
175
+ < span className = "text-md font-semibold" >
176
+ Upgrade your { project . teamId ? "team" : "personal account" } to access larger workspaces
177
+ </ span >
178
+ < span className = "font-sm" >
179
+ Workspace classes allow you to select the resources available to your workspaces.{ " " }
180
+ < a
181
+ className = "gp-link"
182
+ href = "https://www.gitpod.io/docs/configure/workspaces/workspace-classes"
183
+ >
184
+ Learn more
185
+ </ a >
186
+ </ span >
187
+ < a className = "mt-4" href = { project . teamId ? "../billing" : "/billing" } >
188
+ < button > Upgrade { project . teamId ? "Team" : "Personal Account" } </ button >
189
+ </ a >
190
+ </ div >
191
+ </ Alert >
192
+ ) }
193
+ </ div >
166
194
</ ProjectSettingsPage >
167
195
) ;
168
196
}
0 commit comments