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

@@ -25,6 +25,7 @@ import {
} from '@/components';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Vendor credit detail actions bar.
@@ -39,14 +40,13 @@ function VendorCreditDetailActionsBar({
// #withDrawerActions
closeDrawer,
}) {
const { vendorCreditId, vendorCredit } = useVendorCreditDetailDrawerContext();
const history = useHistory();
const { vendorCreditId, vendorCredit } = useVendorCreditDetailDrawerContext();
// Handle edit credit note.
const handleEditVendorCredit = () => {
history.push(`/vendor-credits/${vendorCreditId}/edit`);
closeDrawer('vendor-credit-detail-drawer');
closeDrawer(DRAWERS.VENDOR_CREDIT_DETAILS);
};
// Handle delete credit note.

View File

@@ -9,6 +9,7 @@ import {
import { DrawerHeaderContent, DrawerLoading } from '@/components';
import { useFeatureCan } from '@/hooks/state';
import { Features } from '@/constants';
import { DRAWERS } from '@/constants/drawers';
const VendorCreditDetailDrawerContext = React.createContext();
@@ -61,7 +62,7 @@ function VendorCreditDetailDrawerProvider({ vendorCreditId, ...props }) {
}
>
<DrawerHeaderContent
name="vendor-credit-detail-drawer"
name={DRAWERS.VENDOR_CREDIT_DETAILS}
title={intl.get('vendor_credit.drawer_vendor_credit_detail', {
vendorNumber: vendorCredit.vendor_credit_number,
})}