From c680f5aa71b08e978444df07f93c381f9d47ab82 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 5 Jun 2023 10:04:09 -0300 Subject: rename aml --- packages/exchange-backoffice-ui/.gitignore | 4 - packages/exchange-backoffice-ui/Makefile | 17 - packages/exchange-backoffice-ui/README.md | 4 - packages/exchange-backoffice-ui/build.mjs | 28 - packages/exchange-backoffice-ui/copyleft-header.js | 15 - packages/exchange-backoffice-ui/dev.mjs | 40 - packages/exchange-backoffice-ui/package.json | 67 -- packages/exchange-backoffice-ui/postcss.config.js | 6 - packages/exchange-backoffice-ui/src/App.tsx | 12 - packages/exchange-backoffice-ui/src/Dashboard.tsx | 599 --------------- packages/exchange-backoffice-ui/src/NiceForm.tsx | 59 -- packages/exchange-backoffice-ui/src/account.ts | 92 --- .../src/assets/logo-2021.svg | 9 - .../exchange-backoffice-ui/src/declaration.d.ts | 30 - .../exchange-backoffice-ui/src/forms/902_11e.ts | 154 ---- .../exchange-backoffice-ui/src/forms/902_12e.ts | 440 ----------- .../exchange-backoffice-ui/src/forms/902_13e.ts | 527 ------------- .../exchange-backoffice-ui/src/forms/902_15e.ts | 197 ----- .../exchange-backoffice-ui/src/forms/902_1e.ts | 695 ----------------- .../exchange-backoffice-ui/src/forms/902_4e.ts | 822 --------------------- .../exchange-backoffice-ui/src/forms/902_5e.ts | 281 ------- .../exchange-backoffice-ui/src/forms/902_9e.ts | 138 ---- packages/exchange-backoffice-ui/src/forms/index.ts | 146 ---- .../exchange-backoffice-ui/src/forms/simplest.ts | 103 --- .../src/handlers/Caption.tsx | 35 - .../src/handlers/FormProvider.tsx | 99 --- .../exchange-backoffice-ui/src/handlers/Group.tsx | 41 - .../src/handlers/InputAmount.tsx | 34 - .../src/handlers/InputArray.tsx | 183 ----- .../src/handlers/InputChoiceHorizontal.tsx | 86 --- .../src/handlers/InputChoiceStacked.tsx | 111 --- .../src/handlers/InputDate.tsx | 37 - .../src/handlers/InputFile.tsx | 101 --- .../src/handlers/InputInteger.tsx | 23 - .../src/handlers/InputLine.tsx | 282 ------- .../src/handlers/InputSelectMultiple.tsx | 151 ---- .../src/handlers/InputSelectOne.tsx | 134 ---- .../src/handlers/InputText.tsx | 8 - .../src/handlers/InputTextArea.tsx | 8 - .../exchange-backoffice-ui/src/handlers/forms.ts | 135 ---- .../src/handlers/useField.ts | 93 --- .../exchange-backoffice-ui/src/hooks/useOfficer.ts | 100 --- packages/exchange-backoffice-ui/src/i18n/bank.pot | 486 ------------ packages/exchange-backoffice-ui/src/i18n/de.po | 486 ------------ packages/exchange-backoffice-ui/src/i18n/en.po | 511 ------------- packages/exchange-backoffice-ui/src/i18n/es.po | 497 ------------- packages/exchange-backoffice-ui/src/i18n/fr.po | 486 ------------ packages/exchange-backoffice-ui/src/i18n/it.po | 521 ------------- packages/exchange-backoffice-ui/src/i18n/poheader | 26 - .../src/i18n/strings-prelude | 19 - .../exchange-backoffice-ui/src/i18n/strings.ts | 510 ------------- packages/exchange-backoffice-ui/src/index.html | 42 -- packages/exchange-backoffice-ui/src/index.tsx | 22 - packages/exchange-backoffice-ui/src/pages.ts | 55 -- .../src/pages/AntiMoneyLaunderingForm.tsx | 90 --- .../src/pages/CaseDetails.tsx | 447 ----------- .../exchange-backoffice-ui/src/pages/Cases.tsx | 288 -------- .../src/pages/CreateAccount.tsx | 102 --- .../src/pages/HandleAccountNotReady.tsx | 34 - packages/exchange-backoffice-ui/src/pages/Home.tsx | 5 - .../src/pages/NewFormEntry.tsx | 76 -- .../exchange-backoffice-ui/src/pages/Officer.tsx | 55 -- .../exchange-backoffice-ui/src/pages/Settings.tsx | 5 - .../src/pages/UnlockAccount.tsx | 81 -- .../exchange-backoffice-ui/src/pages/Welcome.tsx | 9 - packages/exchange-backoffice-ui/src/route.ts | 167 ----- packages/exchange-backoffice-ui/src/scss/main.css | 3 - .../exchange-backoffice-ui/src/stories.test.ts | 56 -- packages/exchange-backoffice-ui/src/stories.tsx | 44 -- packages/exchange-backoffice-ui/src/types.ts | 81 -- packages/exchange-backoffice-ui/tailwind.config.js | 8 - packages/exchange-backoffice-ui/test.mjs | 31 - packages/exchange-backoffice-ui/tsconfig.json | 51 -- 73 files changed, 11440 deletions(-) delete mode 100644 packages/exchange-backoffice-ui/.gitignore delete mode 100644 packages/exchange-backoffice-ui/Makefile delete mode 100644 packages/exchange-backoffice-ui/README.md delete mode 100755 packages/exchange-backoffice-ui/build.mjs delete mode 100644 packages/exchange-backoffice-ui/copyleft-header.js delete mode 100755 packages/exchange-backoffice-ui/dev.mjs delete mode 100644 packages/exchange-backoffice-ui/package.json delete mode 100644 packages/exchange-backoffice-ui/postcss.config.js delete mode 100644 packages/exchange-backoffice-ui/src/App.tsx delete mode 100644 packages/exchange-backoffice-ui/src/Dashboard.tsx delete mode 100644 packages/exchange-backoffice-ui/src/NiceForm.tsx delete mode 100644 packages/exchange-backoffice-ui/src/account.ts delete mode 100644 packages/exchange-backoffice-ui/src/assets/logo-2021.svg delete mode 100644 packages/exchange-backoffice-ui/src/declaration.d.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/902_11e.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/902_12e.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/902_13e.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/902_15e.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/902_1e.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/902_4e.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/902_5e.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/902_9e.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/index.ts delete mode 100644 packages/exchange-backoffice-ui/src/forms/simplest.ts delete mode 100644 packages/exchange-backoffice-ui/src/handlers/Caption.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/FormProvider.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/Group.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputAmount.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputArray.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputChoiceHorizontal.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputChoiceStacked.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputDate.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputFile.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputInteger.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputLine.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputSelectMultiple.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputSelectOne.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputText.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/InputTextArea.tsx delete mode 100644 packages/exchange-backoffice-ui/src/handlers/forms.ts delete mode 100644 packages/exchange-backoffice-ui/src/handlers/useField.ts delete mode 100644 packages/exchange-backoffice-ui/src/hooks/useOfficer.ts delete mode 100644 packages/exchange-backoffice-ui/src/i18n/bank.pot delete mode 100644 packages/exchange-backoffice-ui/src/i18n/de.po delete mode 100644 packages/exchange-backoffice-ui/src/i18n/en.po delete mode 100644 packages/exchange-backoffice-ui/src/i18n/es.po delete mode 100644 packages/exchange-backoffice-ui/src/i18n/fr.po delete mode 100644 packages/exchange-backoffice-ui/src/i18n/it.po delete mode 100644 packages/exchange-backoffice-ui/src/i18n/poheader delete mode 100644 packages/exchange-backoffice-ui/src/i18n/strings-prelude delete mode 100644 packages/exchange-backoffice-ui/src/i18n/strings.ts delete mode 100644 packages/exchange-backoffice-ui/src/index.html delete mode 100644 packages/exchange-backoffice-ui/src/index.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages.ts delete mode 100644 packages/exchange-backoffice-ui/src/pages/AntiMoneyLaunderingForm.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/CaseDetails.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/Cases.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/CreateAccount.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/HandleAccountNotReady.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/Home.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/NewFormEntry.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/Officer.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/Settings.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/UnlockAccount.tsx delete mode 100644 packages/exchange-backoffice-ui/src/pages/Welcome.tsx delete mode 100644 packages/exchange-backoffice-ui/src/route.ts delete mode 100644 packages/exchange-backoffice-ui/src/scss/main.css delete mode 100644 packages/exchange-backoffice-ui/src/stories.test.ts delete mode 100644 packages/exchange-backoffice-ui/src/stories.tsx delete mode 100644 packages/exchange-backoffice-ui/src/types.ts delete mode 100644 packages/exchange-backoffice-ui/tailwind.config.js delete mode 100755 packages/exchange-backoffice-ui/test.mjs delete mode 100644 packages/exchange-backoffice-ui/tsconfig.json (limited to 'packages/exchange-backoffice-ui') diff --git a/packages/exchange-backoffice-ui/.gitignore b/packages/exchange-backoffice-ui/.gitignore deleted file mode 100644 index 30cb2774c..000000000 --- a/packages/exchange-backoffice-ui/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -/build -/*.log -/demobank-ui-settings.js diff --git a/packages/exchange-backoffice-ui/Makefile b/packages/exchange-backoffice-ui/Makefile deleted file mode 100644 index 3cf5ebe40..000000000 --- a/packages/exchange-backoffice-ui/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# This Makefile has been placed in the public domain - -# Settings from "./configure" -include .config.mk - -all: - @echo run \'make install\' to install - -spa_dir=$(prefix)/share/taler/exchange-backoffice-ui - -install: - pnpm install --frozen-lockfile --filter @gnu-taler/exchange-backoffice-ui... - pnpm run check - pnpm run build - install -d $(spa_dir) - install ./dist/prod/* $(spa_dir) - diff --git a/packages/exchange-backoffice-ui/README.md b/packages/exchange-backoffice-ui/README.md deleted file mode 100644 index 855addd74..000000000 --- a/packages/exchange-backoffice-ui/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Taler Exchange Backoffice UI - -Web-based user interface for the GNU Taler exchange. - diff --git a/packages/exchange-backoffice-ui/build.mjs b/packages/exchange-backoffice-ui/build.mjs deleted file mode 100755 index ae38c193d..000000000 --- a/packages/exchange-backoffice-ui/build.mjs +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env node -/* - This file is part of GNU Taler - (C) 2022 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see - */ - -import { build } from "@gnu-taler/web-util/build"; - -await build({ - type: "production", - source: { - js: ["src/index.tsx"], - assets: [{base:"src",files:["src/index.html"]}], - }, - destination: "./dist/prod", - css: "postcss", -}); diff --git a/packages/exchange-backoffice-ui/copyleft-header.js b/packages/exchange-backoffice-ui/copyleft-header.js deleted file mode 100644 index 2635717c5..000000000 --- a/packages/exchange-backoffice-ui/copyleft-header.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2022 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see - */ diff --git a/packages/exchange-backoffice-ui/dev.mjs b/packages/exchange-backoffice-ui/dev.mjs deleted file mode 100755 index c8996b894..000000000 --- a/packages/exchange-backoffice-ui/dev.mjs +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env node -/* - This file is part of GNU Taler - (C) 2022 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see - */ - -import { serve } from "@gnu-taler/web-util/node"; -import { initializeDev } from "@gnu-taler/web-util/build"; - -const devEntryPoints = ["src/stories.tsx", "src/index.tsx"]; - -const build = initializeDev({ - type: "development", - source: { - js: devEntryPoints, - assets: [{base:"src",files:["src/index.html"]}], - }, - destination: "./dist/dev", - css: "postcss", -}); - -await build(); - -serve({ - folder: "./dist/dev", - port: 8080, - source: "./src", - onSourceUpdate: build, -}); diff --git a/packages/exchange-backoffice-ui/package.json b/packages/exchange-backoffice-ui/package.json deleted file mode 100644 index 0de234049..000000000 --- a/packages/exchange-backoffice-ui/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "private": true, - "name": "@gnu-taler/exchange-backoffice-ui", - "version": "0.1.0", - "author": "sebasjm", - "license": "AGPL-3.0-OR-LATER", - "description": "Back-office SPA for GNU Taler Exchange.", - "type": "module", - "scripts": { - "build": "./build.mjs", - "check": "tsc", - "compile": "tsc && ./build.mjs", - "test": "./test.mjs && mocha --require source-map-support/register 'dist/test/**/*.test.js' 'dist/test/**/test.js'", - "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'", - "i18n:extract": "pogen extract", - "i18n:merge": "pogen merge", - "i18n:emit": "pogen emit", - "i18n": "pnpm i18n:extract && pnpm i18n:merge && pnpm i18n:emit", - "pretty": "prettier --write src" - }, - "dependencies": { - "@gnu-taler/taler-util": "workspace:*", - "@gnu-taler/web-util": "workspace:*", - "@headlessui/react": "^1.7.14", - "@heroicons/react": "^2.0.17", - "date-fns": "2.29.3", - "history": "4.10.1", - "jed": "1.1.1", - "preact": "10.11.3", - "swr": "2.0.3" - }, - "eslintConfig": { - "plugins": [ - "header" - ], - "rules": { - "header/header": [ - 2, - "copyleft-header.js" - ] - }, - "extends": [ - "prettier" - ] - }, - "devDependencies": { - "@gnu-taler/pogen": "^0.0.5", - "@tailwindcss/forms": "^0.5.3", - "@tailwindcss/typography": "^0.5.9", - "@types/chai": "^4.3.0", - "@types/history": "^4.7.8", - "@types/mocha": "^10.0.1", - "autoprefixer": "^10.4.14", - "chai": "^4.3.6", - "esbuild": "^0.17.7", - "eslint-config-preact": "^1.2.0", - "mocha": "^9.2.0", - "po2json": "^0.4.5", - "postcss": "^8.4.23", - "postcss-cli": "^10.1.0", - "tailwindcss": "^3.3.2", - "typescript": "4.9.4" - }, - "pogen": { - "domain": "exchange-backoffice" - } -} diff --git a/packages/exchange-backoffice-ui/postcss.config.js b/packages/exchange-backoffice-ui/postcss.config.js deleted file mode 100644 index 2e7af2b7f..000000000 --- a/packages/exchange-backoffice-ui/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/packages/exchange-backoffice-ui/src/App.tsx b/packages/exchange-backoffice-ui/src/App.tsx deleted file mode 100644 index 600131219..000000000 --- a/packages/exchange-backoffice-ui/src/App.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { TranslationProvider } from "@gnu-taler/web-util/browser"; -import { h, VNode } from "preact"; -import { Dashboard } from "./Dashboard.js"; -import "./scss/main.css"; - -export function App(): VNode { - return ( - - - - ); -} diff --git a/packages/exchange-backoffice-ui/src/Dashboard.tsx b/packages/exchange-backoffice-ui/src/Dashboard.tsx deleted file mode 100644 index 6794ca1f8..000000000 --- a/packages/exchange-backoffice-ui/src/Dashboard.tsx +++ /dev/null @@ -1,599 +0,0 @@ -import { useNotifications } from "@gnu-taler/web-util/browser"; -import { Dialog, Transition } from "@headlessui/react"; -import { UserIcon, XCircleIcon } from "@heroicons/react/20/solid"; -import { CheckCircleIcon, XMarkIcon } from "@heroicons/react/24/outline"; -import { InformationCircleIcon } from "@heroicons/react/24/solid"; -import { ComponentChildren, Fragment, VNode, h } from "preact"; -import { useState } from "preact/hooks"; -import logo from "./assets/logo-2021.svg"; -import { Pages } from "./pages.js"; -import { Router, useCurrentLocation } from "./route.js"; - -function classNames(...classes: string[]) { - return classes.filter(Boolean).join(" "); -} - -/** - * mapping route to view - * not found (error page) - * nested, index element, relative routes - * link interception - * form POST interception, call action - * fromData => Object.fromEntries - * segments in the URL - * navigationState: idle, submitting, loading - * form GET interception: does a navigateTo - * form GET Sync: - * 1.- back after submit: useEffect to sync URL to form - * 2.- refresh after submit: input default value - * useSubmit for form submission onChange, history replace - * - * post form without redirect - * - * - * @param param0 - * @returns - */ - -const GIT_HASH = typeof __GIT_HASH__ !== "undefined" ? __GIT_HASH__ : undefined; -const VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : undefined; - -const versionText = VERSION - ? GIT_HASH - ? `v${VERSION} (${GIT_HASH.substring(0, 8)})` - : VERSION - : ""; - -/** - * TO BE FIXED: - * - * 1.- when the form change to other form and both form share the same structure - * the same input component may be rendered in the same place, - * since input are uncontrolled the are not re-rendered and since they are - * uncontrolled it will keep the value of the previous form. - * One solutions could be to remove the form when unloading and when the new - * form load it will start without previous vdom, preventing the cache - * to create this behavior. - * Other solutions could be using IDs in the fields that are constructed - * with the ID of the form, so two fields of different form will need to re-render - * cleaning up the state of the previous form. - * - * 2.- currently the design prop and the behavior prop of the flexible form - * are two side of the same coin. From the design point of view, it is important - * to design the form in a list-of-field manner and there may be additional - * content that is not directly mapped to the form structure (object) - * So maybe we want to change the current shape so the computation of the state - * of the form is in a field level, but this computation required the field value and - * the whole form values and state (since one field may be disabled/hidden) because - * of the value of other field. - * - * 3.- given the previous requirement, maybe the name of the field of the form could be - * a function (P: F -> V) where F is the form (or parent object) and V is the type of the - * property. That will help with the typing of the forms props - * - * 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 - */ - -function LeftMenu() { - const currentLocation = useCurrentLocation(pageList); - - return ( - - ); -} - -export function Dashboard({ - children, -}: { - children?: ComponentChildren; -}): VNode { - const [sidebarOpen, setSidebarOpen] = useState(false); - - return ( - - -
-
-
-

- Exchange AML Backoffice -

-
-
- -
-
-
-
- { - setSidebarOpen(true); - }} - /> - -
-
- { - return
not found
; - }} - /> -
-
-
-
- ); -} - -const pageList = Object.values(Pages); - -function NavigationBar({ - isOpen, - setOpen, - children, -}: { - isOpen: boolean; - setOpen: (v: boolean) => void; - children: ComponentChildren; -}) { - return ( - - - - -
- - -
- - - -
- -
-
- {children} -
-
-
-
-
- - -
- ); -} - -function TopBar({ onOpenSidebar }: { onOpenSidebar: () => void }) { - return ( -
-
- -
-
-
- Taler -
-
- {/*
dd
*/} -
- ); -} - -// return ( -//
-// - -// {/* Separator */} -//