lint common

This commit is contained in:
Matteo Pagliazzi
2019-10-09 20:08:36 +02:00
parent 0c27fb24a5
commit e0e9811ab6
330 changed files with 6885 additions and 7668 deletions

View File

@@ -26,26 +26,24 @@
<script>
import { mapState } from '@/libs/store';
export default {
props: ['task', 'group'],
computed: {
...mapState({user: 'user.data'}),
...mapState({ user: 'user.data' }),
message () {
let approvals = this.task.approvals || [];
let approvalsLength = approvals.length;
let userIsRequesting = approvals.findIndex((approval) => {
return approval.userId.id === this.user._id;
}) !== -1;
const approvals = this.task.approvals || [];
const approvalsLength = approvals.length;
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});
} else if (approvalsLength > 1 && !userIsRequesting) {
return this.$t('userCountRequestsApproval', {userCount: approvalsLength});
} else if (approvalsLength === 1 && userIsRequesting || this.task.group.approval && this.task.group.approval.requested && !this.task.group.approval.approved) {
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) {
return this.$t('youAreRequestingApproval');
} else {
return null;
}
return null;
},
userIsAdmin () {
return this.group && (this.group.leader.id === this.user._id || this.group.managers[this.user._id]);