-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[dashboard] Re-implement default IDE switch for new dashboard #3482
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d628bbe
[code] Graduate VS Code out of Feature Preview
jankeromnes 853ddf1
[dashboard] Re-implement default IDE switch for new dashboard
jankeromnes 1a1738f
[dashboard] Adjust styles in Settings menu and Account page
jankeromnes 76d8997
[dashboard] Simplify SettingsPage component by folding the SubMenu ba…
jankeromnes a85db18
[dashboad] Apply Default IDE code review feedback
jankeromnes 3608e0c
[dashboard] Make the new Default IDE page actually change the user se…
jankeromnes e161436
[code] Make VS Code the default IDE for new users
jankeromnes 2d3d4f0
[dashboard] Delete custom IDE image option from new dashboard again
jankeromnes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export interface SelectableCardProps { | ||
title: string; | ||
selected: boolean; | ||
className?: string; | ||
onClick: () => void; | ||
children?: React.ReactNode; | ||
} | ||
|
||
function SelectableCard(props: SelectableCardProps) { | ||
return <div className={`rounded-xl px-4 py-3 flex flex-col cursor-pointer group border-2 ${props.selected ? 'border-green-600' : 'border-gray-300 hover:border-gray-400'} ${props.className || ''}`} onClick={props.onClick}> | ||
<div className="flex items-center"> | ||
<p className={`w-full text-base font-semibold ${props.selected ? 'text-green-600' : 'text-gray-300 group-hover:text-gray-400'}`}>{props.title}</p> | ||
<input className={props.selected ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'} type="radio" checked={props.selected} /> | ||
</div> | ||
{props.children} | ||
</div>; | ||
} | ||
|
||
export default SelectableCard; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
import { SettingsPage } from "../components/SettingsPage"; | ||
import settingsMenu from './settings-menu'; | ||
import { SettingsPage } from "./SettingsPage"; | ||
|
||
export default function EnvVars() { | ||
return <div> | ||
<SettingsPage title='Environment Variables' subtitle='Configure environment variables for your workspaces' menuEntries={settingsMenu}> | ||
<div className="lg:px-28 px-10 flex pt-10"> | ||
Environment Variables | ||
</div> | ||
<SettingsPage title='Environment Variables' subtitle='Configure environment variables for your workspaces'> | ||
<h3>Environment Variables</h3> | ||
</SettingsPage> | ||
</div>; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
import { SettingsPage } from "../components/SettingsPage"; | ||
import settingsMenu from './settings-menu'; | ||
import { SettingsPage } from "./SettingsPage"; | ||
|
||
export default function GitIntegrations() { | ||
return <div> | ||
<SettingsPage title='Git Integrations' subtitle='Manage integration with your Git hosters' menuEntries={settingsMenu}> | ||
<div className="lg:px-28 px-10 flex pt-10"> | ||
Git Hoster Access Control | ||
</div> | ||
<SettingsPage title='Git Integrations' subtitle='Manage integration with your Git hosters'> | ||
<h3>Git Hoster Access Control</h3> | ||
</SettingsPage> | ||
</div>; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
import { SettingsPage } from "../components/SettingsPage"; | ||
import settingsMenu from "./settings-menu"; | ||
import { SettingsPage } from "./SettingsPage"; | ||
|
||
export default function Notifications() { | ||
return <div> | ||
<SettingsPage title='Notifications' subtitle='Email notification preferences' menuEntries={settingsMenu}> | ||
<div className="lg:px-28 px-10 flex pt-10"> | ||
Notifications | ||
</div> | ||
<SettingsPage title='Notifications' subtitle='Email notification preferences'> | ||
<h3>Notifications</h3> | ||
</SettingsPage> | ||
</div>; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { useContext, useState } from "react"; | ||
import { getGitpodService } from "../service/service"; | ||
import SelectableCard from "../components/SelectableCard"; | ||
import { UserContext } from "../user-context"; | ||
import { SettingsPage } from "./SettingsPage"; | ||
|
||
export default function Preferences() { | ||
const { user } = useContext(UserContext); | ||
const [ defaultIde, setDefaultIde ] = useState<string>(user?.additionalData?.ideSettings?.defaultIde || 'theia'); | ||
const actuallySetDefaultIde = async (value: string) => { | ||
const additionalData = user?.additionalData || {}; | ||
const settings = additionalData.ideSettings || {}; | ||
if (value === 'theia') { | ||
delete settings.defaultIde; | ||
} else { | ||
settings.defaultIde = value; | ||
} | ||
additionalData.ideSettings = settings; | ||
await getGitpodService().server.updateLoggedInUser({ additionalData }); | ||
setDefaultIde(value); | ||
} | ||
|
||
return <div> | ||
<SettingsPage title='Preferences' subtitle='Configure your Default IDE for all workspaces.'> | ||
<h3>Default IDE</h3> | ||
<p className="text-base">Choose which IDE you want to use.</p> | ||
<div className="mt-4 space-x-4 flex"> | ||
<SelectableCard className="w-36 h-40" title="VS Code" selected={defaultIde === 'code'} onClick={() => actuallySetDefaultIde('code')}> | ||
<div className="flex-grow flex justify-center align-center"> | ||
<img className="w-16 filter-grayscale" src="/images/vscode.svg"/> | ||
</div> | ||
</SelectableCard> | ||
<SelectableCard className="w-36 h-40" title="Theia" selected={defaultIde === 'theia'} onClick={() => actuallySetDefaultIde('theia')}> | ||
<div className="flex-grow flex justify-center align-center"> | ||
<img className="w-16" src="/images/theia-gray.svg"/> | ||
</div> | ||
</SelectableCard> | ||
</div> | ||
</SettingsPage> | ||
</div>; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Link } from "react-router-dom"; | ||
import Header from '../components/Header'; | ||
import settingsMenu from "./settings-menu"; | ||
|
||
export interface Props { | ||
title: string; | ||
subtitle: string; | ||
children: React.ReactNode; | ||
} | ||
|
||
export function SettingsPage(p: Props) { | ||
return <div> | ||
<Header title={p.title} subtitle={p.subtitle}/> | ||
<div className='lg:px-28 px-10 flex pt-9'> | ||
<div> | ||
<ul className="flex flex-col text-sm text-gray-500 pt-4 lg:pt-0 w-48 space-y-2"> | ||
{settingsMenu.map(e => { | ||
let classes = "flex block py-2 font-sm px-4 rounded-md"; | ||
if (e.link.toLowerCase() === window.location.pathname) { | ||
classes += " bg-gray-800 text-gray-50"; | ||
} else { | ||
classes += " hover:bg-gray-100"; | ||
} | ||
return <Link to={e.link} key={e.title}> | ||
<li className={classes}> | ||
{e.title} | ||
</li> | ||
</Link>; | ||
})} | ||
</ul> | ||
</div> | ||
<div className='ml-32 w-full pt-1'> | ||
{p.children} | ||
</div> | ||
</div> | ||
</div>; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is that
bg-white
based on a design I missed?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.
That's a secondary button (outline vs plain color), cc @gtsiolis
Currently, it seems that all
<button>
havebg-green-600
by default:gitpod/components/dashboard/src/index.css
Lines 31 to 33 in 8ff6ed7
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.
For more context, see relevant specs in #3395.