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
c09217e7
Commit
c09217e7
authored
Dec 21, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable approval buttons during API calls.
parent
ccf8b725
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
5 deletions
+33
-5
app/assets/javascripts/merge_request_widget/approvals/components/approvals_body.js.es6
...request_widget/approvals/components/approvals_body.js.es6
+10
-1
app/assets/javascripts/merge_request_widget/approvals/components/approvals_footer.js.es6
...quest_widget/approvals/components/approvals_footer.js.es6
+15
-3
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+8
-1
No files found.
app/assets/javascripts/merge_request_widget/approvals/components/approvals_body.js.es6
View file @
c09217e7
...
...
@@ -27,6 +27,11 @@
required: false,
},
},
data() {
return {
approving: false,
};
},
computed: {
approvalsRequiredStringified() {
const baseString = `${this.approvalsLeft} more approval`;
...
...
@@ -61,7 +66,10 @@
},
methods: {
approveMergeRequest() {
return gl.ApprovalsStore.approve();
this.approving = true;
return gl.ApprovalsStore.approve().then(() => {
this.approving = false;
});
},
},
beforeCreate() {
...
...
@@ -74,6 +82,7 @@
</h4>
<div v-if='showApproveButton' class='append-bottom-10'>
<button
:disabled='approving'
@click='approveMergeRequest'
class='btn btn-primary approve-btn'>
Approve Merge Request
...
...
app/assets/javascripts/merge_request_widget/approvals/components/approvals_footer.js.es6
View file @
c09217e7
...
...
@@ -35,14 +35,22 @@
required: true,
},
},
data() {
return {
unapproving: false,
};
},
computed: {
showUnapproveButton() {
return this.userHasApproved && !this.userCanApprove;
},
},
methods: {
removeApproval() {
gl.ApprovalsStore.unapprove();
unapproveMergeRequest() {
this.unapproving = true;
gl.ApprovalsStore.unapprove().then(() => {
this.unapproving = false;
});
},
},
beforeCreate() {
...
...
@@ -70,9 +78,13 @@
</link-to-member-avatar>
</span>
<span class='unapprove-btn-wrap' v-if='showUnapproveButton'>
<span class='unapprove-btn' @click='removeApproval()'>
<button
:disabled='unapproving'
@click='unapproveMergeRequest'
class='btn btn-link unapprove-btn'>
<i class='fa fa-close'></i>
Remove your approval</span>
</button>
</span>
</div>
`,
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
c09217e7
...
...
@@ -473,15 +473,22 @@
.unapprove-btn-wrap
{
border-left
:
1px
solid
$gl-gray-light
;
padding-left
:
1
5px
;
padding-left
:
5px
;
margin-left
:
10px
;
}
.unapprove-btn
{
border
:
none
;
background
:
transparent
;
cursor
:
pointer
;
&
:hover
{
color
:
$gl-gray-light
;
text-decoration
:
none
;
}
&
:focus
{
outline
:
none
;
}
}
...
...
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