Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4e9555d6
Commit
4e9555d6
authored
Jan 16, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
3b6e441c
454942da
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
30 deletions
+92
-30
app/assets/javascripts/diffs/components/compare_versions.vue
app/assets/javascripts/diffs/components/compare_versions.vue
+4
-0
app/assets/javascripts/diffs/components/compare_versions_dropdown.vue
...avascripts/diffs/components/compare_versions_dropdown.vue
+8
-6
app/serializers/merge_request_diff_entity.rb
app/serializers/merge_request_diff_entity.rb
+8
-0
changelogs/unreleased/52275-fix-master-to-be-hyperlink.yml
changelogs/unreleased/52275-fix-master-to-be-hyperlink.yml
+5
-0
spec/javascripts/diffs/components/compare_versions_dropdown_spec.js
...cripts/diffs/components/compare_versions_dropdown_spec.js
+33
-0
spec/javascripts/diffs/components/compare_versions_spec.js
spec/javascripts/diffs/components/compare_versions_spec.js
+6
-0
spec/javascripts/diffs/mock_data/merge_request_diffs.js
spec/javascripts/diffs/mock_data/merge_request_diffs.js
+28
-24
No files found.
app/assets/javascripts/diffs/components/compare_versions.vue
View file @
4e9555d6
...
...
@@ -54,6 +54,9 @@ export default {
showDropdowns
()
{
return
!
this
.
commit
&&
this
.
mergeRequestDiffs
.
length
;
},
baseVersionPath
()
{
return
this
.
mergeRequestDiff
.
base_version_path
;
},
},
methods
:
{
...
mapActions
(
'
diffs
'
,
[
...
...
@@ -95,6 +98,7 @@ export default {
and
<compare-versions-dropdown
:other-versions=
"comparableDiffs"
:base-version-path=
"baseVersionPath"
:start-version=
"startVersion"
:target-branch=
"targetBranch"
class=
"mr-version-compare-dropdown"
...
...
app/assets/javascripts/diffs/components/compare_versions_dropdown.vue
View file @
4e9555d6
...
...
@@ -34,14 +34,13 @@ export default {
required
:
false
,
default
:
false
,
},
baseVersionPath
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
},
computed
:
{
baseVersion
()
{
return
{
name
:
'
hii
'
,
versionIndex
:
-
1
,
};
},
targetVersions
()
{
if
(
this
.
mergeRequestVersion
)
{
return
this
.
otherVersions
;
...
...
@@ -62,6 +61,9 @@ export default {
);
},
href
(
version
)
{
if
(
this
.
isBase
(
version
))
{
return
this
.
baseVersionPath
;
}
if
(
this
.
showCommitCount
)
{
return
version
.
version_path
;
}
...
...
app/serializers/merge_request_diff_entity.rb
View file @
4e9555d6
...
...
@@ -24,6 +24,14 @@ class MergeRequestDiffEntity < Grape::Entity
short_sha
(
merge_request_diff
.
head_commit_sha
)
end
expose
:base_version_path
do
|
merge_request_diff
|
project
=
merge_request
.
target_project
next
unless
project
merge_request_version_path
(
project
,
merge_request
,
merge_request_diff
)
end
expose
:version_path
do
|
merge_request_diff
|
start_sha
=
options
[
:start_sha
]
project
=
merge_request
.
target_project
...
...
changelogs/unreleased/52275-fix-master-to-be-hyperlink.yml
0 → 100644
View file @
4e9555d6
---
title
:
Resolve In Merge Request diff screen, master is not a hyperlink
merge_request
:
23874
author
:
type
:
fixed
spec/javascripts/diffs/components/compare_versions_dropdown_spec.js
View file @
4e9555d6
// TODO: https://gitlab.com/gitlab-org/gitlab-ce/issues/48034
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
CompareVersionsDropdown
from
'
~/diffs/components/compare_versions_dropdown.vue
'
;
import
diffsMockData
from
'
../mock_data/merge_request_diffs
'
;
describe
(
'
CompareVersionsDropdown
'
,
()
=>
{
let
wrapper
;
const
targetBranch
=
{
branchName
:
'
tmp-wine-dev
'
,
versionIndex
:
-
1
};
const
factory
=
(
options
=
{})
=>
{
const
localVue
=
createLocalVue
();
wrapper
=
shallowMount
(
CompareVersionsDropdown
,
{
localVue
,
...
options
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
should render a correct base version link
'
,
()
=>
{
factory
({
propsData
:
{
baseVersionPath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37
'
,
otherVersions
:
diffsMockData
.
slice
(
1
),
targetBranch
,
},
});
const
links
=
wrapper
.
findAll
(
'
a
'
);
const
lastLink
=
links
.
wrappers
[
links
.
length
-
1
];
expect
(
lastLink
.
attributes
(
'
href
'
)).
toEqual
(
wrapper
.
props
(
'
baseVersionPath
'
));
});
});
spec/javascripts/diffs/components/compare_versions_spec.js
View file @
4e9555d6
...
...
@@ -100,6 +100,12 @@ describe('CompareVersions', () => {
});
});
describe
(
'
baseVersionPath
'
,
()
=>
{
it
(
'
should be set correctly from mergeRequestDiff
'
,
()
=>
{
expect
(
vm
.
baseVersionPath
).
toEqual
(
vm
.
mergeRequestDiff
.
base_version_path
);
});
});
describe
(
'
isWhitespaceVisible
'
,
()
=>
{
const
originalHref
=
window
.
location
.
href
;
...
...
spec/javascripts/diffs/mock_data/merge_request_diffs.js
View file @
4e9555d6
export
default
[
{
versionIndex
:
4
,
createdAt
:
'
2018-10-23T11:49:16.611Z
'
,
commitsCount
:
4
,
base_version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37
'
,
version_index
:
4
,
created_at
:
'
2018-10-23T11:49:16.611Z
'
,
commits_count
:
4
,
latest
:
true
,
short
CommitS
ha
:
'
de7a8f7f
'
,
version
P
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37
'
,
compare
P
ath
:
short
_commit_s
ha
:
'
de7a8f7f
'
,
version
_p
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37
'
,
compare
_p
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37&start_sha=de7a8f7f20c3ea2e0bef3ba01cfd41c21f6b4995
'
,
},
{
versionIndex
:
3
,
createdAt
:
'
2018-10-23T11:46:40.617Z
'
,
commitsCount
:
3
,
base_version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=36
'
,
version_index
:
3
,
created_at
:
'
2018-10-23T11:46:40.617Z
'
,
commits_count
:
3
,
latest
:
false
,
short
CommitS
ha
:
'
e78fc18f
'
,
version
P
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=36
'
,
compare
P
ath
:
short
_commit_s
ha
:
'
e78fc18f
'
,
version
_p
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=36
'
,
compare
_p
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37&start_sha=e78fc18fa37acb2185c59ca94d4a964464feb50e
'
,
},
{
versionIndex
:
2
,
createdAt
:
'
2018-10-04T09:57:39.648Z
'
,
commitsCount
:
2
,
base_version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=35
'
,
version_index
:
2
,
created_at
:
'
2018-10-04T09:57:39.648Z
'
,
commits_count
:
2
,
latest
:
false
,
short
CommitS
ha
:
'
48da7e7e
'
,
version
P
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=35
'
,
compare
P
ath
:
short
_commit_s
ha
:
'
48da7e7e
'
,
version
_p
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=35
'
,
compare
_p
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37&start_sha=48da7e7e9a99d41c852578bd9cb541ca4d864b3e
'
,
},
{
versionIndex
:
1
,
createdAt
:
'
2018-09-25T20:30:39.493Z
'
,
commitsCount
:
1
,
base_version_path
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=20
'
,
version_index
:
1
,
created_at
:
'
2018-09-25T20:30:39.493Z
'
,
commits_count
:
1
,
latest
:
false
,
short
CommitS
ha
:
'
47bac2ed
'
,
version
P
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=20
'
,
compare
P
ath
:
short
_commit_s
ha
:
'
47bac2ed
'
,
version
_p
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=20
'
,
compare
_p
ath
:
'
/gnuwget/wget2/merge_requests/6/diffs?diff_id=37&start_sha=47bac2ed972c5bee344c1cea159a22cd7f711dc0
'
,
},
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment