Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
digibib
ls.ext
Commits
c48908ef
Commit
c48908ef
authored
Jul 31, 2018
by
Petter Goksøyr Åsen
Browse files
patron-client: drop last step in regristration
parent
335501cf
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
redef/patron-client/src/frontend/components/KeepMyHistory.js
View file @
c48908ef
...
...
@@ -92,7 +92,8 @@ KeepMyHistory.propTypes = {
personalInformation
:
PropTypes
.
object
.
isRequired
,
personalAttributes
:
PropTypes
.
object
.
isRequired
,
postProfileSettingsSuccess
:
PropTypes
.
bool
,
historySize
:
PropTypes
.
number
.
isRequired
historySize
:
PropTypes
.
number
.
isRequired
,
intl
:
PropTypes
.
object
.
isRequired
}
export
const
messages
=
defineMessages
({
...
...
redef/patron-client/src/frontend/containers/PaymentResponse.js
View file @
c48908ef
...
...
@@ -105,7 +105,7 @@ class PaymentResponse extends React.Component {
if
(
this
.
props
.
isSavingPayment
||
this
.
props
.
isRequestingLoansAndReservations
)
{
return
(
<
div
style
=
{{
textAlign
:
'
center
'
}}
>
<
span
data
-
automation
-
id
=
"
is_searching
"
className
=
"
loading-spinner
"
><
/span
>
<
span
data
-
automation
-
id
=
"
is_searching
"
className
=
"
loading-spinner
"
/
>
<
/div
>
)
}
...
...
redef/patron-client/src/frontend/containers/Register.js
View file @
c48908ef
...
...
@@ -6,7 +6,6 @@ import { injectIntl, intlShape, defineMessages, FormattedMessage } from 'react-i
import
FormPartOne
from
'
./forms/RegistrationFormPartOne
'
import
FormPartTwo
from
'
./forms/RegistrationFormPartTwo
'
import
FormPartThree
from
'
./forms/RegistrationFormPartThree
'
import
FormPartFour
from
'
./forms/RegistrationFormPartFour
'
class
Register
extends
React
.
Component
{
...
...
@@ -15,7 +14,6 @@ class Register extends React.Component {
this
.
props
.
dispatch
(
destroy
(
'
registrationPartOne
'
))
this
.
props
.
dispatch
(
destroy
(
'
registrationPartTwo
'
))
this
.
props
.
dispatch
(
destroy
(
'
registrationPartThree
'
))
this
.
props
.
dispatch
(
destroy
(
'
registrationPartFour
'
))
return
(
<
div
data
-
automation
-
id
=
"
registration_success_modal
"
className
=
"
default-form
"
>
...
...
@@ -64,8 +62,7 @@ class Register extends React.Component {
{(
this
.
props
.
stepNumber
===
1
||
this
.
props
.
stepNumber
===
2
)
&&
<
FormPartOne
/>
}
{
this
.
props
.
stepNumber
===
2
&&
<
FormPartTwo
/>
}
{
this
.
props
.
stepNumber
===
3
&&
<
FormPartThree
/>
}
{
this
.
props
.
stepNumber
===
4
&&
<
FormPartFour
/>
}
{
this
.
props
.
stepNumber
===
5
&&
this
.
renderSuccess
()
}
{
this
.
props
.
stepNumber
===
4
&&
this
.
renderSuccess
()
}
<
/div
>
<
/section
>
)
...
...
redef/patron-client/src/frontend/containers/UserLoans.js
View file @
c48908ef
...
...
@@ -588,7 +588,7 @@ class UserLoans extends React.Component {
if
(
this
.
props
.
isRequestingLoansAndReservations
)
{
return
<
div
style
=
{{
textAlign
:
'
center
'
}}
>
<
span
data
-
automation
-
id
=
"
is_searching
"
className
=
"
loading-spinner
"
><
/span
>
<
span
data
-
automation
-
id
=
"
is_searching
"
className
=
"
loading-spinner
"
/
>
<
/div
>
}
else
if
(
this
.
props
.
loansAndReservationError
)
{
return
<
FormattedMessage
{...
messages
.
loansAndReservationError
}
/
>
...
...
redef/patron-client/src/frontend/containers/forms/RegistrationFormPartFour.js
deleted
100644 → 0
View file @
335501cf
import
PropTypes
from
'
prop-types
'
import
React
from
'
react
'
import
{
reduxForm
}
from
'
redux-form
'
import
{
bindActionCreators
}
from
'
redux
'
import
{
connect
}
from
'
react-redux
'
import
{
injectIntl
,
intlShape
,
defineMessages
,
FormattedMessage
}
from
'
react-intl
'
import
*
as
RegistrationActions
from
'
../../actions/RegistrationActions
'
const
formName
=
'
registrationPartFour
'
class
RegistrationFormPartFour
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
handleComplete
=
this
.
handleComplete
.
bind
(
this
)
}
handleComplete
()
{
this
.
props
.
registrationActions
.
postRegistration
()
}
render
()
{
const
{
handleSubmit
}
=
this
.
props
return
(
<
div
className
=
"
default-form
"
onSubmit
=
{
handleSubmit
(
this
.
handleComplete
)}
>
<
form
>
<
div
style
=
{{
textAlign
:
'
center
'
,
padding
:
'
1em
'
}}
>
<
h1
><
FormattedMessage
{...
messages
.
thanks
}
/></
h1
>
<
button
className
=
"
blue-btn
"
type
=
"
submit
"
>
<
FormattedMessage
{...
messages
.
submit
}
/
>
<
/button
>
<
/div
>
<
/form
>
<
/div
>
)
}
}
export
const
messages
=
defineMessages
({
submit
:
{
id
:
'
RegistrationFormPartFour.submit
'
,
description
:
'
The submit button text
'
,
defaultMessage
:
'
Complete registration
'
},
thanks
:
{
id
:
'
RegistrationFormPartFour.thanks
'
,
description
:
'
Thank you text
'
,
defaultMessage
:
'
Thanks! We now have all the information we need.
'
}
})
RegistrationFormPartFour
.
propTypes
=
{
dispatch
:
PropTypes
.
func
.
isRequired
,
handleSubmit
:
PropTypes
.
func
.
isRequired
,
fields
:
PropTypes
.
object
.
isRequired
,
intl
:
intlShape
.
isRequired
,
registrationActions
:
PropTypes
.
object
.
isRequired
}
function
mapStateToProps
(
state
)
{
return
{
fields
:
state
.
form
.
registrationPartFour
?
state
.
form
.
registrationPartFour
:
{}
}
}
function
mapDispatchToProps
(
dispatch
)
{
return
{
dispatch
:
dispatch
,
registrationActions
:
bindActionCreators
(
RegistrationActions
,
dispatch
)
}
}
const
intlRegistrationFormPartFour
=
injectIntl
(
RegistrationFormPartFour
)
export
{
intlRegistrationFormPartFour
as
RegistrationFormPartFour
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
reduxForm
({
form
:
formName
,
destroyOnUnmount
:
false
})(
intlRegistrationFormPartFour
))
redef/patron-client/src/frontend/containers/forms/RegistrationFormPartThree.js
View file @
c48908ef
...
...
@@ -20,11 +20,13 @@ class RegistrationFormPartThree extends React.Component {
handleNo
(
event
)
{
this
.
props
.
change
(
'
keepHistory
'
,
false
)
this
.
props
.
registrationActions
.
historySet
()
this
.
props
.
registrationActions
.
postRegistration
()
}
handleYes
(
event
)
{
this
.
props
.
change
(
'
keepHistory
'
,
true
)
this
.
props
.
registrationActions
.
historySet
()
this
.
props
.
registrationActions
.
postRegistration
()
}
render
()
{
...
...
redef/patron-client/src/frontend/i18n/no.js
View file @
c48908ef
...
...
@@ -200,8 +200,6 @@ export default {
'
RegistrationFormPartTwo.repeatPin
'
:
'
Gjenta PIN-kode
'
,
'
RegistrationFormPartTwo.yesOption
'
:
'
Ja
'
,
'
RegistrationFormPartTwo.zipcode
'
:
'
Postnummer
'
,
'
RegistrationFormPartFour.thanks
'
:
'
Takk! Nå har vi alt vi trenger.
'
,
'
RegistrationFormPartFour.submit
'
:
'
Fullfør registreringen
'
,
'
RemoteReservationModal.button
'
:
'
OK
'
,
'
RemoteReservationModal.cancel
'
:
'
Avbryt
'
,
'
RemoteReservationModal.genericReservationError
'
:
'
Bestillingen feilet.
\n
Vennligst kontakt biblioteket for mer informasjon.
'
,
...
...
@@ -364,6 +362,7 @@ export default {
'
UserLoans.renewAllLoans
'
:
'
Forleng alle lån
'
,
'
UserLoans.reservations
'
:
'
Reserveringer
'
,
'
UserLoans.resumeReservation
'
:
'
Gjenoppta
'
,
'
UserLoans.sendPaymentReceiptEmailRequired
'
:
'
Epost er påkrevd
'
,
'
UserLoans.suspendReservation
'
:
'
Sett på vent
'
,
'
UserLoans.title
'
:
'
Tittel
'
,
'
UserLoans.tooManyRenewals
'
:
'
Kan ikke forlenges flere ganger
'
,
...
...
redef/patron-client/src/frontend/reducers/registration.js
View file @
c48908ef
...
...
@@ -62,7 +62,7 @@ export default function registration (state = initialState, action) {
isSuccess
:
action
.
payload
.
isSuccess
,
username
:
action
.
payload
.
username
,
categoryCode
:
action
.
payload
.
categoryCode
,
stepNumber
:
5
stepNumber
:
4
}
case
REGISTRATION_FAILURE
:
return
{
...
...
@@ -80,8 +80,7 @@ export default function registration (state = initialState, action) {
}
case
REGISTRATION_HISTORY_SET
:
return
{
...
state
,
stepNumber
:
4
...
state
}
default
:
return
state
...
...
redef/patron-client/test/reducers/loan.js
deleted
100644 → 0
View file @
335501cf
/* eslint-env mocha */
import
expect
from
'
expect
'
import
loan
from
'
../../src/frontend/reducers/loan
'
import
*
as
types
from
'
../../src/frontend/constants/ActionTypes
'
describe
(
'
reducers
'
,
()
=>
{
describe
(
'
loan
'
,
()
=>
{
it
(
'
should handle initial state
'
,
()
=>
{
expect
(
loan
(
undefined
,
{})
).
toEqual
({
isRequestingExtendLoan
:
false
,
isRequestingExtendAllLoans
:
false
,
extendLoanError
:
false
,
hasRequestedRenewAll
:
false
})
})
it
(
`should handle
${
types
.
REQUEST_EXTEND_ALL_LOANS
}
`
,
()
=>
{
expect
(
loan
({},
{
type
:
types
.
REQUEST_EXTEND_ALL_LOANS
})
).
toEqual
({
extendLoanError
:
false
,
isRequestingExtendAllLoans
:
true
,
hasRequestedRenewAll
:
true
})
})
it
(
`should handle
${
types
.
REQUEST_EXTEND_LOAN
}
`
,
()
=>
{
expect
(
loan
({},
{
type
:
types
.
REQUEST_EXTEND_LOAN
})
).
toEqual
({
isRequestingExtendLoan
:
true
,
extendLoanError
:
false
})
})
it
(
`should handle
${
types
.
EXTEND_LOAN_SUCCESS
}
`
,
()
=>
{
expect
(
loan
({},
{
type
:
types
.
EXTEND_LOAN_SUCCESS
})
).
toEqual
({
isRequestingExtendLoan
:
false
,
extendLoanError
:
false
})
})
it
(
`should handle
${
types
.
EXTEND_LOAN_FAILURE
}
`
,
()
=>
{
expect
(
loan
({},
{
type
:
types
.
EXTEND_LOAN_FAILURE
,
payload
:
{
message
:
'
error
'
,
checkoutId
:
'
checkoutId
'
},
error
:
true
})
).
toEqual
({
isRequestingExtendLoan
:
false
,
extendLoanError
:
true
})
})
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment