client lint first pass

This commit is contained in:
Matteo Pagliazzi
2019-10-11 20:35:49 +02:00
parent 07cffe9e16
commit a625e83b53
104 changed files with 1053 additions and 893 deletions

View File

@@ -34,19 +34,24 @@ export default {
message () {
const approvals = this.task.approvals || [];
const approvalsLength = approvals.length;
const userIsRequesting = approvals.findIndex(approval => approval.userId.id === this.user._id) !== -1;
const userIsRequesting = approvals
.findIndex(approval => approval.userId.id === this.user._id) !== -1;
if (approvalsLength === 1 && !userIsRequesting) {
return this.$t('userRequestsApproval', { userName: approvals[0].userId.profile.name });
} if (approvalsLength > 1 && !userIsRequesting) {
return this.$t('userCountRequestsApproval', { userCount: approvalsLength });
} if (approvalsLength === 1 && userIsRequesting || this.task.group.approval && this.task.group.approval.requested && !this.task.group.approval.approved) {
} if (
(approvalsLength === 1 && userIsRequesting)
|| (this.task.group.approval
&& this.task.group.approval.requested && !this.task.group.approval.approved)) {
return this.$t('youAreRequestingApproval');
}
return null;
},
userIsAdmin () {
return this.group && (this.group.leader.id === this.user._id || this.group.managers[this.user._id]);
return this.group
&& (this.group.leader.id === this.user._id || this.group.managers[this.user._id]);
},
},
};