@inveniosoftware/react-invenio-app-ils 2.0.1 → 2.1.0
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 +398 -34
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +398 -34
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -4359,6 +4359,14 @@ const prettyPrintBooleanValue = value => {
|
|
|
4359
4359
|
const screenIsWiderThan = pixels => {
|
|
4360
4360
|
return window.matchMedia(`(max-width: ${pixels}px)`).matches ? false : true;
|
|
4361
4361
|
};
|
|
4362
|
+
const isPrivilegedUser = () => {
|
|
4363
|
+
const roles = _get__default["default"](sessionManager, 'user.roles', []);
|
|
4364
|
+
return roles.includes('admin') || roles.includes('librarian');
|
|
4365
|
+
};
|
|
4366
|
+
const isDocumentOverbooked = async documentPid => {
|
|
4367
|
+
const response = await documentApi.get(documentPid);
|
|
4368
|
+
return _get__default["default"](response, 'data.metadata.circulation.overbooked', false);
|
|
4369
|
+
};
|
|
4362
4370
|
|
|
4363
4371
|
class MetadataTable extends React.Component {
|
|
4364
4372
|
renderRows() {
|
|
@@ -8964,6 +8972,14 @@ const Sidebar = reactRedux.connect(mapStateToProps$1A, mapDispatchToProps$1f)(Si
|
|
|
8964
8972
|
const IS_LOADING$H = 'fetchOrderDetails/IS_LOADING';
|
|
8965
8973
|
const SUCCESS$H = 'fetchOrderDetails/SUCCESS';
|
|
8966
8974
|
const HAS_ERROR$H = 'fetchOrderDetails/HAS_ERROR';
|
|
8975
|
+
const CLEAR$c = 'fetchOrderDetails/CLEAR';
|
|
8976
|
+
const clearOrderDetails = () => {
|
|
8977
|
+
return dispatch => {
|
|
8978
|
+
dispatch({
|
|
8979
|
+
type: CLEAR$c
|
|
8980
|
+
});
|
|
8981
|
+
};
|
|
8982
|
+
};
|
|
8967
8983
|
const fetchOrderDetails = pid => {
|
|
8968
8984
|
return async dispatch => {
|
|
8969
8985
|
dispatch({
|
|
@@ -9758,6 +9774,12 @@ class OrderDetails$1 extends React__default["default"].Component {
|
|
|
9758
9774
|
fetchOrderDetails(orderPid);
|
|
9759
9775
|
}
|
|
9760
9776
|
}
|
|
9777
|
+
componentWillUnmount() {
|
|
9778
|
+
const {
|
|
9779
|
+
clearOrderDetails
|
|
9780
|
+
} = this.props;
|
|
9781
|
+
clearOrderDetails();
|
|
9782
|
+
}
|
|
9761
9783
|
render() {
|
|
9762
9784
|
const {
|
|
9763
9785
|
isLoading,
|
|
@@ -9822,7 +9844,8 @@ const mapStateToProps$1z = state => ({
|
|
|
9822
9844
|
hasError: state.orderDetails.hasError
|
|
9823
9845
|
});
|
|
9824
9846
|
const mapDispatchToProps$1e = dispatch => ({
|
|
9825
|
-
fetchOrderDetails: orderPid => dispatch(fetchOrderDetails(orderPid))
|
|
9847
|
+
fetchOrderDetails: orderPid => dispatch(fetchOrderDetails(orderPid)),
|
|
9848
|
+
clearOrderDetails: () => dispatch(clearOrderDetails())
|
|
9826
9849
|
});
|
|
9827
9850
|
const OrderDetails = reactRedux.connect(mapStateToProps$1z, mapDispatchToProps$1e)(OrderDetails$1);
|
|
9828
9851
|
|
|
@@ -12334,7 +12357,7 @@ const MULTIPLE_LOAN_RESULTS = 'itemLoansSearch/MULTIPLE_LOAN_RESULTS';
|
|
|
12334
12357
|
const CHECKIN_IS_LOADING = 'itemCheckin/IS_LOADING';
|
|
12335
12358
|
const CHECKIN_SUCCESS = 'itemCheckin/SUCCESS';
|
|
12336
12359
|
const CHECKIN_HAS_ERROR = 'itemCheckin/HAS_ERROR';
|
|
12337
|
-
const CLEAR$
|
|
12360
|
+
const CLEAR$b = 'itemCheckin/CLEAR';
|
|
12338
12361
|
const checkin = (barcode, onSuccess) => {
|
|
12339
12362
|
return async dispatch => {
|
|
12340
12363
|
dispatch({
|
|
@@ -12398,7 +12421,7 @@ const checkInLoan = (checkinUrl, documentPid, patronPid, itemPid) => {
|
|
|
12398
12421
|
const clearResults$2 = () => {
|
|
12399
12422
|
return dispatch => {
|
|
12400
12423
|
dispatch({
|
|
12401
|
-
type: CLEAR$
|
|
12424
|
+
type: CLEAR$b
|
|
12402
12425
|
});
|
|
12403
12426
|
};
|
|
12404
12427
|
};
|
|
@@ -12988,9 +13011,17 @@ class CheckOut extends React.Component {
|
|
|
12988
13011
|
const IS_LOADING$G = 'fetchDocumentDetails/IS_LOADING';
|
|
12989
13012
|
const SUCCESS$G = 'fetchDocumentDetails/SUCCESS';
|
|
12990
13013
|
const HAS_ERROR$G = 'fetchDocumentDetails/HAS_ERROR';
|
|
13014
|
+
const CLEAR$a = 'fetchDocumentDetails/CLEAR';
|
|
12991
13015
|
const DELETE_IS_LOADING$8 = 'deleteDocument/DELETE_IS_LOADING';
|
|
12992
13016
|
const DELETE_SUCCESS$7 = 'deleteDocument/DELETE_SUCCESS';
|
|
12993
13017
|
const DELETE_HAS_ERROR$8 = 'deleteDocument/DELETE_HAS_ERROR';
|
|
13018
|
+
const clearDocumentDetails = () => {
|
|
13019
|
+
return dispatch => {
|
|
13020
|
+
dispatch({
|
|
13021
|
+
type: CLEAR$a
|
|
13022
|
+
});
|
|
13023
|
+
};
|
|
13024
|
+
};
|
|
12994
13025
|
const fetchDocumentDetails = documentPid => {
|
|
12995
13026
|
return async dispatch => {
|
|
12996
13027
|
dispatch({
|
|
@@ -17994,6 +18025,12 @@ class DocumentDetails$3 extends React.Component {
|
|
|
17994
18025
|
fetchDocumentDetails(documentPid);
|
|
17995
18026
|
}
|
|
17996
18027
|
}
|
|
18028
|
+
componentWillUnmount() {
|
|
18029
|
+
const {
|
|
18030
|
+
clearDocumentDetails
|
|
18031
|
+
} = this.props;
|
|
18032
|
+
clearDocumentDetails();
|
|
18033
|
+
}
|
|
17997
18034
|
render() {
|
|
17998
18035
|
const {
|
|
17999
18036
|
isLoading,
|
|
@@ -18060,7 +18097,8 @@ const mapStateToProps$14 = state => ({
|
|
|
18060
18097
|
hasError: state.documentDetails.hasError
|
|
18061
18098
|
});
|
|
18062
18099
|
const mapDispatchToProps$X = dispatch => ({
|
|
18063
|
-
fetchDocumentDetails: documentPid => dispatch(fetchDocumentDetails(documentPid))
|
|
18100
|
+
fetchDocumentDetails: documentPid => dispatch(fetchDocumentDetails(documentPid)),
|
|
18101
|
+
clearDocumentDetails: () => dispatch(clearDocumentDetails())
|
|
18064
18102
|
});
|
|
18065
18103
|
const DocumentDetails$2 = reactRedux.connect(mapStateToProps$14, mapDispatchToProps$X)(DocumentDetails$3);
|
|
18066
18104
|
|
|
@@ -19457,8 +19495,16 @@ class DocumentSearch extends React.Component {
|
|
|
19457
19495
|
const IS_LOADING$z = 'fetchDocumentRequestDetails/IS_LOADING';
|
|
19458
19496
|
const SUCCESS$z = 'fetchDocumentRequestDetails/SUCCESS';
|
|
19459
19497
|
const HAS_ERROR$z = 'fetchDocumentRequestDetails/HAS_ERROR';
|
|
19498
|
+
const CLEAR$9 = 'fetchDocumentRequestDetails/CLEAR';
|
|
19460
19499
|
const DELETE_IS_LOADING$7 = 'deleteDocumentRequest/DELETE_IS_LOADING';
|
|
19461
19500
|
const DELETE_HAS_ERROR$7 = 'deleteDocumentRequest/DELETE_HAS_ERROR';
|
|
19501
|
+
const clearDocumentRequestDetails = () => {
|
|
19502
|
+
return dispatch => {
|
|
19503
|
+
dispatch({
|
|
19504
|
+
type: CLEAR$9
|
|
19505
|
+
});
|
|
19506
|
+
};
|
|
19507
|
+
};
|
|
19462
19508
|
const fetchDocumentRequestDetails = documentRequestPid => {
|
|
19463
19509
|
return async dispatch => {
|
|
19464
19510
|
dispatch({
|
|
@@ -20567,6 +20613,12 @@ class DocumentRequestDetails$1 extends React.Component {
|
|
|
20567
20613
|
fetchDocumentRequestDetails(documentRequestPid);
|
|
20568
20614
|
}
|
|
20569
20615
|
}
|
|
20616
|
+
componentWillUnmount() {
|
|
20617
|
+
const {
|
|
20618
|
+
clearDocumentRequestDetails
|
|
20619
|
+
} = this.props;
|
|
20620
|
+
clearDocumentRequestDetails();
|
|
20621
|
+
}
|
|
20570
20622
|
render() {
|
|
20571
20623
|
const {
|
|
20572
20624
|
data,
|
|
@@ -20618,7 +20670,8 @@ const mapStateToProps$13 = state => ({
|
|
|
20618
20670
|
error: state.documentRequestDetails.error
|
|
20619
20671
|
});
|
|
20620
20672
|
const mapDispatchToProps$S = dispatch => ({
|
|
20621
|
-
fetchDocumentRequestDetails: documentRequestPid => dispatch(fetchDocumentRequestDetails(documentRequestPid))
|
|
20673
|
+
fetchDocumentRequestDetails: documentRequestPid => dispatch(fetchDocumentRequestDetails(documentRequestPid)),
|
|
20674
|
+
clearDocumentRequestDetails: () => dispatch(clearDocumentRequestDetails())
|
|
20622
20675
|
});
|
|
20623
20676
|
const DocumentRequestDetails = reactRedux.connect(mapStateToProps$13, mapDispatchToProps$S)(DocumentRequestDetails$1);
|
|
20624
20677
|
|
|
@@ -21038,12 +21091,20 @@ class DocumentRequestSearch extends React.Component {
|
|
|
21038
21091
|
const IS_LOADING$y = 'fetchEItemDetails/IS_LOADING';
|
|
21039
21092
|
const SUCCESS$y = 'fetchEItemDetails/SUCCESS';
|
|
21040
21093
|
const HAS_ERROR$y = 'fetchEItemDetails/HAS_ERROR';
|
|
21094
|
+
const CLEAR$8 = 'fetchEItemDetails/CLEAR';
|
|
21041
21095
|
const DELETE_IS_LOADING$6 = 'fetchEItemDetails/DELETE_IS_LOADING';
|
|
21042
21096
|
const DELETE_SUCCESS$6 = 'fetchEItemDetails/DELETE_SUCCESS';
|
|
21043
21097
|
const DELETE_HAS_ERROR$6 = 'fetchEItemDetails/DELETE_HAS_ERROR';
|
|
21044
21098
|
const ADD_FILE = 'fetchEItemDetails/ADD_FILE';
|
|
21045
21099
|
const DELETE_FILE = 'fetchEItemDetails/DELETE_FILE';
|
|
21046
21100
|
const UPLOAD_IS_LOADING = 'fetchEItemDetails/UPLOAD_IS_LOADING';
|
|
21101
|
+
const clearEItemDetails = () => {
|
|
21102
|
+
return dispatch => {
|
|
21103
|
+
dispatch({
|
|
21104
|
+
type: CLEAR$8
|
|
21105
|
+
});
|
|
21106
|
+
};
|
|
21107
|
+
};
|
|
21047
21108
|
const deleteEItem = eitemPid => {
|
|
21048
21109
|
return async dispatch => {
|
|
21049
21110
|
dispatch({
|
|
@@ -21723,6 +21784,12 @@ class EItemDetails$1 extends React.Component {
|
|
|
21723
21784
|
fetchEItemDetails(eitemPid);
|
|
21724
21785
|
}
|
|
21725
21786
|
}
|
|
21787
|
+
componentWillUnmount() {
|
|
21788
|
+
const {
|
|
21789
|
+
clearEItemDetails
|
|
21790
|
+
} = this.props;
|
|
21791
|
+
clearEItemDetails();
|
|
21792
|
+
}
|
|
21726
21793
|
render() {
|
|
21727
21794
|
const {
|
|
21728
21795
|
isLoading,
|
|
@@ -21775,7 +21842,8 @@ const mapStateToProps$_ = state => ({
|
|
|
21775
21842
|
data: state.eitemDetails.data
|
|
21776
21843
|
});
|
|
21777
21844
|
const mapDispatchToProps$N = dispatch => ({
|
|
21778
|
-
fetchEItemDetails: eitemPid => dispatch(fetchEItemDetails(eitemPid))
|
|
21845
|
+
fetchEItemDetails: eitemPid => dispatch(fetchEItemDetails(eitemPid)),
|
|
21846
|
+
clearEItemDetails: () => dispatch(clearEItemDetails())
|
|
21779
21847
|
});
|
|
21780
21848
|
const EItemDetails = reactRedux.connect(mapStateToProps$_, mapDispatchToProps$N)(EItemDetails$1);
|
|
21781
21849
|
|
|
@@ -23391,6 +23459,7 @@ class Home$2 extends React.Component {
|
|
|
23391
23459
|
const IS_LOADING$w = 'fetchBorrowingRequestDetails/IS_LOADING';
|
|
23392
23460
|
const SUCCESS$w = 'fetchBorrowingRequestDetails/SUCCESS';
|
|
23393
23461
|
const HAS_ERROR$w = 'fetchBorrowingRequestDetails/HAS_ERROR';
|
|
23462
|
+
const CLEAR$7 = 'fetchBorrowingRequestDetails/CLEAR';
|
|
23394
23463
|
const fetchBorrowingRequestDetails = borrowingRequestPid => {
|
|
23395
23464
|
return async dispatch => {
|
|
23396
23465
|
dispatch({
|
|
@@ -23410,6 +23479,13 @@ const fetchBorrowingRequestDetails = borrowingRequestPid => {
|
|
|
23410
23479
|
}
|
|
23411
23480
|
};
|
|
23412
23481
|
};
|
|
23482
|
+
const clearBorrowingRequestDetails = () => {
|
|
23483
|
+
return dispatch => {
|
|
23484
|
+
dispatch({
|
|
23485
|
+
type: CLEAR$7
|
|
23486
|
+
});
|
|
23487
|
+
};
|
|
23488
|
+
};
|
|
23413
23489
|
|
|
23414
23490
|
const SUCCESS$v = 'borrowingRequestPatronLoanCreate/SUCCESS';
|
|
23415
23491
|
const IS_LOADING$v = 'borrowingRequestPatronLoanCreate/IS_LOADING';
|
|
@@ -24232,6 +24308,12 @@ class BorrowingRequestDetails$1 extends React.Component {
|
|
|
24232
24308
|
fetchBorrowingRequestDetails(borrowingRequestPid);
|
|
24233
24309
|
}
|
|
24234
24310
|
}
|
|
24311
|
+
componentWillUnmount() {
|
|
24312
|
+
const {
|
|
24313
|
+
clearBorrowingRequestDetails
|
|
24314
|
+
} = this.props;
|
|
24315
|
+
clearBorrowingRequestDetails();
|
|
24316
|
+
}
|
|
24235
24317
|
render() {
|
|
24236
24318
|
const {
|
|
24237
24319
|
isLoading,
|
|
@@ -24294,7 +24376,8 @@ const mapStateToProps$X = state => ({
|
|
|
24294
24376
|
error: state.borrowingRequestDetails.error
|
|
24295
24377
|
});
|
|
24296
24378
|
const mapDispatchToProps$K = dispatch => ({
|
|
24297
|
-
fetchBorrowingRequestDetails: brwReqPid => dispatch(fetchBorrowingRequestDetails(brwReqPid))
|
|
24379
|
+
fetchBorrowingRequestDetails: brwReqPid => dispatch(fetchBorrowingRequestDetails(brwReqPid)),
|
|
24380
|
+
clearBorrowingRequestDetails: () => dispatch(clearBorrowingRequestDetails())
|
|
24298
24381
|
});
|
|
24299
24382
|
const BorrowingRequestDetails = reactRedux.connect(mapStateToProps$X, mapDispatchToProps$K)(BorrowingRequestDetails$1);
|
|
24300
24383
|
|
|
@@ -24875,6 +24958,7 @@ class BorrowingRequestSearch extends React.Component {
|
|
|
24875
24958
|
const IS_LOADING$t = 'fetchItemDetails/IS_LOADING';
|
|
24876
24959
|
const SUCCESS$t = 'fetchItemDetails/SUCCESS';
|
|
24877
24960
|
const HAS_ERROR$t = 'fetchItemDetails/HAS_ERROR';
|
|
24961
|
+
const CLEAR$6 = 'fetchItemDetails/CLEAR';
|
|
24878
24962
|
const DELETE_IS_LOADING$5 = 'deleteItem/DELETE_IS_LOADING';
|
|
24879
24963
|
const DELETE_SUCCESS$5 = 'deleteItem/DELETE_SUCCESS';
|
|
24880
24964
|
const DELETE_HAS_ERROR$5 = 'deleteItem/DELETE_HAS_ERROR';
|
|
@@ -24923,6 +25007,13 @@ const deleteItem = itemPid => {
|
|
|
24923
25007
|
}
|
|
24924
25008
|
};
|
|
24925
25009
|
};
|
|
25010
|
+
const clearItemDetails = () => {
|
|
25011
|
+
return dispatch => {
|
|
25012
|
+
dispatch({
|
|
25013
|
+
type: CLEAR$6
|
|
25014
|
+
});
|
|
25015
|
+
};
|
|
25016
|
+
};
|
|
24926
25017
|
const checkoutItem$1 = function (documentPid, itemPid, patronPid) {
|
|
24927
25018
|
let force = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
24928
25019
|
return async dispatch => {
|
|
@@ -25665,6 +25756,7 @@ const ACTION_HAS_ERROR = 'loanAction/HAS_ERROR';
|
|
|
25665
25756
|
const DETAILS_IS_LOADING = 'fetchLoanDetails/IS_LOADING';
|
|
25666
25757
|
const DETAILS_SUCCESS = 'fetchLoanDetails/SUCCESS';
|
|
25667
25758
|
const DETAILS_HAS_ERROR = 'fetchLoanDetails/HAS_ERROR';
|
|
25759
|
+
const CLEAR$5 = 'fetchLoanDetails/CLEAR';
|
|
25668
25760
|
const fetchLoanDetails = function (loanPid) {
|
|
25669
25761
|
let withFetchOtherPendingLoans = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
25670
25762
|
return async dispatch => {
|
|
@@ -25695,6 +25787,13 @@ const fetchLoanDetails = function (loanPid) {
|
|
|
25695
25787
|
}
|
|
25696
25788
|
};
|
|
25697
25789
|
};
|
|
25790
|
+
const clearLoanDetails = () => {
|
|
25791
|
+
return dispatch => {
|
|
25792
|
+
dispatch({
|
|
25793
|
+
type: CLEAR$5
|
|
25794
|
+
});
|
|
25795
|
+
};
|
|
25796
|
+
};
|
|
25698
25797
|
const performLoanAction = function (actionURL, documentPid, patronPid) {
|
|
25699
25798
|
let {
|
|
25700
25799
|
itemPid = null,
|
|
@@ -25901,6 +26000,12 @@ class ItemDetails$1 extends React.Component {
|
|
|
25901
26000
|
fetchItemDetails(itemPid);
|
|
25902
26001
|
}
|
|
25903
26002
|
}
|
|
26003
|
+
componentWillUnmount() {
|
|
26004
|
+
const {
|
|
26005
|
+
clearItemDetails
|
|
26006
|
+
} = this.props;
|
|
26007
|
+
clearItemDetails();
|
|
26008
|
+
}
|
|
25904
26009
|
render() {
|
|
25905
26010
|
const {
|
|
25906
26011
|
isLoading,
|
|
@@ -25957,7 +26062,8 @@ const mapStateToProps$R = state => ({
|
|
|
25957
26062
|
});
|
|
25958
26063
|
const mapDispatchToProps$F = dispatch => ({
|
|
25959
26064
|
fetchItemDetails: itemPid => dispatch(fetchItemDetails(itemPid)),
|
|
25960
|
-
deleteItem: itemPid => dispatch(deleteItem(itemPid))
|
|
26065
|
+
deleteItem: itemPid => dispatch(deleteItem(itemPid)),
|
|
26066
|
+
clearItemDetails: () => dispatch(clearItemDetails())
|
|
25961
26067
|
});
|
|
25962
26068
|
const ItemDetails = reactRedux.connect(mapStateToProps$R, mapDispatchToProps$F)(ItemDetails$1);
|
|
25963
26069
|
|
|
@@ -27341,7 +27447,7 @@ LoanUpdateDates$1.defaultProps = {
|
|
|
27341
27447
|
const IS_LOADING$q = 'updateLoanDates/IS_LOADING';
|
|
27342
27448
|
const SUCCESS$q = 'updateLoanDates/SUCCESS';
|
|
27343
27449
|
const HAS_ERROR$q = 'updateLoanDates/HAS_ERROR';
|
|
27344
|
-
const CLEAR = 'updateLoanDates/CLEAR';
|
|
27450
|
+
const CLEAR$4 = 'updateLoanDates/CLEAR';
|
|
27345
27451
|
const loanUpdateDates = (pid, data) => {
|
|
27346
27452
|
return async dispatch => {
|
|
27347
27453
|
dispatch({
|
|
@@ -27365,7 +27471,7 @@ const loanUpdateDates = (pid, data) => {
|
|
|
27365
27471
|
const clearError = () => {
|
|
27366
27472
|
return dispatch => {
|
|
27367
27473
|
dispatch({
|
|
27368
|
-
type: CLEAR
|
|
27474
|
+
type: CLEAR$4
|
|
27369
27475
|
});
|
|
27370
27476
|
};
|
|
27371
27477
|
};
|
|
@@ -27971,6 +28077,12 @@ class LoanDetails$1 extends React.Component {
|
|
|
27971
28077
|
fetchLoanDetails(loanPid, true);
|
|
27972
28078
|
}
|
|
27973
28079
|
}
|
|
28080
|
+
componentWillUnmount() {
|
|
28081
|
+
const {
|
|
28082
|
+
clearLoanDetails
|
|
28083
|
+
} = this.props;
|
|
28084
|
+
clearLoanDetails();
|
|
28085
|
+
}
|
|
27974
28086
|
render() {
|
|
27975
28087
|
var _data$metadata;
|
|
27976
28088
|
const {
|
|
@@ -28034,7 +28146,8 @@ const mapStateToProps$K = state => ({
|
|
|
28034
28146
|
data: state.loanDetails.data
|
|
28035
28147
|
});
|
|
28036
28148
|
const mapDispatchToProps$z = dispatch => ({
|
|
28037
|
-
fetchLoanDetails: (loanPid, withFetchOtherPendingLoans) => dispatch(fetchLoanDetails(loanPid, withFetchOtherPendingLoans))
|
|
28149
|
+
fetchLoanDetails: (loanPid, withFetchOtherPendingLoans) => dispatch(fetchLoanDetails(loanPid, withFetchOtherPendingLoans)),
|
|
28150
|
+
clearLoanDetails: () => dispatch(clearLoanDetails())
|
|
28038
28151
|
});
|
|
28039
28152
|
const LoanDetails = reactRedux.connect(mapStateToProps$K, mapDispatchToProps$z)(LoanDetails$1);
|
|
28040
28153
|
|
|
@@ -28326,6 +28439,7 @@ const HAS_ERROR$o = 'fetchLocationDetails/HAS_ERROR';
|
|
|
28326
28439
|
const DELETE_IS_LOADING$4 = 'deleteLocation/DELETE_IS_LOADING';
|
|
28327
28440
|
const DELETE_SUCCESS$4 = 'deleteLocation/DELETE_SUCCESS';
|
|
28328
28441
|
const DELETE_HAS_ERROR$4 = 'deleteLocation/DELETE_HAS_ERROR';
|
|
28442
|
+
const CLEAR$3 = 'fetchLocationDetails/CLEAR';
|
|
28329
28443
|
const fetchLocationDetails = pid => {
|
|
28330
28444
|
return async dispatch => {
|
|
28331
28445
|
dispatch({
|
|
@@ -28371,6 +28485,13 @@ const deleteLocation$1 = pid => {
|
|
|
28371
28485
|
}
|
|
28372
28486
|
};
|
|
28373
28487
|
};
|
|
28488
|
+
const clearLocationDetails = () => {
|
|
28489
|
+
return dispatch => {
|
|
28490
|
+
dispatch({
|
|
28491
|
+
type: CLEAR$3
|
|
28492
|
+
});
|
|
28493
|
+
};
|
|
28494
|
+
};
|
|
28374
28495
|
|
|
28375
28496
|
class LocationInformation extends React__default["default"].Component {
|
|
28376
28497
|
render() {
|
|
@@ -28736,6 +28857,12 @@ class LocationDetails$1 extends React__default["default"].Component {
|
|
|
28736
28857
|
fetchLocationDetails(locationPid);
|
|
28737
28858
|
}
|
|
28738
28859
|
}
|
|
28860
|
+
componentWillUnmount() {
|
|
28861
|
+
const {
|
|
28862
|
+
clearLocationDetails
|
|
28863
|
+
} = this.props;
|
|
28864
|
+
clearLocationDetails();
|
|
28865
|
+
}
|
|
28739
28866
|
render() {
|
|
28740
28867
|
const {
|
|
28741
28868
|
data,
|
|
@@ -28796,7 +28923,8 @@ const mapStateToProps$I = state => ({
|
|
|
28796
28923
|
});
|
|
28797
28924
|
const mapDispatchToProps$x = dispatch => ({
|
|
28798
28925
|
fetchLocationDetails: LocationPid => dispatch(fetchLocationDetails(LocationPid)),
|
|
28799
|
-
deleteLocation: locationPid => dispatch(deleteLocation$1(locationPid))
|
|
28926
|
+
deleteLocation: locationPid => dispatch(deleteLocation$1(locationPid)),
|
|
28927
|
+
clearLocationDetails: () => dispatch(clearLocationDetails())
|
|
28800
28928
|
});
|
|
28801
28929
|
const LocationDetails = reactRedux.connect(mapStateToProps$I, mapDispatchToProps$x)(LocationDetails$1);
|
|
28802
28930
|
|
|
@@ -29427,19 +29555,108 @@ const mapDispatchToProps$v = dispatch => ({
|
|
|
29427
29555
|
});
|
|
29428
29556
|
const LocationList = reactRedux.connect(mapStateToProps$G, mapDispatchToProps$v)(LocationList$1);
|
|
29429
29557
|
|
|
29558
|
+
const OverbookedConfirmModal = _ref => {
|
|
29559
|
+
let {
|
|
29560
|
+
open,
|
|
29561
|
+
onClose,
|
|
29562
|
+
onConfirm,
|
|
29563
|
+
overbookedDocuments
|
|
29564
|
+
} = _ref;
|
|
29565
|
+
const isMultiple = overbookedDocuments.length > 1;
|
|
29566
|
+
return /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Modal, {
|
|
29567
|
+
size: "small",
|
|
29568
|
+
open: open,
|
|
29569
|
+
onClose: onClose
|
|
29570
|
+
}, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Modal.Header, null, "Item in high demand!"), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Modal.Content, null, overbookedDocuments.map((doc, index) => /*#__PURE__*/React__default["default"].createElement("p", {
|
|
29571
|
+
key: doc.loanRequestId || doc.title || index
|
|
29572
|
+
}, "There is another patron waiting for \"", /*#__PURE__*/React__default["default"].createElement("strong", null, doc.title), "\"", ' ', doc.loanRequestId && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, "(", /*#__PURE__*/React__default["default"].createElement("a", {
|
|
29573
|
+
href: `/backoffice/loans/${doc.loanRequestId}`
|
|
29574
|
+
}, "See loan request"), ")"), ".")), /*#__PURE__*/React__default["default"].createElement("p", null, /*#__PURE__*/React__default["default"].createElement("strong", null, "Do you still want to extend your ", isMultiple ? 'loans' : 'loan', "?"))), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Modal.Actions, null, /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button, {
|
|
29575
|
+
secondary: true,
|
|
29576
|
+
onClick: onClose
|
|
29577
|
+
}, "Cancel"), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button, {
|
|
29578
|
+
primary: true,
|
|
29579
|
+
onClick: onConfirm
|
|
29580
|
+
}, "Extend")));
|
|
29581
|
+
};
|
|
29582
|
+
|
|
29430
29583
|
class PatronBulkExtendLoans$1 extends React.Component {
|
|
29431
29584
|
constructor() {
|
|
29432
29585
|
super(...arguments);
|
|
29433
29586
|
this.state = {
|
|
29434
|
-
open: false
|
|
29587
|
+
open: false,
|
|
29588
|
+
showOverbookedConfirm: false,
|
|
29589
|
+
overbookedDocuments: [],
|
|
29590
|
+
isChecking: false
|
|
29591
|
+
};
|
|
29592
|
+
this.open = async () => {
|
|
29593
|
+
this.setState({
|
|
29594
|
+
open: true
|
|
29595
|
+
});
|
|
29596
|
+
if (!isPrivilegedUser()) return;
|
|
29597
|
+
this.setState({
|
|
29598
|
+
isChecking: true
|
|
29599
|
+
});
|
|
29600
|
+
try {
|
|
29601
|
+
const {
|
|
29602
|
+
patronPid
|
|
29603
|
+
} = this.props;
|
|
29604
|
+
// Get all active loans for the patron
|
|
29605
|
+
const query = loanApi.query().withPatronPid(patronPid).withState(invenioConfig.CIRCULATION.loanActiveStates).withSize(invenioConfig.APP.PATRON_PROFILE_MAX_RESULTS_SIZE).sortByNewest().qs();
|
|
29606
|
+
const response = await loanApi.list(query);
|
|
29607
|
+
const loans = response.data.hits;
|
|
29608
|
+
const checks = loans.map(async loan => {
|
|
29609
|
+
const documentPid = _get__default["default"](loan, 'metadata.document.pid');
|
|
29610
|
+
const isOverbooked = await isDocumentOverbooked(documentPid);
|
|
29611
|
+
if (isOverbooked) {
|
|
29612
|
+
return {
|
|
29613
|
+
title: loan.metadata.document.title,
|
|
29614
|
+
loanRequestId: loan.id
|
|
29615
|
+
};
|
|
29616
|
+
}
|
|
29617
|
+
return null;
|
|
29618
|
+
});
|
|
29619
|
+
const results = await Promise.all(checks);
|
|
29620
|
+
const overbookedDocuments = results.filter(Boolean);
|
|
29621
|
+
this.setState({
|
|
29622
|
+
overbookedDocuments,
|
|
29623
|
+
isChecking: false
|
|
29624
|
+
});
|
|
29625
|
+
} catch (error) {
|
|
29626
|
+
console.error('Failed to fetch overbooked documents', error);
|
|
29627
|
+
this.setState({
|
|
29628
|
+
isChecking: false
|
|
29629
|
+
});
|
|
29630
|
+
}
|
|
29631
|
+
};
|
|
29632
|
+
this.close = () => {
|
|
29633
|
+
this.setState({
|
|
29634
|
+
open: false,
|
|
29635
|
+
showOverbookedConfirm: false,
|
|
29636
|
+
overbookedDocuments: []
|
|
29637
|
+
});
|
|
29435
29638
|
};
|
|
29436
|
-
this.open = () => this.setState({
|
|
29437
|
-
open: true
|
|
29438
|
-
});
|
|
29439
|
-
this.close = () => this.setState({
|
|
29440
|
-
open: false
|
|
29441
|
-
});
|
|
29442
29639
|
this.handleSubmitExtend = () => {
|
|
29640
|
+
const {
|
|
29641
|
+
bulkLoanExtension,
|
|
29642
|
+
patronPid
|
|
29643
|
+
} = this.props;
|
|
29644
|
+
const {
|
|
29645
|
+
overbookedDocuments
|
|
29646
|
+
} = this.state;
|
|
29647
|
+
|
|
29648
|
+
// If the user is privileged and there are overbooked docs
|
|
29649
|
+
if (isPrivilegedUser() && overbookedDocuments.length > 0) {
|
|
29650
|
+
this.setState({
|
|
29651
|
+
showOverbookedConfirm: true
|
|
29652
|
+
});
|
|
29653
|
+
return;
|
|
29654
|
+
}
|
|
29655
|
+
// Otherwise extend directly
|
|
29656
|
+
bulkLoanExtension(patronPid);
|
|
29657
|
+
this.close();
|
|
29658
|
+
};
|
|
29659
|
+
this.confirmBulkExtension = () => {
|
|
29443
29660
|
const {
|
|
29444
29661
|
bulkLoanExtension,
|
|
29445
29662
|
patronPid
|
|
@@ -29450,16 +29667,26 @@ class PatronBulkExtendLoans$1 extends React.Component {
|
|
|
29450
29667
|
}
|
|
29451
29668
|
render() {
|
|
29452
29669
|
const {
|
|
29453
|
-
patronPid,
|
|
29454
|
-
bulkLoanExtension,
|
|
29455
29670
|
isLoading,
|
|
29456
29671
|
disabled,
|
|
29672
|
+
patronPid,
|
|
29673
|
+
bulkLoanExtension,
|
|
29457
29674
|
...uiProps
|
|
29458
29675
|
} = this.props;
|
|
29459
29676
|
const {
|
|
29460
|
-
open
|
|
29677
|
+
open,
|
|
29678
|
+
showOverbookedConfirm,
|
|
29679
|
+
overbookedDocuments,
|
|
29680
|
+
isChecking
|
|
29461
29681
|
} = this.state;
|
|
29462
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
29682
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(OverbookedConfirmModal, {
|
|
29683
|
+
open: showOverbookedConfirm,
|
|
29684
|
+
onClose: () => this.setState({
|
|
29685
|
+
showOverbookedConfirm: false
|
|
29686
|
+
}),
|
|
29687
|
+
onConfirm: this.confirmBulkExtension,
|
|
29688
|
+
overbookedDocuments: overbookedDocuments
|
|
29689
|
+
}), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Modal, {
|
|
29463
29690
|
open: open,
|
|
29464
29691
|
onClose: this.close,
|
|
29465
29692
|
onOpen: this.open,
|
|
@@ -29479,8 +29706,9 @@ class PatronBulkExtendLoans$1 extends React.Component {
|
|
|
29479
29706
|
onClick: this.close
|
|
29480
29707
|
}, "Cancel"), /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Button, {
|
|
29481
29708
|
onClick: this.handleSubmitExtend,
|
|
29482
|
-
primary: true
|
|
29483
|
-
|
|
29709
|
+
primary: true,
|
|
29710
|
+
loading: isChecking
|
|
29711
|
+
}, "Extend the loans"))));
|
|
29484
29712
|
}
|
|
29485
29713
|
}
|
|
29486
29714
|
PatronBulkExtendLoans$1.defaultProps = {
|
|
@@ -30924,6 +31152,12 @@ class PatronDetails$1 extends React.Component {
|
|
|
30924
31152
|
fetchPatronDetails(currentPatronPid);
|
|
30925
31153
|
}
|
|
30926
31154
|
}
|
|
31155
|
+
componentWillUnmount() {
|
|
31156
|
+
const {
|
|
31157
|
+
clearPatronDetails
|
|
31158
|
+
} = this.props;
|
|
31159
|
+
clearPatronDetails();
|
|
31160
|
+
}
|
|
30927
31161
|
render() {
|
|
30928
31162
|
const {
|
|
30929
31163
|
isLoading,
|
|
@@ -31036,6 +31270,7 @@ PatronDetails$1.defaultProps = {
|
|
|
31036
31270
|
const IS_LOADING$c = 'fetchPatronDetails/IS_LOADING';
|
|
31037
31271
|
const SUCCESS$c = 'fetchPatronDetails/SUCCESS';
|
|
31038
31272
|
const HAS_ERROR$c = 'fetchPatronDetails/HAS_ERROR';
|
|
31273
|
+
const CLEAR$2 = 'fetchPatronDetails/CLEAR';
|
|
31039
31274
|
const fetchPatronDetails = patronPid => {
|
|
31040
31275
|
return async dispatch => {
|
|
31041
31276
|
dispatch({
|
|
@@ -31056,6 +31291,13 @@ const fetchPatronDetails = patronPid => {
|
|
|
31056
31291
|
}
|
|
31057
31292
|
};
|
|
31058
31293
|
};
|
|
31294
|
+
const clearPatronDetails = () => {
|
|
31295
|
+
return dispatch => {
|
|
31296
|
+
dispatch({
|
|
31297
|
+
type: CLEAR$2
|
|
31298
|
+
});
|
|
31299
|
+
};
|
|
31300
|
+
};
|
|
31059
31301
|
|
|
31060
31302
|
const mapStateToProps$v = state => ({
|
|
31061
31303
|
isLoading: state.patronDetails.isLoading,
|
|
@@ -31065,7 +31307,8 @@ const mapStateToProps$v = state => ({
|
|
|
31065
31307
|
currentLoans: state.patronCurrentLoans.data
|
|
31066
31308
|
});
|
|
31067
31309
|
const mapDispatchToProps$k = dispatch => ({
|
|
31068
|
-
fetchPatronDetails: patronPid => dispatch(fetchPatronDetails(patronPid))
|
|
31310
|
+
fetchPatronDetails: patronPid => dispatch(fetchPatronDetails(patronPid)),
|
|
31311
|
+
clearPatronDetails: () => dispatch(clearPatronDetails())
|
|
31069
31312
|
});
|
|
31070
31313
|
const PatronDetails = reactRedux.connect(mapStateToProps$v, mapDispatchToProps$k)(PatronDetails$1);
|
|
31071
31314
|
|
|
@@ -31200,6 +31443,7 @@ const HAS_ERROR$b = 'fetchProviderDetails/HAS_ERROR';
|
|
|
31200
31443
|
const DELETE_IS_LOADING$1 = 'deleteProvider/DELETE_IS_LOADING';
|
|
31201
31444
|
const DELETE_SUCCESS$1 = 'deleteProvider/DELETE_SUCCESS';
|
|
31202
31445
|
const DELETE_HAS_ERROR$1 = 'deleteProvider/DELETE_HAS_ERROR';
|
|
31446
|
+
const CLEAR$1 = 'fetchProviderDetails/CLEAR';
|
|
31203
31447
|
const fetchProviderDetails = pid => {
|
|
31204
31448
|
return async dispatch => {
|
|
31205
31449
|
dispatch({
|
|
@@ -31245,6 +31489,13 @@ const deleteProvider = pid => {
|
|
|
31245
31489
|
}
|
|
31246
31490
|
};
|
|
31247
31491
|
};
|
|
31492
|
+
const clearProviderDetails = () => {
|
|
31493
|
+
return dispatch => {
|
|
31494
|
+
dispatch({
|
|
31495
|
+
type: CLEAR$1
|
|
31496
|
+
});
|
|
31497
|
+
};
|
|
31498
|
+
};
|
|
31248
31499
|
|
|
31249
31500
|
class ProviderInformation extends React__default["default"].Component {
|
|
31250
31501
|
render() {
|
|
@@ -31418,6 +31669,12 @@ class ProviderDetails$1 extends React__default["default"].Component {
|
|
|
31418
31669
|
fetchProviderDetails(providerPid);
|
|
31419
31670
|
}
|
|
31420
31671
|
}
|
|
31672
|
+
componentWillUnmount() {
|
|
31673
|
+
const {
|
|
31674
|
+
clearProviderDetails
|
|
31675
|
+
} = this.props;
|
|
31676
|
+
clearProviderDetails();
|
|
31677
|
+
}
|
|
31421
31678
|
render() {
|
|
31422
31679
|
const {
|
|
31423
31680
|
data,
|
|
@@ -31476,7 +31733,8 @@ const mapStateToProps$u = state => ({
|
|
|
31476
31733
|
});
|
|
31477
31734
|
const mapDispatchToProps$j = dispatch => ({
|
|
31478
31735
|
fetchProviderDetails: providerPid => dispatch(fetchProviderDetails(providerPid)),
|
|
31479
|
-
deleteProvider: providerPid => dispatch(deleteProvider(providerPid))
|
|
31736
|
+
deleteProvider: providerPid => dispatch(deleteProvider(providerPid)),
|
|
31737
|
+
clearProviderDetails: () => dispatch(clearProviderDetails())
|
|
31480
31738
|
});
|
|
31481
31739
|
const ProviderDetails = reactRedux.connect(mapStateToProps$u, mapDispatchToProps$j)(ProviderDetails$1);
|
|
31482
31740
|
|
|
@@ -31845,6 +32103,7 @@ class ProviderSearch extends React.Component {
|
|
|
31845
32103
|
const IS_LOADING$a = 'fetchSeriesDetails/IS_LOADING';
|
|
31846
32104
|
const SUCCESS$a = 'fetchSeriesDetails/SUCCESS';
|
|
31847
32105
|
const HAS_ERROR$a = 'fetchSeriesDetails/HAS_ERROR';
|
|
32106
|
+
const CLEAR = 'fetchSeriesDetails/CLEAR';
|
|
31848
32107
|
const DELETE_IS_LOADING = 'deleteSeries/DELETE_IS_LOADING';
|
|
31849
32108
|
const DELETE_SUCCESS = 'deleteSeries/DELETE_SUCCESS';
|
|
31850
32109
|
const DELETE_HAS_ERROR = 'deleteSeries/DELETE_HAS_ERROR';
|
|
@@ -31893,6 +32152,13 @@ const fetchSeriesDetails$1 = seriesPid => {
|
|
|
31893
32152
|
}
|
|
31894
32153
|
};
|
|
31895
32154
|
};
|
|
32155
|
+
const clearSeriesDetails = () => {
|
|
32156
|
+
return dispatch => {
|
|
32157
|
+
dispatch({
|
|
32158
|
+
type: CLEAR
|
|
32159
|
+
});
|
|
32160
|
+
};
|
|
32161
|
+
};
|
|
31896
32162
|
|
|
31897
32163
|
const deleteButton = props => {
|
|
31898
32164
|
return /*#__PURE__*/React__default["default"].createElement(DeleteButton, Object.assign({
|
|
@@ -33522,6 +33788,12 @@ class SeriesDetails$3 extends React.Component {
|
|
|
33522
33788
|
fetchSeriesDetails(match.params.seriesPid);
|
|
33523
33789
|
}
|
|
33524
33790
|
}
|
|
33791
|
+
componentWillUnmount() {
|
|
33792
|
+
const {
|
|
33793
|
+
clearSeriesDetails
|
|
33794
|
+
} = this.props;
|
|
33795
|
+
clearSeriesDetails();
|
|
33796
|
+
}
|
|
33525
33797
|
render() {
|
|
33526
33798
|
const {
|
|
33527
33799
|
isLoading,
|
|
@@ -33594,7 +33866,8 @@ const mapStateToProps$j = state => ({
|
|
|
33594
33866
|
multipartMonographsInSeries: state.seriesMultipartMonographs.data
|
|
33595
33867
|
});
|
|
33596
33868
|
const mapDispatchToProps$g = dispatch => ({
|
|
33597
|
-
fetchSeriesDetails: seriesPid => dispatch(fetchSeriesDetails$1(seriesPid))
|
|
33869
|
+
fetchSeriesDetails: seriesPid => dispatch(fetchSeriesDetails$1(seriesPid)),
|
|
33870
|
+
clearSeriesDetails: () => dispatch(clearSeriesDetails())
|
|
33598
33871
|
});
|
|
33599
33872
|
const SeriesDetails$2 = reactRedux.connect(mapStateToProps$j, mapDispatchToProps$g)(SeriesDetails$3);
|
|
33600
33873
|
|
|
@@ -38783,6 +39056,36 @@ class LoanExtendButton extends React.Component {
|
|
|
38783
39056
|
constructor(props) {
|
|
38784
39057
|
super(props);
|
|
38785
39058
|
this.triggerExtension = async () => {
|
|
39059
|
+
const {
|
|
39060
|
+
loan,
|
|
39061
|
+
onError
|
|
39062
|
+
} = this.props;
|
|
39063
|
+
const isUserPrivileged = isPrivilegedUser();
|
|
39064
|
+
if (isUserPrivileged) {
|
|
39065
|
+
this.setState({
|
|
39066
|
+
isLoading: true
|
|
39067
|
+
});
|
|
39068
|
+
try {
|
|
39069
|
+
const documentPid = _get__default["default"](loan, 'metadata.document.pid');
|
|
39070
|
+
const isOverbooked = await isDocumentOverbooked(documentPid);
|
|
39071
|
+
if (isOverbooked) {
|
|
39072
|
+
this.setState({
|
|
39073
|
+
isLoading: false,
|
|
39074
|
+
showOverbookedConfirm: true
|
|
39075
|
+
});
|
|
39076
|
+
return;
|
|
39077
|
+
}
|
|
39078
|
+
} catch (error) {
|
|
39079
|
+
onError('Something went wrong while checking if the literature is overbooked.', error);
|
|
39080
|
+
this.setState({
|
|
39081
|
+
isLoading: false
|
|
39082
|
+
});
|
|
39083
|
+
return;
|
|
39084
|
+
}
|
|
39085
|
+
}
|
|
39086
|
+
await this.performExtension();
|
|
39087
|
+
};
|
|
39088
|
+
this.performExtension = async () => {
|
|
38786
39089
|
const {
|
|
38787
39090
|
loan,
|
|
38788
39091
|
onSuccess,
|
|
@@ -38800,7 +39103,8 @@ class LoanExtendButton extends React.Component {
|
|
|
38800
39103
|
this.cancellableExtendLoan = withCancel(this.extendLoan(extendUrl, document.pid, patronPid));
|
|
38801
39104
|
const response = await this.cancellableExtendLoan.promise;
|
|
38802
39105
|
this.setState({
|
|
38803
|
-
isLoading: false
|
|
39106
|
+
isLoading: false,
|
|
39107
|
+
showOverbookedConfirm: false
|
|
38804
39108
|
});
|
|
38805
39109
|
const documentTitle = document.title;
|
|
38806
39110
|
onSuccess(INFO_MESSAGES.SUCCESS(documentTitle, luxon.DateTime.fromISO(response.data.metadata.end_date)));
|
|
@@ -38811,6 +39115,11 @@ class LoanExtendButton extends React.Component {
|
|
|
38811
39115
|
onError(error.response.data.message);
|
|
38812
39116
|
}
|
|
38813
39117
|
};
|
|
39118
|
+
this.hideOverbookedConfirm = () => {
|
|
39119
|
+
this.setState({
|
|
39120
|
+
showOverbookedConfirm: false
|
|
39121
|
+
});
|
|
39122
|
+
};
|
|
38814
39123
|
this.validate = loan => {
|
|
38815
39124
|
const hasExtendAction = _has__default["default"](loan, 'availableActions.extend');
|
|
38816
39125
|
if (!hasExtendAction) return {
|
|
@@ -38838,7 +39147,8 @@ class LoanExtendButton extends React.Component {
|
|
|
38838
39147
|
};
|
|
38839
39148
|
};
|
|
38840
39149
|
this.state = {
|
|
38841
|
-
isLoading: false
|
|
39150
|
+
isLoading: false,
|
|
39151
|
+
showOverbookedConfirm: false
|
|
38842
39152
|
};
|
|
38843
39153
|
}
|
|
38844
39154
|
componentWillUnmount() {
|
|
@@ -38857,11 +39167,21 @@ class LoanExtendButton extends React.Component {
|
|
|
38857
39167
|
loan
|
|
38858
39168
|
} = this.props;
|
|
38859
39169
|
const {
|
|
38860
|
-
isLoading
|
|
39170
|
+
isLoading,
|
|
39171
|
+
showOverbookedConfirm
|
|
38861
39172
|
} = this.state;
|
|
38862
39173
|
const validation = this.validate(loan);
|
|
38863
39174
|
const isDisabled = !validation.isValid;
|
|
38864
|
-
|
|
39175
|
+
const overbookedDocuments = [{
|
|
39176
|
+
title: _get__default["default"](loan, 'metadata.document.title', 'Unknown title'),
|
|
39177
|
+
loanRequestId: loan.id
|
|
39178
|
+
}];
|
|
39179
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, showOverbookedConfirm && /*#__PURE__*/React__default["default"].createElement(OverbookedConfirmModal, {
|
|
39180
|
+
open: showOverbookedConfirm,
|
|
39181
|
+
onClose: this.hideOverbookedConfirm,
|
|
39182
|
+
onConfirm: this.performExtension,
|
|
39183
|
+
overbookedDocuments: overbookedDocuments
|
|
39184
|
+
}), isDisabled && /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Popup, {
|
|
38865
39185
|
content: validation.msg,
|
|
38866
39186
|
trigger: /*#__PURE__*/React__default["default"].createElement(semanticUiReact.Icon, {
|
|
38867
39187
|
name: "info"
|
|
@@ -41148,6 +41468,10 @@ const loanDetailsReducer = function () {
|
|
|
41148
41468
|
isLoading: false,
|
|
41149
41469
|
hasError: true
|
|
41150
41470
|
};
|
|
41471
|
+
case CLEAR$5:
|
|
41472
|
+
return {
|
|
41473
|
+
...initialDetailsState
|
|
41474
|
+
};
|
|
41151
41475
|
default:
|
|
41152
41476
|
return state;
|
|
41153
41477
|
}
|
|
@@ -41536,6 +41860,10 @@ var orderDetailsReducer = (function () {
|
|
|
41536
41860
|
error: action.payload,
|
|
41537
41861
|
hasError: true
|
|
41538
41862
|
};
|
|
41863
|
+
case CLEAR$c:
|
|
41864
|
+
return {
|
|
41865
|
+
...initialState$A
|
|
41866
|
+
};
|
|
41539
41867
|
default:
|
|
41540
41868
|
return state;
|
|
41541
41869
|
}
|
|
@@ -41600,7 +41928,7 @@ var itemsCheckInReducer = (function () {
|
|
|
41600
41928
|
error: action.payload,
|
|
41601
41929
|
hasError: true
|
|
41602
41930
|
};
|
|
41603
|
-
case CLEAR$
|
|
41931
|
+
case CLEAR$b:
|
|
41604
41932
|
return {
|
|
41605
41933
|
...state,
|
|
41606
41934
|
items: [],
|
|
@@ -41749,6 +42077,10 @@ var documentDetailsReducer = (function () {
|
|
|
41749
42077
|
error: action.payload,
|
|
41750
42078
|
hasError: true
|
|
41751
42079
|
};
|
|
42080
|
+
case CLEAR$a:
|
|
42081
|
+
return {
|
|
42082
|
+
...initialState$w
|
|
42083
|
+
};
|
|
41752
42084
|
default:
|
|
41753
42085
|
return state;
|
|
41754
42086
|
}
|
|
@@ -41938,6 +42270,10 @@ var documentRequestDetailsReducer = (function () {
|
|
|
41938
42270
|
isLoading: false,
|
|
41939
42271
|
hasError: true
|
|
41940
42272
|
};
|
|
42273
|
+
case CLEAR$9:
|
|
42274
|
+
return {
|
|
42275
|
+
...initialState$r
|
|
42276
|
+
};
|
|
41941
42277
|
default:
|
|
41942
42278
|
return state;
|
|
41943
42279
|
}
|
|
@@ -42078,6 +42414,10 @@ var eitemDetailsReducer = (function () {
|
|
|
42078
42414
|
error: action.payload,
|
|
42079
42415
|
hasError: true
|
|
42080
42416
|
};
|
|
42417
|
+
case CLEAR$8:
|
|
42418
|
+
return {
|
|
42419
|
+
...initialState$p
|
|
42420
|
+
};
|
|
42081
42421
|
default:
|
|
42082
42422
|
return state;
|
|
42083
42423
|
}
|
|
@@ -42177,6 +42517,10 @@ var borrowingRequestDetailsReducer = (function () {
|
|
|
42177
42517
|
isLoading: false,
|
|
42178
42518
|
hasError: true
|
|
42179
42519
|
};
|
|
42520
|
+
case CLEAR$7:
|
|
42521
|
+
return {
|
|
42522
|
+
...initialState$m
|
|
42523
|
+
};
|
|
42180
42524
|
default:
|
|
42181
42525
|
return state;
|
|
42182
42526
|
}
|
|
@@ -42231,6 +42575,10 @@ var providerDetailsReducer = (function () {
|
|
|
42231
42575
|
error: action.payload,
|
|
42232
42576
|
hasError: true
|
|
42233
42577
|
};
|
|
42578
|
+
case CLEAR$1:
|
|
42579
|
+
return {
|
|
42580
|
+
...initialState$l
|
|
42581
|
+
};
|
|
42234
42582
|
default:
|
|
42235
42583
|
return state;
|
|
42236
42584
|
}
|
|
@@ -42286,6 +42634,10 @@ var itemDetailsReducer = (function () {
|
|
|
42286
42634
|
error: action.payload,
|
|
42287
42635
|
hasError: true
|
|
42288
42636
|
};
|
|
42637
|
+
case CLEAR$6:
|
|
42638
|
+
return {
|
|
42639
|
+
...initialState$k
|
|
42640
|
+
};
|
|
42289
42641
|
default:
|
|
42290
42642
|
return state;
|
|
42291
42643
|
}
|
|
@@ -42359,7 +42711,7 @@ var loanUpdateDatesReducer = (function () {
|
|
|
42359
42711
|
error: action.payload,
|
|
42360
42712
|
hasError: true
|
|
42361
42713
|
};
|
|
42362
|
-
case CLEAR:
|
|
42714
|
+
case CLEAR$4:
|
|
42363
42715
|
return initialState$i;
|
|
42364
42716
|
default:
|
|
42365
42717
|
return state;
|
|
@@ -42453,6 +42805,10 @@ var locationDetailsReducer = (function () {
|
|
|
42453
42805
|
error: action.payload,
|
|
42454
42806
|
hasError: true
|
|
42455
42807
|
};
|
|
42808
|
+
case CLEAR$3:
|
|
42809
|
+
return {
|
|
42810
|
+
...initialState$g
|
|
42811
|
+
};
|
|
42456
42812
|
default:
|
|
42457
42813
|
return state;
|
|
42458
42814
|
}
|
|
@@ -42647,6 +43003,10 @@ var patronDetailsReducer = (function () {
|
|
|
42647
43003
|
error: action.payload,
|
|
42648
43004
|
hasError: true
|
|
42649
43005
|
};
|
|
43006
|
+
case CLEAR$2:
|
|
43007
|
+
return {
|
|
43008
|
+
...initialState$c
|
|
43009
|
+
};
|
|
42650
43010
|
default:
|
|
42651
43011
|
return state;
|
|
42652
43012
|
}
|
|
@@ -42734,6 +43094,10 @@ var seriesDetailsReducer = (function () {
|
|
|
42734
43094
|
error: action.payload,
|
|
42735
43095
|
hasError: true
|
|
42736
43096
|
};
|
|
43097
|
+
case CLEAR:
|
|
43098
|
+
return {
|
|
43099
|
+
...initialState$a
|
|
43100
|
+
};
|
|
42737
43101
|
default:
|
|
42738
43102
|
return state;
|
|
42739
43103
|
}
|