Skip to content

Commit

Permalink
UIIN-3172: Use VersionHistoryPane
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrHladchenko1 committed Feb 5, 2025
1 parent 6b8517b commit 3ab108e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
8 changes: 0 additions & 8 deletions src/views/ItemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,9 @@ const ItemView = props => {
const intl = useIntl();
const calloutContext = useContext(CalloutContext);
const accordionStatusRef = useRef();
const paneTitleRef = useRef();
const { mutateHolding } = useHoldingMutation(targetTenant?.id);
const { updateOwnership } = useUpdateOwnership(UPDATE_OWNERSHIP_API.ITEMS);

useEffect(() => {
if (paneTitleRef.current) {
paneTitleRef.current.focus();
}
}, [isVersionHistoryOpen]);

useEffect(() => {
if (checkIfUserInMemberTenant(stripes)) {
setTenants(omitCurrentAndCentralTenants(stripes));
Expand Down Expand Up @@ -1756,7 +1749,6 @@ const ItemView = props => {
{isVersionHistoryOpen && (
<VersionHistory
onClose={() => setIsSetVersionHistoryOpen(false)}
paneTitleRef={paneTitleRef}
/>
)}
</Paneset>
Expand Down
35 changes: 21 additions & 14 deletions src/views/VersionHistory/VersionHistory.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';

import { Pane } from '@folio/stripes/components';
import {
VersionHistoryPane,
VersionViewContextProvider,
} from '@folio/stripes-acq-components';

const VersionHistory = ({ onClose, paneTitleRef }) => {
const VersionHistory = ({ onClose }) => {
return (
<Pane
id="version-history-pane"
defaultWidth="20%"
onClose={onClose}
paneTitle={<FormattedMessage id="ui-inventory.versionHistory.paneTitle" />}
dismissible
paneTitleRef={paneTitleRef}
<VersionViewContextProvider
snapshotPath=""
versions={[]}
versionId={null}
>
{/* TODO: Create here the list of version history cards in scope of https://folio-org.atlassian.net/browse/UIIN-3175 */}
<span>Versions</span>
</Pane>
<VersionHistoryPane
currentVersion={null}
id="inventory"
isLoading={false}
onClose={onClose}
onSelectVersion={() => {}}
snapshotPath=""
labelsMap={{}}
versions={[]}
hiddenFields={[]}
/>
</VersionViewContextProvider>
);
};

VersionHistory.propTypes = {
onClose: PropTypes.func,
paneTitleRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
};


Expand Down

0 comments on commit 3ab108e

Please sign in to comment.