Skip to content

Commit

Permalink
Merge pull request #107 from ezpaarse-project/feature/(front)no-locke…
Browse files Browse the repository at this point in the history
…d-perm-edit

fix(front): lock permissions buttons when user is locked
  • Loading branch information
nojhamster authored Oct 23, 2023
2 parents 78c4700 + 3188ba7 commit 8928371
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
9 changes: 8 additions & 1 deletion front/components/MemberInstitutionPermissions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
:key="permissionLevel.value"
:value="permissionLevel.value"
:loading="saving"
:disabled="readonly"
small
outlined
>
Expand Down Expand Up @@ -76,6 +77,10 @@ export default {
type: String,
default: () => '',
},
readonly: {
type: Boolean,
default: () => false,
},
},
data() {
return {
Expand Down Expand Up @@ -149,7 +154,9 @@ export default {
},
async savePermissions() {
if (!this.username || !this.institutionId) { return; }
if (!this.username || !this.institutionId || this.readonly) {
return;
}
this.saving = true;
this.saveError = null;
Expand Down
7 changes: 6 additions & 1 deletion front/components/MemberRepoPermissions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
:key="permission.value"
:value="permission.value"
:loading="loadingPerms[repository.id]"
:disabled="readonly"
small
outlined
>
Expand Down Expand Up @@ -77,6 +78,10 @@ export default {
type: String,
default: () => '',
},
readonly: {
type: Boolean,
default: () => false,
},
},
data() {
return {
Expand Down Expand Up @@ -151,7 +156,7 @@ export default {
},
async savePermission(repositoryId) {
if (!this.username) {
if (!this.username || this.readonly) {
return;
}
Expand Down
7 changes: 6 additions & 1 deletion front/components/MemberSpacePermissions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
:key="permission.value"
:value="permission.value"
:loading="loadingPerms[space.id]"
:disabled="readonly"
small
outlined
>
Expand Down Expand Up @@ -77,6 +78,10 @@ export default {
type: String,
default: () => '',
},
readonly: {
type: Boolean,
default: () => false,
},
},
data() {
return {
Expand Down Expand Up @@ -151,7 +156,7 @@ export default {
},
async savePermission(spaceId) {
if (!this.username) {
if (!this.username || this.readonly) {
return;
}
Expand Down
3 changes: 3 additions & 0 deletions front/components/MemberUpdateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<MemberInstitutionPermissions
:institution-id="institutionId"
:username="username"
:readonly="readonly"
class="px-0"
@change="hasChanged = true"
/>
Expand All @@ -44,6 +45,7 @@
<MemberRepoPermissions
:institution-id="institutionId"
:username="username"
:readonly="readonly"
class="px-0"
@change="hasChanged = true"
/>
Expand All @@ -59,6 +61,7 @@
<MemberSpacePermissions
:institution-id="institutionId"
:username="username"
:readonly="readonly"
class="px-0"
@change="hasChanged = true"
/>
Expand Down

0 comments on commit 8928371

Please sign in to comment.