BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ae3abc38
Commit
ae3abc38
authored
Mar 26, 2018
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re added The Web IDE Button
parent
38d56a8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
43 deletions
+54
-43
mr_widget_header.vue
.../vue_merge_request_widget/components/mr_widget_header.vue
+54
-43
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
View file @
ae3abc38
<
script
>
import
tooltip
from
'~/vue_shared/directives/tooltip'
;
import
{
n__
}
from
'~/locale'
;
import
icon
from
'~/vue_shared/components/icon.vue'
;
import
clipboardButton
from
'~/vue_shared/components/clipboard_button.vue'
;
import
tooltip
from
'~/vue_shared/directives/tooltip'
;
import
{
n__
}
from
'~/locale'
;
import
icon
from
'~/vue_shared/components/icon.vue'
;
import
clipboardButton
from
'~/vue_shared/components/clipboard_button.vue'
;
export
default
{
name
:
'MRWidgetHeader'
,
directives
:
{
tooltip
,
export
default
{
name
:
'MRWidgetHeader'
,
directives
:
{
tooltip
,
},
components
:
{
icon
,
clipboardButton
,
},
props
:
{
mr
:
{
type
:
Object
,
required
:
true
,
},
components
:
{
icon
,
clipboardButton
,
},
computed
:
{
shouldShowCommitsBehindText
()
{
return
this
.
mr
.
divergedCommitsCount
>
0
;
},
props
:
{
mr
:
{
type
:
Object
,
required
:
true
,
},
commitsText
()
{
return
n__
(
'%d commit behind'
,
'%d commits behind'
,
this
.
mr
.
divergedCommitsCount
);
},
computed
:
{
shouldShowCommitsBehindText
()
{
return
this
.
mr
.
divergedCommitsCount
>
0
;
},
commitsText
()
{
return
n__
(
'%d commit behind'
,
'%d commits behind'
,
this
.
mr
.
divergedCommitsCount
);
},
branchNameClipboardData
()
{
// This supports code in app/assets/javascripts/copy_to_clipboard.js that
// works around ClipboardJS limitations to allow the context-specific
// copy/pasting of plain text or GFM.
return
JSON
.
stringify
({
text
:
this
.
mr
.
sourceBranch
,
gfm
:
`\`
${
this
.
mr
.
sourceBranch
}
\``
,
});
},
isSourceBranchLong
()
{
return
this
.
isBranchTitleLong
(
this
.
mr
.
sourceBranch
);
},
isTargetBranchLong
()
{
return
this
.
isBranchTitleLong
(
this
.
mr
.
targetBranch
);
},
branchNameClipboardData
()
{
// This supports code in app/assets/javascripts/copy_to_clipboard.js that
// works around ClipboardJS limitations to allow the context-specific
// copy/pasting of plain text or GFM.
return
JSON
.
stringify
({
text
:
this
.
mr
.
sourceBranch
,
gfm
:
`\`
${
this
.
mr
.
sourceBranch
}
\``
,
});
},
methods
:
{
isBranchTitleLong
(
branchTitle
)
{
return
branchTitle
.
length
>
32
;
},
isSourceBranchLong
()
{
return
this
.
isBranchTitleLong
(
this
.
mr
.
sourceBranch
);
},
};
isTargetBranchLong
()
{
return
this
.
isBranchTitleLong
(
this
.
mr
.
targetBranch
);
},
webIdePath
()
{
return
`
${
gon
.
relative_url_root
}
/-/ide/project
${
this
.
mr
.
statusPath
.
replace
(
'.json'
,
''
)}
`
;
},
},
methods
:
{
isBranchTitleLong
(
branchTitle
)
{
return
branchTitle
.
length
>
32
;
},
},
};
</
script
>
<
template
>
<div
class=
"mr-source-target"
>
...
...
@@ -96,6 +99,14 @@
</div>
<div
v-if=
"mr.isOpen"
>
<a
:disabled=
"mr.sourceBranchRemoved"
:href=
"webIdePath"
class=
"btn btn-sm btn-default inline js-web-ide"
type=
"button"
>
{{
s__
(
"mrWidget|Open in Web IDE"
)
}}
</a>
<button
data-target=
"#modal_merge_info"
data-toggle=
"modal"
...
...
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