]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/entity-permissions.js
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / resources / js / components / entity-permissions.js
index 0dec5ca0937dda6620122628e5aef22b5ccd8013..b020c5d85ba8f785785df1e2f98e2607f0e9b385 100644 (file)
@@ -1,9 +1,7 @@
-/**
- * @extends {Component}
- */
-import {htmlToDom} from "../services/dom";
+import {htmlToDom} from '../services/dom.ts';
+import {Component} from './component';
 
-class EntityPermissions {
+export class EntityPermissions extends Component {
 
     setup() {
         this.container = this.$el;
@@ -31,12 +29,12 @@ class EntityPermissions {
         this.container.addEventListener('click', event => {
             const button = event.target.closest('button');
             if (button && button.dataset.roleId) {
-                this.removeRowOnButtonClick(button)
+                this.removeRowOnButtonClick(button);
             }
         });
 
         // Role select change
-        this.roleSelect.addEventListener('change', event => {
+        this.roleSelect.addEventListener('change', () => {
             const roleId = this.roleSelect.value;
             if (roleId) {
                 this.addRoleRow(roleId);
@@ -63,8 +61,8 @@ class EntityPermissions {
 
     removeRowOnButtonClick(button) {
         const row = button.closest('.item-list-row');
-        const roleId = button.dataset.roleId;
-        const roleName = button.dataset.roleName;
+        const {roleId} = button.dataset;
+        const {roleName} = button.dataset;
 
         const option = document.createElement('option');
         option.value = roleId;
@@ -75,5 +73,3 @@ class EntityPermissions {
     }
 
 }
-
-export default EntityPermissions;
\ No newline at end of file