Skip to content

Commit

Permalink
STSMACOM-879 Use this.resources in StripesConnectedSource instead…
Browse files Browse the repository at this point in the history
… of accessing props directly. (#1544)

`StripesConnectedSource` can accept either `parentResources` or
`resources` and one of them can be undefined. Because of this we should
use `this.resources` instead, which takes this into account

https://github.com/user-attachments/assets/ec30f55d-c9b2-4643-afd6-ca3d663eb68b

[STSMACOM-879](https://folio-org.atlassian.net/browse/STSMACOM-879)

(cherry picked from commit 3fd7f0c)
  • Loading branch information
BogdanDenis authored and zburke committed Dec 5, 2024
1 parent 30c64d2 commit 35ff190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 9.2.5 IN PROGRESS

* Fetch updaters in `<ViewMetaData>` on `props.metadata` changes. Fixes STSMACOM-878.
* Use `this.resources` in `StripesConnectedSource` instead of accessing props directly. Fixes STSMACOM-879.

## [9.2.4](https://github.com/folio-org/stripes-smart-components/tree/v9.2.4) (2024-12-02)
[Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v9.2.3...v9.2.4)
Expand Down
7 changes: 2 additions & 5 deletions lib/SearchAndSort/ConnectedSource/StripesConnectedSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ export default class StripesConnectedSource {
}

failureMessage() {
const {
isRequestUrlExceededLimit,
parentResources,
} = this.props;
const { isRequestUrlExceededLimit } = this.props;

const failed = this.recordsObj.failed;

Expand All @@ -80,7 +77,7 @@ export default class StripesConnectedSource {
// stripes-connect failure object has: dataKey, httpStatus, message, module, resource, throwErrors
const res = `Error ${failed.httpStatus}: ${failed.message.replace(/.*:\s*/, '')}`;
this.logger.log('source', 'failureMessage', res);
return <FormattedMessage id="stripes-smart-components.error.badRequest" values={{ query: parentResources.query.query }} />;
return <FormattedMessage id="stripes-smart-components.error.badRequest" values={{ query: this.resources.query.query }} />;
}

fetchMore(increment) {
Expand Down

0 comments on commit 35ff190

Please sign in to comment.