mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
fix(webapp): use all drawers name from common enum object
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
} from '@/components';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
* Item action-bar of readonly details drawer.
|
||||
@@ -42,7 +43,7 @@ function ItemDetailActionsBar({
|
||||
// Handle edit item.
|
||||
const handleEditItem = () => {
|
||||
history.push(`/items/${itemId}/edit`);
|
||||
closeDrawer('item-detail-drawer');
|
||||
closeDrawer(DRAWERS.ITEM_DETAILS);
|
||||
};
|
||||
|
||||
// Handle delete item.
|
||||
|
||||
@@ -3,6 +3,7 @@ import React from 'react';
|
||||
import { DrawerHeaderContent, DrawerLoading } from '@/components';
|
||||
import { useItem } from '@/hooks/query';
|
||||
import { inactiveStatus } from './utlis';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
const ItemDetailDrawerContext = React.createContext();
|
||||
|
||||
@@ -30,7 +31,7 @@ function ItemDetailDrawerProvider({ itemId, ...props }) {
|
||||
return (
|
||||
<DrawerLoading loading={isItemLoading}>
|
||||
<DrawerHeaderContent
|
||||
name="item-detail-drawer"
|
||||
name={DRAWERS.ITEM_DETAILS}
|
||||
title={inactiveStatus(item)}
|
||||
/>
|
||||
<ItemDetailDrawerContext.Provider value={provider} {...props} />
|
||||
|
||||
@@ -12,6 +12,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
* Bill payment transactions data table.
|
||||
@@ -48,7 +49,7 @@ function BillPaymentTransactions({
|
||||
// Handles edit payment transactions.
|
||||
const handleEditPaymentTransactions = ({ bill_id }) => {
|
||||
history.push(`/bills/${bill_id}/edit`);
|
||||
closeDrawer('item-detail-drawer');
|
||||
closeDrawer(DRAWERS.ITEM_DETAILS);
|
||||
};
|
||||
return (
|
||||
<DataTable
|
||||
|
||||
@@ -13,6 +13,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
* Esimtate payment transactions.
|
||||
@@ -26,6 +27,7 @@ function EstimatePaymentTransactions({
|
||||
}) {
|
||||
const history = useHistory();
|
||||
|
||||
// Estimate transactions table columns.
|
||||
const columns = useEstimateTransactionsColumns();
|
||||
|
||||
const { itemId } = useItemDetailDrawerContext();
|
||||
@@ -49,7 +51,7 @@ function EstimatePaymentTransactions({
|
||||
// Handles edit payment transactions.
|
||||
const handleEditPaymentTransactions = ({ estimate_id }) => {
|
||||
history.push(`/estimates/${estimate_id}/edit`);
|
||||
closeDrawer('item-detail-drawer');
|
||||
closeDrawer(DRAWERS.ITEM_DETAILS);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -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.
|
||||
@@ -52,7 +53,7 @@ function InvoicePaymentTransactions({
|
||||
// Handles edit payment transactions.
|
||||
const handleEditPaymentTransactions = ({ invoice_id }) => {
|
||||
history.push(`/invoices/${invoice_id}/edit`);
|
||||
closeDrawer('item-detail-drawer');
|
||||
closeDrawer(DRAWERS.ITEM_DETAILS);
|
||||
};
|
||||
return (
|
||||
<DataTable
|
||||
|
||||
@@ -12,6 +12,7 @@ import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
* Receipt payment transactions.
|
||||
@@ -48,7 +49,7 @@ function ReceiptPaymentTransactions({
|
||||
// Handles edit payment transactions.
|
||||
const handleEditPaymentTransactions = ({ receipt_id }) => {
|
||||
history.push(`/receipts/${receipt_id}/edit`);
|
||||
closeDrawer('item-detail-drawer');
|
||||
closeDrawer(DRAWERS.ITEM_DETAILS);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user