Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
a577cfcb
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a577cfcb
编写于
10月 11, 2018
作者:
J
Jacques Erasmus
提交者:
Mike Greiling
10月 11, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix broken file name navigation on MRs
上级
da4f7795
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
6 deletion
+25
-6
app/assets/javascripts/diffs/components/diff_file_header.vue
app/assets/javascripts/diffs/components/diff_file_header.vue
+7
-3
app/assets/javascripts/notes/components/diff_with_note.vue
app/assets/javascripts/notes/components/diff_with_note.vue
+1
-0
changelogs/unreleased/50185-fix-broken-file-name-navigation.yml
...logs/unreleased/50185-fix-broken-file-name-navigation.yml
+5
-0
spec/javascripts/diffs/components/diff_file_header_spec.js
spec/javascripts/diffs/components/diff_file_header_spec.js
+12
-3
未找到文件。
app/assets/javascripts/diffs/components/diff_file_header.vue
浏览文件 @
a577cfcb
...
...
@@ -20,6 +20,11 @@ export default {
Tooltip
,
},
props
:
{
discussionPath
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
diffFile
:
{
type
:
Object
,
required
:
true
,
...
...
@@ -65,8 +70,7 @@ export default {
if
(
this
.
diffFile
.
submodule
)
{
return
this
.
diffFile
.
submoduleTreeUrl
||
this
.
diffFile
.
submoduleLink
;
}
return
`#
${
this
.
diffFile
.
fileHash
}
`
;
return
this
.
discussionPath
;
},
filePath
()
{
if
(
this
.
diffFile
.
submodule
)
{
...
...
@@ -152,7 +156,7 @@ export default {
v-once
ref=
"titleWrapper"
:href=
"titleLink"
class=
"append-right-4"
class=
"append-right-4
js-title-wrapper
"
>
<file-icon
:file-name=
"filePath"
...
...
app/assets/javascripts/notes/components/diff_with_note.vue
浏览文件 @
a577cfcb
...
...
@@ -94,6 +94,7 @@ export default {
class=
"diff-file file-holder"
>
<diff-file-header
:discussion-path=
"discussion.discussionPath"
:diff-file=
"diffFile"
:can-current-user-fork=
"false"
:discussions-expanded=
"isDiscussionsExpanded"
...
...
changelogs/unreleased/50185-fix-broken-file-name-navigation.yml
0 → 100644
浏览文件 @
a577cfcb
---
title
:
Fix broken file name navigation on MRs
merge_request
:
22109
author
:
type
:
fixed
spec/javascripts/diffs/components/diff_file_header_spec.js
浏览文件 @
a577cfcb
...
...
@@ -6,6 +6,8 @@ import DiffFileHeader from '~/diffs/components/diff_file_header.vue';
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
mountComponentWithStore
}
from
'
spec/helpers/vue_mount_component_helper
'
;
Vue
.
use
(
Vuex
);
const
discussionFixture
=
'
merge_requests/diff_discussion.json
'
;
describe
(
'
diff_file_header
'
,
()
=>
{
...
...
@@ -58,19 +60,19 @@ describe('diff_file_header', () => {
describe
(
'
titleLink
'
,
()
=>
{
beforeEach
(()
=>
{
props
.
discussionPath
=
'
link://to/discussion
'
;
Object
.
assign
(
props
.
diffFile
,
{
fileHash
:
'
badc0ffee
'
,
submoduleLink
:
'
link://to/submodule
'
,
submoduleTreeUrl
:
'
some://tree/url
'
,
});
});
it
(
'
returns the
fileHas
h for files
'
,
()
=>
{
it
(
'
returns the
discussionPat
h for files
'
,
()
=>
{
props
.
diffFile
.
submodule
=
false
;
vm
=
mountComponentWithStore
(
Component
,
{
props
,
store
});
expect
(
vm
.
titleLink
).
toBe
(
`#
${
props
.
diffFile
.
fileHash
}
`
);
expect
(
vm
.
titleLink
).
toBe
(
props
.
discussionPath
);
});
it
(
'
returns the submoduleTreeUrl for submodules
'
,
()
=>
{
...
...
@@ -91,6 +93,13 @@ describe('diff_file_header', () => {
expect
(
vm
.
titleLink
).
toBe
(
props
.
diffFile
.
submoduleLink
);
});
it
(
'
sets the correct path to the discussion
'
,
()
=>
{
props
.
discussionPath
=
'
link://to/discussion
'
;
vm
=
mountComponentWithStore
(
Component
,
{
props
,
store
});
const
href
=
vm
.
$el
.
querySelector
(
'
.js-title-wrapper
'
).
getAttribute
(
'
href
'
);
expect
(
href
).
toBe
(
vm
.
discussionPath
);
});
});
describe
(
'
filePath
'
,
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录