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

@@ -1,4 +1,5 @@
// @ts-nocheck
import { DRAWERS } from '@/constants/drawers';
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
@@ -14,7 +15,7 @@ function ExpenseUniversalSearchItemSelectComponent({
openDrawer,
}) {
if (resourceType === RESOURCES_TYPES.EXPENSE) {
openDrawer('expense-drawer', { expenseId: resourceId });
openDrawer(DRAWERS.EXPENSE_DETAILS, { expenseId: resourceId });
}
return null;
}

View File

@@ -22,6 +22,7 @@ import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import withSettings from '@/containers/Settings/withSettings';
import { ActionsMenu, useExpensesTableColumns } from './components';
import { DRAWERS } from '@/constants/drawers';
/**
* Expenses datatable.
@@ -87,14 +88,14 @@ function ExpensesDataTable({
// Handle view detail expense.
const handleViewDetailExpense = ({ id }) => {
openDrawer('expense-drawer', {
openDrawer(DRAWERS.EXPENSE_DETAILS, {
expenseId: id,
});
};
// Handle cell click.
const handleCellClick = (cell, event) => {
openDrawer('expense-drawer', { expenseId: cell.row.original.id });
openDrawer(DRAWERS.EXPENSE_DETAILS, { expenseId: cell.row.original.id });
};
// Display empty status instead of the table.