diff --git a/web/src/components/AccessControl.vue b/web/src/components/AccessControl.vue index 8ad7a8b4..c772d4b4 100644 --- a/web/src/components/AccessControl.vue +++ b/web/src/components/AccessControl.vue @@ -11,7 +11,7 @@ const props = defineProps<{ const emit = defineEmits(["updateSelectedProject"]); const allUsers: Ref = ref([]); const showUserSelectDialog: Ref = ref(false); -const userSelectDialogMode: Ref = ref("add"); +const userSelectDialogMode: Ref<"add" | "transfer"> = ref("add"); const selectedUsers: Ref = ref([]); const selectedPermissionLevel: Ref = ref("follower"); const permissionLevels = ["follower", "collaborator"]; @@ -31,7 +31,7 @@ function savePermissions() { (uid: number) => uid !== userToRemove.value?.id ); } else if ( - ["transfer", "claim"].includes(userSelectDialogMode.value) && + userSelectDialogMode.value === "transfer" && selectedUsers.value.length === 1 ) { if (!newPermissions.collaborator_ids.includes(newPermissions.owner_id)) { @@ -123,18 +123,6 @@ onMounted(() => { /> - - - Collaborators @@ -275,10 +263,8 @@ onMounted(() => { item-title="username" :rules="[ (v) => - !( - ['transfer', 'claim'].includes(userSelectDialogMode) && - v.length > 1 - ) || 'Must select one new owner', + !(userSelectDialogMode === 'transfer' && v.length > 1) || + 'Must select one new owner', ]" return-object multiple