Skip to content
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

Remove Theia settings and point to Code image #5511

Merged
merged 1 commit into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chart/templates/server-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ data:
"license": "{{ .Values.license }}",
"workspaceHeartbeat": {{ $comp.workspaceHeartbeat | toJson }},
"workspaceDefaults": {
"ideVersion": "{{ template "gitpod.comp.version" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.theiaImage) }}",
"ideImageRepo": "{{ template "gitpod.comp.imageRepo" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.theiaImage) }}",
"ideVersion": "{{ .Values.components.workspace.codeImage.stableVersion }}",
"ideImageRepo": "{{ template "gitpod.comp.imageRepo" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.codeImage) }}",
"ideImageAliases": {{ (dict "code-latest" (include "gitpod.comp.imageFull" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.codeImage)) "code" (include "stable-image-full" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.codeImage))) | toJson }},
"workspaceImage": "{{ template "gitpod.comp.imageFull" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.defaultImage) }}",
"previewFeatureFlags": {{ $comp.previewFeatureFlags | toJson }},
Expand Down
4 changes: 2 additions & 2 deletions chart/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ spec:
- name: THEIA_PORT
value: "{{ .Values.components.workspace.ports.http.containerPort | toString }}"
- name: THEIA_IMAGE_REPO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Shall we open a follow up issue to remove this later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should create a follow-up issue to clean up the code if we don't have it yet.

value: "{{ template "gitpod.comp.imageRepo" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.theiaImage) }}"
value: "{{ template "gitpod.comp.imageRepo" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.codeImage) }}"
- name: THEIA_VERSION
value: "{{ template "gitpod.comp.version" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.theiaImage) }}"
value: "{{ .Values.components.workspace.codeImage.stableVersion }}"
- name: CODE_IMAGE_REPO
value: "{{ template "gitpod.comp.imageRepo" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.codeImage) }}"
- name: EXPERIMENTAL_FEATURE_FLAGS
Expand Down
28 changes: 7 additions & 21 deletions components/dashboard/src/settings/Preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,25 @@
*/

import { useContext, useState } from "react";
import { getGitpodService } from "../service/service";
import { PageWithSubMenu } from "../components/PageWithSubMenu";
import SelectableCard from "../components/SelectableCard";
import { UserContext } from "../user-context";
import { ThemeContext } from "../theme-context";
import theia from '../images/theia-gray.svg';
import Tooltip from "../components/Tooltip";
import vscode from '../images/vscode.svg';
import { PageWithSubMenu } from "../components/PageWithSubMenu";
import { getGitpodService } from "../service/service";
import { ThemeContext } from "../theme-context";
import { UserContext } from "../user-context";
import settingsMenu from "./settings-menu";
import AlertBox from "../components/AlertBox";
import Tooltip from "../components/Tooltip";

type Theme = 'light' | 'dark' | 'system';

export default function Preferences() {
const { user } = useContext(UserContext);
const { setIsDark } = useContext(ThemeContext);
const [defaultIde, setDefaultIde] = useState<string>(user?.additionalData?.ideSettings?.defaultIde || 'theia');
const [defaultIde, setDefaultIde] = useState<string>(user?.additionalData?.ideSettings?.defaultIde || 'code');
const actuallySetDefaultIde = async (value: string) => {
const additionalData = user?.additionalData || {};
const settings = additionalData.ideSettings || {};
if (value === 'theia') {
delete settings.defaultIde;
} else {
settings.defaultIde = value;
}
settings.defaultIde = value;
JanKoehnlein marked this conversation as resolved.
Show resolved Hide resolved
additionalData.ideSettings = settings;
await getGitpodService().server.updateLoggedInUser({ additionalData });
setDefaultIde(value);
Expand All @@ -50,9 +44,6 @@ export default function Preferences() {
<PageWithSubMenu subMenu={settingsMenu} title='Preferences' subtitle='Configure user preferences.'>
<h3>Default IDE</h3>
<p className="text-base text-gray-500">Choose which IDE you want to use.</p>
<AlertBox className="mt-3 mb-4 w-3/4">
We're deprecating the Theia editor. You can still switch back to Theia for the next few weeks but the preference will be removed by the end of August 2021.
</AlertBox>
Comment on lines -53 to -55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Thanks for also removing this, @laushinka! 🎗️

<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 justify-center mt-3">
Expand All @@ -67,11 +58,6 @@ export default function Preferences() {
<span className="mt-2 ml-2 self-center rounded-xl py-0.5 px-2 text-sm bg-orange-100 text-orange-700 dark:bg-orange-600 dark:text-orange-100 font-semibold">LATEST</span>
</SelectableCard>
</Tooltip>
<SelectableCard className="w-36 h-40" title="Theia" selected={defaultIde === 'theia'} onClick={() => actuallySetDefaultIde('theia')}>
<div className="flex justify-center mt-3">
<img className="w-16 h-16 dark:filter-invert self-center" src={theia} />
</div>
</SelectableCard>
</div>
<h3 className="mt-12">Theme</h3>
<p className="text-base text-gray-500">Early bird or night owl? Choose your side.</p>
Expand Down