diff --git a/ApiTestManager/src/components/PropertyTable.js b/ApiTestManager/src/components/PropertyTable.js index 1480495..8b68399 100644 --- a/ApiTestManager/src/components/PropertyTable.js +++ b/ApiTestManager/src/components/PropertyTable.js @@ -86,9 +86,9 @@ class PropertyTableView { if (checkbox) { checkbox.addEventListener('change', (event) => { const index = parseInt(event.target.parentElement.parentElement.parentElement.getAttribute('data-index'), 10); - this.propertyTable.controller.updateProperty(index, 'enabled', event.target.checked); - if (this.propertyTable.controller.additionalCallback) { - this.propertyTable.controller.additionalCallback(this.model.getProperties()); + this.controller.updateProperty(index, 'enabled', event.target.checked); + if (this.controller.additionalCallback) { + this.controller.additionalCallback(this.model.getProperties()); } }); } @@ -103,8 +103,8 @@ class PropertyTableView { editableInput.init(editableElement, (value) => { let model = this.model.getProperties()[index]; model[editableElement.dataset.name] = value; - if (this.propertyTable.controller.additionalCallback) { - this.propertyTable.controller.additionalCallback(this.model.getProperties()); + if (this.controller.additionalCallback) { + this.controller.additionalCallback(this.model.getProperties()); } }); }); @@ -121,14 +121,14 @@ class PropertyTableView { console.log(event.target.getAttribute('data-index')); const index = parseInt(event.target.getAttribute('data-index'), 10); console.log({index}); - this.propertyTable.controller.removeProperty(index); + this.controller.removeProperty(index); }); }); const addButton = this.element.querySelector('.add_property'); if (addButton) { addButton.addEventListener('click', (event) => { - this.propertyTable.controller.addProperty(); + this.controller.addProperty(); }); } else { console.log('Add button not found'); // Check if the button is not found @@ -140,7 +140,7 @@ class PropertyTableView { class PropertyTableController { constructor(model) { this.model = model; - this.view = new PropertyTableView(this.model); + this.view = new PropertyTableView(this.model, this); } init(element, callback) { diff --git a/src/main/java/com/eactive/testmaster/client/dto/ApiRequestKeyValueDTO.java b/src/main/java/com/eactive/testmaster/client/dto/ApiRequestKeyValueDTO.java index c5d6f07..957337b 100644 --- a/src/main/java/com/eactive/testmaster/client/dto/ApiRequestKeyValueDTO.java +++ b/src/main/java/com/eactive/testmaster/client/dto/ApiRequestKeyValueDTO.java @@ -18,6 +18,9 @@ public class ApiRequestKeyValueDTO implements Serializable { this.value = value; } + public ApiRequestKeyValueDTO() { + } + public boolean isEnabled() { return enabled; }