-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add IDE versions to the dashboard #15139
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
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 |
---|---|---|
|
@@ -75,12 +75,7 @@ export default function SelectIDE(props: SelectIDEProps) { | |
const [ideOptions, setIdeOptions] = useState<IDEOptions | undefined>(undefined); | ||
useEffect(() => { | ||
(async () => { | ||
const ideopts = await getGitpodService().server.getIDEOptions(); | ||
// TODO: Compatible with ide-config not deployed, need revert after ide-config deployed | ||
delete ideopts.options["code-latest"]; | ||
delete ideopts.options["code-desktop-insiders"]; | ||
|
||
setIdeOptions(ideopts); | ||
setIdeOptions(await getGitpodService().server.getIDEOptions()); | ||
})(); | ||
}, []); | ||
|
||
|
@@ -95,8 +90,9 @@ export default function SelectIDE(props: SelectIDEProps) { | |
<div className={`my-4 gap-3 flex flex-wrap max-w-3xl`}> | ||
{allIdeOptions.map(([id, option]) => { | ||
const selected = defaultIde === id; | ||
const version = useLatestVersion ? option.latestImageVersion : option.imageVersion; | ||
const onSelect = () => actuallySetDefaultIde(id); | ||
return renderIdeOption(option, selected, onSelect); | ||
return renderIdeOption(option, selected, version, onSelect); | ||
})} | ||
</div> | ||
{ideOptions.options[defaultIde]?.notes && ( | ||
|
@@ -176,20 +172,45 @@ function orderedIdeOptions(ideOptions: IDEOptions) { | |
}); | ||
} | ||
|
||
function renderIdeOption(option: IDEOption, selected: boolean, onSelect: () => void): JSX.Element { | ||
function renderIdeOption( | ||
option: IDEOption, | ||
selected: boolean, | ||
version: IDEOption["imageVersion"], | ||
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. question: When selecting the latest release, VS Code version remains the same. Is this expected? 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 here it's because in preview environments, we just use the stable version as Insiders. Should be expected @iQQBot please correct me if I'm wrong here 😄 🙏 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. Thanks, @filiptronicek! OK, let's see how this behaves in production, then. 🎣
filiptronicek marked this conversation as resolved.
Show resolved
Hide resolved
|
||
onSelect: () => void, | ||
): JSX.Element { | ||
const label = option.type === "desktop" ? "" : option.type; | ||
const card = ( | ||
<SelectableCardSolid className="w-36 h-40" title={option.title} selected={selected} onClick={onSelect}> | ||
<SelectableCardSolid className="w-36 h-44" title={option.title} selected={selected} onClick={onSelect}> | ||
<div className="flex justify-center mt-3"> | ||
<img className="w-16 filter-grayscale self-center" src={option.logo} alt="logo" /> | ||
</div> | ||
{label ? ( | ||
<div | ||
className="mt-2 px-3 py-1 self-center" | ||
style={{ | ||
minHeight: "1.75rem", | ||
}} | ||
> | ||
{label ? ( | ||
<span | ||
className={`font-semibold text-sm ${ | ||
selected ? "text-gray-100 dark:text-gray-600" : "text-gray-600 dark:text-gray-500" | ||
} uppercase`} | ||
> | ||
{label} | ||
</span> | ||
) : ( | ||
<></> | ||
)} | ||
</div> | ||
|
||
{version ? ( | ||
<div | ||
className={`font-semibold text-sm ${ | ||
className={`font-semibold text-xs ${ | ||
selected ? "text-gray-100 dark:text-gray-600" : "text-gray-600 dark:text-gray-500" | ||
} uppercase mt-2 px-3 py-1 self-center`} | ||
} uppercase px-3 self-center`} | ||
title="The IDE's current version on Gitpod" | ||
> | ||
{label} | ||
{version} | ||
</div> | ||
) : ( | ||
<></> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't the version already be inside the
option: IDEOption
param?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
option has 2 versions stable and latest, passed version is a selection one of another depending on a user choice (line 98 above)