-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UIREC-303 UIREC-304 Implementation of the claim send and claim delay …
…actions
- Loading branch information
1 parent
16cb7c8
commit cc80015
Showing
15 changed files
with
345 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import PropTypes from 'prop-types'; | ||
import { | ||
FormattedMessage, | ||
useIntl, | ||
} from 'react-intl'; | ||
|
||
import { | ||
Button, | ||
Col, | ||
Modal, | ||
Row, | ||
} from '@folio/stripes/components'; | ||
import stripesFinalForm from '@folio/stripes/final-form'; | ||
import { ModalFooter } from '@folio/stripes-acq-components'; | ||
|
||
import { FieldClaimingDate } from '../../common/components'; | ||
|
||
export const DelayClaimModal = ({ | ||
onCancel, | ||
handleSubmit, | ||
open, | ||
}) => { | ||
const intl = useIntl(); | ||
const modalLabel = intl.formatMessage({ id: 'ui-receiving.modal.delayClaim.heading' }); | ||
|
||
const start = ( | ||
<Button | ||
marginBottom0 | ||
onClick={onCancel} | ||
> | ||
<FormattedMessage id="stripes-acq-components.FormFooter.cancel" /> | ||
</Button> | ||
); | ||
const end = ( | ||
<> | ||
<Button | ||
buttonStyle="primary" | ||
onClick={handleSubmit} | ||
marginBottom0 | ||
> | ||
<FormattedMessage id="stripes-acq-components.FormFooter.save" /> | ||
</Button> | ||
</> | ||
); | ||
|
||
const footer = ( | ||
<ModalFooter | ||
renderStart={start} | ||
renderEnd={end} | ||
/> | ||
); | ||
|
||
return ( | ||
<Modal | ||
open={open} | ||
id="delay-claim-modal" | ||
size="small" | ||
footer={footer} | ||
label={modalLabel} | ||
aria-label={modalLabel} | ||
> | ||
<form onSubmit={handleSubmit}> | ||
<Row> | ||
<Col xs> | ||
<FieldClaimingDate label={<FormattedMessage id="ui-receiving.modal.delayClaim.field.delayTo" />} /> | ||
</Col> | ||
</Row> | ||
</form> | ||
</Modal> | ||
); | ||
}; | ||
|
||
DelayClaimModal.propTypes = { | ||
handleSubmit: PropTypes.func.isRequired, | ||
onCancel: PropTypes.func.isRequired, | ||
open: PropTypes.bool, | ||
}; | ||
|
||
export default stripesFinalForm({ | ||
navigationCheck: true, | ||
subscription: { values: true }, | ||
})(DelayClaimModal); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as DelayClaimModal } from './DelayClaimModal'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import PropTypes from 'prop-types'; | ||
import { Field } from 'react-final-form'; | ||
import { | ||
FormattedMessage, | ||
useIntl, | ||
} from 'react-intl'; | ||
|
||
import { | ||
Button, | ||
Col, | ||
Modal, | ||
Row, | ||
TextArea, | ||
} from '@folio/stripes/components'; | ||
import stripesFinalForm from '@folio/stripes/final-form'; | ||
import { ModalFooter } from '@folio/stripes-acq-components'; | ||
|
||
import { FieldClaimingDate } from '../../common/components'; | ||
|
||
const SendClaimModal = ({ | ||
handleSubmit, | ||
onCancel, | ||
open, | ||
}) => { | ||
const intl = useIntl(); | ||
const modalLabel = intl.formatMessage({ id: 'ui-receiving.modal.sendClaim.heading' }); | ||
|
||
const start = ( | ||
<Button | ||
marginBottom0 | ||
onClick={onCancel} | ||
> | ||
<FormattedMessage id="stripes-acq-components.FormFooter.cancel" /> | ||
</Button> | ||
); | ||
const end = ( | ||
<> | ||
<Button | ||
buttonStyle="primary" | ||
marginBottom0 | ||
onClick={handleSubmit} | ||
> | ||
<FormattedMessage id="stripes-acq-components.FormFooter.save" /> | ||
</Button> | ||
</> | ||
); | ||
|
||
const footer = ( | ||
<ModalFooter | ||
renderStart={start} | ||
renderEnd={end} | ||
/> | ||
); | ||
|
||
return ( | ||
<Modal | ||
open={open} | ||
id="send-claim-modal" | ||
footer={footer} | ||
label={modalLabel} | ||
aria-label={modalLabel} | ||
> | ||
<form onSubmit={handleSubmit}> | ||
<Row> | ||
<Col xs> | ||
<FieldClaimingDate label={<FormattedMessage id="ui-receiving.modal.sendClaim.field.claimExpiryDate" />} /> | ||
</Col> | ||
</Row> | ||
|
||
<Row> | ||
<Col xs> | ||
<Field | ||
component={TextArea} | ||
fullWidth | ||
label={<FormattedMessage id="ui-receiving.piece.internalNote" />} | ||
name="internalNote" | ||
/> | ||
</Col> | ||
<Col xs> | ||
<Field | ||
component={TextArea} | ||
fullWidth | ||
label={<FormattedMessage id="ui-receiving.piece.externalNote" />} | ||
name="externalNote" | ||
/> | ||
</Col> | ||
</Row> | ||
</form> | ||
</Modal> | ||
); | ||
}; | ||
|
||
SendClaimModal.propTypes = { | ||
handleSubmit: PropTypes.func.isRequired, | ||
onCancel: PropTypes.func.isRequired, | ||
open: PropTypes.bool, | ||
}; | ||
|
||
export default stripesFinalForm({ | ||
navigationCheck: true, | ||
subscription: { values: true }, | ||
})(SendClaimModal); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as SendClaimModal } from './SendClaimModal'; |
Oops, something went wrong.