From 3c6cf97646d4abe228ff2458fdc7a2c1bd20c35b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 24 Oct 2022 10:42:18 +0200 Subject: move repo --- packages/bank/.gitignore | 5 - packages/bank/.storybook/.babelrc | 25 - packages/bank/.storybook/main.js | 57 - packages/bank/.storybook/preview.js | 55 - packages/bank/README.md | 35 - packages/bank/TODO | 45 - packages/bank/build-bank-translations.sh | 32 - packages/bank/contrib/po2ts | 42 - packages/bank/mocks/demo-window.js | 28 - packages/bank/mocks/json-server/db.json | 4 - packages/bank/mocks/window.js | 27 - packages/bank/package.json | 126 - packages/bank/preact.config.js | 70 - packages/bank/preact.mock.demo.js | 55 - packages/bank/preact.mock.js | 55 - packages/bank/preact.single-config.js | 60 - packages/bank/remove-link-stylesheet.sh | 8 - packages/bank/src/.babelrc | 3 - packages/bank/src/assets/empty.png | Bin 2785 -> 0 bytes packages/bank/src/assets/example/id1.jpg | Bin 103558 -> 0 bytes packages/bank/src/assets/favicon.ico | Bin 15086 -> 0 bytes .../src/assets/icons/android-chrome-192x192.png | Bin 14058 -> 0 bytes .../src/assets/icons/android-chrome-512x512.png | Bin 51484 -> 0 bytes .../bank/src/assets/icons/apple-touch-icon.png | Bin 12746 -> 0 bytes .../bank/src/assets/icons/auth_method/email.svg | 1 - .../bank/src/assets/icons/auth_method/postal.svg | 1 - .../bank/src/assets/icons/auth_method/question.svg | 1 - packages/bank/src/assets/icons/auth_method/sms.svg | 1 - .../bank/src/assets/icons/auth_method/video.svg | 1 - packages/bank/src/assets/icons/favicon-16x16.png | Bin 626 -> 0 bytes packages/bank/src/assets/icons/favicon-32x32.png | Bin 1487 -> 0 bytes packages/bank/src/assets/icons/languageicon.svg | 48 - packages/bank/src/assets/icons/mstile-150x150.png | Bin 9050 -> 0 bytes packages/bank/src/assets/logo-white.svg | 45 - packages/bank/src/assets/logo.jpeg | Bin 39336 -> 0 bytes packages/bank/src/components/AsyncButton.tsx | 66 - packages/bank/src/components/FileButton.tsx | 57 - packages/bank/src/components/Notifications.tsx | 74 - packages/bank/src/components/QR.tsx | 48 - packages/bank/src/components/app.tsx | 16 - packages/bank/src/components/fields/DateInput.tsx | 90 - packages/bank/src/components/fields/EmailInput.tsx | 57 - packages/bank/src/components/fields/FileInput.tsx | 104 - packages/bank/src/components/fields/ImageInput.tsx | 93 - .../bank/src/components/fields/NumberInput.tsx | 56 - packages/bank/src/components/fields/TextInput.tsx | 68 - packages/bank/src/components/menu/LangSelector.tsx | 101 - .../bank/src/components/menu/NavigationBar.tsx | 53 - packages/bank/src/components/menu/SideBar.tsx | 73 - packages/bank/src/components/menu/index.tsx | 135 - packages/bank/src/components/picker/DatePicker.tsx | 356 -- .../components/picker/DurationPicker.stories.tsx | 55 - .../bank/src/components/picker/DurationPicker.tsx | 211 -- packages/bank/src/context/translation.ts | 73 - packages/bank/src/declaration.d.ts | 20 - packages/bank/src/hooks/async.ts | 80 - packages/bank/src/hooks/index.ts | 151 - packages/bank/src/i18n/bank.pot | 258 -- packages/bank/src/i18n/de.po | 257 -- packages/bank/src/i18n/en.po | 266 -- packages/bank/src/i18n/index.tsx | 211 -- packages/bank/src/i18n/it.po | 258 -- packages/bank/src/i18n/poheader | 27 - packages/bank/src/i18n/strings-prelude | 19 - packages/bank/src/i18n/strings.ts | 472 --- packages/bank/src/index.tsx | 3 - packages/bank/src/manifest.json | 21 - packages/bank/src/pages/home/index.tsx | 2062 ------------ packages/bank/src/pages/notfound/index.tsx | 16 - packages/bank/src/pages/notfound/style.css | 0 packages/bank/src/pages/profile/index.stories.tsx | 38 - packages/bank/src/pages/profile/index.tsx | 42 - packages/bank/src/pages/profile/style.css | 0 packages/bank/src/scss/DurationPicker.scss | 70 - packages/bank/src/scss/_aside.scss | 128 - packages/bank/src/scss/_card.scss | 69 - packages/bank/src/scss/_custom-calendar.scss | 263 -- packages/bank/src/scss/_footer.scss | 35 - packages/bank/src/scss/_form.scss | 71 - packages/bank/src/scss/_hero-bar.scss | 55 - packages/bank/src/scss/_import_theme.scss | 79 - packages/bank/src/scss/_loading.scss | 51 - packages/bank/src/scss/_main-section.scss | 24 - packages/bank/src/scss/_misc.scss | 50 - packages/bank/src/scss/_mixins.scss | 34 - packages/bank/src/scss/_modal.scss | 35 - packages/bank/src/scss/_nav-bar.scss | 144 - packages/bank/src/scss/_table.scss | 179 - packages/bank/src/scss/_theme-default.scss | 135 - packages/bank/src/scss/_tiles.scss | 24 - packages/bank/src/scss/_title-bar.scss | 50 - packages/bank/src/scss/bank.scss | 362 -- packages/bank/src/scss/colors-bank.scss | 31 - packages/bank/src/scss/demo.scss | 161 - .../bank/src/scss/fonts/XRXV3I6Li01BKofINeaE.ttf | Bin 43752 -> 0 bytes packages/bank/src/scss/fonts/nunito.css | 22 - .../fonts/materialdesignicons-webfont-4.9.95.eot | Bin 844600 -> 0 bytes .../fonts/materialdesignicons-webfont-4.9.95.ttf | Bin 844380 -> 0 bytes .../fonts/materialdesignicons-webfont-4.9.95.woff | Bin 404384 -> 0 bytes .../fonts/materialdesignicons-webfont-4.9.95.woff2 | Bin 283040 -> 0 bytes .../scss/icons/materialdesignicons-4.9.95.min.css | 3 - packages/bank/src/scss/libs/_all.scss | 29 - packages/bank/src/scss/main.scss | 4 - packages/bank/src/scss/pure.scss | 1517 --------- packages/bank/src/style/index.css | 0 packages/bank/src/template.html | 52 - packages/bank/tests/__mocks__/browserMocks.ts | 21 - packages/bank/tests/__mocks__/fileMocks.ts | 3 - packages/bank/tests/__mocks__/setupTests.ts | 6 - packages/bank/tests/__tests__/homepage.js | 466 --- packages/bank/tests/declarations.d.ts | 3 - packages/bank/tsconfig.json | 60 - packages/merchant-backend/.gitignore | 9 - packages/merchant-backend/.storybook/.babelrc | 25 - packages/merchant-backend/.storybook/main.js | 82 - packages/merchant-backend/.storybook/preview.js | 73 - packages/merchant-backend/README.md | 30 - packages/merchant-backend/contrib/po2ts | 42 - packages/merchant-backend/copyleft-header.js | 15 - packages/merchant-backend/package.json | 144 - packages/merchant-backend/render-examples.ts | 83 - packages/merchant-backend/rollup.config.js | 112 - packages/merchant-backend/src/assets/empty.png | Bin 2785 -> 0 bytes .../src/assets/icons/android-chrome-192x192.png | Bin 14058 -> 0 bytes .../src/assets/icons/android-chrome-512x512.png | Bin 51484 -> 0 bytes .../src/assets/icons/apple-touch-icon.png | Bin 12746 -> 0 bytes .../src/assets/icons/favicon-16x16.png | Bin 626 -> 0 bytes .../src/assets/icons/favicon-32x32.png | Bin 1487 -> 0 bytes .../src/assets/icons/languageicon.svg | 48 - .../src/assets/icons/mstile-150x150.png | Bin 9050 -> 0 bytes .../merchant-backend/src/components/Footer.tsx | 32 - packages/merchant-backend/src/components/QR.tsx | 41 - packages/merchant-backend/src/context/backend.ts | 82 - packages/merchant-backend/src/context/config.ts | 32 - packages/merchant-backend/src/context/fetch.ts | 40 - packages/merchant-backend/src/context/instance.ts | 35 - packages/merchant-backend/src/context/listener.ts | 35 - .../merchant-backend/src/context/translation.ts | 59 - packages/merchant-backend/src/css/pure-min.css | 973 ------ packages/merchant-backend/src/css/style.css | 61 - packages/merchant-backend/src/custom.d.ts | 40 - packages/merchant-backend/src/declaration.d.ts | 1384 -------- packages/merchant-backend/src/hooks/async.ts | 76 - packages/merchant-backend/src/hooks/backend.ts | 262 -- packages/merchant-backend/src/hooks/index.ts | 110 - packages/merchant-backend/src/hooks/instance.ts | 187 -- packages/merchant-backend/src/hooks/listener.ts | 68 - .../merchant-backend/src/hooks/notification.ts | 43 - .../merchant-backend/src/hooks/notifications.ts | 48 - packages/merchant-backend/src/hooks/order.ts | 217 -- packages/merchant-backend/src/hooks/product.ts | 223 -- packages/merchant-backend/src/hooks/tips.ts | 159 - packages/merchant-backend/src/hooks/transfer.ts | 150 - packages/merchant-backend/src/i18n/de.po | 1057 ------ packages/merchant-backend/src/i18n/en.po | 1057 ------ packages/merchant-backend/src/i18n/es.po | 1065 ------ packages/merchant-backend/src/i18n/fr.po | 1057 ------ packages/merchant-backend/src/i18n/index.tsx | 203 -- packages/merchant-backend/src/i18n/it.po | 1057 ------ packages/merchant-backend/src/i18n/poheader | 27 - packages/merchant-backend/src/i18n/strings-prelude | 19 - packages/merchant-backend/src/i18n/strings.ts | 3445 -------------------- packages/merchant-backend/src/i18n/sv.po | 1057 ------ .../src/i18n/taler-merchant-backoffice.pot | 1054 ------ packages/merchant-backend/src/index.tsx | 61 - .../src/pages/DepletedTip.stories.tsx | 40 - .../merchant-backend/src/pages/DepletedTip.tsx | 60 - .../src/pages/OfferRefund.stories.tsx | 45 - .../merchant-backend/src/pages/OfferRefund.tsx | 154 - .../src/pages/OfferTip.stories.tsx | 45 - packages/merchant-backend/src/pages/OfferTip.tsx | 141 - .../src/pages/RequestPayment.stories.tsx | 45 - .../merchant-backend/src/pages/RequestPayment.tsx | 196 -- .../src/pages/ShowOrderDetails.examples.ts | 219 -- .../src/pages/ShowOrderDetails.stories.tsx | 49 - .../src/pages/ShowOrderDetails.tsx | 551 ---- packages/merchant-backend/src/styled/index.tsx | 178 - packages/merchant-backend/src/utils/amount.ts | 69 - packages/merchant-backend/src/utils/constants.ts | 47 - packages/merchant-backend/src/utils/table.ts | 37 - packages/merchant-backend/src/utils/types.ts | 31 - .../tests/__mocks__/browserMocks.ts | 42 - .../merchant-backend/tests/__mocks__/fileMocks.ts | 24 - .../tests/__mocks__/fileTransformer.js | 31 - .../merchant-backend/tests/__mocks__/setupTests.ts | 28 - .../merchant-backend/tests/funcitons/regex.test.ts | 87 - packages/merchant-backend/tests/util.ts | 62 - packages/merchant-backend/tsconfig.back.json | 23 - packages/merchant-backend/tsconfig.json | 61 - packages/merchant-backend/tsconfig.tsbuildinfo | 2147 ------------ packages/merchant-backoffice/.gitignore | 6 - packages/merchant-backoffice/.storybook/.babelrc | 25 - packages/merchant-backoffice/.storybook/main.js | 57 - packages/merchant-backoffice/.storybook/preview.js | 74 - packages/merchant-backoffice/contrib/po2ts | 42 - packages/merchant-backoffice/copyleft-header.js | 15 - packages/merchant-backoffice/package.json | 123 - packages/merchant-backoffice/preact.config.js | 70 - .../merchant-backoffice/preact.single-config.js | 62 - .../merchant-backoffice/remove-link-stylesheet.sh | 8 - packages/merchant-backoffice/src/.babelrc | 26 - packages/merchant-backoffice/src/AdminRoutes.tsx | 58 - .../src/ApplicationReadyRoutes.tsx | 120 - .../merchant-backoffice/src/InstanceRoutes.tsx | 528 --- packages/merchant-backoffice/src/assets/empty.png | Bin 2785 -> 0 bytes .../src/assets/icons/android-chrome-192x192.png | Bin 14058 -> 0 bytes .../src/assets/icons/android-chrome-512x512.png | Bin 51484 -> 0 bytes .../src/assets/icons/apple-touch-icon.png | Bin 12746 -> 0 bytes .../src/assets/icons/favicon-16x16.png | Bin 626 -> 0 bytes .../src/assets/icons/favicon-32x32.png | Bin 1487 -> 0 bytes .../src/assets/icons/languageicon.svg | 48 - .../src/assets/icons/mstile-150x150.png | Bin 9050 -> 0 bytes packages/merchant-backoffice/src/assets/logo.jpeg | Bin 39336 -> 0 bytes .../src/components/exception/AsyncButton.tsx | 49 - .../src/components/exception/QR.tsx | 49 - .../src/components/exception/loading.tsx | 32 - .../src/components/exception/login.tsx | 143 - .../src/components/form/FormProvider.tsx | 81 - .../src/components/form/Input.tsx | 71 - .../src/components/form/InputArray.tsx | 97 - .../src/components/form/InputBoolean.tsx | 72 - .../src/components/form/InputCurrency.tsx | 47 - .../src/components/form/InputDate.tsx | 159 - .../src/components/form/InputDuration.tsx | 172 - .../src/components/form/InputGroup.tsx | 66 - .../src/components/form/InputImage.tsx | 95 - .../src/components/form/InputLocation.tsx | 43 - .../src/components/form/InputNumber.tsx | 42 - .../src/components/form/InputPayto.tsx | 39 - .../src/components/form/InputPaytoForm.tsx | 392 --- .../src/components/form/InputSearchProduct.tsx | 139 - .../src/components/form/InputSecured.stories.tsx | 55 - .../src/components/form/InputSecured.tsx | 119 - .../src/components/form/InputSelector.tsx | 86 - .../src/components/form/InputStock.stories.tsx | 162 - .../src/components/form/InputStock.tsx | 171 - .../src/components/form/InputTaxes.tsx | 97 - .../src/components/form/InputWithAddon.tsx | 77 - .../src/components/form/TextField.tsx | 53 - .../src/components/form/useField.tsx | 86 - .../src/components/form/useGroupField.tsx | 40 - .../instance/DefaultInstanceFormFields.tsx | 135 - .../src/components/menu/LangSelector.tsx | 73 - .../src/components/menu/NavigationBar.tsx | 58 - .../src/components/menu/SideBar.tsx | 227 -- .../src/components/menu/index.tsx | 210 -- .../src/components/modal/index.tsx | 262 -- .../notifications/CreatedSuccessfully.tsx | 49 - .../notifications/Notifications.stories.tsx | 57 - .../src/components/notifications/index.tsx | 52 - .../src/components/picker/DatePicker.tsx | 324 -- .../components/picker/DurationPicker.stories.tsx | 50 - .../src/components/picker/DurationPicker.tsx | 211 -- .../product/InventoryProductForm.stories.tsx | 58 - .../components/product/InventoryProductForm.tsx | 95 - .../components/product/NonInventoryProductForm.tsx | 146 - .../src/components/product/ProductForm.tsx | 176 - .../src/components/product/ProductList.tsx | 105 - .../merchant-backoffice/src/context/backend.ts | 82 - packages/merchant-backoffice/src/context/config.ts | 32 - packages/merchant-backoffice/src/context/fetch.ts | 54 - .../merchant-backoffice/src/context/instance.ts | 35 - .../merchant-backoffice/src/context/listener.ts | 35 - .../merchant-backoffice/src/context/translation.ts | 59 - packages/merchant-backoffice/src/custom.d.ts | 40 - packages/merchant-backoffice/src/declaration.d.ts | 1443 -------- packages/merchant-backoffice/src/hooks/async.ts | 76 - packages/merchant-backoffice/src/hooks/backend.ts | 319 -- packages/merchant-backoffice/src/hooks/index.ts | 110 - packages/merchant-backoffice/src/hooks/instance.ts | 292 -- packages/merchant-backoffice/src/hooks/listener.ts | 81 - .../merchant-backoffice/src/hooks/notifications.ts | 48 - packages/merchant-backoffice/src/hooks/order.ts | 323 -- packages/merchant-backoffice/src/hooks/product.ts | 187 -- packages/merchant-backoffice/src/hooks/reserves.ts | 218 -- packages/merchant-backoffice/src/hooks/transfer.ts | 217 -- packages/merchant-backoffice/src/i18n/de.po | 1057 ------ packages/merchant-backoffice/src/i18n/en.po | 1057 ------ packages/merchant-backoffice/src/i18n/es.po | 1065 ------ packages/merchant-backoffice/src/i18n/fr.po | 1057 ------ packages/merchant-backoffice/src/i18n/index.tsx | 215 -- packages/merchant-backoffice/src/i18n/it.po | 1057 ------ packages/merchant-backoffice/src/i18n/poheader | 27 - .../merchant-backoffice/src/i18n/strings-prelude | 19 - packages/merchant-backoffice/src/i18n/strings.ts | 3445 -------------------- packages/merchant-backoffice/src/i18n/sv.po | 1057 ------ .../src/i18n/taler-merchant-backoffice.pot | 1054 ------ packages/merchant-backoffice/src/index.tsx | 111 - packages/merchant-backoffice/src/manifest.json | 21 - .../src/paths/admin/create/Create.stories.tsx | 46 - .../src/paths/admin/create/CreatePage.tsx | 234 -- .../admin/create/InstanceCreatedSuccessfully.tsx | 65 - .../src/paths/admin/create/index.tsx | 74 - .../src/paths/admin/list/TableActive.tsx | 184 -- .../src/paths/admin/list/View.stories.tsx | 82 - .../src/paths/admin/list/View.tsx | 80 - .../src/paths/admin/list/index.tsx | 126 - .../src/paths/instance/details/DetailPage.tsx | 87 - .../src/paths/instance/details/Details.stories.tsx | 61 - .../src/paths/instance/details/index.tsx | 65 - .../src/paths/instance/kyc/list/ListPage.tsx | 178 - .../src/paths/instance/kyc/list/index.tsx | 51 - .../instance/orders/create/Create.stories.tsx | 70 - .../paths/instance/orders/create/CreatePage.tsx | 576 ---- .../orders/create/OrderCreatedSuccessfully.tsx | 89 - .../src/paths/instance/orders/create/index.tsx | 82 - .../instance/orders/details/Detail.stories.tsx | 137 - .../paths/instance/orders/details/DetailPage.tsx | 776 ----- .../src/paths/instance/orders/details/Timeline.tsx | 128 - .../src/paths/instance/orders/details/index.tsx | 67 - .../paths/instance/orders/list/List.stories.tsx | 107 - .../src/paths/instance/orders/list/ListPage.tsx | 146 - .../src/paths/instance/orders/list/Table.tsx | 412 --- .../src/paths/instance/orders/list/index.tsx | 171 - .../instance/products/create/Create.stories.tsx | 42 - .../paths/instance/products/create/CreatePage.tsx | 65 - .../products/create/CreatedSuccessfully.tsx | 67 - .../src/paths/instance/products/create/index.tsx | 55 - .../paths/instance/products/list/List.stories.tsx | 58 - .../src/paths/instance/products/list/Table.tsx | 479 --- .../src/paths/instance/products/list/index.tsx | 80 - .../instance/products/update/Update.stories.tsx | 71 - .../paths/instance/products/update/UpdatePage.tsx | 77 - .../src/paths/instance/products/update/index.tsx | 71 - .../instance/reserves/create/Create.stories.tsx | 42 - .../paths/instance/reserves/create/CreatePage.tsx | 168 - .../create/CreatedSuccessfully.stories.tsx | 53 - .../reserves/create/CreatedSuccessfully.tsx | 79 - .../src/paths/instance/reserves/create/index.tsx | 71 - .../paths/instance/reserves/details/DetailPage.tsx | 278 -- .../instance/reserves/details/Details.stories.tsx | 105 - .../paths/instance/reserves/details/TipInfo.tsx | 87 - .../src/paths/instance/reserves/details/index.tsx | 56 - .../instance/reserves/list/AutorizeTipModal.tsx | 85 - .../instance/reserves/list/CreatedSuccessfully.tsx | 100 - .../paths/instance/reserves/list/List.stories.tsx | 102 - .../src/paths/instance/reserves/list/Table.tsx | 313 -- .../src/paths/instance/reserves/list/index.tsx | 117 - .../instance/transfers/create/Create.stories.tsx | 43 - .../paths/instance/transfers/create/CreatePage.tsx | 104 - .../src/paths/instance/transfers/create/index.tsx | 60 - .../paths/instance/transfers/list/List.stories.tsx | 93 - .../src/paths/instance/transfers/list/ListPage.tsx | 89 - .../src/paths/instance/transfers/list/Table.tsx | 225 -- .../src/paths/instance/transfers/list/index.tsx | 85 - .../src/paths/instance/transfers/update/index.tsx | 26 - .../src/paths/instance/update/Update.stories.tsx | 61 - .../src/paths/instance/update/UpdatePage.tsx | 259 -- .../src/paths/instance/update/index.tsx | 113 - .../merchant-backoffice/src/paths/login/index.tsx | 29 - .../src/paths/notfound/index.tsx | 36 - packages/merchant-backoffice/src/schemas/index.ts | 202 -- .../src/scss/DurationPicker.scss | 71 - packages/merchant-backoffice/src/scss/_aside.scss | 179 - packages/merchant-backoffice/src/scss/_card.scss | 69 - .../src/scss/_custom-calendar.scss | 254 -- packages/merchant-backoffice/src/scss/_footer.scss | 35 - packages/merchant-backoffice/src/scss/_form.scss | 64 - .../merchant-backoffice/src/scss/_hero-bar.scss | 55 - .../merchant-backoffice/src/scss/_loading.scss | 51 - .../src/scss/_main-section.scss | 24 - packages/merchant-backoffice/src/scss/_misc.scss | 50 - packages/merchant-backoffice/src/scss/_mixins.scss | 34 - packages/merchant-backoffice/src/scss/_modal.scss | 35 - .../merchant-backoffice/src/scss/_nav-bar.scss | 144 - packages/merchant-backoffice/src/scss/_table.scss | 173 - .../src/scss/_theme-default.scss | 136 - packages/merchant-backoffice/src/scss/_tiles.scss | 25 - .../merchant-backoffice/src/scss/_title-bar.scss | 50 - .../src/scss/fonts/XRXV3I6Li01BKofINeaE.ttf | Bin 43752 -> 0 bytes .../merchant-backoffice/src/scss/fonts/nunito.css | 22 - .../fonts/materialdesignicons-webfont-4.9.95.eot | Bin 844600 -> 0 bytes .../fonts/materialdesignicons-webfont-4.9.95.ttf | Bin 844380 -> 0 bytes .../fonts/materialdesignicons-webfont-4.9.95.woff | Bin 404384 -> 0 bytes .../fonts/materialdesignicons-webfont-4.9.95.woff2 | Bin 283040 -> 0 bytes .../scss/icons/materialdesignicons-4.9.95.min.css | 3 - .../merchant-backoffice/src/scss/libs/_all.scss | 29 - packages/merchant-backoffice/src/scss/main.scss | 191 -- packages/merchant-backoffice/src/sw.js | 25 - packages/merchant-backoffice/src/template.html | 52 - packages/merchant-backoffice/src/utils/amount.ts | 70 - .../merchant-backoffice/src/utils/constants.ts | 194 -- .../src/utils/switchableAxios.ts | 66 - packages/merchant-backoffice/src/utils/table.ts | 37 - packages/merchant-backoffice/src/utils/types.ts | 31 - .../tests/__mocks__/browserMocks.ts | 42 - .../tests/__mocks__/fileMocks.ts | 24 - .../tests/__mocks__/fileTransformer.js | 31 - .../tests/__mocks__/setupTests.ts | 28 - packages/merchant-backoffice/tests/axiosMock.ts | 445 --- .../tests/context/backend.test.tsx | 172 - .../merchant-backoffice/tests/declarations.d.ts | 28 - .../tests/functions/regex.test.ts | 87 - packages/merchant-backoffice/tests/header.test.tsx | 63 - .../merchant-backoffice/tests/hooks/async.test.ts | 158 - .../tests/hooks/listener.test.ts | 62 - .../tests/hooks/notification.test.ts | 51 - .../merchant-backoffice/tests/hooks/swr/index.tsx | 45 - .../tests/hooks/swr/instance.test.ts | 636 ---- .../tests/hooks/swr/order.test.ts | 567 ---- .../tests/hooks/swr/product.test.ts | 338 -- .../tests/hooks/swr/reserve.test.ts | 470 --- .../tests/hooks/swr/transfer.test.ts | 268 -- .../merchant-backoffice/tests/stories.test.tsx | 89 - packages/merchant-backoffice/tsconfig.json | 61 - 405 files changed, 66895 deletions(-) delete mode 100644 packages/bank/.gitignore delete mode 100644 packages/bank/.storybook/.babelrc delete mode 100644 packages/bank/.storybook/main.js delete mode 100644 packages/bank/.storybook/preview.js delete mode 100644 packages/bank/README.md delete mode 100644 packages/bank/TODO delete mode 100755 packages/bank/build-bank-translations.sh delete mode 100755 packages/bank/contrib/po2ts delete mode 100644 packages/bank/mocks/demo-window.js delete mode 100644 packages/bank/mocks/json-server/db.json delete mode 100644 packages/bank/mocks/window.js delete mode 100644 packages/bank/package.json delete mode 100644 packages/bank/preact.config.js delete mode 100644 packages/bank/preact.mock.demo.js delete mode 100644 packages/bank/preact.mock.js delete mode 100644 packages/bank/preact.single-config.js delete mode 100755 packages/bank/remove-link-stylesheet.sh delete mode 100644 packages/bank/src/.babelrc delete mode 100644 packages/bank/src/assets/empty.png delete mode 100644 packages/bank/src/assets/example/id1.jpg delete mode 100644 packages/bank/src/assets/favicon.ico delete mode 100644 packages/bank/src/assets/icons/android-chrome-192x192.png delete mode 100644 packages/bank/src/assets/icons/android-chrome-512x512.png delete mode 100644 packages/bank/src/assets/icons/apple-touch-icon.png delete mode 100644 packages/bank/src/assets/icons/auth_method/email.svg delete mode 100644 packages/bank/src/assets/icons/auth_method/postal.svg delete mode 100644 packages/bank/src/assets/icons/auth_method/question.svg delete mode 100644 packages/bank/src/assets/icons/auth_method/sms.svg delete mode 100644 packages/bank/src/assets/icons/auth_method/video.svg delete mode 100644 packages/bank/src/assets/icons/favicon-16x16.png delete mode 100644 packages/bank/src/assets/icons/favicon-32x32.png delete mode 100644 packages/bank/src/assets/icons/languageicon.svg delete mode 100644 packages/bank/src/assets/icons/mstile-150x150.png delete mode 100644 packages/bank/src/assets/logo-white.svg delete mode 100644 packages/bank/src/assets/logo.jpeg delete mode 100644 packages/bank/src/components/AsyncButton.tsx delete mode 100644 packages/bank/src/components/FileButton.tsx delete mode 100644 packages/bank/src/components/Notifications.tsx delete mode 100644 packages/bank/src/components/QR.tsx delete mode 100644 packages/bank/src/components/app.tsx delete mode 100644 packages/bank/src/components/fields/DateInput.tsx delete mode 100644 packages/bank/src/components/fields/EmailInput.tsx delete mode 100644 packages/bank/src/components/fields/FileInput.tsx delete mode 100644 packages/bank/src/components/fields/ImageInput.tsx delete mode 100644 packages/bank/src/components/fields/NumberInput.tsx delete mode 100644 packages/bank/src/components/fields/TextInput.tsx delete mode 100644 packages/bank/src/components/menu/LangSelector.tsx delete mode 100644 packages/bank/src/components/menu/NavigationBar.tsx delete mode 100644 packages/bank/src/components/menu/SideBar.tsx delete mode 100644 packages/bank/src/components/menu/index.tsx delete mode 100644 packages/bank/src/components/picker/DatePicker.tsx delete mode 100644 packages/bank/src/components/picker/DurationPicker.stories.tsx delete mode 100644 packages/bank/src/components/picker/DurationPicker.tsx delete mode 100644 packages/bank/src/context/translation.ts delete mode 100644 packages/bank/src/declaration.d.ts delete mode 100644 packages/bank/src/hooks/async.ts delete mode 100644 packages/bank/src/hooks/index.ts delete mode 100644 packages/bank/src/i18n/bank.pot delete mode 100644 packages/bank/src/i18n/de.po delete mode 100644 packages/bank/src/i18n/en.po delete mode 100644 packages/bank/src/i18n/index.tsx delete mode 100644 packages/bank/src/i18n/it.po delete mode 100644 packages/bank/src/i18n/poheader delete mode 100644 packages/bank/src/i18n/strings-prelude delete mode 100644 packages/bank/src/i18n/strings.ts delete mode 100644 packages/bank/src/index.tsx delete mode 100644 packages/bank/src/manifest.json delete mode 100644 packages/bank/src/pages/home/index.tsx delete mode 100644 packages/bank/src/pages/notfound/index.tsx delete mode 100644 packages/bank/src/pages/notfound/style.css delete mode 100644 packages/bank/src/pages/profile/index.stories.tsx delete mode 100644 packages/bank/src/pages/profile/index.tsx delete mode 100644 packages/bank/src/pages/profile/style.css delete mode 100644 packages/bank/src/scss/DurationPicker.scss delete mode 100644 packages/bank/src/scss/_aside.scss delete mode 100644 packages/bank/src/scss/_card.scss delete mode 100644 packages/bank/src/scss/_custom-calendar.scss delete mode 100644 packages/bank/src/scss/_footer.scss delete mode 100644 packages/bank/src/scss/_form.scss delete mode 100644 packages/bank/src/scss/_hero-bar.scss delete mode 100644 packages/bank/src/scss/_import_theme.scss delete mode 100644 packages/bank/src/scss/_loading.scss delete mode 100644 packages/bank/src/scss/_main-section.scss delete mode 100644 packages/bank/src/scss/_misc.scss delete mode 100644 packages/bank/src/scss/_mixins.scss delete mode 100644 packages/bank/src/scss/_modal.scss delete mode 100644 packages/bank/src/scss/_nav-bar.scss delete mode 100644 packages/bank/src/scss/_table.scss delete mode 100644 packages/bank/src/scss/_theme-default.scss delete mode 100644 packages/bank/src/scss/_tiles.scss delete mode 100644 packages/bank/src/scss/_title-bar.scss delete mode 100644 packages/bank/src/scss/bank.scss delete mode 100644 packages/bank/src/scss/colors-bank.scss delete mode 100644 packages/bank/src/scss/demo.scss delete mode 100644 packages/bank/src/scss/fonts/XRXV3I6Li01BKofINeaE.ttf delete mode 100644 packages/bank/src/scss/fonts/nunito.css delete mode 100644 packages/bank/src/scss/icons/fonts/materialdesignicons-webfont-4.9.95.eot delete mode 100644 packages/bank/src/scss/icons/fonts/materialdesignicons-webfont-4.9.95.ttf delete mode 100644 packages/bank/src/scss/icons/fonts/materialdesignicons-webfont-4.9.95.woff delete mode 100644 packages/bank/src/scss/icons/fonts/materialdesignicons-webfont-4.9.95.woff2 delete mode 100644 packages/bank/src/scss/icons/materialdesignicons-4.9.95.min.css delete mode 100644 packages/bank/src/scss/libs/_all.scss delete mode 100644 packages/bank/src/scss/main.scss delete mode 100644 packages/bank/src/scss/pure.scss delete mode 100644 packages/bank/src/style/index.css delete mode 100644 packages/bank/src/template.html delete mode 100644 packages/bank/tests/__mocks__/browserMocks.ts delete mode 100644 packages/bank/tests/__mocks__/fileMocks.ts delete mode 100644 packages/bank/tests/__mocks__/setupTests.ts delete mode 100644 packages/bank/tests/__tests__/homepage.js delete mode 100644 packages/bank/tests/declarations.d.ts delete mode 100644 packages/bank/tsconfig.json delete mode 100644 packages/merchant-backend/.gitignore delete mode 100644 packages/merchant-backend/.storybook/.babelrc delete mode 100644 packages/merchant-backend/.storybook/main.js delete mode 100644 packages/merchant-backend/.storybook/preview.js delete mode 100644 packages/merchant-backend/README.md delete mode 100755 packages/merchant-backend/contrib/po2ts delete mode 100644 packages/merchant-backend/copyleft-header.js delete mode 100644 packages/merchant-backend/package.json delete mode 100644 packages/merchant-backend/render-examples.ts delete mode 100644 packages/merchant-backend/rollup.config.js delete mode 100644 packages/merchant-backend/src/assets/empty.png delete mode 100644 packages/merchant-backend/src/assets/icons/android-chrome-192x192.png delete mode 100644 packages/merchant-backend/src/assets/icons/android-chrome-512x512.png delete mode 100644 packages/merchant-backend/src/assets/icons/apple-touch-icon.png delete mode 100644 packages/merchant-backend/src/assets/icons/favicon-16x16.png delete mode 100644 packages/merchant-backend/src/assets/icons/favicon-32x32.png delete mode 100644 packages/merchant-backend/src/assets/icons/languageicon.svg delete mode 100644 packages/merchant-backend/src/assets/icons/mstile-150x150.png delete mode 100644 packages/merchant-backend/src/components/Footer.tsx delete mode 100644 packages/merchant-backend/src/components/QR.tsx delete mode 100644 packages/merchant-backend/src/context/backend.ts delete mode 100644 packages/merchant-backend/src/context/config.ts delete mode 100644 packages/merchant-backend/src/context/fetch.ts delete mode 100644 packages/merchant-backend/src/context/instance.ts delete mode 100644 packages/merchant-backend/src/context/listener.ts delete mode 100644 packages/merchant-backend/src/context/translation.ts delete mode 100644 packages/merchant-backend/src/css/pure-min.css delete mode 100644 packages/merchant-backend/src/css/style.css delete mode 100644 packages/merchant-backend/src/custom.d.ts delete mode 100644 packages/merchant-backend/src/declaration.d.ts delete mode 100644 packages/merchant-backend/src/hooks/async.ts delete mode 100644 packages/merchant-backend/src/hooks/backend.ts delete mode 100644 packages/merchant-backend/src/hooks/index.ts delete mode 100644 packages/merchant-backend/src/hooks/instance.ts delete mode 100644 packages/merchant-backend/src/hooks/listener.ts delete mode 100644 packages/merchant-backend/src/hooks/notification.ts delete mode 100644 packages/merchant-backend/src/hooks/notifications.ts delete mode 100644 packages/merchant-backend/src/hooks/order.ts delete mode 100644 packages/merchant-backend/src/hooks/product.ts delete mode 100644 packages/merchant-backend/src/hooks/tips.ts delete mode 100644 packages/merchant-backend/src/hooks/transfer.ts delete mode 100644 packages/merchant-backend/src/i18n/de.po delete mode 100644 packages/merchant-backend/src/i18n/en.po delete mode 100644 packages/merchant-backend/src/i18n/es.po delete mode 100644 packages/merchant-backend/src/i18n/fr.po delete mode 100644 packages/merchant-backend/src/i18n/index.tsx delete mode 100644 packages/merchant-backend/src/i18n/it.po delete mode 100644 packages/merchant-backend/src/i18n/poheader delete mode 100644 packages/merchant-backend/src/i18n/strings-prelude delete mode 100644 packages/merchant-backend/src/i18n/strings.ts delete mode 100644 packages/merchant-backend/src/i18n/sv.po delete mode 100644 packages/merchant-backend/src/i18n/taler-merchant-backoffice.pot delete mode 100644 packages/merchant-backend/src/index.tsx delete mode 100644 packages/merchant-backend/src/pages/DepletedTip.stories.tsx delete mode 100644 packages/merchant-backend/src/pages/DepletedTip.tsx delete mode 100644 packages/merchant-backend/src/pages/OfferRefund.stories.tsx delete mode 100644 packages/merchant-backend/src/pages/OfferRefund.tsx delete mode 100644 packages/merchant-backend/src/pages/OfferTip.stories.tsx delete mode 100644 packages/merchant-backend/src/pages/OfferTip.tsx delete mode 100644 packages/merchant-backend/src/pages/RequestPayment.stories.tsx delete mode 100644 packages/merchant-backend/src/pages/RequestPayment.tsx delete mode 100644 packages/merchant-backend/src/pages/ShowOrderDetails.examples.ts delete mode 100644 packages/merchant-backend/src/pages/ShowOrderDetails.stories.tsx delete mode 100644 packages/merchant-backend/src/pages/ShowOrderDetails.tsx delete mode 100644 packages/merchant-backend/src/styled/index.tsx delete mode 100644 packages/merchant-backend/src/utils/amount.ts delete mode 100644 packages/merchant-backend/src/utils/constants.ts delete mode 100644 packages/merchant-backend/src/utils/table.ts delete mode 100644 packages/merchant-backend/src/utils/types.ts delete mode 100644 packages/merchant-backend/tests/__mocks__/browserMocks.ts delete mode 100644 packages/merchant-backend/tests/__mocks__/fileMocks.ts delete mode 100644 packages/merchant-backend/tests/__mocks__/fileTransformer.js delete mode 100644 packages/merchant-backend/tests/__mocks__/setupTests.ts delete mode 100644 packages/merchant-backend/tests/funcitons/regex.test.ts delete mode 100644 packages/merchant-backend/tests/util.ts delete mode 100644 packages/merchant-backend/tsconfig.back.json delete mode 100644 packages/merchant-backend/tsconfig.json delete mode 100644 packages/merchant-backend/tsconfig.tsbuildinfo delete mode 100644 packages/merchant-backoffice/.gitignore delete mode 100644 packages/merchant-backoffice/.storybook/.babelrc delete mode 100644 packages/merchant-backoffice/.storybook/main.js delete mode 100644 packages/merchant-backoffice/.storybook/preview.js delete mode 100755 packages/merchant-backoffice/contrib/po2ts delete mode 100644 packages/merchant-backoffice/copyleft-header.js delete mode 100644 packages/merchant-backoffice/package.json delete mode 100644 packages/merchant-backoffice/preact.config.js delete mode 100644 packages/merchant-backoffice/preact.single-config.js delete mode 100644 packages/merchant-backoffice/remove-link-stylesheet.sh delete mode 100644 packages/merchant-backoffice/src/.babelrc delete mode 100644 packages/merchant-backoffice/src/AdminRoutes.tsx delete mode 100644 packages/merchant-backoffice/src/ApplicationReadyRoutes.tsx delete mode 100644 packages/merchant-backoffice/src/InstanceRoutes.tsx delete mode 100644 packages/merchant-backoffice/src/assets/empty.png delete mode 100644 packages/merchant-backoffice/src/assets/icons/android-chrome-192x192.png delete mode 100644 packages/merchant-backoffice/src/assets/icons/android-chrome-512x512.png delete mode 100644 packages/merchant-backoffice/src/assets/icons/apple-touch-icon.png delete mode 100644 packages/merchant-backoffice/src/assets/icons/favicon-16x16.png delete mode 100644 packages/merchant-backoffice/src/assets/icons/favicon-32x32.png delete mode 100644 packages/merchant-backoffice/src/assets/icons/languageicon.svg delete mode 100644 packages/merchant-backoffice/src/assets/icons/mstile-150x150.png delete mode 100644 packages/merchant-backoffice/src/assets/logo.jpeg delete mode 100644 packages/merchant-backoffice/src/components/exception/AsyncButton.tsx delete mode 100644 packages/merchant-backoffice/src/components/exception/QR.tsx delete mode 100644 packages/merchant-backoffice/src/components/exception/loading.tsx delete mode 100644 packages/merchant-backoffice/src/components/exception/login.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/FormProvider.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/Input.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputArray.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputBoolean.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputCurrency.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputDate.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputDuration.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputGroup.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputImage.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputLocation.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputNumber.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputPayto.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputPaytoForm.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputSearchProduct.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputSecured.stories.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputSecured.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputSelector.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputStock.stories.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputStock.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputTaxes.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/InputWithAddon.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/TextField.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/useField.tsx delete mode 100644 packages/merchant-backoffice/src/components/form/useGroupField.tsx delete mode 100644 packages/merchant-backoffice/src/components/instance/DefaultInstanceFormFields.tsx delete mode 100644 packages/merchant-backoffice/src/components/menu/LangSelector.tsx delete mode 100644 packages/merchant-backoffice/src/components/menu/NavigationBar.tsx delete mode 100644 packages/merchant-backoffice/src/components/menu/SideBar.tsx delete mode 100644 packages/merchant-backoffice/src/components/menu/index.tsx delete mode 100644 packages/merchant-backoffice/src/components/modal/index.tsx delete mode 100644 packages/merchant-backoffice/src/components/notifications/CreatedSuccessfully.tsx delete mode 100644 packages/merchant-backoffice/src/components/notifications/Notifications.stories.tsx delete mode 100644 packages/merchant-backoffice/src/components/notifications/index.tsx delete mode 100644 packages/merchant-backoffice/src/components/picker/DatePicker.tsx delete mode 100644 packages/merchant-backoffice/src/components/picker/DurationPicker.stories.tsx delete mode 100644 packages/merchant-backoffice/src/components/picker/DurationPicker.tsx delete mode 100644 packages/merchant-backoffice/src/components/product/InventoryProductForm.stories.tsx delete mode 100644 packages/merchant-backoffice/src/components/product/InventoryProductForm.tsx delete mode 100644 packages/merchant-backoffice/src/components/product/NonInventoryProductForm.tsx delete mode 100644 packages/merchant-backoffice/src/components/product/ProductForm.tsx delete mode 100644 packages/merchant-backoffice/src/components/product/ProductList.tsx delete mode 100644 packages/merchant-backoffice/src/context/backend.ts delete mode 100644 packages/merchant-backoffice/src/context/config.ts delete mode 100644 packages/merchant-backoffice/src/context/fetch.ts delete mode 100644 packages/merchant-backoffice/src/context/instance.ts delete mode 100644 packages/merchant-backoffice/src/context/listener.ts delete mode 100644 packages/merchant-backoffice/src/context/translation.ts delete mode 100644 packages/merchant-backoffice/src/custom.d.ts delete mode 100644 packages/merchant-backoffice/src/declaration.d.ts delete mode 100644 packages/merchant-backoffice/src/hooks/async.ts delete mode 100644 packages/merchant-backoffice/src/hooks/backend.ts delete mode 100644 packages/merchant-backoffice/src/hooks/index.ts delete mode 100644 packages/merchant-backoffice/src/hooks/instance.ts delete mode 100644 packages/merchant-backoffice/src/hooks/listener.ts delete mode 100644 packages/merchant-backoffice/src/hooks/notifications.ts delete mode 100644 packages/merchant-backoffice/src/hooks/order.ts delete mode 100644 packages/merchant-backoffice/src/hooks/product.ts delete mode 100644 packages/merchant-backoffice/src/hooks/reserves.ts delete mode 100644 packages/merchant-backoffice/src/hooks/transfer.ts delete mode 100644 packages/merchant-backoffice/src/i18n/de.po delete mode 100644 packages/merchant-backoffice/src/i18n/en.po delete mode 100644 packages/merchant-backoffice/src/i18n/es.po delete mode 100644 packages/merchant-backoffice/src/i18n/fr.po delete mode 100644 packages/merchant-backoffice/src/i18n/index.tsx delete mode 100644 packages/merchant-backoffice/src/i18n/it.po delete mode 100644 packages/merchant-backoffice/src/i18n/poheader delete mode 100644 packages/merchant-backoffice/src/i18n/strings-prelude delete mode 100644 packages/merchant-backoffice/src/i18n/strings.ts delete mode 100644 packages/merchant-backoffice/src/i18n/sv.po delete mode 100644 packages/merchant-backoffice/src/i18n/taler-merchant-backoffice.pot delete mode 100644 packages/merchant-backoffice/src/index.tsx delete mode 100644 packages/merchant-backoffice/src/manifest.json delete mode 100644 packages/merchant-backoffice/src/paths/admin/create/Create.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/admin/create/CreatePage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/admin/create/InstanceCreatedSuccessfully.tsx delete mode 100644 packages/merchant-backoffice/src/paths/admin/create/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/admin/list/TableActive.tsx delete mode 100644 packages/merchant-backoffice/src/paths/admin/list/View.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/admin/list/View.tsx delete mode 100644 packages/merchant-backoffice/src/paths/admin/list/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/details/DetailPage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/details/Details.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/details/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/kyc/list/ListPage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/kyc/list/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/create/Create.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/create/CreatePage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/create/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/details/Detail.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/details/DetailPage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/details/Timeline.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/details/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/list/List.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/list/ListPage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/list/Table.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/orders/list/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/create/Create.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/create/CreatePage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/create/CreatedSuccessfully.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/create/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/list/List.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/list/Table.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/list/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/update/Update.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/update/UpdatePage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/products/update/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/create/Create.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/create/CreatePage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/create/CreatedSuccessfully.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/create/CreatedSuccessfully.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/create/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/details/DetailPage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/details/Details.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/details/TipInfo.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/details/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/list/AutorizeTipModal.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/list/CreatedSuccessfully.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/list/List.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/list/Table.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/reserves/list/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/transfers/create/Create.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/transfers/create/CreatePage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/transfers/create/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/transfers/list/List.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/transfers/list/ListPage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/transfers/list/Table.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/transfers/list/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/transfers/update/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/update/Update.stories.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/update/UpdatePage.tsx delete mode 100644 packages/merchant-backoffice/src/paths/instance/update/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/login/index.tsx delete mode 100644 packages/merchant-backoffice/src/paths/notfound/index.tsx delete mode 100644 packages/merchant-backoffice/src/schemas/index.ts delete mode 100644 packages/merchant-backoffice/src/scss/DurationPicker.scss delete mode 100644 packages/merchant-backoffice/src/scss/_aside.scss delete mode 100644 packages/merchant-backoffice/src/scss/_card.scss delete mode 100644 packages/merchant-backoffice/src/scss/_custom-calendar.scss delete mode 100644 packages/merchant-backoffice/src/scss/_footer.scss delete mode 100644 packages/merchant-backoffice/src/scss/_form.scss delete mode 100644 packages/merchant-backoffice/src/scss/_hero-bar.scss delete mode 100644 packages/merchant-backoffice/src/scss/_loading.scss delete mode 100644 packages/merchant-backoffice/src/scss/_main-section.scss delete mode 100644 packages/merchant-backoffice/src/scss/_misc.scss delete mode 100644 packages/merchant-backoffice/src/scss/_mixins.scss delete mode 100644 packages/merchant-backoffice/src/scss/_modal.scss delete mode 100644 packages/merchant-backoffice/src/scss/_nav-bar.scss delete mode 100644 packages/merchant-backoffice/src/scss/_table.scss delete mode 100644 packages/merchant-backoffice/src/scss/_theme-default.scss delete mode 100644 packages/merchant-backoffice/src/scss/_tiles.scss delete mode 100644 packages/merchant-backoffice/src/scss/_title-bar.scss delete mode 100644 packages/merchant-backoffice/src/scss/fonts/XRXV3I6Li01BKofINeaE.ttf delete mode 100644 packages/merchant-backoffice/src/scss/fonts/nunito.css delete mode 100644 packages/merchant-backoffice/src/scss/icons/fonts/materialdesignicons-webfont-4.9.95.eot delete mode 100644 packages/merchant-backoffice/src/scss/icons/fonts/materialdesignicons-webfont-4.9.95.ttf delete mode 100644 packages/merchant-backoffice/src/scss/icons/fonts/materialdesignicons-webfont-4.9.95.woff delete mode 100644 packages/merchant-backoffice/src/scss/icons/fonts/materialdesignicons-webfont-4.9.95.woff2 delete mode 100644 packages/merchant-backoffice/src/scss/icons/materialdesignicons-4.9.95.min.css delete mode 100644 packages/merchant-backoffice/src/scss/libs/_all.scss delete mode 100644 packages/merchant-backoffice/src/scss/main.scss delete mode 100644 packages/merchant-backoffice/src/sw.js delete mode 100644 packages/merchant-backoffice/src/template.html delete mode 100644 packages/merchant-backoffice/src/utils/amount.ts delete mode 100644 packages/merchant-backoffice/src/utils/constants.ts delete mode 100644 packages/merchant-backoffice/src/utils/switchableAxios.ts delete mode 100644 packages/merchant-backoffice/src/utils/table.ts delete mode 100644 packages/merchant-backoffice/src/utils/types.ts delete mode 100644 packages/merchant-backoffice/tests/__mocks__/browserMocks.ts delete mode 100644 packages/merchant-backoffice/tests/__mocks__/fileMocks.ts delete mode 100644 packages/merchant-backoffice/tests/__mocks__/fileTransformer.js delete mode 100644 packages/merchant-backoffice/tests/__mocks__/setupTests.ts delete mode 100644 packages/merchant-backoffice/tests/axiosMock.ts delete mode 100644 packages/merchant-backoffice/tests/context/backend.test.tsx delete mode 100644 packages/merchant-backoffice/tests/declarations.d.ts delete mode 100644 packages/merchant-backoffice/tests/functions/regex.test.ts delete mode 100644 packages/merchant-backoffice/tests/header.test.tsx delete mode 100644 packages/merchant-backoffice/tests/hooks/async.test.ts delete mode 100644 packages/merchant-backoffice/tests/hooks/listener.test.ts delete mode 100644 packages/merchant-backoffice/tests/hooks/notification.test.ts delete mode 100644 packages/merchant-backoffice/tests/hooks/swr/index.tsx delete mode 100644 packages/merchant-backoffice/tests/hooks/swr/instance.test.ts delete mode 100644 packages/merchant-backoffice/tests/hooks/swr/order.test.ts delete mode 100644 packages/merchant-backoffice/tests/hooks/swr/product.test.ts delete mode 100644 packages/merchant-backoffice/tests/hooks/swr/reserve.test.ts delete mode 100644 packages/merchant-backoffice/tests/hooks/swr/transfer.test.ts delete mode 100644 packages/merchant-backoffice/tests/stories.test.tsx delete mode 100644 packages/merchant-backoffice/tsconfig.json (limited to 'packages') diff --git a/packages/bank/.gitignore b/packages/bank/.gitignore deleted file mode 100644 index 32d0a50..0000000 --- a/packages/bank/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -/build -/*.log -/size-plugin.json -/storybook-static/ diff --git a/packages/bank/.storybook/.babelrc b/packages/bank/.storybook/.babelrc deleted file mode 100644 index 610b6f3..0000000 --- a/packages/bank/.storybook/.babelrc +++ /dev/null @@ -1,25 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - - /** - * - * @author Sebastian Javier Marchano (sebasjm) - */ -{ - "presets": [ - "preact-cli/babel" - ] -} \ No newline at end of file diff --git a/packages/bank/.storybook/main.js b/packages/bank/.storybook/main.js deleted file mode 100644 index f8e4bbc..0000000 --- a/packages/bank/.storybook/main.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - -/** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ - - -module.exports = { - "stories": [ - "../src/**/*.stories.mdx", - "../src/**/*.stories.@(js|jsx|ts|tsx)" - ], - "addons": [ - "@storybook/preset-scss", - "@storybook/addon-a11y", - "@storybook/addon-essentials" //docs, control, actions, viewpot, toolbar, background - ], - // sb does not yet support new jsx transform by default - // https://github.com/storybookjs/storybook/issues/12881 - // https://github.com/storybookjs/storybook/issues/12952 - babel: async (options) => ({ - ...options, - presets: [ - ...options.presets, - [ - '@babel/preset-react', { - runtime: 'automatic', - }, - 'preset-react-jsx-transform' - ], - ], - }), - webpackFinal: (config) => { - // should be removed after storybook 6.3 - // https://github.com/storybookjs/storybook/issues/12853#issuecomment-821576113 - config.resolve.alias = { - react: "preact/compat", - "react-dom": "preact/compat", - }; - return config; - }, -} \ No newline at end of file diff --git a/packages/bank/.storybook/preview.js b/packages/bank/.storybook/preview.js deleted file mode 100644 index 9ab4d94..0000000 --- a/packages/bank/.storybook/preview.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 "../src/scss/main.scss" -import { TranslationProvider } from '../src/context/translation' -import { h } from 'preact'; - - -export const parameters = { - controls: { expanded: true }, - options: { - storySort: (a, b) => { - return (a[1].args.order ?? 0) - (b[1].args.order ?? 0) - // return a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true }) - } - }, -} - -export const globalTypes = { - locale: { - name: 'Locale', - description: 'Internationalization locale', - defaultValue: 'en', - toolbar: { - icon: 'globe', - items: [ - { value: 'en', right: 'πŸ‡ΊπŸ‡Έ', title: 'English' }, - { value: 'es', right: 'πŸ‡ͺπŸ‡Έ', title: 'Spanish' }, - ], - }, - }, -}; - -export const decorators = [ - (Story, { globals }) => { - document.body.parentElement.classList = "has-aside-left has-aside-mobile-transition has-navbar-fixed-top has-aside-expanded" - return - }, - (Story, { globals }) => - - , -]; diff --git a/packages/bank/README.md b/packages/bank/README.md deleted file mode 100644 index 233e4d7..0000000 --- a/packages/bank/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# bank web - -## Testing at bank.demo.taler.net - -the command "pnpm dev-demo" mocks the 'window' object -to address any request to the backend at bank.demo.taler.net, -and launches the development server (see mocks/demo-window.js). - -Point your browser at localhost:9090, in order to get the -SPA automatically compiled and loaded. - -Note: even if login/register/withdraw operations do reach -the backend, the 'window' object as shown in the javascript -console relates however to "localhost:9090" (FIXME). - - -## CLI Commands - -- `npm install`: Installs dependencies - -- `npm run dev`: Run a development, HMR server - -- `npm run serve`: Run a production-like server - -- `npm run build`: Production-ready build - -- `npm run lint`: Pass TypeScript files using ESLint - -- `npm run test`: Run Jest and Enzyme with - [`enzyme-adapter-preact-pure`](https://github.com/preactjs/enzyme-adapter-preact-pure) for - your tests - -For detailed explanation on how things work, checkout the [CLI Readme](https://github.com/developit/preact-cli/blob/master/README.md). - -It's worth noting that you may need to use Node.JS v12/14 on some builds of Node.JS as webpack attempts to make MD4 hashes, which are unsupported in some OpenSSL versions used by more modern NodeJS versions. diff --git a/packages/bank/TODO b/packages/bank/TODO deleted file mode 100644 index a399ada..0000000 --- a/packages/bank/TODO +++ /dev/null @@ -1,45 +0,0 @@ -Urgent TODOs: - -- General: - * not only Nora dark-theme, but default light! (CSS) - * auto-focus on input fields is not working well - * buttons should be visibly insensitive - as long as required input fields are not - working - * next required invalid/missing input field is - not properly highlighted in red - * Logout button needs more padding to the right (CSS) - -- Error bar: - * shows JSON, should only show good error message - and numeric code, not JSON syntax - * should auto-hide after next action, no need for - "clear"! - * need variant "status bar" in green (or blue) - which shows status of last operation - -* H1-Titles: - * Center more (currently way on the left) (CSS) - -- Assets: - * Numeric amount needs to be shown MUCH bigger (CSS) - * Center more? (CSS) - -- Payments: - * Amount to withdraw currently shown in white-on-white (CSS) - * Big frame drawn around notebook-tabs is not nice (CSS) - * Center more? (CSS) - * "Wire to bank account" - - maybe split two types (payto and IBAN) into - two tabs? - - currently cannot switch back from payto to IBAN - -- Withdraw: - * Should use new 'status' bar at the end, instead - of extra dialog with "close" button - * ditto for bank-wire-transfer final stage - -- Footer: - * overlaps with transaction history or other - content, needs to consistently show at the - end! => change rendering logic!? (CSS?) diff --git a/packages/bank/build-bank-translations.sh b/packages/bank/build-bank-translations.sh deleted file mode 100755 index 85c8ad0..0000000 --- a/packages/bank/build-bank-translations.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -set -eu - -# NOTE: the node somehow didn't get -# the strings extracted. Only i18n`` did - -function build { - POTGEN=node_modules/@gnu-taler/pogen/bin/pogen - PACKAGE_NAME=$1 - - find src/ \( -type f -name "*.ts" -or -name "*.tsx" \) ! -name "*.d.ts" \ - | xargs node $POTGEN \ - | msguniq \ - | msgmerge src/i18n/poheader - \ - > src/i18n/$PACKAGE_NAME.pot - - # merge existing translations: fails when NO .po-files were found. - for pofile in $(ls src/i18n/*.po 2> /dev/null || true); do - echo merging $pofile; - msgmerge -o $pofile $pofile src/i18n/$PACKAGE_NAME.pot; - done; - - # generate .ts file containing all translations - cat src/i18n/strings-prelude > src/i18n/strings.ts - for pofile in $(ls src/i18n/*.po 2> /dev/null || true); do \ - echo appending $pofile; \ - ./contrib/po2ts $pofile >> src/i18n/strings.ts; \ - done; -} - -build bank diff --git a/packages/bank/contrib/po2ts b/packages/bank/contrib/po2ts deleted file mode 100755 index a135da6..0000000 --- a/packages/bank/contrib/po2ts +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env node -/* - This file is part of GNU Taler - (C) 2020 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 - */ - -/** - * Convert a .po file into a JavaScript / TypeScript expression. - */ - -const po2json = require("po2json"); - -const filename = process.argv[2]; - -if (!filename) { - console.error("error: missing filename"); - process.exit(1); -} - -const m = filename.match(/([a-zA-Z0-9-_]+).po/); - -if (!m) { - console.error("error: unexpected filename (expected .po)"); - process.exit(1); -} - -const lang = m[1]; -const pojson = po2json.parseFileSync(filename, { format: "jed1.x", fuzzy: true }); -const s = - "strings['" + lang + "'] = " + JSON.stringify(pojson, null, " ") + ";\n"; -console.log(s); diff --git a/packages/bank/mocks/demo-window.js b/packages/bank/mocks/demo-window.js deleted file mode 100644 index 4400590..0000000 --- a/packages/bank/mocks/demo-window.js +++ /dev/null @@ -1,28 +0,0 @@ -Object.defineProperty(window, 'requestAnimationFrame', { - value: function(cb) {} // Silence the browser. -}) - -Object.defineProperty(window, 'localStorage', { - value: { - store: {}, - getItem: function(key) { - return this.store[key]; - }, - setItem: function(key, value) { - return this.store[key] = value; - }, - clear: function() { - this.store = {}; - } - } -}); -Object.defineProperty(window, 'location', { - value: { - origin: "https://bank.demo.taler.net", - search: "", - pathname: "/demobanks/default", - href: "https://bank.demo.taler.net/demobanks/default" - } -}) - -export default window; diff --git a/packages/bank/mocks/json-server/db.json b/packages/bank/mocks/json-server/db.json deleted file mode 100644 index 44d3cca..0000000 --- a/packages/bank/mocks/json-server/db.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "register": {}, - "transactions": {} -} diff --git a/packages/bank/mocks/window.js b/packages/bank/mocks/window.js deleted file mode 100644 index f396ff9..0000000 --- a/packages/bank/mocks/window.js +++ /dev/null @@ -1,27 +0,0 @@ -Object.defineProperty(window, 'requestAnimationFrame', { - value: function(cb) {} // Silence the browser. -}) - -Object.defineProperty(window, 'localStorage', { - value: { - store: {}, - getItem: function(key) { - return this.store[key]; - }, - setItem: function(key, value) { - return this.store[key] = value; - }, - clear: function() { - this.store = {}; - } - } -}); -Object.defineProperty(window, 'location', { - value: { - origin: "http://localhost:8080", /* where taler-local rev proxy listens to */ - search: "", - pathname: "/sandbox/demobanks/default", - } -}) - -export default window; diff --git a/packages/bank/package.json b/packages/bank/package.json deleted file mode 100644 index a44da5c..0000000 --- a/packages/bank/package.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "private": true, - "name": "bank", - "version": "0.1.0", - "license": "AGPL-3.0-OR-LATER", - "scripts": { - "dev": "preact watch --port ${PORT:=9090} --no-sw --no-esm -c preact.mock.js", - "dev-demo": "preact watch --port ${PORT:=9090} --no-sw --no-esm -c preact.mock.demo.js", - "build": "preact build --no-sw --no-esm -c preact.single-config.js --dest build && sh remove-link-stylesheet.sh", - "serve": "sirv build --port ${PORT:=8080} --cors --single", - "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'", - "test": "jest ./tests", - "build-storybook": "build-storybook", - "serve-single": "sirv single --port ${PORT:=8080} --cors --single", - "pretty": "prettier --write src", - "storybook": "start-storybook -p 6006" - }, - "eslintConfig": { - "parser": "@typescript-eslint/parser", - "extends": [ - "preact", - "plugin:@typescript-eslint/recommended" - ], - "ignorePatterns": [ - "build/" - ], - "rules": { - "@typescript-eslint/no-explicit-any": [ - 0 - ], - "@typescript-eslint/ban-ts-comment": [ - 1 - ], - "quotes": [ - 2, - "single", - { - "allowTemplateLiterals": true, - "avoidEscape": false - } - ], - "indent": [ - 2, - 2 - ], - "prefer-arrow-callback": [ - 2, - { - "allowNamedFunctions": false, - "allowUnboundThis": true - } - ], - "curly": [ - 2, - "multi" - ], - "prefer-template": [ - 1 - ] - } - }, - "dependencies": { - "base64-inline-loader": "1.1.1", - "date-fns": "2.25.0", - "jed": "1.1.1", - "preact": "^10.11.2", - "preact-render-to-string": "^5.2.5", - "preact-router": "^3.2.1", - "qrcode-generator": "^1.4.4", - "swr": "~1.1.2" - }, - "devDependencies": { - "@babel/core": "^7.19.6", - "@babel/plugin-transform-react-jsx": "^7.19.0", - "@babel/plugin-transform-react-jsx-source": "^7.19.6", - "@babel/preset-env": "^7.19.4", - "@creativebulma/bulma-tooltip": "^1.2.0", - "@gnu-taler/pogen": "^0.0.5", - "@storybook/addon-a11y": "6.2.9", - "@storybook/addon-actions": "6.2.9", - "@storybook/addon-essentials": "6.2.9", - "@storybook/addon-links": "6.2.9", - "@storybook/preact": "6.2.9", - "@storybook/preset-scss": "^1.0.3", - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/preact": "^2.0.1", - "@testing-library/preact-hooks": "^1.1.0", - "@types/enzyme": "^3.10.12", - "@types/jest": "^27.5.2", - "@typescript-eslint/eslint-plugin": "^5.40.1", - "@typescript-eslint/parser": "^5.40.1", - "babel-loader": "^8.2.5", - "base64-inline-loader": "^1.1.1", - "bulma": "^0.9.4", - "bulma-checkbox": "^1.2.1", - "bulma-radio": "^1.2.0", - "enzyme": "^3.11.0", - "enzyme-adapter-preact-pure": "^3.4.0", - "eslint": "^8.26.0", - "eslint-config-preact": "^1.3.0", - "html-webpack-inline-chunk-plugin": "^1.1.1", - "html-webpack-inline-source-plugin": "0.0.10", - "html-webpack-skip-assets-plugin": "^1.0.3", - "inline-chunk-html-plugin": "^1.1.1", - "jest": "^27.5.1", - "jest-environment-jsdom": "^27.5.1", - "jest-fetch-mock": "^3.0.3", - "jest-preset-preact": "^4.0.5", - "jest-watch-typeahead": "^1.1.0", - "jssha": "^3.3.0", - "po2json": "^0.4.5", - "preact-cli": "3.0.5", - "sass": "1.32.13", - "sass-loader": "^10.3.1", - "script-ext-html-webpack-plugin": "^2.1.5", - "sirv-cli": "^1.0.14", - "typescript": "^4.8.4" - }, - "jest": { - "preset": "jest-preset-preact", - "setupFiles": [ - "/tests/__mocks__/browserMocks.ts", - "/tests/__mocks__/setupTests.ts" - ] - } -} diff --git a/packages/bank/preact.config.js b/packages/bank/preact.config.js deleted file mode 100644 index 8e640f3..0000000 --- a/packages/bank/preact.config.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - -/** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ - -import { DefinePlugin } from 'webpack'; - -import pack from './package.json'; -import * as cp from 'child_process'; - -const commitHash = cp.execSync('git rev-parse --short HEAD').toString(); - -export default { - webpack(config, env, helpers) { - // ensure that process.env will not be undefined on runtime - config.node.process = 'mock' - - // add __VERSION__ to be use in the html - config.plugins.push( - new DefinePlugin({ - 'process.env.__VERSION__': JSON.stringify(env.isProd ? pack.version : `dev-${commitHash}`) , - }), - ); - - // suddenly getting out of memory error from build process, error below [1] - // FIXME: remove preact-cli, use rollup - let { index } = helpers.getPluginsByName(config, 'WebpackFixStyleOnlyEntriesPlugin')[0] - config.plugins.splice(index, 1) - } -} - - - -/* [1] from this error decided to remove plugin 'webpack-fix-style-only-entries - leaving this error for future reference - - -<--- Last few GCs ---> - -[32479:0x2e01870] 19969 ms: Mark-sweep 1869.4 (1950.2) -> 1443.1 (1504.1) MB, 497.5 / 0.0 ms (average mu = 0.631, current mu = 0.455) allocation failure scavenge might not succeed -[32479:0x2e01870] 21907 ms: Mark-sweep 2016.9 (2077.9) -> 1628.6 (1681.4) MB, 1596.0 / 0.0 ms (average mu = 0.354, current mu = 0.176) allocation failure scavenge might not succeed - -<--- JS stacktrace ---> - -==== JS stack trace ========================================= - - 0: ExitFrame [pc: 0x13cf099] -Security context: 0x2f4ca66c08d1 - 1: /* anonymous * / [0x35d05555b4b9] [...path/merchant-backoffice/node_modules/.pnpm/webpack-fix-style-only-entries@0.5.2/node_modules/webpack-fix-style-only-entries/index.js:~80] [pc=0x2145e699d1a4](this=0x1149465410e9 ,0x047e52e36a49 ) - 2: arguments adaptor frame: 3... - -FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory - -*/ \ No newline at end of file diff --git a/packages/bank/preact.mock.demo.js b/packages/bank/preact.mock.demo.js deleted file mode 100644 index e58ef1d..0000000 --- a/packages/bank/preact.mock.demo.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - -/** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ - -import { DefinePlugin, ProvidePlugin } from 'webpack'; - -import pack from './package.json'; -import * as cp from 'child_process'; - -const commitHash = cp.execSync('git rev-parse --short HEAD').toString(); -import path from 'path'; - -export default { - webpack(config, env, helpers) { - // Ensure that process.env will not be undefined at runtime. - config.node.process = 'mock' - let DEMO_SITES = { - "Blog": process.env.TALER_ENV_URL_MERCHANT_BLOG, - "Donations": process.env.TALER_ENV_URL_MERCHANT_DONATIONS, - "Survey": process.env.TALER_ENV_URL_MERCHANT_SURVEY, - "Landing": process.env.TALER_ENV_URL_INTRO, - "Bank": process.env.TALER_ENV_URL_BANK, - } - console.log("demo links found", DEMO_SITES); - // Add __VERSION__ to be use in the html. - config.plugins.push( - new DefinePlugin({ - 'process.env.__VERSION__': JSON.stringify(env.isProd ? pack.version : `dev-${commitHash}`) , - }), - // 'window' gets mocked to point at a running euFin instance. - new ProvidePlugin({window: path.resolve("mocks/demo-window")}), - new DefinePlugin({"DEMO_SITES": JSON.stringify(DEMO_SITES)}) - ); - - let { index } = helpers.getPluginsByName(config, 'WebpackFixStyleOnlyEntriesPlugin')[0] - config.plugins.splice(index, 1) - } -} diff --git a/packages/bank/preact.mock.js b/packages/bank/preact.mock.js deleted file mode 100644 index dc3ceb6..0000000 --- a/packages/bank/preact.mock.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - -/** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ - -import { DefinePlugin, ProvidePlugin } from 'webpack'; - -import pack from './package.json'; -import * as cp from 'child_process'; - -const commitHash = cp.execSync('git rev-parse --short HEAD').toString(); -import path from 'path'; - -export default { - webpack(config, env, helpers) { - // Ensure that process.env will not be undefined at runtime. - config.node.process = 'mock' - let DEMO_SITES = { - "Blog": process.env.TALER_ENV_URL_MERCHANT_BLOG, - "Donations": process.env.TALER_ENV_URL_MERCHANT_DONATIONS, - "Survey": process.env.TALER_ENV_URL_MERCHANT_SURVEY, - "Landing": process.env.TALER_ENV_URL_INTRO, - "Bank": process.env.TALER_ENV_URL_BANK, - } - console.log("demo links found", DEMO_SITES); - // Add __VERSION__ to be use in the html. - config.plugins.push( - new DefinePlugin({ - 'process.env.__VERSION__': JSON.stringify(env.isProd ? pack.version : `dev-${commitHash}`) , - }), - // 'window' gets mocked to point at a running euFin instance. - new ProvidePlugin({window: path.resolve("mocks/window")}), - new DefinePlugin({"DEMO_SITES": JSON.stringify(DEMO_SITES)}) - ); - - let { index } = helpers.getPluginsByName(config, 'WebpackFixStyleOnlyEntriesPlugin')[0] - config.plugins.splice(index, 1) - } -} diff --git a/packages/bank/preact.single-config.js b/packages/bank/preact.single-config.js deleted file mode 100644 index 0fb6f1d..0000000 --- a/packages/bank/preact.single-config.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - -/** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ - -import defaultConfig from './preact.config' - -export default { - webpack(config, env, helpers, options) { - defaultConfig.webpack(config, env, helpers, options) - - //1. check no file is under /routers or /component/{routers,async} to prevent async components - // https://github.com/preactjs/preact-cli#route-based-code-splitting - - //2. remove devtools to prevent sourcemaps - config.devtool = false - - //3. change assetLoader to load assets inline - const loaders = helpers.getLoaders(config) - const assetsLoader = loaders.find(lo => lo.rule.test.test('something.woff')) - if (assetsLoader) { - assetsLoader.rule.use = 'base64-inline-loader' - assetsLoader.rule.loader = undefined - } - - //4. remove critters - //critters remove the css bundle from htmlWebpackPlugin.files.css - //for now, pushing all the content into the html is enough - const crittersWrapper = helpers.getPluginsByName(config, 'Critters') - if (crittersWrapper && crittersWrapper.length > 0) { - const [{ index }] = crittersWrapper - config.plugins.splice(index, 1) - } - - //5. remove favicon from src/assets - - //6. remove performance hints since we now that this is going to be big - if (config.performance) { - config.performance.hints = false - } - - //7. template.html should have a favicon and add js/css content - } -} diff --git a/packages/bank/remove-link-stylesheet.sh b/packages/bank/remove-link-stylesheet.sh deleted file mode 100755 index d3376b8..0000000 --- a/packages/bank/remove-link-stylesheet.sh +++ /dev/null @@ -1,8 +0,0 @@ -# This script has been placed in the public domain. - -FILE=$(ls build/bundle.*.css) -BUNDLE=${FILE#build} -grep -q '' build/index.html || { echo bundle $BUNDLE not found in index.html; exit 1; } -echo -n Removing link from index.html ... -sed 's___' -i build/index.html -echo done diff --git a/packages/bank/src/.babelrc b/packages/bank/src/.babelrc deleted file mode 100644 index 05f4dcc..0000000 --- a/packages/bank/src/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["preact-cli/babel"] -} diff --git a/packages/bank/src/assets/empty.png b/packages/bank/src/assets/empty.png deleted file mode 100644 index 5120d31..0000000 Binary files a/packages/bank/src/assets/empty.png and /dev/null differ diff --git a/packages/bank/src/assets/example/id1.jpg b/packages/bank/src/assets/example/id1.jpg deleted file mode 100644 index 5d022a3..0000000 Binary files a/packages/bank/src/assets/example/id1.jpg and /dev/null differ diff --git a/packages/bank/src/assets/favicon.ico b/packages/bank/src/assets/favicon.ico deleted file mode 100644 index 0741914..0000000 Binary files a/packages/bank/src/assets/favicon.ico and /dev/null differ diff --git a/packages/bank/src/assets/icons/android-chrome-192x192.png b/packages/bank/src/assets/icons/android-chrome-192x192.png deleted file mode 100644 index 93ebe2e..0000000 Binary files a/packages/bank/src/assets/icons/android-chrome-192x192.png and /dev/null differ diff --git a/packages/bank/src/assets/icons/android-chrome-512x512.png b/packages/bank/src/assets/icons/android-chrome-512x512.png deleted file mode 100644 index 52d1623..0000000 Binary files a/packages/bank/src/assets/icons/android-chrome-512x512.png and /dev/null differ diff --git a/packages/bank/src/assets/icons/apple-touch-icon.png b/packages/bank/src/assets/icons/apple-touch-icon.png deleted file mode 100644 index 254e4bb..0000000 Binary files a/packages/bank/src/assets/icons/apple-touch-icon.png and /dev/null differ diff --git a/packages/bank/src/assets/icons/auth_method/email.svg b/packages/bank/src/assets/icons/auth_method/email.svg deleted file mode 100644 index 3e44b87..0000000 --- a/packages/bank/src/assets/icons/auth_method/email.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/bank/src/assets/icons/auth_method/postal.svg b/packages/bank/src/assets/icons/auth_method/postal.svg deleted file mode 100644 index 3787b83..0000000 --- a/packages/bank/src/assets/icons/auth_method/postal.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/bank/src/assets/icons/auth_method/question.svg b/packages/bank/src/assets/icons/auth_method/question.svg deleted file mode 100644 index a346556..0000000 --- a/packages/bank/src/assets/icons/auth_method/question.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/bank/src/assets/icons/auth_method/sms.svg b/packages/bank/src/assets/icons/auth_method/sms.svg deleted file mode 100644 index ed15679..0000000 --- a/packages/bank/src/assets/icons/auth_method/sms.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/bank/src/assets/icons/auth_method/video.svg b/packages/bank/src/assets/icons/auth_method/video.svg deleted file mode 100644 index 69de5e0..0000000 --- a/packages/bank/src/assets/icons/auth_method/video.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/bank/src/assets/icons/favicon-16x16.png b/packages/bank/src/assets/icons/favicon-16x16.png deleted file mode 100644 index e81177d..0000000 Binary files a/packages/bank/src/assets/icons/favicon-16x16.png and /dev/null differ diff --git a/packages/bank/src/assets/icons/favicon-32x32.png b/packages/bank/src/assets/icons/favicon-32x32.png deleted file mode 100644 index 40e9b5b..0000000 Binary files a/packages/bank/src/assets/icons/favicon-32x32.png and /dev/null differ diff --git a/packages/bank/src/assets/icons/languageicon.svg b/packages/bank/src/assets/icons/languageicon.svg deleted file mode 100644 index 22d58da..0000000 --- a/packages/bank/src/assets/icons/languageicon.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/bank/src/assets/icons/mstile-150x150.png b/packages/bank/src/assets/icons/mstile-150x150.png deleted file mode 100644 index 9cfb889..0000000 Binary files a/packages/bank/src/assets/icons/mstile-150x150.png and /dev/null differ diff --git a/packages/bank/src/assets/logo-white.svg b/packages/bank/src/assets/logo-white.svg deleted file mode 100644 index cb1f023..0000000 --- a/packages/bank/src/assets/logo-white.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - diff --git a/packages/bank/src/assets/logo.jpeg b/packages/bank/src/assets/logo.jpeg deleted file mode 100644 index 489832f..0000000 Binary files a/packages/bank/src/assets/logo.jpeg and /dev/null differ diff --git a/packages/bank/src/components/AsyncButton.tsx b/packages/bank/src/components/AsyncButton.tsx deleted file mode 100644 index 0c43056..0000000 --- a/packages/bank/src/components/AsyncButton.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ - -import { ComponentChildren, h, VNode } from 'preact'; -import { useLayoutEffect, useRef } from 'preact/hooks'; -// import { LoadingModal } from "../modal"; -import { useAsync } from '../hooks/async'; -// import { Translate } from "../../i18n"; - -type Props = { - children: ComponentChildren; - disabled?: boolean; - onClick?: () => Promise; - grabFocus?: boolean; - [rest: string]: any; -}; - -export function AsyncButton({ - onClick, - grabFocus, - disabled, - children, - ...rest -}: Props): VNode { - const { isLoading, request } = useAsync(onClick); - - const buttonRef = useRef(null); - useLayoutEffect(() => { - if (grabFocus) - buttonRef.current?.focus(); - - }, [grabFocus]); - - // if (isSlow) { - // return ; - // } - if (isLoading) - return ; - - - return ( - - - - ); -} diff --git a/packages/bank/src/components/FileButton.tsx b/packages/bank/src/components/FileButton.tsx deleted file mode 100644 index dba86cc..0000000 --- a/packages/bank/src/components/FileButton.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { h, VNode } from 'preact'; -import { useRef, useState } from 'preact/hooks'; - -const MAX_IMAGE_UPLOAD_SIZE = 1024 * 1024; - -export interface FileTypeContent { - content: string; - type: string; - name: string; -} - -interface Props { - label: string; - onChange: (v: FileTypeContent | undefined) => void; -} -export function FileButton(props: Props): VNode { - const fileInputRef = useRef(null); - const [sizeError, setSizeError] = useState(false); - return ( -
- - { - const f: FileList | null = e.currentTarget.files; - if (!f || f.length != 1) - return props.onChange(undefined); - - console.log(f); - if (f[0].size > MAX_IMAGE_UPLOAD_SIZE) { - setSizeError(true); - return props.onChange(undefined); - } - setSizeError(false); - return f[0].arrayBuffer().then((b) => { - const content = new Uint8Array(b).reduce( - (data, byte) => data + String.fromCharCode(byte), - '', - ); - return props.onChange({ - content, - name: f[0].name, - type: f[0].type, - }); - }); - }} - /> - {sizeError && ( -

File should be smaller than 1 MB

- )} -
- ); -} diff --git a/packages/bank/src/components/Notifications.tsx b/packages/bank/src/components/Notifications.tsx deleted file mode 100644 index 0932944..0000000 --- a/packages/bank/src/components/Notifications.tsx +++ /dev/null @@ -1,74 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ - -import { h, VNode } from 'preact'; - -export interface Notification { - message: string; - description?: string | VNode; - type: MessageType; -} - -export type MessageType = 'INFO' | 'WARN' | 'ERROR' | 'SUCCESS'; - -interface Props { - notifications: Notification[]; - removeNotification?: (n: Notification) => void; -} - -function messageStyle(type: MessageType): string { - switch (type) { - case 'INFO': - return 'message is-info'; - case 'WARN': - return 'message is-warning'; - case 'ERROR': - return 'message is-danger'; - case 'SUCCESS': - return 'message is-success'; - default: - return 'message'; - } -} - -export function Notifications({ - notifications, - removeNotification, -}: Props): VNode { - return ( -
- {notifications.map((n, i) => ( -
-
-

{n.message}

- {removeNotification && ( -
- {n.description &&
{n.description}
} -
- ))} -
- ); -} diff --git a/packages/bank/src/components/QR.tsx b/packages/bank/src/components/QR.tsx deleted file mode 100644 index ee5b73c..0000000 --- a/packages/bank/src/components/QR.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 { h, VNode } from 'preact'; -import { useEffect, useRef } from 'preact/hooks'; -import qrcode from 'qrcode-generator'; - -export function QR({ text }: { text: string }): VNode { - const divRef = useRef(null); - useEffect(() => { - const qr = qrcode(0, 'L'); - qr.addData(text); - qr.make(); - if (divRef.current) - divRef.current.innerHTML = qr.createSvgTag({ - scalable: true, - }); - }); - - return ( -
-
-
- ); -} diff --git a/packages/bank/src/components/app.tsx b/packages/bank/src/components/app.tsx deleted file mode 100644 index a211aea..0000000 --- a/packages/bank/src/components/app.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { FunctionalComponent, h } from 'preact'; -import { TranslationProvider } from '../context/translation'; -import { BankHome } from '../pages/home/index'; - -const App: FunctionalComponent = () => { - return ( - - {/* TODO: move this somewhere else - the code is too spaghetti for me to find out where to put this */} -
- - - ); -}; - -export default App; diff --git a/packages/bank/src/components/fields/DateInput.tsx b/packages/bank/src/components/fields/DateInput.tsx deleted file mode 100644 index 06ec4b6..0000000 --- a/packages/bank/src/components/fields/DateInput.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { format, subYears } from 'date-fns'; -import { h, VNode } from 'preact'; -import { useLayoutEffect, useRef, useState } from 'preact/hooks'; -import { DatePicker } from '../picker/DatePicker'; - -export interface DateInputProps { - label: string; - grabFocus?: boolean; - tooltip?: string; - error?: string; - years?: Array; - onConfirm?: () => void; - bind: [string, (x: string) => void]; -} - -export function DateInput(props: DateInputProps): VNode { - const inputRef = useRef(null); - useLayoutEffect(() => { - if (props.grabFocus) - inputRef.current?.focus(); - - }, [props.grabFocus]); - const [opened, setOpened] = useState(false); - - const value = props.bind[0] || ''; - const [dirty, setDirty] = useState(false); - const showError = dirty && props.error; - - const calendar = subYears(new Date(), 30); - - return ( -
- -
-
-

- { - if (e.key === 'Enter' && props.onConfirm) - props.onConfirm() - - }} - onInput={(e) => { - const text = e.currentTarget.value; - setDirty(true); - props.bind[1](text); - }} - ref={inputRef} - /> -

-

- { - setOpened(true); - }} - > - - - - -

-
-
-

Using the format yyyy-mm-dd

- {showError &&

{props.error}

} - setOpened(false)} - dateReceiver={(d) => { - setDirty(true); - const v = format(d, 'yyyy-MM-dd'); - props.bind[1](v); - }} - /> -
- ); -} diff --git a/packages/bank/src/components/fields/EmailInput.tsx b/packages/bank/src/components/fields/EmailInput.tsx deleted file mode 100644 index 8b64264..0000000 --- a/packages/bank/src/components/fields/EmailInput.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { h, VNode } from 'preact'; -import { useLayoutEffect, useRef, useState } from 'preact/hooks'; - -export interface TextInputProps { - label: string; - grabFocus?: boolean; - error?: string; - placeholder?: string; - tooltip?: string; - onConfirm?: () => void; - bind: [string, (x: string) => void]; -} - -export function EmailInput(props: TextInputProps): VNode { - const inputRef = useRef(null); - useLayoutEffect(() => { - if (props.grabFocus) - inputRef.current?.focus(); - - }, [props.grabFocus]); - const value = props.bind[0]; - const [dirty, setDirty] = useState(false); - const showError = dirty && props.error; - return ( -
- -
- { - if (e.key === 'Enter' && props.onConfirm) - props.onConfirm() - - }} - onInput={(e) => { - setDirty(true); - props.bind[1]((e.target as HTMLInputElement).value); - }} - ref={inputRef} - style={{ display: 'block' }} - /> -
- {showError &&

{props.error}

} -
- ); -} diff --git a/packages/bank/src/components/fields/FileInput.tsx b/packages/bank/src/components/fields/FileInput.tsx deleted file mode 100644 index 17413b9..0000000 --- a/packages/bank/src/components/fields/FileInput.tsx +++ /dev/null @@ -1,104 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ -import { h, VNode } from 'preact'; -import { useLayoutEffect, useRef, useState } from 'preact/hooks'; - -const MAX_IMAGE_UPLOAD_SIZE = 1024 * 1024; - -export interface FileTypeContent { - content: string; - type: string; - name: string; -} - -export interface FileInputProps { - label: string; - grabFocus?: boolean; - disabled?: boolean; - error?: string; - placeholder?: string; - tooltip?: string; - onChange: (v: FileTypeContent | undefined) => void; -} - -export function FileInput(props: FileInputProps): VNode { - const inputRef = useRef(null); - useLayoutEffect(() => { - if (props.grabFocus) - inputRef.current?.focus(); - - }, [props.grabFocus]); - - const fileInputRef = useRef(null); - const [sizeError, setSizeError] = useState(false); - return ( -
- -
- { - const f: FileList | null = e.currentTarget.files; - if (!f || f.length != 1) - return props.onChange(undefined); - - console.log(f) - if (f[0].size > MAX_IMAGE_UPLOAD_SIZE) { - setSizeError(true); - return props.onChange(undefined); - } - setSizeError(false); - return f[0].arrayBuffer().then((b) => { - const b64 = btoa( - new Uint8Array(b).reduce( - (data, byte) => data + String.fromCharCode(byte), - '', - ), - ); - return props.onChange({content: `data:${f[0].type};base64,${b64}`, name: f[0].name, type: f[0].type}); - }); - }} - /> - {props.error &&

{props.error}

} - {sizeError && ( -

File should be smaller than 1 MB

- )} -
-
- ); -} diff --git a/packages/bank/src/components/fields/ImageInput.tsx b/packages/bank/src/components/fields/ImageInput.tsx deleted file mode 100644 index 98457af..0000000 --- a/packages/bank/src/components/fields/ImageInput.tsx +++ /dev/null @@ -1,93 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 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 - */ - -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ -import { h, VNode } from 'preact'; -import { useLayoutEffect, useRef, useState } from 'preact/hooks'; -import emptyImage from '../../assets/empty.png'; -import { TextInputProps } from './TextInput'; - -const MAX_IMAGE_UPLOAD_SIZE = 1024 * 1024; - -export function ImageInput(props: TextInputProps): VNode { - const inputRef = useRef(null); - useLayoutEffect(() => { - if (props.grabFocus) - inputRef.current?.focus(); - - }, [props.grabFocus]); - - const value = props.bind[0]; - // const [dirty, setDirty] = useState(false) - const image = useRef(null); - const [sizeError, setSizeError] = useState(false); - function onChange(v: string): void { - // setDirty(true); - props.bind[1](v); - } - return ( -
- -
- image.current?.click()} - /> - { - const f: FileList | null = e.currentTarget.files; - if (!f || f.length != 1) - return onChange(emptyImage); - - if (f[0].size > MAX_IMAGE_UPLOAD_SIZE) { - setSizeError(true); - return onChange(emptyImage); - } - setSizeError(false); - return f[0].arrayBuffer().then((b) => { - const b64 = btoa( - new Uint8Array(b).reduce( - (data, byte) => data + String.fromCharCode(byte), - '', - ), - ); - return onChange(`data:${f[0].type};base64,${b64}` as any); - }); - }} - /> - {props.error &&

{props.error}

} - {sizeError && ( -

Image should be smaller than 1 MB

- )} -
-
- ); -} diff --git a/packages/bank/src/components/fields/NumberInput.tsx b/packages/bank/src/components/fields/NumberInput.tsx deleted file mode 100644 index 881c61c..0000000 --- a/packages/bank/src/components/fields/NumberInput.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { h, VNode } from 'preact'; -import { useLayoutEffect, useRef, useState } from 'preact/hooks'; - -export interface TextInputProps { - label: string; - grabFocus?: boolean; - error?: string; - placeholder?: string; - tooltip?: string; - onConfirm?: () => void; - bind: [string, (x: string) => void]; -} - -export function PhoneNumberInput(props: TextInputProps): VNode { - const inputRef = useRef(null); - useLayoutEffect(() => { - if (props.grabFocus) - inputRef.current?.focus(); - - }, [props.grabFocus]); - const value = props.bind[0]; - const [dirty, setDirty] = useState(false); - const showError = dirty && props.error; - return ( -
- -
- { - if (e.key === 'Enter' && props.onConfirm) - props.onConfirm() - - }} - onInput={(e) => { - setDirty(true); - props.bind[1]((e.target as HTMLInputElement).value); - }} - ref={inputRef} - style={{ display: 'block' }} - /> -
- {showError &&

{props.error}

} -
- ); -} diff --git a/packages/bank/src/components/fields/TextInput.tsx b/packages/bank/src/components/fields/TextInput.tsx deleted file mode 100644 index 5cc9f32..0000000 --- a/packages/bank/src/components/fields/TextInput.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { h, VNode } from 'preact'; -import { useLayoutEffect, useRef, useState } from 'preact/hooks'; - -export interface TextInputProps { - inputType?: 'text' | 'number' | 'multiline' | 'password'; - label: string; - grabFocus?: boolean; - disabled?: boolean; - error?: string; - placeholder?: string; - tooltip?: string; - onConfirm?: () => void; - bind: [string, (x: string) => void]; -} - -const TextInputType = function ({ inputType, grabFocus, ...rest }: any): VNode { - const inputRef = useRef(null); - useLayoutEffect(() => { - if (grabFocus) - inputRef.current?.focus(); - - }, [grabFocus]); - - return inputType === 'multiline' ? ( -