83d8035dc2
* root + server * frontend * frontend-2 * dui3 * dui3 * tailwind theme * ui-components * preview service * viewer * viewer-sandbox * fileimport-service * webhook service * objectloader * shared * ui-components-nuxt * WIP full config * WIP full linter * eslint projectwide util * minor fix * removing redundant ci * clean up test errors * fixed prettier formatting * CI improvements * TSC lint fix * 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader * removed unnecessary void --------- Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
46 lines
1.1 KiB
Vue
46 lines
1.1 KiB
Vue
<template>
|
|
<div class="mt-4">
|
|
<ProjectVisibilitySelect
|
|
v-model="currentVisibility"
|
|
:disabled="isDisabled"
|
|
mount-menu-on-body
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import type {
|
|
ProjectVisibility,
|
|
ProjectsPageTeamDialogManagePermissions_ProjectFragment
|
|
} from '~~/lib/common/generated/gql/graphql'
|
|
import { useTeamManagePermissionsInternals } from '~~/lib/projects/composables/team'
|
|
import { graphql } from '~~/lib/common/generated/gql/gql'
|
|
|
|
graphql(`
|
|
fragment ProjectsPageTeamDialogManagePermissions_Project on Project {
|
|
id
|
|
visibility
|
|
role
|
|
}
|
|
`)
|
|
|
|
const props = defineProps<{
|
|
project: ProjectsPageTeamDialogManagePermissions_ProjectFragment
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
(e: 'changedVisibility', newVisibility: ProjectVisibility): void
|
|
}>()
|
|
|
|
const projectRef = toRef(props, 'project')
|
|
const { isOwner, isServerGuest } = useTeamManagePermissionsInternals(projectRef)
|
|
|
|
const isDisabled = computed(() => !isOwner.value || isServerGuest.value)
|
|
|
|
const currentVisibility = ref(props.project.visibility)
|
|
|
|
watch(currentVisibility, (newVisibility) => {
|
|
emit('changedVisibility', newVisibility)
|
|
})
|
|
</script>
|