fix(webapp): use all drawers name from common enum object

This commit is contained in:
Ahmed Bouhuolia
2023-06-14 19:51:14 +02:00
parent 01c27b56ef
commit d1a09e3b15
99 changed files with 286 additions and 186 deletions

View File

@@ -7,6 +7,7 @@ import {
} from '@/components';
import QuickCustomerFormDrawer from './QuickCustomerFormDrawer';
import { DRAWERS } from '@/constants/drawers';
/**
* Quick create/edit customer drawer.
@@ -15,7 +16,7 @@ export default function QuickCreateCustomerDrawerContent({ displayName }) {
return (
<React.Fragment>
<DrawerHeaderContent
name="quick-create-customer"
name={DRAWERS.QUICK_CREATE_CUSTOMER}
title={<T id={'create_a_new_customer'} />}
/>
<DrawerBody>

View File

@@ -13,6 +13,7 @@ import CustomerFormFormik, {
} from '@/containers/Customers/CustomerForm/CustomerFormFormik';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { DRAWERS } from '@/constants/drawers';
/**
* Drawer customer form loading wrapper.
@@ -30,11 +31,11 @@ function DrawerCustomerFormLoading({ children }) {
function QuickCustomerFormDrawer({ displayName, closeDrawer, customerId }) {
// Handle the form submit request success.
const handleSubmitSuccess = () => {
closeDrawer('quick-create-customer');
closeDrawer(DRAWERS.QUICK_CREATE_CUSTOMER);
};
// Handle the form cancel action.
const handleCancelForm = () => {
closeDrawer('quick-create-customer');
closeDrawer(DRAWERS.QUICK_CREATE_CUSTOMER);
};
return (