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

@@ -22,6 +22,7 @@ import { useManualJournalDrawerContext } from './ManualJournalDrawerProvider';
import { ManualJournalAction, AbilitySubject } from '@/constants/abilityOption';
import { compose } from '@/utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Manual journal action bar.
@@ -39,7 +40,7 @@ function ManualJournalDrawerActionBar({
// Handle edit manual journal action.
const handleEditManualJournal = () => {
history.push(`/manual-journals/${manualJournalId}/edit`);
closeDrawer('journal-drawer');
closeDrawer(DRAWERS.JOURNAL_DETAILS);
};
// Handle manual journal delete action.

View File

@@ -3,6 +3,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import { useJournal } from '@/hooks/query';
import { DrawerLoading, DrawerHeaderContent } from '@/components';
import { DRAWERS } from '@/constants/drawers';
const ManualJournalDrawerContext = React.createContext();
@@ -31,7 +32,7 @@ function ManualJournalDrawerProvider({ manualJournalId, ...props }) {
return (
<DrawerLoading loading={isJournalLoading}>
<DrawerHeaderContent
name={'journal-drawer'}
name={DRAWERS.JOURNAL_DETAILS}
title={intl.get('manual_journal.drawer.title', {
number: manualJournal?.journal_number,
})}