Skip to content

Commit

Permalink
Merge pull request #16 from appventure-nush/beta
Browse files Browse the repository at this point in the history
fix creating role with no users
  • Loading branch information
squi-ddy authored May 26, 2024
2 parents 2e1dde4 + ddf0723 commit 4f8aa3a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions frontend/src/components/viewer/RoleViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
</div>
<v-hover v-slot="{hover}" v-else>
<div class="my-1">
<UserAvatar :uid="user.uid" :size="46" classes="ma-1" :key="user.uid" v-for="user in usersWithRole||[]"
<UserAvatar :uid="user.uid" :size="46" classes="ma-1" :key="user.uid" v-for="user in usersWithRole||[]"
:elevation="hover?3:0"></UserAvatar>
<template v-if="!usersWithRole.length">No users</template>
</div>
</v-hover>
<div v-if="showPlainEmail">
Expand All @@ -46,7 +47,7 @@
<h1 class="text-h5">Pending</h1>
<pre v-text="role.pendingEmail.join('\n')"></pre>
</div>
<v-btn v-if="!editing&&!creating" text @click="showPlainEmail=!showPlainEmail">Toggle Plain</v-btn>
<v-btn v-if="!editing&&!creating&&usersWithRole.length" text @click="showPlainEmail=!showPlainEmail">Toggle Plain</v-btn>
</v-card-text>
<PermissionEditor v-model="editedPermissions" :editing="editing"
no-data="No permission overrides set for this role"></PermissionEditor>
Expand Down Expand Up @@ -165,11 +166,12 @@ export default class RoleViewer extends Vue {
emails: this.emailsWithRoles
})
}).then(() => {
const self = this;
const rid = this.editedRole.rid;
EventBus.$emit('needRoleUpdate', () => {
self.$router.push({name: 'Role', params: {rid: self.editedRole.rid}});
self.saving = false;
})
// this.editedRole is reset in this callback
this.$router.push({name: 'Role', params: {rid: rid}});
this.saving = false;
});
}).catch(err => {
this.saving = false;
alert(err);
Expand Down

0 comments on commit 4f8aa3a

Please sign in to comment.