From 373952a59bf0b84299fd80de8d09d9b25a01e30e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 5 Apr 2023 17:43:35 +0100 Subject: [PATCH 1/4] Fixing #10155 - some options errors were being swallowed and in general it was never considered to be an error state due to the 'handled' flag being consistently sent, changed the logic a bit here. --- .../backend/DataTable/RowFieldControl.svelte | 2 +- .../DataTable/modals/CreateEditRow.svelte | 27 ++++++++++--------- .../scripts/integrations/postgres/init.sql | 5 ++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte index 1c93880ec1..aff143452f 100644 --- a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte +++ b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte @@ -42,7 +42,7 @@ {#if type === "options" && meta.constraints.inclusion.length !== 0} - {:else if type === "datetime"} Date: Wed, 5 Apr 2023 17:50:14 +0100 Subject: [PATCH 2/4] Reverting test sql changes. --- packages/server/scripts/integrations/postgres/init.sql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/server/scripts/integrations/postgres/init.sql b/packages/server/scripts/integrations/postgres/init.sql index 19a6446ad2..78af4c20b9 100644 --- a/packages/server/scripts/integrations/postgres/init.sql +++ b/packages/server/scripts/integrations/postgres/init.sql @@ -7,7 +7,6 @@ CREATE TABLE Persons ( LastName varchar(255), FirstName varchar(255), Address varchar(255), - Age INT NOT NULL, City varchar(255) DEFAULT 'Belfast', Type person_job ); @@ -43,8 +42,8 @@ CREATE TABLE test.table1 ( id SERIAL PRIMARY KEY, Name varchar(255) ); -INSERT INTO Persons (FirstName, LastName, Address, City, Type, Age) VALUES ('Mike', 'Hughes', '123 Fake Street', 'Belfast', 'qa', 20); -INSERT INTO Persons (FirstName, LastName, Address, City, Type, Age) VALUES ('John', 'Smith', '64 Updown Road', 'Dublin', 'programmer', 30); +INSERT INTO Persons (FirstName, LastName, Address, City, Type) VALUES ('Mike', 'Hughes', '123 Fake Street', 'Belfast', 'qa'); +INSERT INTO Persons (FirstName, LastName, Address, City, Type) VALUES ('John', 'Smith', '64 Updown Road', 'Dublin', 'programmer'); INSERT INTO Tasks (ExecutorID, QaID, TaskName, Completed) VALUES (1, 2, 'assembling', TRUE); INSERT INTO Tasks (ExecutorID, QaID, TaskName, Completed) VALUES (2, 1, 'processing', FALSE); INSERT INTO Products (ProductName) VALUES ('Computers'); From 022b3acbccaaf78637efcfa46342d5bda3c0b0be Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 5 Apr 2023 17:54:05 +0100 Subject: [PATCH 3/4] Linting. --- .../components/backend/DataTable/RowFieldControl.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte index aff143452f..1a4ced9f3a 100644 --- a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte +++ b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte @@ -42,7 +42,13 @@ {#if type === "options" && meta.constraints.inclusion.length !== 0} - {:else if type === "datetime"} Date: Wed, 5 Apr 2023 20:32:41 +0100 Subject: [PATCH 4/4] Removing console logging. --- .../components/backend/DataTable/modals/CreateEditRow.svelte | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte index c4127d36bd..2bca6474d2 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte @@ -29,10 +29,8 @@ } catch (error) { const response = error.json if (error.handled && response?.errors) { - console.error("FIRST") errors = response.errors } else if (error.handled && response?.validationErrors) { - console.error(response.validationErrors) const mappedErrors = {} for (let field in response.validationErrors) { mappedErrors[ @@ -40,7 +38,6 @@ ] = `${field} ${response.validationErrors[field][0]}` } errors = mappedErrors - console.log(errors) } else { notifications.error(`Failed to save row - ${error.message}`) }