Skip to content

Commit abd5874

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

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

components/dashboard/src/start/StartWorkspace.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import React, { Suspense, useEffect } from "react";
2323
import { v4 } from "uuid";
2424
import Arrow from "../components/Arrow";
2525
import ContextMenu from "../components/ContextMenu";
26+
import InfoBox from "../components/InfoBox";
2627
import PendingChangesDropdown from "../components/PendingChangesDropdown";
2728
import { watchHeadlessLogs } from "../components/PrebuildLogs";
2829
import { getGitpodService, gitpodHostUrl } from "../service/service";
@@ -650,11 +651,24 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
650651
);
651652
break;
652653
}
653-
654+
const useLatest = !!this.state.workspaceInstance?.configuration?.ideConfig?.useLatest;
654655
return (
655-
<StartPage phase={phase} error={error} title={title}>
656-
{statusMessage}
657-
</StartPage>
656+
<>
657+
<StartPage phase={phase} error={error} title={title}>
658+
{statusMessage}
659+
</StartPage>
660+
{useLatest && (
661+
<InfoBox>
662+
You are using the latest editor version.{" "}
663+
<a
664+
className="text-blue-400 dark:text-blue-300 hover:text-blue-600 dark:hover:text-blue-400"
665+
href="/preferences"
666+
>
667+
Change preferences
668+
</a>
669+
</InfoBox>
670+
)}
671+
</>
658672
);
659673
}
660674
}

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)