Skip to content

Commit

Permalink
add gitpod clone support (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonka3000 authored Oct 14, 2021
1 parent 7fd7b3c commit d09f6c4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
Binary file added extensions/gitlab/assets/gitpod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions extensions/gitlab/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extensions/gitlab/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gitlab",
"title": "GitLab",
"version": "1.0.0",
"version": "1.1.0",
"author": "tonka3000",
"license": "MIT",
"description": "Create, search and modify issues, manage merge requests, projects and more.",
Expand Down
3 changes: 2 additions & 1 deletion extensions/gitlab/src/components/project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MilestoneList } from "./milestones";
import { MRList, MRScope } from "./mr";
import { ProjectNavMenusList } from "./project_nav";
import { IssueList, IssueScope } from "./issues";
import { CloneProjectInVSCodeAction } from "./project_actions";
import { CloneProjectInGitPod, CloneProjectInVSCodeAction } from "./project_actions";
import { GitLabIcons, useImage } from "../icons";
import { useCache } from "../cache";
import { ClearLocalCacheAction } from "./cache_actions";
Expand Down Expand Up @@ -91,6 +91,7 @@ export function ProjectListItem(props: { project: Project }) {
url={webUrl(props.project, "edit")}
/>
<CloneProjectInVSCodeAction shortcut={{ modifiers: ["cmd", "shift"], key: "c" }} project={project} />
<CloneProjectInGitPod shortcut={{ modifiers: ["cmd", "shift"], key: "g" }} project={project} />
<ClearLocalCacheAction />
</ActionPanel>
}
Expand Down
18 changes: 18 additions & 0 deletions extensions/gitlab/src/components/project_actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
KeyboardShortcut,
List,
ListItem,
OpenInBrowserAction,
popToRoot,
PushAction,
showToast,
Expand Down Expand Up @@ -71,3 +72,20 @@ export function CloneProjectInVSCodeAction(props: { shortcut?: KeyboardShortcut;
return null;
}
}

export function CloneProjectInGitPod(props: { shortcut?: KeyboardShortcut; project: Project }) {
const pro = props.project;
const url = `https://gitpod.io#${pro.web_url}`;
if (pro.http_url_to_repo || pro.ssh_url_to_repo) {
return (
<OpenInBrowserAction
title="Clone in Gitpod"
shortcut={props.shortcut}
icon={{ source: "gitpod.png" }}
url={url}
/>
);
} else {
return null;
}
}
3 changes: 2 additions & 1 deletion extensions/gitlab/src/components/project_search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MilestoneList } from "./milestones";
import { MRList, MRScope } from "./mr";
import { ProjectNavMenusList } from "./project_nav";
import { IssueList, IssueScope } from "./issues";
import { CloneProjectInVSCodeAction } from "./project_actions";
import { CloneProjectInGitPod, CloneProjectInVSCodeAction } from "./project_actions";
import { GitLabIcons } from "../icons";
import { ClearLocalCacheAction } from "./cache_actions";

Expand Down Expand Up @@ -89,6 +89,7 @@ export function ProjectListItem(props: { project: Project }) {
url={webUrl(props.project, "edit")}
/>
<CloneProjectInVSCodeAction shortcut={{ modifiers: ["cmd", "shift"], key: "c" }} project={project} />
<CloneProjectInGitPod shortcut={{ modifiers: ["cmd", "shift"], key: "g" }} project={project} />
<ClearLocalCacheAction />
</ActionPanel>
}
Expand Down

0 comments on commit d09f6c4

Please sign in to comment.