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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
68 deletions
+51
-68
editor_mode_dropdown.vue
...ssets/javascripts/ide/components/editor_mode_dropdown.vue
+11
-64
ide_review.vue
app/assets/javascripts/ide/components/ide_review.vue
+38
-3
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
>
<
script
>
import
Icon
from
'~/vue_shared/components/icon.vue'
;
import
{
__
,
sprintf
}
from
'~/locale'
;
import
{
__
,
sprintf
}
from
'~/locale'
;
export
default
{
export
default
{
components
:
{
Icon
,
},
props
:
{
props
:
{
hasChanges
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
mergeRequestId
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
viewer
:
{
viewer
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
showShadow
:
{
mergeRequestId
:
{
type
:
Boolean
,
type
:
Number
,
required
:
true
,
required
:
true
,
},
},
},
},
...
@@ -44,69 +30,30 @@ export default {
...
@@ -44,69 +30,30 @@ export default {
<
template
>
<
template
>
<div
<div
class=
"dropdown"
class=
"dropdown"
:class=
"
{
style=
"margin-left:auto;"
shadow: showShadow,
}"
>
>
<button
<button
type=
"button"
type=
"button"
class=
"btn btn-primary btn-sm"
class=
"btn btn-link"
:class=
"
{
'btn-inverted': hasChanges,
}"
data-toggle=
"dropdown"
data-toggle=
"dropdown"
>
>
<template
v-if=
"viewer === 'mrdiff' && mergeRequestId"
>
Edit
{{
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"
/>
</button>
</button>
<div
class=
"dropdown-menu dropdown-menu-selectable dropdown-open-left"
>
<div
class=
"dropdown-menu dropdown-menu-selectable dropdown-open-left"
>
<ul>
<ul>
<
template
v-if=
"mergeRequestId"
>
<li>
<a
href=
"#"
@
click
.
prevent=
"changeMode('mrdiff')"
:class=
"
{
'is-active': viewer === 'mrdiff',
}"
>
<strong
class=
"dropdown-menu-inner-title"
>
{{
mergeReviewLine
}}
</strong>
<span
class=
"dropdown-menu-inner-content"
>
{{
__
(
'Compare changes with the merge request target branch'
)
}}
</span>
</a>
</li>
<li
role=
"separator"
class=
"divider"
>
</li>
</
template
>
<li>
<li>
<a
<a
href=
"#"
href=
"#"
@
click
.
prevent=
"changeMode('
editor
')"
@
click
.
prevent=
"changeMode('
mrdiff
')"
:class=
"
{
:class=
"
{
'is-active': viewer === '
editor
',
'is-active': viewer === '
mrdiff
',
}"
}"
>
>
<strong
class=
"dropdown-menu-inner-title"
>
{{ __('Editing') }}
</strong>
<strong
class=
"dropdown-menu-inner-title"
>
{{
mergeReviewLine
}}
</strong>
<span
class=
"dropdown-menu-inner-content"
>
<span
class=
"dropdown-menu-inner-content"
>
{{ __('
View and edit lines
') }}
{{
__
(
'
Compare changes with the merge request target branch
'
)
}}
</span>
</span>
</a>
</a>
</li>
</li>
...
...
app/assets/javascripts/ide/components/ide_review.vue
View file @
129dd185
<
script
>
<
script
>
import
{
mapGetters
,
mapState
,
mapActions
}
from
'vuex'
;
import
IdeTreeList
from
'./ide_tree_list.vue'
;
import
IdeTreeList
from
'./ide_tree_list.vue'
;
import
EditorModeDropdown
from
'./editor_mode_dropdown.vue'
;
export
default
{
export
default
{
components
:
{
components
:
{
IdeTreeList
,
IdeTreeList
,
EditorModeDropdown
,
},
computed
:
{
...
mapGetters
([
'currentMergeRequest'
]),
...
mapState
([
'viewer'
]),
},
mounted
()
{
this
.
updateViewer
(
this
.
currentMergeRequest
?
'mrdiff'
:
'diff'
);
},
methods
:
{
...
mapActions
([
'updateViewer'
]),
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<ide-tree-list
<ide-tree-list
viewer-type=
"diff
"
:viewer-type=
"viewer
"
header-class=
"ide-review-header"
header-class=
"ide-review-header"
:disable-action-dropdown=
"true"
:disable-action-dropdown=
"true"
>
>
<template
<template
slot=
"header"
slot=
"header"
>
>
{{
__
(
'Review'
)
}}
<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"
>
<div
class=
"prepend-top-5 ide-review-sub-header"
>
{{
__
(
'Lastest changes'
)
}}
<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>
</div>
</template>
</template>
</ide-tree-list>
</ide-tree-list>
</template>
</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';
...
@@ -2,6 +2,7 @@ import Vue from 'vue';
import
VueRouter
from
'vue-router'
;
import
VueRouter
from
'vue-router'
;
import
flash
from
'~/flash'
;
import
flash
from
'~/flash'
;
import
store
from
'./stores'
;
import
store
from
'./stores'
;
import
{
activityBarViews
}
from
'./constants'
;
Vue
.
use
(
VueRouter
);
Vue
.
use
(
VueRouter
);
...
@@ -101,7 +102,7 @@ router.beforeEach((to, from, next) => {
...
@@ -101,7 +102,7 @@ router.beforeEach((to, from, next) => {
throw
e
;
throw
e
;
});
});
}
else
if
(
to
.
params
.
mrid
)
{
}
else
if
(
to
.
params
.
mrid
)
{
store
.
dispatch
(
'update
Viewer'
,
'mrdiff'
);
store
.
dispatch
(
'update
ActivityBarView'
,
activityBarViews
.
review
);
store
store
.
dispatch
(
'getMergeRequestData'
,
{
.
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