taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 5ccf99ae92290ac41621884451e0824f4818d11a
parent 906d5bcfaf17f03872ed1ed20996952e29497687
Author: Florian Dold <florian@dold.me>
Date:   Fri, 21 Mar 2025 11:46:25 +0100

simplify form

Diffstat:
Mpackages/web-util/src/forms/gana/VQF_902_1_customer.ts | 73++++++++++++++++++-------------------------------------------------------
1 file changed, 18 insertions(+), 55 deletions(-)

diff --git a/packages/web-util/src/forms/gana/VQF_902_1_customer.ts b/packages/web-util/src/forms/gana/VQF_902_1_customer.ts @@ -1,3 +1,19 @@ +/* + This file is part of GNU Taler + (C) 2025 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU Affero Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU Affero Public License for more details. + + You should have received a copy of the GNU Affero Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + import { DoubleColumnFormDesign, InternationalizationAPI, @@ -6,9 +22,7 @@ import { countryNationalityList } from "../../utils/select-ui-lists.js"; import { TalerFormAttributes } from "./taler_form_attributes.js"; /** - * VQF_902_1 filled by customer - * - * @returns + * Form vqf_902_1_customer. */ export function VQF_902_1_customer( i18n: InternationalizationAPI, @@ -51,36 +65,24 @@ member act as director of a domiciliary company, this domiciliary company is the label: i18n.str`Full name`, type: "text", required: true, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_RESIDENTIAL.id, label: i18n.str`Residential address`, type: "textArea", required: true, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_PHONE.id, label: i18n.str`Telephone`, type: "text", required: false, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_EMAIL.id, label: i18n.str`E-mail`, type: "text", required: false, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_BIRTHDATE.id, @@ -89,9 +91,6 @@ member act as director of a domiciliary company, this domiciliary company is the placeholder: "dd/MM/yyyy", pattern: "dd/MM/yyyy", required: true, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_NATIONALITY.id, @@ -99,9 +98,6 @@ member act as director of a domiciliary company, this domiciliary company is the type: "selectOne", choices: countryNationalityList(i18n), required: true, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_NATIONAL_ID.id, @@ -109,9 +105,6 @@ member act as director of a domiciliary company, this domiciliary company is the type: "file", accept: "application/pdf", required: true, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, ], }, @@ -127,9 +120,6 @@ member act as director of a domiciliary company, this domiciliary company is the label: i18n.str`Company name`, type: "text", required: false, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_REGISTERED_OFFICE @@ -137,9 +127,6 @@ member act as director of a domiciliary company, this domiciliary company is the label: i18n.str`Registered office`, type: "text", required: false, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_NATURAL_COMPANY_ID_DOC @@ -148,9 +135,6 @@ member act as director of a domiciliary company, this domiciliary company is the type: "file", required: false, accept: "application/pdf", - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "NATURAL_PERSON"; - }, }, ], }, @@ -166,18 +150,12 @@ member act as director of a domiciliary company, this domiciliary company is the label: i18n.str`Company name`, type: "text", required: true, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_ADDRESS.id, label: i18n.str`Domicile`, type: "textArea", required: true, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, }, { id: TalerFormAttributes.VQF_902_1 @@ -185,27 +163,18 @@ member act as director of a domiciliary company, this domiciliary company is the label: i18n.str`Contact person`, type: "text", required: false, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_PHONE.id, label: i18n.str`Telephone`, type: "text", required: false, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_EMAIL.id, label: i18n.str`E-mail`, type: "text", required: false, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, }, { id: TalerFormAttributes.VQF_902_1.CUSTOMER_ENTITY_ID_COPY.id, @@ -213,9 +182,6 @@ member act as director of a domiciliary company, this domiciliary company is the type: "file", accept: "application/pdf", required: true, - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, }, ], }, @@ -227,11 +193,9 @@ member act as director of a domiciliary company, this domiciliary company is the id: TalerFormAttributes.VQF_902_1.FOUNDER_LIST.id, label: i18n.str`Founders`, type: "array", - hide(value, root) { - return root["CUSTOMER_INFO_TYPE"] !== "LEGAL_ENTITY"; - }, labelFieldId: TalerFormAttributes.VQF_902_1_founder.FOUNDER_FULL_NAME.id, + required: true, fields: [ { id: TalerFormAttributes.VQF_902_1_founder.FOUNDER_FULL_NAME.id, @@ -297,7 +261,6 @@ member act as director of a domiciliary company, this domiciliary company is the required: true, }, ], - required: true, }, ], },