Skip to content

Commit

Permalink
Only show manage button when user canEdit (#2260)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwallacespeckle authored May 15, 2024
1 parent a6ead06 commit 7a1d4ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/frontend-2/components/project/page/team/Block.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<template #bottom>
<div class="flex items-center justify-between mt-1">
<UserAvatarGroup :users="teamUsers" class="max-w-[104px]" />
<div v-if="activeUser">
<div v-if="canEdit">
<FormButton class="ml-2" :to="projectCollaboratorsRoute(project.id)">
Manage
</FormButton>
Expand All @@ -25,15 +25,15 @@
</ProjectPageStatsBlock>
</template>
<script setup lang="ts">
import { useActiveUser } from '~~/lib/auth/composables/activeUser'
import { canEditProject } from '~~/lib/projects/helpers/permissions'
import type { ProjectPageTeamInternals_ProjectFragment } from '~~/lib/common/generated/gql/graphql'
import { projectCollaboratorsRoute } from '~~/lib/common/helpers/route'

const props = defineProps<{
project: ProjectPageTeamInternals_ProjectFragment
}>()

const { activeUser } = useActiveUser()
const canEdit = computed(() => canEditProject(props.project))

const teamUsers = computed(() => props.project.team.map((t) => t.user))
</script>

0 comments on commit 7a1d4ba

Please sign in to comment.