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

@@ -30,6 +30,7 @@ import {
import { compose } from '@/utils';
import { BadDebtMenuItem } from './utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Invoice details action bar.
@@ -52,7 +53,7 @@ function InvoiceDetailActionsBar({
// Handle edit sale invoice.
const handleEditInvoice = () => {
history.push(`/invoices/${invoiceId}/edit`);
closeDrawer('invoice-detail-drawer');
closeDrawer(DRAWERS.INVOICE_DETAILS);
};
// Handle convert to invoice.
@@ -60,7 +61,7 @@ function InvoiceDetailActionsBar({
history.push(`/credit-notes/new?from_invoice_id=${invoiceId}`, {
invoiceId: invoiceId,
});
closeDrawer('invoice-detail-drawer');
closeDrawer(DRAWERS.INVOICE_DETAILS);
};
// Handle delete sale invoice.

View File

@@ -5,6 +5,7 @@ import { DrawerHeaderContent, DrawerLoading } from '@/components';
import { Features } from '@/constants';
import { useInvoice } from '@/hooks/query';
import { useFeatureCan } from '@/hooks/state';
import { DRAWERS } from '@/constants/drawers';
const InvoiceDetailDrawerContext = React.createContext();
/**
@@ -28,7 +29,7 @@ function InvoiceDetailDrawerProvider({ invoiceId, ...props }) {
return (
<DrawerLoading loading={isInvoiceLoading}>
<DrawerHeaderContent
name="invoice-detail-drawer"
name={DRAWERS.INVOICE_DETAILS}
title={intl.get('invoice_details.drawer.title', {
invoiceNumber: invoice.invoice_no,
})}

View File

@@ -16,6 +16,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Invoice payment transactions datatable.
@@ -54,7 +55,7 @@ function InvoicePaymentTransactionsTable({
// Handles edit payment transactions.
const handleEditPaymentTransactions = ({ payment_receive_id }) => {
history.push(`/payment-receives/${payment_receive_id}/edit`);
closeDrawer('invoice-detail-drawer');
closeDrawer(DRAWERS.INVOICE_DETAILS);
};
return (
<Card>