Skip to content

Commit

Permalink
Release v12.0.5 (#2690)
Browse files Browse the repository at this point in the history
* UIIN-3127: Display informative error message when editing same instance, holdings, item in two tabs (#2672)

(cherry picked from commit c0f1176)

* UIIN-3147 User can edit Source consortium "Holdings sources" in member tenant but not in Consortia manager (#2681)

(cherry picked from commit 034df62)

* UIIN-3143: Set the previously used offset by executing 'resultOffset.replace' when changing the segment. (#2680)

(cherry picked from commit d9f70e3)

* Release v12.0.5

---------

Co-authored-by: Oleksandr Hladchenko <[email protected]>
Co-authored-by: Mikita Siadykh <[email protected]>
Co-authored-by: Dmytro-Melnyshyn <[email protected]>
  • Loading branch information
4 people authored Dec 4, 2024
1 parent 433fe63 commit 3557e9e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change history for ui-inventory

## [12.0.5](https://github.com/folio-org/ui-inventory/tree/v12.0.5) (2024-12-04)
[Full Changelog](https://github.com/folio-org/ui-inventory/compare/v12.0.4...v12.0.5)

* Display informative error message when editing same instance, holdings, item in two tabs. Fixes UIIN-3127.
* User can edit Source consortium "Holdings sources" in member tenant but not in Consortia manager. Refs UIIN-3147.
* Set the previously used offset by executing `resultOffset.replace` when changing the segment. Fixes UIIN-3143.

## [12.0.4](https://github.com/folio-org/ui-inventory/tree/v12.0.4) (2024-12-03)
[Full Changelog](https://github.com/folio-org/ui-inventory/compare/v12.0.3...v12.0.4)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@folio/inventory",
"version": "12.0.4",
"version": "12.0.5",
"description": "Inventory manager",
"repository": "folio-org/ui-inventory",
"publishConfig": {
Expand Down
8 changes: 8 additions & 0 deletions src/components/InstancesList/InstancesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ class InstancesList extends React.Component {
data,
location,
segment,
parentMutator,
getLastSearchOffset,
} = this.props;
const sortBy = this.getSortFromParams();

Expand Down Expand Up @@ -297,6 +299,12 @@ class InstancesList extends React.Component {
searchParams.set('sort', data.displaySettings.defaultSort);
this.redirectToSearchParams(searchParams);
}

if (prevProps.segment !== segment) {
const lastSearchOffset = getLastSearchOffset(segment);

parentMutator.resultOffset.replace(lastSearchOffset);
}
}

componentWillUnmount() {
Expand Down
21 changes: 21 additions & 0 deletions src/components/InstancesList/InstancesList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,27 @@ describe('InstancesList', () => {
expect(mockStoreLastSearchOffset).toHaveBeenCalledWith(offset, 'instances');
});
});

describe('and segment has been changed', () => {
it('should apply offset from storage', () => {
const lastSearchOffset = 200;

const { rerender } = renderInstancesList({
segment: segments.instances,
});

mockStoreLastSearchOffset.mockClear();
mockResultOffsetReplace.mockClear();
mockGetLastSearchOffset.mockReturnValueOnce(lastSearchOffset);

rerender(getInstancesListTree({
segment: segments.holdings,
}));

expect(mockGetLastSearchOffset).toHaveBeenCalledWith(segments.holdings);
expect(mockResultOffsetReplace).toHaveBeenCalledWith(lastSearchOffset);
});
});
});

describe('when user clicks Reset all', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/settings/HoldingsSourcesSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HoldingsSourcesSettings extends React.Component {

render() {
const hasPerm = this.props.stripes.hasPerm('ui-inventory.settings.holdings-sources');
const suppress = getSourceSuppressor(RECORD_SOURCE.FOLIO);
const suppress = getSourceSuppressor([RECORD_SOURCE.FOLIO, RECORD_SOURCE.CONSORTIUM]);

return (
<IntlConsumer>
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ export const parseHttpError = async httpError => {
let jsonError = {};

try {
if (contentType === 'text/plain') {
if (contentType.includes('text/plain')) {
jsonError.message = await httpError.text();
} else {
jsonError = await httpError.json();
Expand Down

0 comments on commit 3557e9e

Please sign in to comment.