Skip to content

Commit

Permalink
refactor: Remove ownership claim mode
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Oct 10, 2024
1 parent ba7fbcf commit 816dd25
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions web/src/components/AccessControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const props = defineProps<{
const emit = defineEmits(["updateSelectedProject"]);
const allUsers: Ref<User[]> = ref([]);
const showUserSelectDialog: Ref<boolean> = ref(false);
const userSelectDialogMode: Ref<string> = ref("add");
const userSelectDialogMode: Ref<"add" | "transfer"> = ref("add");
const selectedUsers: Ref<User[]> = ref([]);
const selectedPermissionLevel: Ref<string> = ref("follower");
const permissionLevels = ["follower", "collaborator"];
Expand All @@ -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)) {
Expand Down Expand Up @@ -123,18 +123,6 @@ onMounted(() => {
/>
</template>
</v-list-item>
<v-list-item v-else class="mx-4" subtitle="No owner">
<template v-slot:append>
<v-icon
v-if="permissions[project.id] === 'own'"
icon="mdi-pencil"
@click="
showUserSelectDialog = true;
userSelectDialogMode = 'claim';
"
/>
</template>
</v-list-item>
<v-list-subheader>
Collaborators
<v-tooltip activator="parent" location="end">
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 816dd25

Please sign in to comment.