-/**
- * @extends {Component}
- */
-import {htmlToDom} from "../services/dom";
+import {htmlToDom} from '../services/dom';
+import {Component} from './component';
-class EntityPermissions {
+export class EntityPermissions extends Component {
setup() {
this.container = this.$el;
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);
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;
}
}
-
-export default EntityPermissions;
\ No newline at end of file