Skip to content

Commit

Permalink
Improved: made whole permission item card clickable (hotwax#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Jul 15, 2024
1 parent 3219d44 commit 4c02fc2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/PermissionItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
</ion-item-divider>

<section v-if="group.groupId !== 'SGC_HIDDEN'">
<ion-card v-for="permission in group.permissions" :key="permission.permissionId">
<ion-card v-for="permission in group.permissions" :key="permission.permissionId" button @click="updatePermissionAssociation(permission)">
<ion-card-header>
<div>
<ion-card-title>{{ permission.permissionId }}</ion-card-title>
<ion-card-subtitle>{{ permission.description }}</ion-card-subtitle>
</div>
<ion-checkbox :disabled="permission.isChecked ? !hasPermission(Actions.APP_PERMISSION_UPDATE) : !hasPermission(Actions.APP_PERMISSION_CREATE)" :checked="permission.isChecked" @click.prevent="updatePermissionAssociation($event, permission)" />
<ion-checkbox :disabled="permission.isChecked ? !hasPermission(Actions.APP_PERMISSION_UPDATE) : !hasPermission(Actions.APP_PERMISSION_CREATE)" :checked="permission.isChecked" />
</ion-card-header>
</ion-card>
</section>
Expand Down Expand Up @@ -107,9 +107,7 @@ export default defineComponent({
async updateQuery() {
await this.store.dispatch('permission/updateQuery', this.query)
},
async updatePermissionAssociation(event: any, permission: any) {
event.stopImmediatePropagation();
async updatePermissionAssociation(permission: any) {
let resp = {} as any;
const payload = {
groupId: this.currentGroup.groupId,
Expand Down Expand Up @@ -153,7 +151,6 @@ export default defineComponent({
showToast(translate("Security group permission association successfully updated."))
await this.store.dispatch('permission/updateCurrentGroupPermissions', { groupId: this.currentGroup.groupId, currentPermissions})
this.store.dispatch('permission/checkAssociated')
event.target.checked = !permission.isChecked
} else {
throw resp.data
}
Expand Down

0 comments on commit 4c02fc2

Please sign in to comment.