Remove instance name as a required screen setting and add new screen properties as optional validation
This commit is contained in:
parent
7ea59a521d
commit
91c4f85f81
|
@ -9,6 +9,7 @@ const Joi = require("joi")
|
||||||
|
|
||||||
const OPTIONAL_STRING = Joi.string().optional().allow(null).allow("")
|
const OPTIONAL_STRING = Joi.string().optional().allow(null).allow("")
|
||||||
const OPTIONAL_NUMBER = Joi.number().optional().allow(null)
|
const OPTIONAL_NUMBER = Joi.number().optional().allow(null)
|
||||||
|
const OPTIONAL_BOOLEAN = Joi.boolean().optional().allow(null)
|
||||||
|
|
||||||
exports.tableValidator = () => {
|
exports.tableValidator = () => {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -159,15 +160,16 @@ exports.screenValidator = () => {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
return joiValidator.body(Joi.object({
|
return joiValidator.body(Joi.object({
|
||||||
name: Joi.string().required(),
|
name: Joi.string().required(),
|
||||||
|
showNavigation: OPTIONAL_BOOLEAN,
|
||||||
routing: Joi.object({
|
routing: Joi.object({
|
||||||
route: Joi.string().required(),
|
route: Joi.string().required(),
|
||||||
roleId: Joi.string().required().allow(""),
|
roleId: Joi.string().required().allow(""),
|
||||||
|
homeScreen: OPTIONAL_BOOLEAN,
|
||||||
}).required().unknown(true),
|
}).required().unknown(true),
|
||||||
props: Joi.object({
|
props: Joi.object({
|
||||||
_id: Joi.string().required(),
|
_id: Joi.string().required(),
|
||||||
_component: Joi.string().required(),
|
_component: Joi.string().required(),
|
||||||
_children: Joi.array().required(),
|
_children: Joi.array().required(),
|
||||||
_instanceName: Joi.string().required(),
|
|
||||||
_styles: Joi.object().required(),
|
_styles: Joi.object().required(),
|
||||||
type: OPTIONAL_STRING,
|
type: OPTIONAL_STRING,
|
||||||
table: OPTIONAL_STRING,
|
table: OPTIONAL_STRING,
|
||||||
|
|
Loading…
Reference in New Issue