Skip to content

Commit 639f507

Browse files
committed
[dashboard] display warning for latest IDE versions
1 parent be80566 commit 639f507

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

components/dashboard/src/start/StartPage.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { useEffect } from "react";
8+
import InfoBox from "../components/InfoBox";
89
import gitpodIconUA from "../icons/gitpod-ua.svg";
910

1011
export enum StartPhase {
@@ -74,6 +75,7 @@ export interface StartPageProps {
7475
error?: StartWorkspaceError;
7576
title?: string;
7677
children?: React.ReactNode;
78+
showLatestIdeWarning?: boolean;
7779
}
7880

7981
export interface StartWorkspaceError {
@@ -105,6 +107,17 @@ export function StartPage(props: StartPageProps) {
105107
)}
106108
{error && <StartError error={error} />}
107109
{props.children}
110+
{props.showLatestIdeWarning && (
111+
<InfoBox className="mt-4">
112+
You are using the latest editor version.{" "}
113+
<a
114+
className="text-blue-400 dark:text-blue-300 hover:text-blue-600 dark:hover:text-blue-400"
115+
href="/preferences"
116+
>
117+
Change preferences
118+
</a>
119+
</InfoBox>
120+
)}
108121
</div>
109122
</div>
110123
);

components/dashboard/src/start/StartWorkspace.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,9 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
650650
);
651651
break;
652652
}
653-
653+
const useLatest = !!this.state.workspaceInstance?.configuration?.ideConfig?.useLatest;
654654
return (
655-
<StartPage phase={phase} error={error} title={title}>
655+
<StartPage phase={phase} error={error} title={title} showLatestIdeWarning={useLatest}>
656656
{statusMessage}
657657
</StartPage>
658658
);

components/gitpod-protocol/src/workspace-instance.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ export interface WorkspaceInstanceConfiguration {
221221

222222
// supervisorImage is the ref of the supervisor image this instance uses.
223223
supervisorImage?: string;
224+
225+
ideConfig?: {
226+
useLatest?: boolean;
227+
};
224228
}
225229

226230
/**

components/server/src/workspace/gitpod-server-impl.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
314314
delete res.status.ownerToken;
315315
// is an operational internal detail
316316
delete res.status.nodeName;
317-
// configuration contains feature flags and theia version.
318-
// we might want to share that in the future, but for the time being there's no need
319-
delete res.configuration;
320317
// internal operation detail
321318
// @ts-ignore
322319
delete res.workspaceImage;

components/server/src/workspace/workspace-starter.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,16 +522,20 @@ export class WorkspaceStarter {
522522
excludeFeatureFlags: NamedWorkspaceFeatureFlag[],
523523
ideConfig: IDEConfig,
524524
): Promise<WorkspaceInstance> {
525+
const ideChoice = user.additionalData?.ideSettings?.defaultIde;
526+
const useLatest = !!user.additionalData?.ideSettings?.useLatestVersion;
527+
525528
// TODO(cw): once we allow changing the IDE in the workspace config (i.e. .gitpod.yml), we must
526529
// give that value precedence over the default choice.
527530
const configuration: WorkspaceInstanceConfiguration = {
528531
ideImage: ideConfig.ideOptions.options[ideConfig.ideOptions.defaultIde].image,
529532
supervisorImage: ideConfig.supervisorImage,
533+
ideConfig: {
534+
// TODO(hw): set false when latestImage not found
535+
useLatest,
536+
},
530537
};
531538

532-
const ideChoice = user.additionalData?.ideSettings?.defaultIde;
533-
const useLatest = !!user.additionalData?.ideSettings?.useLatestVersion;
534-
535539
if (!!ideChoice) {
536540
const mappedImage = ideConfig.ideOptions.options[ideChoice];
537541
if (mappedImage.image != null) {

0 commit comments

Comments
 (0)