Skip to content

Commit

Permalink
Merge branch 'master' into UIIN-2628
Browse files Browse the repository at this point in the history
  • Loading branch information
mariia-aloshyna authored Oct 23, 2023
2 parents 824fe01 + f0c4b11 commit 172f5c3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* Instance. Series heading has vanished in detailed view. Fixes UIIN-2601.
* Remove error message after switch from Instance Edit screen to another app. Fixes UIIN-2600.
* Enable/disable consortial holdings/item actions based on User permissions. Refs UIIN-2452.
* User receives an error when searching for an item in the Inventory app. Fixes UIIN-2634.
* Create new instance success toast no longer shows the instance HRID. Fixes UIIN-2635.
* Optimistic locking message not working for instances in non-consortial tenant. Fixes UIIN-2628.

## [10.0.0](https://github.com/folio-org/ui-inventory/tree/v10.0.0) (2023-10-13)
Expand Down
3 changes: 2 additions & 1 deletion src/ViewHoldingsRecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,10 @@ class ViewHoldingsRecord extends React.Component {
referenceTables,
goTo,
stripes,
location: { state: { tenantFrom } },
location,
} = this.props;
const { instance } = this.state;
const tenantFrom = location?.state?.tenantFrom || stripes.okapi.tenant;

if (this.isAwaitingResource()) return <LoadingView />;

Expand Down
4 changes: 2 additions & 2 deletions src/ViewInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -960,9 +960,9 @@ class ViewInstance extends React.Component {

<Callout ref={this.calloutRef} />

{this.state.afterCreate &&
{this.state.afterCreate && !isEmpty(instance) &&
<CalloutRenderer
message={<FormattedMessage id="ui-inventory.instance.successfullySaved" values={{ hrid: instance?.hrid }} />}
message={<FormattedMessage id="ui-inventory.instance.successfullySaved" values={{ hrid: instance.hrid }} />}
/>
}

Expand Down
18 changes: 15 additions & 3 deletions src/components/InstancesList/InstancesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import saveAs from 'file-saver';
import moment from 'moment';
import classnames from 'classnames';
import { stringify } from 'query-string';

import {
Pluggable,
Expand Down Expand Up @@ -134,6 +135,7 @@ class InstancesList extends React.Component {
}),
stripes: PropTypes.object.isRequired,
history: PropTypes.shape({
push: PropTypes.func,
listen: PropTypes.func,
replace: PropTypes.func,
}),
Expand Down Expand Up @@ -956,8 +958,9 @@ class InstancesList extends React.Component {
const {
parentResources,
parentMutator: { itemsByQuery },
goTo,
getParams,
stripes,
history,
} = this.props;
const { query, qindex } = parentResources?.query ?? {};
const { searchInProgress } = this.state;
Expand All @@ -973,7 +976,10 @@ class InstancesList extends React.Component {
}

itemsByQuery.reset();
const items = await itemsByQuery.GET({ params: { query: itemQuery } });
const items = await itemsByQuery.GET({
params: { query: itemQuery },
tenant: stripes.okapi.tenant,
});

this.setState({ searchInProgress: false });

Expand All @@ -984,7 +990,13 @@ class InstancesList extends React.Component {
}

const { id, holdingsRecordId } = items[0];
goTo(`/inventory/view/${instance.id}/${holdingsRecordId}/${id}`, getParams());
const search = stringify(getParams());

history.push({
pathname: `/inventory/view/${instance.id}/${holdingsRecordId}/${id}`,
search,
state: { tenantTo: stripes.okapi.tenant },
});

return null;
}
Expand Down
1 change: 1 addition & 0 deletions src/components/InstancesList/InstancesList.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ describe('InstancesList', () => {
params: {
query: `${option}=="${_query}"`,
},
tenant: 'diku',
});
});
});
Expand Down
3 changes: 2 additions & 1 deletion src/routes/ItemRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ class ItemRoute extends React.Component {
onClose = () => {
const {
stripes,
location: { state: { tenantFrom } },
location,
} = this.props;
const tenantFrom = location?.state?.tenantFrom || stripes.okapi.tenant;

switchAffiliation(stripes, tenantFrom, this.goBack);
}
Expand Down

0 comments on commit 172f5c3

Please sign in to comment.