Skip to content

Commit

Permalink
ERM-3041 Dashboard: the "unsaved changes" confirmation modal is missing
Browse files Browse the repository at this point in the history
* pass string instead of object to ConfirmationModals heading
  • Loading branch information
CalamityC committed Feb 12, 2024
1 parent 510f65e commit 23590ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/hooks/useErmForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Form as FinalForm, FormSpy } from 'react-final-form';
import { useHistory } from 'react-router-dom';
import createDecorator from 'final-form-focus';
import arrayMutators from 'final-form-arrays';
import { FormattedMessage } from 'react-intl';
import { FormattedMessage, useIntl } from 'react-intl';
import { LastVisitedContext } from '@folio/stripes/core';
import { ConfirmationModal } from '@folio/stripes/components';

Expand All @@ -16,6 +16,7 @@ const useErmForm = ({ navigationCheck = true } = {}) => {
const [dirty, setDirty] = useState(false);

const history = useHistory();
const intl = useIntl();

useEffect(() => {
if (navigationCheck) {
Expand Down Expand Up @@ -80,7 +81,7 @@ const useErmForm = ({ navigationCheck = true } = {}) => {
<ConfirmationModal
cancelLabel={<FormattedMessage id="stripes-form.closeWithoutSaving" />}
confirmLabel={<FormattedMessage id="stripes-form.keepEditing" />}
heading={<FormattedMessage id="stripes-form.areYouSure" />}
heading={intl.formatMessage({ id: 'stripes-form.areYouSure' })}
id="cancel-editing-confirmation"
message={<FormattedMessage id="stripes-form.unsavedChanges" />}
onCancel={() => continueNavigation(ctx)}
Expand Down

0 comments on commit 23590ca

Please sign in to comment.