Skip to content

Commit

Permalink
Merge pull request #130 from dinukadesilva/bug-fix-10-14-2022-15-58
Browse files Browse the repository at this point in the history
Bug fix sharing modal
  • Loading branch information
dinukadesilva authored Oct 14, 2022
2 parents f1824ba + bcf6088 commit 3f4dcd8
Show file tree
Hide file tree
Showing 2 changed files with 1,737 additions and 1,589 deletions.
15 changes: 14 additions & 1 deletion src/components/modals/share-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ export default {
}
}
},
getPermissionTypeLevel({id}) {
if (id === "OWNER") {
return 1;
} else if (id === "EDITOR") {
return 2;
} else if (id === "VIEWER") {
return 3;
}
},
async refreshData() {
this.processing = true;
Expand All @@ -118,7 +127,10 @@ export default {
const promises = []
if (this.savedOwners) {
this.owners = this.savedOwners.map(({ownerId, ownerType, permission}) => {
this.owners = this.savedOwners.map(({ownerId, ownerType, permissions}) => {
permissions = permissions.sort((a, b) => this.getPermissionTypeLevel(a) - this.getPermissionTypeLevel(b));
const permission = permissions[0];
let _promise;
if (ownerType === "group") {
_promise = this.$store.dispatch("group/fetchGroup", {clientId: this.clientId, groupId: ownerId});
Expand All @@ -139,6 +151,7 @@ export default {
description: `Unknown error when fetching sharing details.`,
source: e, variant: "danger"
});
throw e;
}
this.processing = false;
Expand Down
Loading

0 comments on commit 3f4dcd8

Please sign in to comment.