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
129dd185
Unverified
Commit
129dd185
authored
May 03, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added merge request to IDE sidebar
#44846
parent
9b8332d3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
60 deletions
+43
-60
editor_mode_dropdown.vue
...ssets/javascripts/ide/components/editor_mode_dropdown.vue
+5
-58
ide_review.vue
app/assets/javascripts/ide/components/ide_review.vue
+36
-1
ide_router.js
app/assets/javascripts/ide/ide_router.js
+2
-1
No files found.
app/assets/javascripts/ide/components/editor_mode_dropdown.vue
View file @
129dd185
<
script
>
import
Icon
from
'~/vue_shared/components/icon.vue'
;
import
{
__
,
sprintf
}
from
'~/locale'
;
export
default
{
components
:
{
Icon
,
},
props
:
{
hasChanges
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
mergeRequestId
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
viewer
:
{
type
:
String
,
required
:
true
,
},
showShadow
:
{
type
:
Boolean
,
mergeRequestId
:
{
type
:
Number
,
required
:
true
,
},
},
...
...
@@ -44,36 +30,17 @@ export default {
<
template
>
<div
class=
"dropdown"
:class=
"
{
shadow: showShadow,
}"
style=
"margin-left:auto;"
>
<button
type=
"button"
class=
"btn btn-primary btn-sm"
:class=
"
{
'btn-inverted': hasChanges,
}"
class=
"btn btn-link"
data-toggle=
"dropdown"
>
<template
v-if=
"viewer === 'mrdiff' && mergeRequestId"
>
{{
mergeReviewLine
}}
</
template
>
<
template
v-else-if=
"viewer === 'editor'"
>
{{
__
(
'Editing'
)
}}
</
template
>
<
template
v-else
>
{{
__
(
'Reviewing'
)
}}
</
template
>
<icon
name=
"angle-down"
:size=
"12"
css-classes=
"caret-down"
/>
Edit
</button>
<div
class=
"dropdown-menu dropdown-menu-selectable dropdown-open-left"
>
<ul>
<
template
v-if=
"mergeRequestId"
>
<li>
<a
href=
"#"
...
...
@@ -90,26 +57,6 @@ export default {
</span>
</a>
</li>
<li
role=
"separator"
class=
"divider"
>
</li>
</
template
>
<li>
<a
href=
"#"
@
click
.
prevent=
"changeMode('editor')"
:class=
"{
'is-active': viewer === 'editor',
}"
>
<strong
class=
"dropdown-menu-inner-title"
>
{{ __('Editing') }}
</strong>
<span
class=
"dropdown-menu-inner-content"
>
{{ __('View and edit lines') }}
</span>
</a>
</li>
<li>
<a
href=
"#"
...
...
app/assets/javascripts/ide/components/ide_review.vue
View file @
129dd185
<
script
>
import
{
mapGetters
,
mapState
,
mapActions
}
from
'vuex'
;
import
IdeTreeList
from
'./ide_tree_list.vue'
;
import
EditorModeDropdown
from
'./editor_mode_dropdown.vue'
;
export
default
{
components
:
{
IdeTreeList
,
EditorModeDropdown
,
},
computed
:
{
...
mapGetters
([
'currentMergeRequest'
]),
...
mapState
([
'viewer'
]),
},
mounted
()
{
this
.
updateViewer
(
this
.
currentMergeRequest
?
'mrdiff'
:
'diff'
);
},
methods
:
{
...
mapActions
([
'updateViewer'
]),
},
};
</
script
>
<
template
>
<ide-tree-list
viewer-type=
"diff
"
:viewer-type=
"viewer
"
header-class=
"ide-review-header"
:disable-action-dropdown=
"true"
>
<template
slot=
"header"
>
<div
class=
"ide-review-button-holder"
>
{{
__
(
'Review'
)
}}
<editor-mode-dropdown
v-if=
"currentMergeRequest"
:viewer=
"viewer"
:merge-request-id=
"currentMergeRequest.iid"
@
click=
"updateViewer"
/>
</div>
<div
class=
"prepend-top-5 ide-review-sub-header"
>
<template
v-if=
"!currentMergeRequest || viewer === 'diff'"
>
{{
__
(
'Lastest changes'
)
}}
</
template
>
<
template
v-else-if=
"currentMergeRequest && viewer === 'mrdiff'"
>
Merge request
(
<a
:href=
"currentMergeRequest.web_url"
>
!
{{
currentMergeRequest
.
iid
}}
</a>
)
</
template
>
</div>
</template>
</ide-tree-list>
</template>
<
style
>
.ide-review-button-holder
{
display
:
flex
;
width
:
100%
;
align-items
:
center
;
}
</
style
>
app/assets/javascripts/ide/ide_router.js
View file @
129dd185
...
...
@@ -2,6 +2,7 @@ import Vue from 'vue';
import
VueRouter
from
'vue-router'
;
import
flash
from
'~/flash'
;
import
store
from
'./stores'
;
import
{
activityBarViews
}
from
'./constants'
;
Vue
.
use
(
VueRouter
);
...
...
@@ -101,7 +102,7 @@ router.beforeEach((to, from, next) => {
throw
e
;
});
}
else
if
(
to
.
params
.
mrid
)
{
store
.
dispatch
(
'update
Viewer'
,
'mrdiff'
);
store
.
dispatch
(
'update
ActivityBarView'
,
activityBarViews
.
review
);
store
.
dispatch
(
'getMergeRequestData'
,
{
...
...
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