From 06bb22f45d526c33231a4be0904d4c00e016c30c Mon Sep 17 00:00:00 2001 From: axolotle Date: Mon, 24 Apr 2023 18:05:07 +0200 Subject: [PATCH] args: reflect pydantic `visible` changes --- app/src/helpers/yunohostArguments.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/helpers/yunohostArguments.js b/app/src/helpers/yunohostArguments.js index 641ae376..4bfe37ab 100644 --- a/app/src/helpers/yunohostArguments.js +++ b/app/src/helpers/yunohostArguments.js @@ -131,7 +131,7 @@ export function formatYunoHostArgument(arg) { arg.ask = formatI18nField(arg.ask) const field = { is: arg.readonly ? 'ReadOnlyField' : 'FormField', - visible: [undefined, true, '"true"'].includes(arg.visible), + visible: arg.visible, props: { label: arg.ask, component: undefined, @@ -433,12 +433,12 @@ export function formatYunoHostConfigPanels(data) { const section = { id: _section.id, isActionSection: _section.is_action_section, - visible: [undefined, true, '"true"'].includes(_section.visible), + visible: _section.visible } if (_section.help) section.help = formatI18nField(_section.help) if (_section.name) section.name = formatI18nField(_section.name) - if (_section.visible && ![false, '"false"'].includes(_section.visible)) { - addEvaluationGetter('visible', section, _section.visible, result.forms) + if (typeof _section.visible === "string") { + addEvaluationGetter('visible', section, section.visible, result.forms) } const { form, fields, validations, errors } = formatYunoHostArguments(