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

@@ -16,6 +16,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
import { useDrawerContext } from '@/components/Drawer/DrawerProvider';
import { DRAWERS } from '@/constants/drawers';
/**
* Drawer vendor form loading wrapper.
@@ -41,7 +42,7 @@ function QuickVendorFormDrawer({
// Handle the form submit request success.
const handleSubmitSuccess = (values, form, submitPayload, response) => {
if (!submitPayload.noRedirect) {
closeDrawer('quick-write-vendor');
closeDrawer(DRAWERS.QUICK_WRITE_VENDOR);
}
if (payload.quickActionEvent) {
addQuickActionEvent(payload.quickActionEvent, {
@@ -51,7 +52,7 @@ function QuickVendorFormDrawer({
};
// Handle the form cancel action.
const handleCancelForm = () => {
closeDrawer('quick-write-vendor');
closeDrawer(DRAWERS.QUICK_WRITE_VENDOR);
};
return (

View File

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