aboutsummaryrefslogtreecommitdiff
path: root/packages/aml-backoffice-ui
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-05-09 18:02:19 -0300
committerSebastian <sebasjm@gmail.com>2024-05-09 18:02:19 -0300
commit2375c1c1c8095b4d38dd2afa878705ad3bb216e1 (patch)
tree0580af464796aee06b90b76b864af3aa5e293c33 /packages/aml-backoffice-ui
parent5ec065a90be3a0bd4a85ca4fdb949fb5f643db96 (diff)
downloadwallet-core-2375c1c1c8095b4d38dd2afa878705ad3bb216e1.tar.xz
documentation updated: change some types
Diffstat (limited to 'packages/aml-backoffice-ui')
-rw-r--r--packages/aml-backoffice-ui/src/forms.json903
-rw-r--r--packages/aml-backoffice-ui/src/forms/simplest.ts60
-rw-r--r--packages/aml-backoffice-ui/src/hooks/form.ts28
-rw-r--r--packages/aml-backoffice-ui/src/pages/CaseUpdate.tsx1
-rw-r--r--packages/aml-backoffice-ui/src/pages/ShowConsolidated.tsx75
5 files changed, 524 insertions, 543 deletions
diff --git a/packages/aml-backoffice-ui/src/forms.json b/packages/aml-backoffice-ui/src/forms.json
index ed556307b..ef8001f91 100644
--- a/packages/aml-backoffice-ui/src/forms.json
+++ b/packages/aml-backoffice-ui/src/forms.json
@@ -13,222 +13,199 @@
"fields": [
{
"type": "choiceStacked",
- "properties": {
- "name": "customerType",
- "id": ".customerType",
- "label": "Type of customer",
- "help": "Select one and complete the next form",
- "required": true,
- "choices": [
- {
- "label": "Natural person",
- "value": "natural"
- },
- {
- "label": "Legal entity",
- "value": "legal"
- }
- ]
- }
+
+ "name": "customerType",
+ "id": ".customerType",
+ "label": "Type of customer",
+ "help": "Select one and complete the next form",
+ "required": true,
+ "choices": [
+ {
+ "label": "Natural person",
+ "value": "natural"
+ },
+ {
+ "label": "Legal entity",
+ "value": "legal"
+ }
+ ]
},
{
"type": "group",
- "properties": {
- "label": "Natural customer form",
- "name": "algo",
- "id": "algo",
- "before": "a) Country risk (nationality)",
- "after": "a) Country risk (nationality)",
- "fields": [
- {
- "type": "text",
- "properties": {
- "name": "naturalCustomer.fullName",
- "id": ".naturalCustomer.fullName",
- "label": "Full name",
- "required": true
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "naturalCustomer.address",
- "id": ".naturalCustomer.address",
- "label": "Residential address",
- "required": true
- }
- },
- {
- "type": "integer",
- "properties": {
- "name": "naturalCustomer.telephone",
- "id": ".naturalCustomer.telephone",
- "label": "Telephone"
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "naturalCustomer.email",
- "id": ".naturalCustomer.email",
- "label": "E-mail"
- }
- },
- {
- "type": "absoluteTime",
- "properties": {
- "pattern": "dd/MM/yyyy",
- "name": "naturalCustomer.dateOfBirth",
- "id": ".naturalCustomer.dateOfBirth",
- "label": "Date of birth",
- "required": true
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "naturalCustomer.nationality",
- "id": ".naturalCustomer.nationality",
- "label": "Nationality",
- "required": true
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "naturalCustomer.document",
- "id": ".naturalCustomer.document",
- "label": "Identification document",
- "required": true
- }
- },
- {
- "type": "file",
- "properties": {
- "name": "naturalCustomer.documentAttachment",
- "id": ".naturalCustomer.documentAttachment",
- "label": "Document attachment",
- "required": true,
- "maxBites": 2097152,
- "accept": ".pdf",
- "help": "PDF file with max size of 2 mega bytes"
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "naturalCustomer.companyName",
- "id": ".naturalCustomer.companyName",
- "label": "Company name"
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "naturalCustomer.office",
- "id": ".naturalCustomer.office",
- "label": "Registered office"
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "naturalCustomer.companyDocument",
- "id": ".naturalCustomer.companyDocument",
- "label": "Company identification document"
- }
- },
- {
- "type": "file",
- "properties": {
- "name": "naturalCustomer.companyDocumentAttachment",
- "id": ".naturalCustomer.companyDocumentAttachment",
- "label": "Document attachment",
- "required": true,
- "maxBites": 2097152,
- "accept": ".png",
- "help": "PNG file with max size of 2 mega bytes"
- }
- }
- ]
- }
+
+ "label": "Natural customer form",
+ "name": "algo",
+ "id": "algo",
+ "before": "a) Country risk (nationality)",
+ "after": "a) Country risk (nationality)",
+ "fields": [
+ {
+ "type": "text",
+
+ "name": "naturalCustomer.fullName",
+ "id": ".naturalCustomer.fullName",
+ "label": "Full name",
+ "required": true
+ },
+ {
+ "type": "text",
+
+ "name": "naturalCustomer.address",
+ "id": ".naturalCustomer.address",
+ "label": "Residential address",
+ "required": true
+ },
+ {
+ "type": "integer",
+
+ "name": "naturalCustomer.telephone",
+ "id": ".naturalCustomer.telephone",
+ "label": "Telephone"
+ },
+ {
+ "type": "text",
+
+ "name": "naturalCustomer.email",
+ "id": ".naturalCustomer.email",
+ "label": "E-mail"
+ },
+ {
+ "type": "absoluteTime",
+
+ "pattern": "dd/MM/yyyy",
+ "name": "naturalCustomer.dateOfBirth",
+ "id": ".naturalCustomer.dateOfBirth",
+ "label": "Date of birth",
+ "required": true
+ },
+ {
+ "type": "text",
+
+ "name": "naturalCustomer.nationality",
+ "id": ".naturalCustomer.nationality",
+ "label": "Nationality",
+ "required": true
+ },
+ {
+ "type": "text",
+
+ "name": "naturalCustomer.document",
+ "id": ".naturalCustomer.document",
+ "label": "Identification document",
+ "required": true
+ },
+ {
+ "type": "file",
+
+ "name": "naturalCustomer.documentAttachment",
+ "id": ".naturalCustomer.documentAttachment",
+ "label": "Document attachment",
+ "required": true,
+ "maxBites": 2097152,
+ "accept": ".pdf",
+ "help": "PDF file with max size of 2 mega bytes"
+ },
+ {
+ "type": "text",
+
+ "name": "naturalCustomer.companyName",
+ "id": ".naturalCustomer.companyName",
+ "label": "Company name"
+ },
+ {
+ "type": "text",
+
+ "name": "naturalCustomer.office",
+ "id": ".naturalCustomer.office",
+ "label": "Registered office"
+ },
+ {
+ "type": "text",
+
+ "name": "naturalCustomer.companyDocument",
+ "id": ".naturalCustomer.companyDocument",
+ "label": "Company identification document"
+ },
+ {
+ "type": "file",
+
+ "name": "naturalCustomer.companyDocumentAttachment",
+ "id": ".naturalCustomer.companyDocumentAttachment",
+ "label": "Document attachment",
+ "required": true,
+ "maxBites": 2097152,
+ "accept": ".png",
+ "help": "PNG file with max size of 2 mega bytes"
+ }
+ ]
},
-
-
+
{
"type": "group",
- "properties": {
- "label": "Natural customer form",
- "name": "algo",
- "id": "algo",
- "before": "a) Country risk (nationality)",
- "after": "a) Country risk (nationality)",
- "fields": [
- {
- "type": "text",
- "properties": {
- "name": "legalCustomer.companyName",
- "id": ".legalCustomer.companyName",
- "label": "Company name",
- "required": true
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "legalCustomer.domicile",
- "id": ".legalCustomer.domicile",
- "label": "Domicile",
- "required": true
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "legalCustomer.contactPerson",
- "id": ".legalCustomer.contactPerson",
- "label": "Contact person"
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "legalCustomer.telephone",
- "id": ".legalCustomer.telephone",
- "label": "Telephone"
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "legalCustomer.email",
- "id": ".legalCustomer.email",
- "label": "E-mail"
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "legalCustomer.document",
- "id": ".legalCustomer.document",
- "label": "Identification document",
- "help": "Not older than 12 month"
- }
- },
- {
- "type": "file",
- "properties": {
- "name": "legalCustomer.documentAttachment",
- "id": ".legalCustomer.documentAttachment",
- "label": "Document attachment",
- "required": true,
- "maxBites": 2097152,
- "accept": ".png",
- "help": "PNG file with max size of 2 mega bytes"
- }
- }
- ]
- }
+
+ "label": "Natural customer form",
+ "name": "algo",
+ "id": "algo",
+ "before": "a) Country risk (nationality)",
+ "after": "a) Country risk (nationality)",
+ "fields": [
+ {
+ "type": "text",
+
+ "name": "legalCustomer.companyName",
+ "id": ".legalCustomer.companyName",
+ "label": "Company name",
+ "required": true
+ },
+ {
+ "type": "text",
+
+ "name": "legalCustomer.domicile",
+ "id": ".legalCustomer.domicile",
+ "label": "Domicile",
+ "required": true
+ },
+ {
+ "type": "text",
+
+ "name": "legalCustomer.contactPerson",
+ "id": ".legalCustomer.contactPerson",
+ "label": "Contact person"
+ },
+ {
+ "type": "text",
+
+ "name": "legalCustomer.telephone",
+ "id": ".legalCustomer.telephone",
+ "label": "Telephone"
+ },
+ {
+ "type": "text",
+
+ "name": "legalCustomer.email",
+ "id": ".legalCustomer.email",
+ "label": "E-mail"
+ },
+ {
+ "type": "text",
+
+ "name": "legalCustomer.document",
+ "id": ".legalCustomer.document",
+ "label": "Identification document",
+ "help": "Not older than 12 month"
+ },
+ {
+ "type": "file",
+
+ "name": "legalCustomer.documentAttachment",
+ "id": ".legalCustomer.documentAttachment",
+ "label": "Document attachment",
+ "required": true,
+ "maxBites": 2097152,
+ "accept": ".png",
+ "help": "PNG file with max size of 2 mega bytes"
+ }
+ ]
}
]
},
@@ -238,108 +215,99 @@
"fields": [
{
"type": "array",
- "properties": {
- "name": "businessEstablisher",
- "id": ".businessEstablisher",
- "label": "Persons",
- "required": true,
- "labelFieldId": "fullName",
- "placeholder": "this is the placeholder",
- "fields": [
- {
- "type": "text",
- "properties": {
- "name": "fullName",
- "id": ".fullName",
- "label": "Full name",
- "required": true
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "address",
- "id": ".address",
- "label": "Residential address",
- "required": true
- }
- },
- {
- "type": "absoluteTime",
- "properties": {
- "pattern": "dd/MM/yyyy",
- "name": "dateOfBirth",
- "id": ".dateOfBirth",
- "label": "Date of birth",
- "required": true
- }
- },
-
- {
- "type": "text",
- "properties": {
- "name": "nationality",
- "id": ".nationality",
- "label": "Nationality",
- "required": true
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "typeOfAuthorization",
- "id": ".typeOfAuthorization",
- "label": "Type of authorization (signatory of representation)",
- "required": true
- }
- },
- {
- "type": "file",
- "properties": {
- "name": "documentAttachment",
- "id": ".documentAttachment",
- "label": "Identification document attachment",
- "required": true,
- "maxBites": 2097152,
- "accept": ".pdf",
- "help": "PDF file with max size of 2 mega bytes"
- }
- },
- {
- "type": "choiceStacked",
- "properties": {
- "name": "powerOfAttorneyArrangements",
- "id": ".powerOfAttorneyArrangements",
- "label": "Power of attorney arrangements",
- "required": true,
- "choices": [
- {
- "label": "CR extract",
- "value": "cr"
- },
- {
- "label": "Mandate",
- "value": "mandate"
- },
- {
- "label": "Other",
- "value": "other"
- }
- ]
- }
- },
- {
- "type": "text",
- "properties": {
- "name": "powerOfAttorneyArrangementsOther",
- "id": ".powerOfAttorneyArrangementsOther",
- "label": "Power of attorney arrangements",
- "required": true
+
+ "name": "businessEstablisher",
+ "id": ".businessEstablisher",
+ "label": "Persons",
+ "required": true,
+ "labelFieldId": "fullName",
+ "placeholder": "this is the placeholder",
+ "fields": [
+ {
+ "type": "text",
+
+ "name": "fullName",
+ "id": ".fullName",
+ "label": "Full name",
+ "required": true
+ },
+ {
+ "type": "text",
+
+ "name": "address",
+ "id": ".address",
+ "label": "Residential address",
+ "required": true
+ },
+ {
+ "type": "absoluteTime",
+
+ "pattern": "dd/MM/yyyy",
+ "name": "dateOfBirth",
+ "id": ".dateOfBirth",
+ "label": "Date of birth",
+ "required": true
+ },
+
+ {
+ "type": "text",
+
+ "name": "nationality",
+ "id": ".nationality",
+ "label": "Nationality",
+ "required": true
+ },
+ {
+ "type": "text",
+
+ "name": "typeOfAuthorization",
+ "id": ".typeOfAuthorization",
+ "label": "Type of authorization (signatory of representation)",
+ "required": true
+ },
+ {
+ "type": "file",
+
+ "name": "documentAttachment",
+ "id": ".documentAttachment",
+ "label": "Identification document attachment",
+ "required": true,
+ "maxBites": 2097152,
+ "accept": ".pdf",
+ "help": "PDF file with max size of 2 mega bytes"
+ },
+ {
+ "type": "choiceStacked",
+
+ "name": "powerOfAttorneyArrangements",
+ "id": ".powerOfAttorneyArrangements",
+ "label": "Power of attorney arrangements",
+ "required": true,
+ "choices": [
+ {
+ "label": "CR extract",
+ "value": "cr"
+ },
+ {
+ "label": "Mandate",
+ "value": "mandate"
+ },
+ {
+ "label": "Other",
+ "value": "other"
}
- }
- ],
- "labelField": "fullName"
- }
+ ]
+ },
+ {
+ "type": "text",
+
+ "name": "powerOfAttorneyArrangementsOther",
+ "id": ".powerOfAttorneyArrangementsOther",
+ "label": "Power of attorney arrangements",
+ "required": true
+ }
+ ],
+ "labelField": "fullName"
}
]
},
@@ -348,103 +316,96 @@
"fields": [
{
"type": "absoluteTime",
- "properties": {
- "name": "acceptance.when",
- "id": ".acceptance.when",
- "pattern": "dd/MM/yyyy",
- "converterId": "Taler.AbsoluteTime",
- "label": "Date (conclusion of contract)"
- }
+
+ "name": "acceptance.when",
+ "id": ".acceptance.when",
+ "pattern": "dd/MM/yyyy",
+ "converterId": "Taler.AbsoluteTime",
+ "label": "Date (conclusion of contract)"
},
{
"type": "choiceStacked",
- "properties": {
- "name": "acceptance.acceptedBy",
- "id": ".acceptance.acceptedBy",
- "label": "Accepted by",
- "required": true,
- "choices": [
- {
- "label": "Face-to-face meeting with customer",
- "value": "face-to-face"
- },
- {
- "label": "Correspondence: authenticated copy of identification document obtained",
- "value": "correspondence-document"
- },
- {
- "label": "Correspondence: residential address validated",
- "value": "correspondence-address"
- }
- ]
- }
+
+ "name": "acceptance.acceptedBy",
+ "id": ".acceptance.acceptedBy",
+ "label": "Accepted by",
+ "required": true,
+ "choices": [
+ {
+ "label": "Face-to-face meeting with customer",
+ "value": "face-to-face"
+ },
+ {
+ "label": "Correspondence: authenticated copy of identification document obtained",
+ "value": "correspondence-document"
+ },
+ {
+ "label": "Correspondence: residential address validated",
+ "value": "correspondence-address"
+ }
+ ]
},
{
"type": "choiceStacked",
- "properties": {
- "name": "acceptance.typeOfCorrespondence",
- "id": ".acceptance.typeOfCorrespondence",
- "label": "Type of correspondence service",
- "choices": [
- {
- "label": "to the customer",
- "value": "customer"
- },
- {
- "label": "hold at bank",
- "value": "bank"
- },
- {
- "label": "to the member",
- "value": "member"
- },
- {
- "label": "to a third party",
- "value": "third-party"
- }
- ]
- }
+
+ "name": "acceptance.typeOfCorrespondence",
+ "id": ".acceptance.typeOfCorrespondence",
+ "label": "Type of correspondence service",
+ "choices": [
+ {
+ "label": "to the customer",
+ "value": "customer"
+ },
+ {
+ "label": "hold at bank",
+ "value": "bank"
+ },
+ {
+ "label": "to the member",
+ "value": "member"
+ },
+ {
+ "label": "to a third party",
+ "value": "third-party"
+ }
+ ]
},
{
"type": "text",
- "properties": {
- "name": "acceptance.thirdPartyFullName",
- "id": ".acceptance.thirdPartyFullName",
- "label": "Third party full name",
- "required": true
- }
+
+ "name": "acceptance.thirdPartyFullName",
+ "id": ".acceptance.thirdPartyFullName",
+ "label": "Third party full name",
+ "required": true
},
{
"type": "text",
- "properties": {
- "name": "acceptance.thirdPartyAddress",
- "id": ".acceptance.thirdPartyAddress",
- "label": "Third party address",
- "required": true
- }
+
+ "name": "acceptance.thirdPartyAddress",
+ "id": ".acceptance.thirdPartyAddress",
+ "label": "Third party address",
+ "required": true
},
{
"type": "selectMultiple",
- "properties": {
- "name": "acceptance.language",
- "id": ".acceptance.language",
- "label": "Languages",
- "choices": [
- {
- "label": "Espanol",
- "value": "es"
- }
- ],
- "unique": true
- }
+
+ "name": "acceptance.language",
+ "id": ".acceptance.language",
+ "label": "Languages",
+ "choices": [
+ {
+ "label": "Espanol",
+ "value": "es"
+ }
+ ],
+ "unique": true
},
{
"type": "textArea",
- "properties": {
- "name": "acceptance.furtherInformation",
- "id": ".acceptance.furtherInformation",
- "label": "Further information"
- }
+
+ "name": "acceptance.furtherInformation",
+ "id": ".acceptance.furtherInformation",
+ "label": "Further information"
}
]
},
@@ -454,34 +415,33 @@
"fields": [
{
"type": "choiceStacked",
- "properties": {
- "name": "establishment",
- "id": ".establishment",
- "label": "The customer is",
- "required": true,
- "choices": [
- {
- "label": "a natural person and there are no doubts that this person is the sole beneficial owner of the assets",
- "value": "natural"
- },
- {
- "label": "a foundation (or a similar construct; incl. underlying companies)",
- "value": "foundation"
- },
- {
- "label": "a trust (incl. underlying companies)",
- "value": "trust"
- },
- {
- "label": "a life insurance policy with separately managed accounts/securities accounts",
- "value": "insurance-wrapper"
- },
- {
- "label": "all other cases",
- "value": "other"
- }
- ]
- }
+
+ "name": "establishment",
+ "id": ".establishment",
+ "label": "The customer is",
+ "required": true,
+ "choices": [
+ {
+ "label": "a natural person and there are no doubts that this person is the sole beneficial owner of the assets",
+ "value": "natural"
+ },
+ {
+ "label": "a foundation (or a similar construct; incl. underlying companies)",
+ "value": "foundation"
+ },
+ {
+ "label": "a trust (incl. underlying companies)",
+ "value": "trust"
+ },
+ {
+ "label": "a life insurance policy with separately managed accounts/securities accounts",
+ "value": "insurance-wrapper"
+ },
+ {
+ "label": "all other cases",
+ "value": "other"
+ }
+ ]
}
]
},
@@ -491,12 +451,11 @@
"fields": [
{
"type": "textArea",
- "properties": {
- "name": "embargoEvaluation",
- "id": ".embargoEvaluation",
- "help": "The evaluation must be made at the beginning of the business relationship and has to be repeated in the case of permanent business relationship every time the according lists are updated.",
- "label": "Evaluation"
- }
+
+ "name": "embargoEvaluation",
+ "id": ".embargoEvaluation",
+ "help": "The evaluation must be made at the beginning of the business relationship and has to be repeated in the case of permanent business relationship every time the according lists are updated.",
+ "label": "Evaluation"
}
]
},
@@ -506,42 +465,78 @@
"fields": [
{
"type": "choiceStacked",
- "properties": {
- "name": "cashTransactions.typeOfBusiness",
- "id": ".cashTransactions.typeOfBusiness",
- "label": "Type of business relationship",
- "choices": [
- {
- "label": "Money exchange",
- "value": "money-exchange"
- },
- {
- "label": "Money and asset transfer",
- "value": "money-and-asset-transfer"
- },
- {
- "label": "Other cash transactions. Specify below",
- "value": "other"
- }
- ]
- }
+
+ "name": "cashTransactions.typeOfBusiness",
+ "id": ".cashTransactions.typeOfBusiness",
+ "label": "Type of business relationship",
+ "choices": [
+ {
+ "label": "Money exchange",
+ "value": "money-exchange"
+ },
+ {
+ "label": "Money and asset transfer",
+ "value": "money-and-asset-transfer"
+ },
+ {
+ "label": "Other cash transactions. Specify below",
+ "value": "other"
+ }
+ ]
},
{
"type": "text",
- "properties": {
- "name": "cashTransactions.otherTypeOfBusiness",
- "id": ".cashTransactions.otherTypeOfBusiness",
- "required": true,
- "label": "Specify other cash transactions:"
- }
+
+ "name": "cashTransactions.otherTypeOfBusiness",
+ "id": ".cashTransactions.otherTypeOfBusiness",
+ "required": true,
+ "label": "Specify other cash transactions:"
},
{
"type": "textArea",
- "properties": {
- "name": "cashTransactions.purpose",
- "id": ".cashTransactions.purpose",
- "label": "Purpose of the business relationship (purpose of service requested)"
- }
+ "name": "cashTransactions.purpose",
+ "id": ".cashTransactions.purpose",
+ "label": "Purpose of the business relationship (purpose of service requested)"
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "label": "Example form",
+ "id": "example",
+ "version": 1,
+ "config": {
+ "type": "double-column",
+ "design": [
+ {
+ "title": "Decorative elements",
+ "description": "This is an example UI of a form with decorative elements",
+ "fields": [
+ {
+ "type": "caption",
+ "name": "cap",
+ "label": "This is a caption"
+ },
+ {
+ "type": "group",
+ "name": "group",
+ "label": "The first name and last name are in a group",
+ "fields": [
+ {
+ "type": "text",
+ "name": "firstName",
+ "id": ".person.name",
+ "label": "First name"
+ },
+ {
+ "type": "text",
+ "name": "lastName",
+ "id": ".person.lastName",
+ "label": "Last name"
+ }
+ ]
}
]
}
diff --git a/packages/aml-backoffice-ui/src/forms/simplest.ts b/packages/aml-backoffice-ui/src/forms/simplest.ts
index 37ab0913d..4cd781b74 100644
--- a/packages/aml-backoffice-ui/src/forms/simplest.ts
+++ b/packages/aml-backoffice-ui/src/forms/simplest.ts
@@ -18,7 +18,7 @@ import type {
DoubleColumnForm,
DoubleColumnFormSection,
InternationalizationAPI,
- UIHandlerId
+ UIHandlerId,
} from "@gnu-taler/web-util/browser";
export const v1 = (i18n: InternationalizationAPI): DoubleColumnForm => ({
@@ -29,11 +29,9 @@ export const v1 = (i18n: InternationalizationAPI): DoubleColumnForm => ({
fields: [
{
type: "textArea",
- properties: {
- id: ".comment" as UIHandlerId,
- name: "comment",
- label: i18n.str`Comment`,
- },
+ id: ".comment" as UIHandlerId,
+ name: "comment",
+ label: i18n.str`Comment`,
},
],
},
@@ -61,36 +59,32 @@ export function resolutionSection(
fields: [
{
type: "choiceHorizontal",
- properties: {
- id: ".state" as UIHandlerId,
- name: "state",
- label: i18n.str`New state`,
- converterId: "TalerExchangeApi.AmlState",
- choices: [
- {
- value: "frozen",
- label: i18n.str`Frozen`,
- },
- {
- value: "pending",
- label: i18n.str`Pending`,
- },
- {
- value: "normal",
- label: i18n.str`Normal`,
- },
- ],
- },
+ id: ".state" as UIHandlerId,
+ name: "state",
+ label: i18n.str`New state`,
+ converterId: "TalerExchangeApi.AmlState",
+ choices: [
+ {
+ value: "frozen",
+ label: i18n.str`Frozen`,
+ },
+ {
+ value: "pending",
+ label: i18n.str`Pending`,
+ },
+ {
+ value: "normal",
+ label: i18n.str`Normal`,
+ },
+ ],
},
{
type: "amount",
- properties: {
- id: ".threshold" as UIHandlerId,
- currency: "NETZBON",
- name: "threshold",
- converterId: "Taler.Amount",
- label: i18n.str`New threshold`,
- },
+ id: ".threshold" as UIHandlerId,
+ currency: "NETZBON",
+ name: "threshold",
+ converterId: "Taler.Amount",
+ label: i18n.str`New threshold`,
},
],
};
diff --git a/packages/aml-backoffice-ui/src/hooks/form.ts b/packages/aml-backoffice-ui/src/hooks/form.ts
index e9194d86d..70b2db571 100644
--- a/packages/aml-backoffice-ui/src/hooks/form.ts
+++ b/packages/aml-backoffice-ui/src/hooks/form.ts
@@ -22,7 +22,7 @@ import {
} from "@gnu-taler/taler-util";
import {
UIFieldHandler,
- UIFormFieldConfig,
+ UIFormElementConfig,
UIHandlerId,
} from "@gnu-taler/web-util/browser";
import { useState } from "preact/hooks";
@@ -167,21 +167,21 @@ export function setValueDeeper(object: any, names: string[], value: any): any {
}
export function getShapeFromFields(
- fields: UIFormFieldConfig[],
+ fields: UIFormElementConfig[],
): Array<UIHandlerId> {
const shape: Array<UIHandlerId> = [];
fields.forEach((field) => {
- if ("id" in field.properties) {
+ if ("id" in field) {
// FIXME: this should be a validation when loading the form
// consistency check
- if (shape.indexOf(field.properties.id) !== -1) {
- throw Error(`already present: ${field.properties.id}`);
+ if (shape.indexOf(field.id) !== -1) {
+ throw Error(`already present: ${field.id}`);
}
- shape.push(field.properties.id);
+ shape.push(field.id);
} else if (field.type === "group") {
Array.prototype.push.apply(
shape,
- getShapeFromFields(field.properties.fields),
+ getShapeFromFields(field.fields),
);
}
});
@@ -189,24 +189,24 @@ export function getShapeFromFields(
}
export function getRequiredFields(
- fields: UIFormFieldConfig[],
+ fields: UIFormElementConfig[],
): Array<UIHandlerId> {
const shape: Array<UIHandlerId> = [];
fields.forEach((field) => {
- if ("id" in field.properties) {
+ if ("id" in field) {
// FIXME: this should be a validation when loading the form
// consistency check
- if (shape.indexOf(field.properties.id) !== -1) {
- throw Error(`already present: ${field.properties.id}`);
+ if (shape.indexOf(field.id) !== -1) {
+ throw Error(`already present: ${field.id}`);
}
- if (!field.properties.required) {
+ if (!field.required) {
return;
}
- shape.push(field.properties.id);
+ shape.push(field.id);
} else if (field.type === "group") {
Array.prototype.push.apply(
shape,
- getRequiredFields(field.properties.fields),
+ getRequiredFields(field.fields),
);
}
});
diff --git a/packages/aml-backoffice-ui/src/pages/CaseUpdate.tsx b/packages/aml-backoffice-ui/src/pages/CaseUpdate.tsx
index 712a1fed9..7801625d0 100644
--- a/packages/aml-backoffice-ui/src/pages/CaseUpdate.tsx
+++ b/packages/aml-backoffice-ui/src/pages/CaseUpdate.tsx
@@ -145,7 +145,6 @@ export function CaseUpdate({
const validatedForm = state.status !== "ok" ? undefined : state.result;
- console.log(state.errors);
const submitHandler =
validatedForm === undefined
? undefined
diff --git a/packages/aml-backoffice-ui/src/pages/ShowConsolidated.tsx b/packages/aml-backoffice-ui/src/pages/ShowConsolidated.tsx
index 3c0301e9f..cdc5d0bc1 100644
--- a/packages/aml-backoffice-ui/src/pages/ShowConsolidated.tsx
+++ b/packages/aml-backoffice-ui/src/pages/ShowConsolidated.tsx
@@ -21,11 +21,10 @@ import {
} from "@gnu-taler/taler-util";
import {
DefaultForm,
- FlexibleForm,
- UIFormField,
- UIFormFieldConfig,
+ FormConfiguration,
+ UIFormElementConfig,
UIHandlerId,
- useTranslationContext,
+ useTranslationContext
} from "@gnu-taler/web-util/browser";
import { format } from "date-fns";
import { Fragment, VNode, h } from "preact";
@@ -42,7 +41,7 @@ export function ShowConsolidated({
const cons = getConsolidated(history, until);
- const form: FlexibleForm = {
+ const form: FormConfiguration = {
type: "double-column",
design: [
{
@@ -50,34 +49,30 @@ export function ShowConsolidated({
fields: [
{
type: "amount",
- properties: {
- id: ".aml.threshold" as UIHandlerId,
- currency: "NETZBON",
- label: i18n.str`Threshold`,
- name: "aml.threshold",
- },
+ id: ".aml.threshold" as UIHandlerId,
+ currency: "NETZBON",
+ label: i18n.str`Threshold`,
+ name: "aml.threshold",
},
{
type: "choiceHorizontal",
- properties: {
- label: i18n.str`State`,
- name: "aml.state",
- id: ".aml.state" as UIHandlerId,
- choices: [
- {
- label: i18n.str`Frozen`,
- value: "frozen",
- },
- {
- label: i18n.str`Pending`,
- value: "pending",
- },
- {
- label: i18n.str`Normal`,
- value: "normal",
- },
- ],
- },
+ label: i18n.str`State`,
+ name: "aml.state",
+ id: ".aml.state" as UIHandlerId,
+ choices: [
+ {
+ label: i18n.str`Frozen`,
+ value: "frozen",
+ },
+ {
+ label: i18n.str`Pending`,
+ value: "pending",
+ },
+ {
+ label: i18n.str`Normal`,
+ value: "normal",
+ },
+ ],
},
],
},
@@ -85,18 +80,16 @@ export function ShowConsolidated({
? {
title: i18n.str`KYC`,
fields: Object.entries(cons.kyc).map(([key, field]) => {
- const result: UIFormFieldConfig = {
+ const result: UIFormElementConfig = {
type: "text",
- properties: {
- label: key as TranslatedString,
- id: `kyc.${key}.value` as UIHandlerId,
- name: `kyc.${key}.value`,
- help: `${field.provider} since ${
- field.since.t_ms === "never"
- ? "never"
- : format(field.since.t_ms, "dd/MM/yyyy")
- }` as TranslatedString,
- },
+ label: key as TranslatedString,
+ id: `kyc.${key}.value` as UIHandlerId,
+ name: `kyc.${key}.value`,
+ help: `${field.provider} since ${
+ field.since.t_ms === "never"
+ ? "never"
+ : format(field.since.t_ms, "dd/MM/yyyy")
+ }` as TranslatedString,
};
return result;
}),