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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
851d4a7c
Commit
851d4a7c
authored
Dec 16, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify state between components on pageload.
parent
d4831953
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
app/assets/javascripts/merge_request_widget/approvals/components/approvals_body.js.es6
...request_widget/approvals/components/approvals_body.js.es6
+5
-3
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+4
-1
app/views/projects/merge_requests/widget/_open.html.haml
app/views/projects/merge_requests/widget/_open.html.haml
+2
-3
No files found.
app/assets/javascripts/merge_request_widget/approvals/components/approvals_body.js.es6
View file @
851d4a7c
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
return this.userCanApprove && !this.userHasApproved;
return this.userCanApprove && !this.userHasApproved;
},
},
showApprovalsBody() {
showApprovalsBody() {
return !this.widgetLoading
&& this.approvalsLeft && this.suggestedApprovers.length
;
return !this.widgetLoading;
}
}
},
},
methods: {
methods: {
...
@@ -45,8 +45,10 @@
...
@@ -45,8 +45,10 @@
gl.ApprovalsStore.initStoreOnce();
gl.ApprovalsStore.initStoreOnce();
},
},
template: `
template: `
<div class='approvals-body' v-if='showApprovalsBody'>
<div class='approvals-body mr-widget-body' v-if='showApprovalsBody'>
<h4> Requires {{ approvalsRequiredStringified }} (from {{ approverNamesStringified }})</h4>
<h4> Requires {{ approvalsRequiredStringified }}
<span v-if='!!suggestedApprovers.length'> (from {{ approverNamesStringified }}) </span>
</h4>
<div v-if='showApproveButton' class='append-bottom-10'>
<div v-if='showApproveButton' class='append-bottom-10'>
<button
<button
@click='approveMergeRequest'
@click='approveMergeRequest'
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
851d4a7c
...
@@ -93,6 +93,10 @@
...
@@ -93,6 +93,10 @@
display
:
inline-block
;
display
:
inline-block
;
}
}
.mr-widget-body
~
.mr-widget-body
{
border-top
:
1px
solid
$well-inner-border
;
}
.mr-widget-body
{
.mr-widget-body
{
h4
{
h4
{
font-weight
:
600
;
font-weight
:
600
;
...
@@ -104,7 +108,6 @@
...
@@ -104,7 +108,6 @@
color
:
$gl-warning
;
color
:
$gl-warning
;
}
}
}
}
p
:last-child
{
p
:last-child
{
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
...
...
app/views/projects/merge_requests/widget/_open.html.haml
View file @
851d4a7c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#merge-request-widget-app
.mr-state-widget
{
'data-endpoint'
=>
merge_request_path
(
@merge_request
)
}
#merge-request-widget-app
.mr-state-widget
{
'data-endpoint'
=>
merge_request_path
(
@merge_request
)
}
=
render
'projects/merge_requests/widget/heading'
=
render
'projects/merge_requests/widget/heading'
.mr-widget-body
{
'v-show'
=>
'showWidgetBody'
}
.mr-widget-body
-# After conflicts are resolved, the user is redirected back to the MR page.
-# After conflicts are resolved, the user is redirected back to the MR page.
-# There is a short window before background workers run and GitLab processes
-# There is a short window before background workers run and GitLab processes
-# the new push and commits, during which it will think the conflicts still exist.
-# the new push and commits, during which it will think the conflicts still exist.
...
@@ -26,8 +26,6 @@
...
@@ -26,8 +26,6 @@
=
render
'projects/merge_requests/widget/open/conflicts'
=
render
'projects/merge_requests/widget/open/conflicts'
-
elsif
@merge_request
.
work_in_progress?
-
elsif
@merge_request
.
work_in_progress?
=
render
'projects/merge_requests/widget/open/wip'
=
render
'projects/merge_requests/widget/open/wip'
-
elsif
@merge_request
.
requires_approve?
&&
!
@merge_request
.
approved?
=
render
'projects/merge_requests/widget/open/approvals_body'
-
elsif
@merge_request
.
merge_when_build_succeeds?
-
elsif
@merge_request
.
merge_when_build_succeeds?
=
render
'projects/merge_requests/widget/open/merge_when_build_succeeds'
=
render
'projects/merge_requests/widget/open/merge_when_build_succeeds'
-
elsif
!
@merge_request
.
can_be_merged_by?
(
current_user
)
-
elsif
!
@merge_request
.
can_be_merged_by?
(
current_user
)
...
@@ -51,6 +49,7 @@
...
@@ -51,6 +49,7 @@
=
mr_assign_issues_link
=
mr_assign_issues_link
-
if
@merge_request
.
requires_approve?
-
if
@merge_request
.
requires_approve?
=
render
'projects/merge_requests/widget/open/approvals_body'
=
render
'projects/merge_requests/widget/open/approvals_footer'
=
render
'projects/merge_requests/widget/open/approvals_footer'
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