From 2be92258e946cb2cd76f0ed34c3788214199fe68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Mon, 10 Jun 2024 08:39:52 +0200 Subject: [PATCH] pkp/pkp-lib#9996 add jsdocs --- src/components/Form/formHelpers.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/Form/formHelpers.js b/src/components/Form/formHelpers.js index e11454bfa..5f27683e3 100644 --- a/src/components/Form/formHelpers.js +++ b/src/components/Form/formHelpers.js @@ -41,6 +41,15 @@ export function shouldShowGroup(group, fields) { return whenField.value === group.showWhen[1]; } +/** + * Should a field be shown? + * + * @param {Object} field One field to check + * @param {Object} fields All form fields + * @param {Object} groups All form groups + * @return {Boolean} + */ + export function shouldShowField(field, fields, groups) { const group = groups.find((group) => group.id === field.groupId);