Skip to content

Commit

Permalink
Revert "[dashboard] disable Bitbucket integration on gitpod.io"
Browse files Browse the repository at this point in the history
This reverts commit 0867669.
  • Loading branch information
AlexTugarev committed May 10, 2022
1 parent 0867669 commit c7350f1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
10 changes: 9 additions & 1 deletion components/dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import {
import { refreshSearchData } from "./components/RepositoryFinder";
import { StartWorkspaceModal } from "./workspaces/StartWorkspaceModal";
import { parseProps } from "./start/StartWorkspace";
import { isGitpodIo } from "./utils";

const Setup = React.lazy(() => import(/* webpackPrefetch: true */ "./Setup"));
const Workspaces = React.lazy(() => import(/* webpackPrefetch: true */ "./workspaces/Workspaces"));
Expand Down Expand Up @@ -85,6 +84,15 @@ function Loading() {
return <></>;
}

function isGitpodIo() {
return (
window.location.hostname === "gitpod.io" ||
window.location.hostname === "gitpod-staging.com" ||
window.location.hostname.endsWith("gitpod-dev.com") ||
window.location.hostname.endsWith("gitpod-io-dev.com")
);
}

function isWebsiteSlug(pathName: string) {
const slugs = [
"about",
Expand Down
5 changes: 4 additions & 1 deletion components/dashboard/src/admin/License.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { ReactComponent as CheckSvg } from "../images/check.svg";
import { ReactComponent as LinkSvg } from "../images/external-link.svg";
import SolidCard from "../components/SolidCard";
import Card from "../components/Card";
import { isGitpodIo } from "../utils";

export default function License() {
const { license, setLicense } = useContext(LicenseContext);
Expand Down Expand Up @@ -213,3 +212,7 @@ function communityPlan(userCount: number, seats: number, fallbackAllowed: boolea

return [licenseLevel("Community"), additionalLicenseInfo("Free"), alertMessage(aboveLimit)];
}

function isGitpodIo() {
return window.location.hostname === "gitpod.io" || window.location.hostname === "gitpod-staging.com";
}
5 changes: 4 additions & 1 deletion components/dashboard/src/admin/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { getGitpodService } from "../service/service";
import { adminMenu } from "./admin-menu";
import { useEffect, useState } from "react";
import InfoBox from "../components/InfoBox";
import { isGitpodIo } from "../utils";

export default function Settings() {
const { adminSettings, setAdminSettings } = useContext(AdminContext);
Expand Down Expand Up @@ -70,3 +69,7 @@ export default function Settings() {
</div>
);
}

function isGitpodIo() {
return window.location.hostname === "gitpod.io" || window.location.hostname === "gitpod-staging.com";
}
3 changes: 1 addition & 2 deletions components/dashboard/src/settings/Integrations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { PaymentContext } from "../payment-context";
import { openAuthorizeWindow } from "../provider-utils";
import { getGitpodService, gitpodHostUrl } from "../service/service";
import { UserContext } from "../user-context";
import { isGitpodIo } from "../utils";
import { SelectAccountModal } from "./SelectAccountModal";
import getSettingsMenu from "./settings-menu";

Expand Down Expand Up @@ -765,7 +764,7 @@ export function GitIntegrationModal(
>
<option value="GitHub">GitHub</option>
<option value="GitLab">GitLab</option>
{!isGitpodIo() && <option value="Bitbucket">Bitbucket</option>}
<option value="Bitbucket">Bitbucket</option>
<option value="BitbucketServer">Bitbucket Server</option>
</select>
</div>
Expand Down
9 changes: 0 additions & 9 deletions components/dashboard/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,3 @@ export const poll = async <T>(
}
}
};

export function isGitpodIo() {
return (
window.location.hostname === "gitpod.io" ||
window.location.hostname === "gitpod-staging.com" ||
window.location.hostname.endsWith("gitpod-dev.com") ||
window.location.hostname.endsWith("gitpod-io-dev.com")
);
}

0 comments on commit c7350f1

Please sign in to comment.