From aa89484b640be98c09d3a47952cffcd491c3318f Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Thu, 26 Mar 2026 14:59:45 +0200 Subject: [PATCH] wip --- .../VendorForm/VendorBillingAddress.tsx | 81 +++++++++ .../VendorForm/VendorFloatingActions.tsx | 44 ++--- .../VendorForm/VendorFormBasicSection.tsx | 126 ++++++++++++++ .../Vendors/VendorForm/VendorFormContent.tsx | 55 +++++++ .../Vendors/VendorForm/VendorFormFields.tsx | 34 ++++ .../VendorForm/VendorFormFinancialSection.tsx | 154 ++++++++++++++++++ .../Vendors/VendorForm/VendorFormFormik.tsx | 56 ++----- .../VendorForm/VendorFormNotesSection.tsx | 17 ++ .../Vendors/VendorForm/VendorFormPage.tsx | 21 +-- .../VendorForm/VendorFormSectionTitle.tsx | 12 ++ .../VendorForm/VendorShippingAddress.tsx | 81 +++++++++ 11 files changed, 597 insertions(+), 84 deletions(-) create mode 100644 packages/webapp/src/containers/Vendors/VendorForm/VendorBillingAddress.tsx create mode 100644 packages/webapp/src/containers/Vendors/VendorForm/VendorFormBasicSection.tsx create mode 100644 packages/webapp/src/containers/Vendors/VendorForm/VendorFormContent.tsx create mode 100644 packages/webapp/src/containers/Vendors/VendorForm/VendorFormFields.tsx create mode 100644 packages/webapp/src/containers/Vendors/VendorForm/VendorFormFinancialSection.tsx create mode 100644 packages/webapp/src/containers/Vendors/VendorForm/VendorFormNotesSection.tsx create mode 100644 packages/webapp/src/containers/Vendors/VendorForm/VendorFormSectionTitle.tsx create mode 100644 packages/webapp/src/containers/Vendors/VendorForm/VendorShippingAddress.tsx diff --git a/packages/webapp/src/containers/Vendors/VendorForm/VendorBillingAddress.tsx b/packages/webapp/src/containers/Vendors/VendorForm/VendorBillingAddress.tsx new file mode 100644 index 000000000..425e92b93 --- /dev/null +++ b/packages/webapp/src/containers/Vendors/VendorForm/VendorBillingAddress.tsx @@ -0,0 +1,81 @@ +// @ts-nocheck +import { Box } from '@/components'; +import { + FormattedMessage as T, + FFormGroup, + FInputGroup, + FTextArea, +} from '@/components'; +import { VendorFormSectionTitle } from './VendorFormSectionTitle'; + +export function VendorBillingAddress() { + return ( + + + + + } + inline + fill + > + + + + } + inline + fill + > + + + + } + inline + fill + > + + + + } + inline + fill + > + + + + } + inline + fill + > + + + + } + inline + fill + > + + + + } + inline + fill + > + + + + ); +} diff --git a/packages/webapp/src/containers/Vendors/VendorForm/VendorFloatingActions.tsx b/packages/webapp/src/containers/Vendors/VendorForm/VendorFloatingActions.tsx index 99fbf0b96..d4f113a4f 100644 --- a/packages/webapp/src/containers/Vendors/VendorForm/VendorFloatingActions.tsx +++ b/packages/webapp/src/containers/Vendors/VendorForm/VendorFloatingActions.tsx @@ -1,5 +1,4 @@ // @ts-nocheck -import React from 'react'; import { Intent, Button, @@ -11,18 +10,15 @@ import { MenuItem, } from '@blueprintjs/core'; import styled from 'styled-components'; -import classNames from 'classnames'; import { useFormikContext } from 'formik'; import { Group, Icon, FormattedMessage as T } from '@/components'; -import { CLASSES } from '@/constants/classes'; import { useVendorFormContext } from './VendorFormProvider'; -import { safeInvoke } from '@/utils'; /** * Vendor floating actions bar. */ -export default function VendorFloatingActions({ onCancel }) { +export function VendorFloatingActions() { // Formik context. const { resetForm, isSubmitting, submitForm } = useFormikContext(); @@ -30,31 +26,23 @@ export default function VendorFloatingActions({ onCancel }) { const { isNewMode, setSubmitPayload } = useVendorFormContext(); // Handle the submit button. - const handleSubmitBtnClick = (event) => { + const handleSubmitBtnClick = () => { setSubmitPayload({ noRedirect: false }); }; // Handle the submit & new button click. - const handleSubmitAndNewClick = (event) => { + const handleSubmitAndNewClick = () => { submitForm(); setSubmitPayload({ noRedirect: true }); }; - // Handle cancel button click. - const handleCancelBtnClick = (event) => { - safeInvoke(onCancel, event); - }; - // Handle clear button click. - const handleClearBtnClick = (event) => { + const handleClearBtnClick = () => { resetForm(); }; return ( - + {/* ----------- Save and New ----------- */} : } /> - {/* ----------- Cancel ----------- */} -