From c9c04a14be4bf9a70cd1730d2e8b5aa8bd38f032 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 10 Jun 2021 23:51:14 -0300 Subject: lots of fixes in same commit added tooltips in buttons and fix tooltips styles in corner cases added a start for required fields token -> access token fixed query product list refactor instance update/create form some more comments from christian email --- .../src/components/exception/AsyncButton.tsx | 12 +- .../frontend/src/components/exception/login.tsx | 6 +- .../frontend/src/components/form/DatePicker.tsx | 5 - packages/frontend/src/components/form/Input.tsx | 7 +- .../frontend/src/components/form/InputArray.tsx | 13 +- .../frontend/src/components/form/InputDate.tsx | 8 +- .../frontend/src/components/form/InputGroup.tsx | 8 +- .../src/components/form/InputSearchProduct.tsx | 24 +-- .../src/components/form/InputSecured.stories.tsx | 6 +- .../frontend/src/components/form/InputSecured.tsx | 2 +- .../frontend/src/components/form/InputStock.tsx | 27 ++-- .../src/components/form/InputWithAddon.tsx | 7 +- .../frontend/src/components/form/TextField.tsx | 53 +++++++ packages/frontend/src/components/form/useField.tsx | 10 +- .../instance/DefaultInstanceFormFields.tsx | 88 +++++++++++ packages/frontend/src/components/menu/index.tsx | 3 - packages/frontend/src/components/modal/index.tsx | 25 +-- packages/frontend/src/context/backend.ts | 1 - packages/frontend/src/declaration.d.ts | 9 ++ packages/frontend/src/hooks/product.ts | 2 +- packages/frontend/src/i18n/index.tsx | 5 +- .../frontend/src/paths/admin/create/CreatePage.tsx | 72 ++++----- .../admin/create/InstanceCreatedSuccessfully.tsx | 2 +- packages/frontend/src/paths/admin/list/Table.tsx | 85 +++++----- .../paths/instance/orders/create/CreatePage.tsx | 2 +- .../orders/create/InventoryProductForm.tsx | 8 +- .../orders/create/NonInventoryProductForm.tsx | 20 +-- .../orders/create/OrderCreatedSuccessfully.tsx | 9 +- .../paths/instance/orders/details/DetailPage.tsx | 171 +++++++++++---------- .../src/paths/instance/orders/details/Timeline.tsx | 5 +- .../src/paths/instance/orders/list/Table.tsx | 7 +- .../src/paths/instance/orders/list/index.tsx | 51 ++++-- .../paths/instance/products/create/CreatePage.tsx | 2 +- .../products/create/CreatedSuccessfully.tsx | 1 + .../src/paths/instance/products/list/Table.tsx | 82 +++++----- .../paths/instance/products/update/UpdatePage.tsx | 21 ++- .../paths/instance/reserves/create/CreatePage.tsx | 2 +- .../paths/instance/reserves/details/DetailPage.tsx | 107 ++++++------- .../src/paths/instance/reserves/list/Table.tsx | 12 +- .../paths/instance/transfers/create/CreatePage.tsx | 2 +- .../src/paths/instance/transfers/list/Table.tsx | 9 +- .../src/paths/instance/transfers/list/index.tsx | 20 ++- .../src/paths/instance/update/UpdatePage.tsx | 34 +--- packages/frontend/src/scss/main.scss | 71 +++++---- 44 files changed, 661 insertions(+), 455 deletions(-) create mode 100644 packages/frontend/src/components/form/TextField.tsx create mode 100644 packages/frontend/src/components/instance/DefaultInstanceFormFields.tsx diff --git a/packages/frontend/src/components/exception/AsyncButton.tsx b/packages/frontend/src/components/exception/AsyncButton.tsx index 95e4e72..3dad3e0 100644 --- a/packages/frontend/src/components/exception/AsyncButton.tsx +++ b/packages/frontend/src/components/exception/AsyncButton.tsx @@ -25,12 +25,12 @@ import { useAsync } from "../../hooks/async"; import { Translate } from "../../i18n"; type Props = { - children: ComponentChildren, + children: ComponentChildren, disabled: boolean; onClick?: () => Promise; }; -export function AsyncButton({ onClick, disabled, children }: Props) { +export function AsyncButton({ onClick, disabled, children, ...rest }: Props) { const { isSlow, isLoading, request, cancel } = useAsync(onClick); if (isSlow) { @@ -40,7 +40,9 @@ export function AsyncButton({ onClick, disabled, children }: Props) { return ; } - return ; + return + + ; } diff --git a/packages/frontend/src/components/exception/login.tsx b/packages/frontend/src/components/exception/login.tsx index e7c9802..fca81ae 100644 --- a/packages/frontend/src/components/exception/login.tsx +++ b/packages/frontend/src/components/exception/login.tsx @@ -55,7 +55,7 @@ export function LoginModal({ onConfirm, withMessage }: Props): VNode {