From 91c4f85f81a62bff0b47cdc210e74a20e329f932 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 11 May 2022 08:46:13 +0100 Subject: [PATCH] Remove instance name as a required screen setting and add new screen properties as optional validation --- .../[screenId]/screens/_components/ScreenRoleModal.svelte | 0 packages/server/src/api/routes/utils/validators.js | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenRoleModal.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenRoleModal.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenRoleModal.svelte new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/server/src/api/routes/utils/validators.js b/packages/server/src/api/routes/utils/validators.js index dac936911b..63bdd81ca7 100644 --- a/packages/server/src/api/routes/utils/validators.js +++ b/packages/server/src/api/routes/utils/validators.js @@ -9,6 +9,7 @@ const Joi = require("joi") const OPTIONAL_STRING = Joi.string().optional().allow(null).allow("") const OPTIONAL_NUMBER = Joi.number().optional().allow(null) +const OPTIONAL_BOOLEAN = Joi.boolean().optional().allow(null) exports.tableValidator = () => { // prettier-ignore @@ -159,15 +160,16 @@ exports.screenValidator = () => { // prettier-ignore return joiValidator.body(Joi.object({ name: Joi.string().required(), + showNavigation: OPTIONAL_BOOLEAN, routing: Joi.object({ route: Joi.string().required(), roleId: Joi.string().required().allow(""), + homeScreen: OPTIONAL_BOOLEAN, }).required().unknown(true), props: Joi.object({ _id: Joi.string().required(), _component: Joi.string().required(), _children: Joi.array().required(), - _instanceName: Joi.string().required(), _styles: Joi.object().required(), type: OPTIONAL_STRING, table: OPTIONAL_STRING,