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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
8f47540a
Commit
8f47540a
authored
May 12, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'acet-mr-widget-fix-link' into 'master'
MRWidget: Fix target branch link. See merge request !11267
parents
6e78508c
dd70776f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
9 deletions
+16
-9
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.js
...s/vue_merge_request_widget/components/mr_widget_header.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_closed.js
...erge_request_widget/components/states/mr_widget_closed.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_locked.js
...erge_request_widget/components/states/mr_widget_locked.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merge_when_pipeline_succeeds.js
...mponents/states/mr_widget_merge_when_pipeline_succeeds.js
+1
-1
spec/javascripts/vue_mr_widget/components/mr_widget_header_spec.js
...scripts/vue_mr_widget/components/mr_widget_header_spec.js
+10
-3
spec/javascripts/vue_mr_widget/components/states/mr_widget_closed_spec.js
.../vue_mr_widget/components/states/mr_widget_closed_spec.js
+2
-2
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.js
View file @
8f47540a
...
@@ -83,7 +83,7 @@ export default {
...
@@ -83,7 +83,7 @@ export default {
:title="isBranchTitleLong(mr.targetBranch) ? mr.targetBranch : ''"
:title="isBranchTitleLong(mr.targetBranch) ? mr.targetBranch : ''"
data-placement="bottom">
data-placement="bottom">
<a
<a
:href="mr.targetBranch
Commits
Path">
:href="mr.targetBranchPath">
{{mr.targetBranch}}
{{mr.targetBranch}}
</a>
</a>
</span>
</span>
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_closed.js
View file @
8f47540a
...
@@ -20,7 +20,7 @@ export default {
...
@@ -20,7 +20,7 @@ export default {
<p>
<p>
The changes were not merged into
The changes were not merged into
<a
<a
:href="mr.targetBranch
Commits
Path"
:href="mr.targetBranchPath"
class="label-branch">
class="label-branch">
{{mr.targetBranch}}</a>.
{{mr.targetBranch}}</a>.
</p>
</p>
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_locked.js
View file @
8f47540a
...
@@ -16,7 +16,7 @@ export default {
...
@@ -16,7 +16,7 @@ export default {
The changes will be merged into
The changes will be merged into
<span class="label-branch">
<span class="label-branch">
<a :href="mr.targetBranchPath">{{mr.targetBranch}}</a>
<a :href="mr.targetBranchPath">{{mr.targetBranch}}</a>
</span>
</span>
.
</p>
</p>
</section>
</section>
</div>
</div>
...
...
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_merge_when_pipeline_succeeds.js
View file @
8f47540a
...
@@ -87,7 +87,7 @@ export default {
...
@@ -87,7 +87,7 @@ export default {
:href="mr.targetBranchPath"
:href="mr.targetBranchPath"
class="label-branch">
class="label-branch">
{{mr.targetBranch}}
{{mr.targetBranch}}
</a>
</a>
.
</p>
</p>
<p v-if="mr.shouldRemoveSourceBranch">
<p v-if="mr.shouldRemoveSourceBranch">
The source branch will be removed.
The source branch will be removed.
...
...
spec/javascripts/vue_mr_widget/components/mr_widget_header_spec.js
View file @
8f47540a
...
@@ -48,10 +48,12 @@ describe('MRWidgetHeader', () => {
...
@@ -48,10 +48,12 @@ describe('MRWidgetHeader', () => {
describe
(
'
template
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
let
vm
;
let
vm
;
let
el
;
let
el
;
const
sourceBranchPath
=
'
/foo/bar/mr-widget-refactor
'
;
const
mr
=
{
const
mr
=
{
divergedCommitsCount
:
12
,
divergedCommitsCount
:
12
,
sourceBranch
:
'
mr-widget-refactor
'
,
sourceBranch
:
'
mr-widget-refactor
'
,
sourceBranchLink
:
'
/foo/bar/mr-widget-refactor
'
,
sourceBranchLink
:
`<a href="
${
sourceBranchPath
}
">mr-widget-refactor</a>`
,
targetBranchPath
:
'
foo/bar/commits-path
'
,
targetBranch
:
'
master
'
,
targetBranch
:
'
master
'
,
isOpen
:
true
,
isOpen
:
true
,
emailPatchesPath
:
'
/mr/email-patches
'
,
emailPatchesPath
:
'
/mr/email-patches
'
,
...
@@ -65,8 +67,13 @@ describe('MRWidgetHeader', () => {
...
@@ -65,8 +67,13 @@ describe('MRWidgetHeader', () => {
it
(
'
should render template elements correctly
'
,
()
=>
{
it
(
'
should render template elements correctly
'
,
()
=>
{
expect
(
el
.
classList
.
contains
(
'
mr-source-target
'
)).
toBeTruthy
();
expect
(
el
.
classList
.
contains
(
'
mr-source-target
'
)).
toBeTruthy
();
expect
(
el
.
querySelectorAll
(
'
.label-branch
'
)[
0
].
textContent
).
toContain
(
mr
.
sourceBranch
);
const
sourceBranchLink
=
el
.
querySelectorAll
(
'
.label-branch
'
)[
0
];
expect
(
el
.
querySelectorAll
(
'
.label-branch
'
)[
1
].
textContent
).
toContain
(
mr
.
targetBranch
);
const
targetBranchLink
=
el
.
querySelectorAll
(
'
.label-branch
'
)[
1
];
expect
(
sourceBranchLink
.
textContent
).
toContain
(
mr
.
sourceBranch
);
expect
(
targetBranchLink
.
textContent
).
toContain
(
mr
.
targetBranch
);
expect
(
sourceBranchLink
.
querySelector
(
'
a
'
).
getAttribute
(
'
href
'
)).
toEqual
(
sourceBranchPath
);
expect
(
targetBranchLink
.
querySelector
(
'
a
'
).
getAttribute
(
'
href
'
)).
toEqual
(
mr
.
targetBranchPath
);
expect
(
el
.
querySelector
(
'
.diverged-commits-count
'
).
textContent
).
toContain
(
'
12 commits behind
'
);
expect
(
el
.
querySelector
(
'
.diverged-commits-count
'
).
textContent
).
toContain
(
'
12 commits behind
'
);
expect
(
el
.
textContent
).
toContain
(
'
Check out branch
'
);
expect
(
el
.
textContent
).
toContain
(
'
Check out branch
'
);
...
...
spec/javascripts/vue_mr_widget/components/states/mr_widget_closed_spec.js
View file @
8f47540a
...
@@ -3,7 +3,7 @@ import closedComponent from '~/vue_merge_request_widget/components/states/mr_wid
...
@@ -3,7 +3,7 @@ import closedComponent from '~/vue_merge_request_widget/components/states/mr_wid
const
mr
=
{
const
mr
=
{
targetBranch
:
'
good-branch
'
,
targetBranch
:
'
good-branch
'
,
targetBranch
Commits
Path
:
'
/good-branch
'
,
targetBranchPath
:
'
/good-branch
'
,
closedBy
:
{
closedBy
:
{
name
:
'
Fatih Acet
'
,
name
:
'
Fatih Acet
'
,
username
:
'
fatihacet
'
,
username
:
'
fatihacet
'
,
...
@@ -44,7 +44,7 @@ describe('MRWidgetClosed', () => {
...
@@ -44,7 +44,7 @@ describe('MRWidgetClosed', () => {
expect
(
el
.
querySelector
(
'
h4
'
).
textContent
).
toContain
(
'
Closed by
'
);
expect
(
el
.
querySelector
(
'
h4
'
).
textContent
).
toContain
(
'
Closed by
'
);
expect
(
el
.
querySelector
(
'
h4
'
).
textContent
).
toContain
(
mr
.
closedBy
.
name
);
expect
(
el
.
querySelector
(
'
h4
'
).
textContent
).
toContain
(
mr
.
closedBy
.
name
);
expect
(
el
.
textContent
).
toContain
(
'
The changes were not merged into
'
);
expect
(
el
.
textContent
).
toContain
(
'
The changes were not merged into
'
);
expect
(
el
.
querySelector
(
'
.label-branch
'
).
getAttribute
(
'
href
'
)).
toEqual
(
mr
.
targetBranch
Commits
Path
);
expect
(
el
.
querySelector
(
'
.label-branch
'
).
getAttribute
(
'
href
'
)).
toEqual
(
mr
.
targetBranchPath
);
expect
(
el
.
querySelector
(
'
.label-branch
'
).
textContent
).
toContain
(
mr
.
targetBranch
);
expect
(
el
.
querySelector
(
'
.label-branch
'
).
textContent
).
toContain
(
mr
.
targetBranch
);
});
});
});
});
...
...
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