mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix(webapp): use all drawers name from common enum object
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
})}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user