Skip to content

Add the Browser Terminal as an IDE #17196

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 13 commits into from
Apr 24, 2023
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
14 changes: 5 additions & 9 deletions components/dashboard/src/components/SelectIDEComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
*/

import { IDEOption, IDEOptions } from "@gitpod/gitpod-protocol/lib/ide-protocol";
import { useCallback, useContext, useEffect, useState } from "react";
import { useCallback, useEffect, useState } from "react";
import { getGitpodService } from "../service/service";
import { DropDown2, DropDown2Element } from "./DropDown2";
import Editor from "../icons/Editor.svg";
import { FeatureFlagContext } from "../contexts/FeatureFlagContext";

interface SelectIDEComponentProps {
selectedIdeOption?: string;
Expand All @@ -18,15 +17,12 @@ interface SelectIDEComponentProps {
setError?: (error?: string) => void;
}

function filteredIdeOptions(ideOptions: IDEOptions, experimentalTurnedOn: boolean) {
return IDEOptions.asArray(ideOptions)
.filter((x) => !x.hidden)
.filter((x) => (x.experimental ? experimentalTurnedOn : true));
function filteredIdeOptions(ideOptions: IDEOptions) {
return IDEOptions.asArray(ideOptions).filter((x) => !x.hidden);
}

export default function SelectIDEComponent(props: SelectIDEComponentProps) {
const [ideOptions, setIdeOptions] = useState<IDEOptions>();
const { experimentalIdes } = useContext(FeatureFlagContext);

useEffect(() => {
getGitpodService().server.getIDEOptions().then(setIdeOptions);
Expand All @@ -36,7 +32,7 @@ export default function SelectIDEComponent(props: SelectIDEComponentProps) {
if (!ideOptions) {
return [];
}
const options = filteredIdeOptions(ideOptions, experimentalIdes);
const options = filteredIdeOptions(ideOptions);
const result: DropDown2Element[] = [];
for (const ide of options.filter((ide) =>
`${ide.label}${ide.title}${ide.notes}${ide.id}`.toLowerCase().includes(search.toLowerCase()),
Expand All @@ -57,7 +53,7 @@ export default function SelectIDEComponent(props: SelectIDEComponentProps) {
}
return result;
},
[experimentalIdes, ideOptions, props.useLatest],
[ideOptions, props.useLatest],
);
const internalOnSelectionChange = (id: string) => {
const { ide, useLatest } = parseId(id);
Expand Down
5 changes: 0 additions & 5 deletions components/dashboard/src/contexts/FeatureFlagContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const defaultFeatureFlags = {
userGitAuthProviders: false,
newSignupFlow: false,
linkedinConnectionForOnboarding: false,
experimentalIdes: false,
};

const FeatureFlagContext = createContext<FeatureFlagsType>(defaultFeatureFlags);
Expand All @@ -48,7 +47,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
const [userGitAuthProviders, setUserGitAuthProviders] = useState<boolean>(false);
const [newSignupFlow, setNewSignupFlow] = useState<boolean>(false);
const [linkedinConnectionForOnboarding, setLinkedinConnectionForOnboarding] = useState<boolean>(false);
const [experimentalIdes, setExperimentalIdes] = useState<boolean>(false);

useEffect(() => {
if (!user) return;
Expand All @@ -67,7 +65,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
userGitAuthProviders: { defaultValue: false, setter: setUserGitAuthProviders },
newSignupFlow: { defaultValue: false, setter: setNewSignupFlow },
linkedinConnectionForOnboarding: { defaultValue: false, setter: setLinkedinConnectionForOnboarding },
experimentalIdes: { defaultValue: false, setter: setExperimentalIdes },
};

for (const [flagName, config] of Object.entries(featureFlags)) {
Expand Down Expand Up @@ -115,7 +112,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
userGitAuthProviders,
newSignupFlow,
linkedinConnectionForOnboarding,
experimentalIdes,
};
}, [
enablePersonalAccessTokens,
Expand All @@ -127,7 +123,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
startWithOptions,
usePublicApiWorkspacesService,
userGitAuthProviders,
experimentalIdes,
]);

return <FeatureFlagContext.Provider value={flags}>{children}</FeatureFlagContext.Provider>;
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/src/user-settings/SelectIDE.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function SelectIDE(props: SelectIDEProps) {
);

//todo(ft): find a better way to group IDEs by vendor
const shouldShowJetbrainsNotice = !["code", "code-desktop"].includes(defaultIde); // a really hacky way to get just JetBrains IDEs
const shouldShowJetbrainsNotice = !["code", "code-desktop", "xterm"].includes(defaultIde); // a really hacky way to get just JetBrains IDEs

return (
<>
Expand Down
4 changes: 4 additions & 0 deletions components/ide-proxy/static/image/ide-logo/terminal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading