From 0bd493a473c4764b3a5bba0ab9180280459213d2 Mon Sep 17 00:00:00 2001 From: Ingmar van Stipriaan Date: Thu, 18 Jan 2024 16:05:03 +0100 Subject: [PATCH] feat: add keys to disable splitbutton and clickthrough --- src/validations/prefab/componentOption.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/validations/prefab/componentOption.ts b/src/validations/prefab/componentOption.ts index af58b730..d10ca41e 100644 --- a/src/validations/prefab/componentOption.ts +++ b/src/validations/prefab/componentOption.ts @@ -75,6 +75,8 @@ const optionConfigurationSchema = Joi.when('type', { 'any.invalid': 'API version 1 is no longer supported.', }), allowedKinds: Joi.array().items(Joi.string()), + allowedSplitButtonKinds: Joi.array().items(Joi.string()), + allowedClickThroughKinds: Joi.array().items(Joi.string()), createProperty: Joi.object({ type: Joi.string(), value: Joi.string().allow(''), @@ -88,6 +90,15 @@ const optionConfigurationSchema = Joi.when('type', { }), otherwise: Joi.object(optionConfigurationSchemaBase), }) + .when('type', { + is: 'VARIABLE', + then: Joi.object({ + ...optionConfigurationSchemaBase, + allowedKinds: Joi.array().items(Joi.string()), + allowedSplitButtonKinds: Joi.array().items(Joi.string()), + allowedClickThroughKinds: Joi.array().items(Joi.string()), + }), + }) .when('type', { is: 'PUBLIC_FILE', then: Joi.object({