Files
habitica/website/client/components/group-plans/index.vue
Sabe Jones 76ae41875d Group Plans quick wins (#11107)
* WIP(groups): quickish wins

* WIP(groups): two quick wins
1. Don't show task creation button if user is not leader or manager
2. Don't require JS confirm() for approving tasks

* fix(group-plans): allow delete from options button

* fix(group-plans): update tasksOrder when task deleted

* fix(group-tasks): dismiss notification when user takes action

* refactor(tasks): DRY out create button styling

* fix(group-tasks): sync after claiming/unclaiming
2019-04-15 10:48:27 -05:00

49 lines
1.4 KiB
Vue

<template lang="pug">
.row
group-form-modal
secondary-menu.col-12
router-link.nav-link(:to="{name: 'groupPlanDetailTaskInformation', params: {groupId}}",
exact, :class="{'active': $route.name === 'groupPlanDetailTaskInformation'}") {{ $t('groupTaskBoard') }}
router-link.nav-link(:to="{name: 'groupPlanDetailInformation', params: {groupId}}",
exact, :class="{'active': $route.name === 'groupPlanDetailInformation'}") {{ $t('groupInformation') }}
router-link.nav-link(
v-if='isLeader',
:to="{name: 'groupPlanBilling', params: {groupId}}",
exact,
:class="{'active': $route.name === 'groupPlanBilling'}") {{ $t('groupBilling') }}
.col-12
router-view
</template>
<script>
import groupFormModal from 'client/components/groups/groupFormModal';
import SecondaryMenu from 'client/components/secondaryMenu';
import { mapState } from 'client/libs/store';
export default {
props: ['groupId'],
components: {
SecondaryMenu,
groupFormModal,
},
computed: {
...mapState({
user: 'user.data',
groupPlans: 'groupPlans',
}),
currentGroup () {
let groupFound = this.groupPlans.find(group => {
return group._id === this.groupId;
});
return groupFound;
},
isLeader () {
if (!this.currentGroup) return false;
return this.currentGroup.leader === this.user._id;
},
},
};
</script>