From 35ff190ada5f971b58129b028dbc31a42770a4f1 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Thu, 28 Nov 2024 15:17:46 +0100 Subject: [PATCH] STSMACOM-879 Use `this.resources` in `StripesConnectedSource` instead 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 3fd7f0c70e671961b8ccfcae11c60f059f630484) --- CHANGELOG.md | 1 + .../ConnectedSource/StripesConnectedSource.js | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0f86869d..4d4b3731d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 9.2.5 IN PROGRESS * Fetch updaters in `` 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) diff --git a/lib/SearchAndSort/ConnectedSource/StripesConnectedSource.js b/lib/SearchAndSort/ConnectedSource/StripesConnectedSource.js index 674773430..d08ad1399 100644 --- a/lib/SearchAndSort/ConnectedSource/StripesConnectedSource.js +++ b/lib/SearchAndSort/ConnectedSource/StripesConnectedSource.js @@ -66,10 +66,7 @@ export default class StripesConnectedSource { } failureMessage() { - const { - isRequestUrlExceededLimit, - parentResources, - } = this.props; + const { isRequestUrlExceededLimit } = this.props; const failed = this.recordsObj.failed; @@ -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 ; + return ; } fetchMore(increment) {