Commit 34b45db4 authored by Bryce Johnson's avatar Bryce Johnson

Shush eslint.

parent 53a5ef60
...@@ -40,23 +40,23 @@ ...@@ -40,23 +40,23 @@
fetch() { fetch() {
return this.api.fetchApprovals() return this.api.fetchApprovals()
.then(res => this.assignToRootStore('approvals', res.data)) .then(res => this.assignToRootStore('approvals', res.data))
.then(data => this.maybeDisableAcceptance(data.approvals_left)); .then(data => this.maybeDisableAcceptance(data.approvalsLeft));
} }
approve() { approve() {
return this.api.approveMergeRequest() return this.api.approveMergeRequest()
.then(res => this.assignToRootStore('approvals', res.data)) .then(res => this.assignToRootStore('approvals', res.data))
.then(data => this.maybeDisableAcceptance(data.approvals_left)); .then(data => this.maybeDisableAcceptance(data.approvalsLeft));
} }
unapprove() { unapprove() {
return this.api.unapproveMergeRequest() return this.api.unapproveMergeRequest()
.then(res => this.assignToRootStore('approvals', res.data)) .then(res => this.assignToRootStore('approvals', res.data))
.then(data => this.maybeDisableAcceptance(data.approvals_left)); .then(data => this.maybeDisableAcceptance(data.approvalsLeft));
} }
maybeDisableAcceptance(approvals_left) { maybeDisableAcceptance(approvalsLeft) {
return this.rootStore.assignToData('disableAcceptance', !!approvals_left); return this.rootStore.assignToData('disableAcceptance', !!approvalsLeft);
} }
assignToRootStore(key, data) { assignToRootStore(key, data) {
......
...@@ -20,16 +20,17 @@ ...@@ -20,16 +20,17 @@
return approvers.length === 1 ? approvers[0].name : return approvers.length === 1 ? approvers[0].name :
approvers.reduce((memo, curr, index) => { approvers.reduce((memo, curr, index) => {
const nextMemo = `${memo}${curr.name}`;
if (index === approvers.length - 2) { // second to last index const nextMemo = `${memo}${curr.name}`;
return `${nextMemo} or `;
} else if (index === approvers.length - 1) { // last index
return nextMemo;
}
return `${nextMemo}, `; if (index === approvers.length - 2) { // second to last index
}, ''); return `${nextMemo} or `;
} else if (index === approvers.length - 1) { // last index
return nextMemo;
}
return `${nextMemo}, `;
}, '');
}, },
showApproveButton() { showApproveButton() {
return this.userCanApprove && !this.userHasApproved; return this.userCanApprove && !this.userHasApproved;
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
type: Number, type: Number,
required: false, required: false,
default: 32, default: 32,
} },
}, },
data() { data() {
return { return {
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
return !this.clickable ? 'disabled' : ''; return !this.clickable ? 'disabled' : '';
}, },
linkClass() { linkClass() {
return `author_link ${this.tooltipClass} ${this.extraLinkClass} ${this.disabledClass}` return `author_link ${this.tooltipClass} ${this.extraLinkClass} ${this.disabledClass}`;
}, },
tooltipContainerAttr() { tooltipContainerAttr() {
return this.tooltipContainer || 'body'; return this.tooltipContainer || 'body';
...@@ -87,6 +87,6 @@ ...@@ -87,6 +87,6 @@
<img :class='avatarClass' :src='avatarUrl' :width='size' :height='size' :alt='displayName'/> <img :class='avatarClass' :src='avatarUrl' :width='size' :height='size' :alt='displayName'/>
</a> </a>
</div> </div>
` `,
}); });
})(); })();
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
`); `);
this.initialData = { this.initialData = {
suggestedApprovers: [ { name: 'Approver 1' }], suggestedApprovers: [{ name: 'Approver 1' }],
userCanApprove: false, userCanApprove: false,
userHasApproved: true, userHasApproved: true,
approvedBy: [], approvedBy: [],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment