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

GitLab: Add Gitpod clone support #32

Merged
merged 1 commit into from
Oct 14, 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
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