Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
一杯枸杞茶ya
csdn-workflow
提交
aac08d3b
C
csdn-workflow
项目概览
一杯枸杞茶ya
/
csdn-workflow
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
csdn-workflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aac08d3b
编写于
1月 29, 2021
作者:
T
Tomas Vik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(gitlab_project): fetch project.webUrl to fix openers
上级
dc4a869e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
7 deletion
+13
-7
src/data_providers/current_branch.js
src/data_providers/current_branch.js
+1
-1
src/gitlab/gitlab_new_service.ts
src/gitlab/gitlab_new_service.ts
+1
-0
src/gitlab/gitlab_project.ts
src/gitlab/gitlab_project.ts
+5
-0
src/openers.js
src/openers.js
+5
-5
src/search_input.js
src/search_input.js
+1
-1
未找到文件。
src/data_providers/current_branch.js
浏览文件 @
aac08d3b
...
...
@@ -45,7 +45,7 @@ class DataProvider {
const
actionText
=
actions
[
pipeline
.
status
]
||
''
;
const
message
=
`Pipeline #
${
pipeline
.
id
}
${
statusText
}
·
${
actionText
}
${
timeAgo
}
`
;
const
url
=
`
${
this
.
project
.
web
_u
rl
}
/pipelines/
${
pipeline
.
id
}
`
;
const
url
=
`
${
this
.
project
.
web
U
rl
}
/pipelines/
${
pipeline
.
id
}
`
;
return
new
ExternalUrlItem
(
message
,
url
);
}
...
...
src/gitlab/gitlab_new_service.ts
浏览文件 @
aac08d3b
...
...
@@ -132,6 +132,7 @@ const queryGetProject = gql`
id
name
fullPath
webUrl
group {
id
}
...
...
src/gitlab/gitlab_project.ts
浏览文件 @
aac08d3b
...
...
@@ -7,6 +7,7 @@ export interface GqlProject {
id
:
string
;
name
:
string
;
fullPath
:
string
;
webUrl
:
string
;
group
?:
GqlGroup
;
}
...
...
@@ -29,6 +30,10 @@ export class GitLabProject {
return
this
.
gqlProject
.
fullPath
;
}
get
webUrl
():
string
{
return
this
.
gqlProject
.
webUrl
;
}
get
groupRestId
():
number
|
undefined
{
return
this
.
gqlProject
.
group
&&
getRestIdFromGraphQLId
(
this
.
gqlProject
.
group
.
id
);
}
...
...
src/openers.js
浏览文件 @
aac08d3b
...
...
@@ -24,7 +24,7 @@ async function getLink(linkTemplate, workspaceFolder) {
const
user
=
await
gitLabService
.
fetchCurrentUser
();
const
project
=
await
gitLabService
.
fetchCurrentProject
(
workspaceFolder
);
return
linkTemplate
.
replace
(
'
$userId
'
,
user
.
id
).
replace
(
'
$projectUrl
'
,
project
.
web
_u
rl
);
return
linkTemplate
.
replace
(
'
$userId
'
,
user
.
id
).
replace
(
'
$projectUrl
'
,
project
.
web
U
rl
);
}
async
function
openLink
(
linkTemplate
,
workspaceFolder
)
{
...
...
@@ -58,7 +58,7 @@ async function getActiveFile() {
}
const
branchName
=
await
createGitService
(
workspaceFolder
).
fetchTrackingBranchName
();
const
filePath
=
editor
.
document
.
uri
.
path
.
replace
(
`
${
workspaceFolder
}
/`
,
''
);
const
fileUrl
=
`
${
currentProject
.
web
_u
rl
}
/blob/
${
branchName
}
/
${
filePath
}
`
;
const
fileUrl
=
`
${
currentProject
.
web
U
rl
}
/blob/
${
branchName
}
/
${
filePath
}
`
;
let
anchor
=
''
;
if
(
editor
.
selection
)
{
...
...
@@ -101,7 +101,7 @@ async function openCreateNewMr() {
const
project
=
await
gitLabService
.
fetchCurrentProject
(
workspaceFolder
);
const
branchName
=
await
createGitService
(
workspaceFolder
).
fetchTrackingBranchName
();
openUrl
(
`
${
project
.
web
_u
rl
}
/merge_requests/new?merge_request%5Bsource_branch%5D=
${
branchName
}
`
);
openUrl
(
`
${
project
.
web
U
rl
}
/merge_requests/new?merge_request%5Bsource_branch%5D=
${
branchName
}
`
);
}
async
function
openProjectPage
()
{
...
...
@@ -121,7 +121,7 @@ async function openCurrentPipeline(workspaceFolder) {
const
pipeline
=
await
gitLabService
.
fetchLastPipelineForCurrentBranch
(
workspaceFolder
);
if
(
pipeline
)
{
openUrl
(
`
${
project
.
web
_u
rl
}
/pipelines/
${
pipeline
.
id
}
`
);
openUrl
(
`
${
project
.
web
U
rl
}
/pipelines/
${
pipeline
.
id
}
`
);
}
}
}
...
...
@@ -135,7 +135,7 @@ async function compareCurrentBranch() {
lastCommitId
=
await
createGitService
(
workspaceFolder
).
fetchLastCommitId
();
if
(
project
&&
lastCommitId
)
{
openUrl
(
`
${
project
.
web
_u
rl
}
/compare/master...
${
lastCommitId
}
`
);
openUrl
(
`
${
project
.
web
U
rl
}
/compare/master...
${
lastCommitId
}
`
);
}
}
...
...
src/search_input.js
浏览文件 @
aac08d3b
...
...
@@ -103,7 +103,7 @@ async function showSearchInputFor(noteableType) {
);
const
queryString
=
await
parseQuery
(
query
,
noteableType
);
await
openers
.
openUrl
(
`
${
project
.
web
_u
rl
}
/
${
noteableType
}${
queryString
}
`
);
await
openers
.
openUrl
(
`
${
project
.
web
U
rl
}
/
${
noteableType
}${
queryString
}
`
);
}
async
function
showIssueSearchInput
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录