From 6138846050563e0dca95b0b6d792776925e4c35f Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 20 Nov 2023 12:38:16 -0300 Subject: new forms api --- packages/aml-backoffice-ui/src/App.tsx | 22 +- packages/aml-backoffice-ui/src/Dashboard.tsx | 27 +- packages/aml-backoffice-ui/src/NiceForm.tsx | 3 + packages/aml-backoffice-ui/src/context/config.ts | 8 + packages/aml-backoffice-ui/src/forms/902_11e.ts | 18 +- packages/aml-backoffice-ui/src/forms/902_12e.ts | 20 +- packages/aml-backoffice-ui/src/forms/902_13e.ts | 32 +- packages/aml-backoffice-ui/src/forms/902_15e.ts | 22 +- packages/aml-backoffice-ui/src/forms/902_1e.ts | 49 +-- packages/aml-backoffice-ui/src/forms/902_4e.ts | 69 ++-- packages/aml-backoffice-ui/src/forms/902_5e.ts | 27 +- packages/aml-backoffice-ui/src/forms/902_9e.ts | 22 +- packages/aml-backoffice-ui/src/forms/simplest.ts | 23 +- .../aml-backoffice-ui/src/handlers/Calendar.tsx | 116 ++++++ packages/aml-backoffice-ui/src/handlers/Dialog.tsx | 15 + .../src/handlers/FormProvider.tsx | 25 +- .../aml-backoffice-ui/src/handlers/InputArray.tsx | 35 +- .../src/handlers/InputChoiceHorizontal.tsx | 1 + .../src/handlers/InputChoiceStacked.tsx | 1 + .../aml-backoffice-ui/src/handlers/InputDate.tsx | 81 +++-- .../aml-backoffice-ui/src/handlers/InputFile.tsx | 88 ++--- .../aml-backoffice-ui/src/handlers/InputLine.tsx | 36 +- .../src/handlers/InputSelectMultiple.tsx | 14 +- .../aml-backoffice-ui/src/handlers/useField.ts | 5 +- packages/aml-backoffice-ui/src/hooks/useCases.ts | 25 +- .../src/pages/AntiMoneyLaunderingForm.stories.tsx | 46 ++- .../src/pages/AntiMoneyLaunderingForm.tsx | 152 ++++++-- .../aml-backoffice-ui/src/pages/CaseDetails.tsx | 288 +++++++++------ .../aml-backoffice-ui/src/pages/Cases.stories.tsx | 42 +++ packages/aml-backoffice-ui/src/pages/Cases.tsx | 392 +++++++++------------ .../aml-backoffice-ui/src/pages/NewFormEntry.tsx | 68 ++-- .../src/pages/ShowConsolidated.stories.tsx | 69 +++- .../aml-backoffice-ui/src/pages/index.stories.ts | 1 + packages/aml-backoffice-ui/src/route.ts | 24 +- packages/aml-backoffice-ui/src/stories.test.ts | 21 +- packages/aml-backoffice-ui/src/stories.tsx | 26 +- packages/web-util/src/forms/DefaultForm.tsx | 1 - packages/web-util/src/stories.tsx | 26 +- 38 files changed, 1137 insertions(+), 803 deletions(-) create mode 100644 packages/aml-backoffice-ui/src/handlers/Calendar.tsx create mode 100644 packages/aml-backoffice-ui/src/handlers/Dialog.tsx create mode 100644 packages/aml-backoffice-ui/src/pages/Cases.stories.tsx diff --git a/packages/aml-backoffice-ui/src/App.tsx b/packages/aml-backoffice-ui/src/App.tsx index 52c86c273..d461934c0 100644 --- a/packages/aml-backoffice-ui/src/App.tsx +++ b/packages/aml-backoffice-ui/src/App.tsx @@ -4,7 +4,7 @@ import { ExchangeAmlFrame } from "./Dashboard.js"; import "./scss/main.css"; import { ExchangeApiProvider } from "./context/config.js"; import { getInitialBackendBaseURL } from "./hooks/useBackend.js"; -import { Router } from "./route.js"; +import { HashPathProvider, Router } from "./route.js"; import { Pages } from "./pages.js"; const pageList = Object.values(Pages); @@ -15,15 +15,17 @@ export function App(): VNode { return ( - - { - window.location.href = Pages.cases.url - return
not found
; - }} - /> -
+ + + { + window.location.href = Pages.cases.url + return
not found
; + }} + /> +
+
); diff --git a/packages/aml-backoffice-ui/src/Dashboard.tsx b/packages/aml-backoffice-ui/src/Dashboard.tsx index b813f83d5..2d75de660 100644 --- a/packages/aml-backoffice-ui/src/Dashboard.tsx +++ b/packages/aml-backoffice-ui/src/Dashboard.tsx @@ -5,7 +5,7 @@ import { useEffect, useErrorBoundary } from "preact/hooks"; import { useOfficer } from "./hooks/useOfficer.js"; import { getAllBooleanSettings, getLabelForSetting, useSettings } from "./hooks/useSettings.js"; import { Pages } from "./pages.js"; -import { PageEntry, useChangeLocation, useCurrentLocation } from "./route.js"; +import { PageEntry, useChangeLocation } from "./route.js"; import { uiSettings } from "./settings.js"; function classNames(...classes: string[]) { @@ -73,8 +73,17 @@ const versionText = VERSION * 4.- tooltip are not placed correctly: the arrow should point the question mark * and the text area should be bigger * - * 5.- date field should have the calendar icon clickable so the user can select date without - * writing text with the correct format + */ + +/** + * check this fields + * + * Signature of Contracting partner, 902_9e + * Currency and amount of deposited assets, 902_5e + * Signature on declaration of trust, 902.13e + * also fundations + * also life insurance + * */ export function ExchangeAmlFrame({ @@ -140,17 +149,17 @@ export function ExchangeAmlFrame({ -
+
{officer.state !== "ready" ? undefined : }
-
+
{children} -
+
- +