@inveniosoftware/react-invenio-app-ils 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +8 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +7 -5
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/CHANGES.md +0 -551
package/dist/esm/index.js
CHANGED
|
@@ -41,12 +41,12 @@ import _difference from 'lodash/difference';
|
|
|
41
41
|
import _first from 'lodash/first';
|
|
42
42
|
import ReactDOM from 'react-dom';
|
|
43
43
|
import { omit } from 'lodash/object';
|
|
44
|
+
import _startCase from 'lodash/startCase';
|
|
44
45
|
import _concat from 'lodash/concat';
|
|
45
46
|
import { random } from 'lodash/number';
|
|
46
47
|
import _truncate from 'lodash/truncate';
|
|
47
48
|
import { TagCloud } from 'react-tagcloud';
|
|
48
49
|
import { Html5Qrcode, Html5QrcodeSupportedFormats } from 'html5-qrcode';
|
|
49
|
-
import _startCase from 'lodash/startCase';
|
|
50
50
|
import PropTypes from 'prop-types';
|
|
51
51
|
import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
52
52
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
@@ -2042,7 +2042,7 @@ const apiConfig = {
|
|
|
2042
2042
|
const http = axios.create(apiConfig);
|
|
2043
2043
|
|
|
2044
2044
|
// List used to specify whether to redirect to route `/errors` & prevent a redundant error notifation
|
|
2045
|
-
const HTTP_STATUS_CODES_WITH_ERROR_PAGE = [404, 410, 429, 500];
|
|
2045
|
+
const HTTP_STATUS_CODES_WITH_ERROR_PAGE = [404, 410, 403, 429, 500];
|
|
2046
2046
|
// The corresponding dedicated error page components exist in `@pages/frontsite/ErrorPafe`
|
|
2047
2047
|
const URLS_NOT_TO_REDIRECT_IF_UNAUTHORIZED = ['/me', '/me/loans'];
|
|
2048
2048
|
// CSRF possible errors
|
|
@@ -8646,7 +8646,7 @@ function UnauthorizedComponent(props) {
|
|
|
8646
8646
|
}, newProps), /*#__PURE__*/React.createElement(HttpError$1, newProps));
|
|
8647
8647
|
}
|
|
8648
8648
|
UnauthorizedComponent.defaultProps = defaultProps;
|
|
8649
|
-
Overridable.component('Unauthorized', UnauthorizedComponent);
|
|
8649
|
+
const Unauthorized = Overridable.component('Unauthorized', UnauthorizedComponent);
|
|
8650
8650
|
function ForbiddenComponent(props) {
|
|
8651
8651
|
const {
|
|
8652
8652
|
title = 'Access Forbidden',
|
|
@@ -27795,7 +27795,7 @@ class LoanActions$1 extends Component {
|
|
|
27795
27795
|
|
|
27796
27796
|
// omit checkout because it must done in one of the available items
|
|
27797
27797
|
if (!itemPid) {
|
|
27798
|
-
actions = omit(actions, 'checkout');
|
|
27798
|
+
actions = omit(actions, ['checkout', 'self_checkout']);
|
|
27799
27799
|
}
|
|
27800
27800
|
return Object.keys(actions).map(action => {
|
|
27801
27801
|
const cancelAction = function () {
|
|
@@ -27823,7 +27823,7 @@ class LoanActions$1 extends Component {
|
|
|
27823
27823
|
onClick: loanAction,
|
|
27824
27824
|
loading: isLoading,
|
|
27825
27825
|
disabled: isLoading
|
|
27826
|
-
},
|
|
27826
|
+
}, _startCase(action)));
|
|
27827
27827
|
});
|
|
27828
27828
|
}
|
|
27829
27829
|
render() {
|
|
@@ -37287,6 +37287,8 @@ class ErrorsPage extends Component {
|
|
|
37287
37287
|
message: "The requested content has been removed.",
|
|
37288
37288
|
icon: "compass outline"
|
|
37289
37289
|
});
|
|
37290
|
+
} else if (params.errorCode === 403) {
|
|
37291
|
+
return /*#__PURE__*/React.createElement(Unauthorized, null);
|
|
37290
37292
|
} else if (params.errorCode === 429) {
|
|
37291
37293
|
return /*#__PURE__*/React.createElement(TooManyRequests, null);
|
|
37292
37294
|
}
|