From a77c7a6965985a56a6a5bfe5d2e6156c8ec5e87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=98=84=EC=84=B1=ED=95=84?= Date: Mon, 19 Feb 2024 15:17:10 +0900 Subject: [PATCH] =?UTF-8?q?PropertyTable.js=20View=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApiTestManager/src/components/PropertyTable.js | 16 ++++++++-------- .../client/dto/ApiRequestKeyValueDTO.java | 3 +++ 2 files changed, 11 insertions(+), 8 deletions(-) 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; }