Skip to content

Commit

Permalink
Merge pull request #126 from folio-org/UIPBEX-53
Browse files Browse the repository at this point in the history
UIPBEX-53 Implemented TitleManager component
  • Loading branch information
chris-hellen authored May 16, 2024
2 parents 5c4dd92 + c73fc86 commit c398db4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/BursarExportPlugin.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Button, LoadingPane, Pane, PaneFooter } from '@folio/stripes/components';
import { useStripes } from '@folio/stripes/core';
import { useStripes, TitleManager } from '@folio/stripes/core';
import { FormApi } from 'final-form';
import React, { useCallback, useRef } from 'react';
import { FormattedMessage } from 'react-intl';
import { FormattedMessage, useIntl } from 'react-intl';
import { formValuesToDto, schedulingToDto } from './api/dto/to';
import { useAutomaticSchedulerMutation, useManualSchedulerMutation } from './api/mutators';
import ConfigurationForm from './components/ConfigurationForm';
Expand All @@ -11,6 +11,7 @@ import useInitialValues from './hooks/useInitialValues';
import { FormValues } from './types';

export default function BursarExportPlugin() {
const intl = useIntl();
const stripes = useStripes();

const initialValues = useInitialValues();
Expand Down Expand Up @@ -71,17 +72,19 @@ export default function BursarExportPlugin() {
}

return (
<Pane
defaultWidth="fill"
footer={footer}
id="pane-batch-group-configuration"
paneTitle={<FormattedMessage id="ui-plugin-bursar-export.bursarExports.paneTitle" />}
>
<ConfigurationForm
initialValues={initialValues}
onSubmit={submitCallback}
formApiRef={formApiRef}
/>
</Pane>
<TitleManager page={intl.formatMessage({ id: 'ui-plugin-bursar-export.settings.title' })} stripes={stripes}>
<Pane
defaultWidth="fill"
footer={footer}
id="pane-batch-group-configuration"
paneTitle={<FormattedMessage id="ui-plugin-bursar-export.bursarExports.paneTitle" />}
>
<ConfigurationForm
initialValues={initialValues}
onSubmit={submitCallback}
formApiRef={formApiRef}
/>
</Pane>
</TitleManager>
);
}
1 change: 1 addition & 0 deletions test/__mocks__/stripes-core.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jest.mock('@folio/stripes/core', () => {
}
}),
Pluggable: jest.fn(({ children }) => [children]),
TitleManager: jest.fn(({ children }) => children),
useOkapiKy: jest.fn(),
useStripes: jest.fn(() => STRIPES),
};
Expand Down
1 change: 1 addition & 0 deletions translations/ui-plugin-bursar-export/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"meta.title": "Transfer configuration",
"settings.title": "Users settings - Transfer criteria",

"bursarExports.paneTitle": "Transfer configuration",

Expand Down

0 comments on commit c398db4

Please sign in to comment.