Commit acd906e7 authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen
Browse files

patorn-client: exclude riksen-only items from fjernlån DEICH-1462

parent c0f325c4
......@@ -111,7 +111,13 @@ export function chooseReservationDialogue (publication) {
dispatch({ type: types.REQUEST_RESERVATION_DIALOGUE })
const profile = getState().profile
if (profile.category === 'IL') { // remote libraries with categorycode IL are remote libraries
dispatch(showModal(ModalComponents.REMOTE_RESERVATION, { publication: publication }))
const onlyAtRiksen = publication.items.every(i => i.branchcode === "frik")
console.log()
if (onlyAtRiksen) {
dispatch(reservePublicationFailure({message: "notForRemoteLoan"}, publication.recordId, "ill"))
} else {
dispatch(showModal(ModalComponents.REMOTE_RESERVATION, { publication: publication }))
}
} else {
dispatch(showModal(ModalComponents.RESERVATION, { publication: publication }))
}
......
......@@ -167,6 +167,11 @@ export const messages = defineMessages({
description: 'The error message when the user is to young',
defaultMessage: 'You are not old enough to borrow this item.'
},
notForRemoteLoan: {
id: 'ReservationModal.notForRemoteLoan',
description: 'The error message when item is not for remote loan',
defaultMessage: 'This item is not available for remote loan'
},
button: {
id: 'ReservationModal.button',
description: 'The button to exit the modal dialog',
......
......@@ -15,6 +15,7 @@ export default {
'CancelReservationModal.headerTextError': 'Feilmelding',
'CancelReservationModal.headerTextSuccess': 'Suksess!',
'CancelReservationModal.messageSuccess': 'Reservasjonen er nå slettet.',
'ReservationModal.notForRemoteLoan': 'Ikke tilgjengelig for fjernlån',
'ChangePinForm.changePin': 'Endre PIN-kode',
'ChangePinForm.changePinSuccess': 'PIN-koden ble endret!',
'ChangePinForm.currentPin': 'Nåværende PIN-kode',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment