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

@@ -26,6 +26,7 @@ import { CreditNoteAction, AbilitySubject } from '@/constants/abilityOption';
import { compose } from '@/utils';
import { CreditNoteMenuItem } from './utils';
import { DRAWERS } from '@/constants/drawers';
/**
* Credit note detail actions bar.
@@ -47,7 +48,7 @@ function CreditNoteDetailActionsBar({
// Handle edit credit note.
const handleEditCreditNote = () => {
history.push(`/credit-notes/${creditNoteId}/edit`);
closeDrawer('credit-note-detail-drawer');
closeDrawer(DRAWERS.CREDIT_NOTE_DETAILS);
};
const handleRefundCreditNote = () => {

View File

@@ -10,6 +10,7 @@ import {
import { Features } from '@/constants';
import { useFeatureCan } from '@/hooks/state';
import { DrawerHeaderContent, DrawerLoading } from '@/components';
import { DRAWERS } from '@/constants/drawers';
const CreditNoteDetailDrawerContext = React.createContext();
@@ -72,7 +73,7 @@ function CreditNoteDetailDrawerProvider({ creditNoteId, ...props }) {
}
>
<DrawerHeaderContent
name="credit-note-detail-drawer"
name={DRAWERS.CREDIT_NOTE_DETAILS}
title={intl.get('credit_note.drawer.title', {
number: creditNote.credit_note_number,
})}