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

@@ -9,6 +9,7 @@ import { T, Icon, Choose, If } from '@/components';
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
import { AbilitySubject, BillAction } from '@/constants/abilityOption';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { DRAWERS } from '@/constants/drawers';
/**
* Universal search bill item select action.
@@ -23,7 +24,7 @@ function BillUniversalSearchSelectComponent({
openDrawer,
}) {
if (resourceType === RESOURCES_TYPES.BILL) {
openDrawer('bill-drawer', { billId: resourceId });
openDrawer(DRAWERS.BILL_DETAILS, { billId: resourceId });
onAction && onAction();
}
return null;

View File

@@ -24,6 +24,7 @@ import { useBillsListContext } from './BillsListProvider';
import { useMemorizedColumnsWidths } from '@/hooks';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Bills transactions datatable.
@@ -99,12 +100,12 @@ function BillsDataTable({
// Handle view detail bill.
const handleViewDetailBill = ({ id }) => {
openDrawer('bill-drawer', { billId: id });
openDrawer(DRAWERS.BILL_DETAILS, { billId: id });
};
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('bill-drawer', { billId: cell.row.original.id });
openDrawer(DRAWERS.BILL_DETAILS, { billId: cell.row.original.id });
};
// Local storage memorizing columns widths.

View File

@@ -23,6 +23,7 @@ import { useVendorsCreditNoteTableColumns, ActionsMenu } from './components';
import { useVendorsCreditNoteListContext } from './VendorsCreditNoteListProvider';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Vendors Credit note data table.
@@ -78,8 +79,9 @@ function VendorsCreditNoteDataTable({
return <VendorsCreditNoteEmptyStatus />;
}
// Handle view vendor credit details.
const handleViewDetailVendorCredit = ({ id }) => {
openDrawer('vendor-credit-detail-drawer', { vendorCreditId: id });
openDrawer(DRAWERS.VENDOR_CREDIT_DETAILS, { vendorCreditId: id });
};
// Handle delete credit note.
@@ -94,7 +96,7 @@ function VendorsCreditNoteDataTable({
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('vendor-credit-detail-drawer', {
openDrawer(DRAWERS.VENDOR_CREDIT_DETAILS, {
vendorCreditId: cell.row.original.id,
});
};

View File

@@ -9,7 +9,6 @@ import { highlightText } from '@/utils';
import { AbilitySubject, PaymentMadeAction } from '@/constants/abilityOption';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
/**
* Universal search bill item select action.
*/
@@ -22,7 +21,7 @@ function PaymentMadeUniversalSearchSelectComponent({
openDrawer,
}) {
if (resourceType === RESOURCES_TYPES.PAYMENT_MADE) {
openDrawer('payment-made-detail-drawer', { paymentMadeId: resourceId });
openDrawer(DRAWERS.PAYMENT_MADE_DETAILS, { paymentMadeId: resourceId });
}
return null;
}

View File

@@ -16,7 +16,6 @@ import PaymentMadesEmptyStatus from './PaymentMadesEmptyStatus';
import withPaymentMade from './withPaymentMade';
import withPaymentMadeActions from './withPaymentMadeActions';
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
import withAlertsActions from '@/containers/Alert/withAlertActions';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import withSettings from '@/containers/Settings/withSettings';
@@ -24,6 +23,7 @@ import withSettings from '@/containers/Settings/withSettings';
import { usePaymentMadesTableColumns, ActionsMenu } from './components';
import { usePaymentMadesListContext } from './PaymentMadesListProvider';
import { useMemorizedColumnsWidths } from '@/hooks';
import { DRAWERS } from '@/constants/drawers';
/**
* Payment made datatable transactions.
@@ -71,12 +71,12 @@ function PaymentMadesTable({
// Handle view detail payment made.
const handleViewDetailPaymentMade = ({ id }) => {
openDrawer('payment-made-detail-drawer', { paymentMadeId: id });
openDrawer(DRAWERS.PAYMENT_MADE_DETAILS, { paymentMadeId: id });
};
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('payment-made-detail-drawer', {
openDrawer(DRAWERS.PAYMENT_MADE_DETAILS, {
paymentMadeId: cell.row.original.id,
});
};