From 85ff73cb26b1fa5ccd3a4282731464c945e3f0a3 Mon Sep 17 00:00:00 2001 From: Kacper Date: Thu, 7 Apr 2022 12:01:05 +0200 Subject: [PATCH 1/3] Do not validate if multi-select options length is 0 --- packages/server/src/api/controllers/row/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/utils.js b/packages/server/src/api/controllers/row/utils.js index 9ff6b085af..9bea800d63 100644 --- a/packages/server/src/api/controllers/row/utils.js +++ b/packages/server/src/api/controllers/row/utils.js @@ -65,7 +65,10 @@ exports.validate = async ({ tableId, row, table }) => { if (type === FieldTypes.ARRAY && row[fieldName]) { if (row[fieldName].length) { row[fieldName].map(val => { - if (!constraints.inclusion.includes(val)) { + if ( + !constraints.inclusion.includes(val) && + constraints.inclusion.length !== 0 + ) { errors[fieldName] = "Field not in list" } }) From cfbb9bfcaa82186189ff2d3f2ba3257f1eebb498 Mon Sep 17 00:00:00 2001 From: Kacper Date: Fri, 8 Apr 2022 17:21:30 +0200 Subject: [PATCH 2/3] Added option on frontend side to render MultiSelect as input instead of selector with no options --- .../src/components/backend/DataTable/RowFieldControl.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte index 7087dd0c23..ee01ef7467 100644 --- a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte +++ b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte @@ -34,10 +34,10 @@ $: label = meta.name ? capitalise(meta.name) : "" const timeStamp = resolveTimeStamp(value) - const isTimeStamp = timeStamp ? true : false + const isTimeStamp = !!timeStamp -{#if type === "options"} +{#if type === "options" && meta.constraints.inclusion.length !== 0}