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
fb1c6650
Commit
fb1c6650
authored
Feb 01, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes after review
parent
e03c85b9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
.../vue_merge_request_widget/components/mr_widget_header.vue
+16
-10
spec/javascripts/vue_mr_widget/components/mr_widget_header_spec.js
...scripts/vue_mr_widget/components/mr_widget_header_spec.js
+2
-2
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
View file @
fb1c6650
...
...
@@ -24,7 +24,7 @@
return
this
.
mr
.
divergedCommitsCount
>
0
;
},
commitsText
()
{
return
n__
(
'
commit behind
'
,
'
commits behind
'
,
this
.
mr
.
divergedCommitsCount
);
return
n__
(
'
%d commit behind
'
,
'
%d
commits behind
'
,
this
.
mr
.
divergedCommitsCount
);
},
branchNameClipboardData
()
{
// This supports code in app/assets/javascripts/copy_to_clipboard.js that
...
...
@@ -35,6 +35,12 @@
gfm
:
`\`
${
this
.
mr
.
sourceBranch
}
\``
,
});
},
isSourceBranchLong
()
{
return
this
.
isBranchTitleLong
(
this
.
mr
.
sourceBranch
);
},
isTargetBranchLong
()
{
return
this
.
isBranchTitleLong
(
this
.
mr
.
targetBranch
);
},
},
methods
:
{
isBranchTitleLong
(
branchTitle
)
{
...
...
@@ -50,15 +56,15 @@
{{
s__
(
"
mrWidget|Request to merge
"
)
}}
<span
class=
"label-branch js-source-branch"
:class=
"
{ 'label-truncated': is
BranchTitleLong(mr.sourceBranch)
}"
:title="is
BranchTitleLong(mr.sourceBranch)
? mr.sourceBranch : ''"
:class=
"
{ 'label-truncated': is
SourceBranchLong
}"
:title="is
SourceBranchLong
? mr.sourceBranch : ''"
data-placement="bottom"
:v-tooltip="is
BranchTitleLong(mr.sourceBranch)
"
:v-tooltip="is
SourceBranchLong
"
v-html="mr.sourceBranchLink"
>
</span>
<clipboard
B
utton
<clipboard
-b
utton
:text=
"branchNameClipboardData"
:title=
"__('Copy branch name to clipboard')"
/>
...
...
@@ -67,9 +73,9 @@
<span
class=
"label-branch"
:v-tooltip=
"is
BranchTitleLong(mr.sourceBranch)
"
:class=
"
{ 'label-truncatedtooltip': is
BranchTitleLong(mr.targetBranch)
}"
:title="is
BranchTitleLong(mr.targetBranch)
? mr.targetBranch : ''"
:v-tooltip=
"is
TargetBranchLong
"
:class=
"
{ 'label-truncatedtooltip': is
TargetBranchLong
}"
:title="is
TargetBranchLong
? mr.targetBranch : ''"
data-placement="bottom"
>
<a
...
...
@@ -84,7 +90,7 @@
v-if=
"shouldShowCommitsBehindText"
class=
"diverged-commits-count"
>
(
<a
:href=
"mr.targetBranchPath"
>
{{
mr
.
divergedCommitsCount
}}
{{
commitsText
}}
</a>
)
(
<a
:href=
"mr.targetBranchPath"
>
{{
commitsText
}}
</a>
)
</span>
</div>
...
...
@@ -93,7 +99,7 @@
data-target=
"#modal_merge_info"
data-toggle=
"modal"
:disabled=
"mr.sourceBranchRemoved"
class=
"btn btn-sm inline js-check-out-branch"
class=
"btn btn-sm
btn-default
inline js-check-out-branch"
type=
"button"
>
{{
s__
(
"
mrWidget|Check out branch
"
)
}}
...
...
spec/javascripts/vue_mr_widget/components/mr_widget_header_spec.js
View file @
fb1c6650
...
...
@@ -47,7 +47,7 @@ describe('MRWidgetHeader', () => {
targetBranch
:
'
master
'
,
}
});
expect
(
vm
.
commitsText
).
toEqual
(
'
commit behind
'
);
expect
(
vm
.
commitsText
).
toEqual
(
'
1
commit behind
'
);
});
it
(
'
returns plural when there is more than one commit
'
,
()
=>
{
...
...
@@ -58,7 +58,7 @@ describe('MRWidgetHeader', () => {
targetBranch
:
'
master
'
,
}
});
expect
(
vm
.
commitsText
).
toEqual
(
'
commits behind
'
);
expect
(
vm
.
commitsText
).
toEqual
(
'
2
commits behind
'
);
});
});
});
...
...
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