Skip to content
Snippets Groups Projects
Commit 80f4620f authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

Merge branch 'HIN-1116-documentation' of...

Merge branch 'HIN-1116-documentation' of gitlab.coko.foundation:xpub/xpub-faraday into HIN-1116-documentation
parents 8fe92f20 f2979487
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!191Hin 1116 documentation
## Hindawi Handling Recommendation HOC.
Injects `createRecommendation` and `onEditorialRecommendation` handlers as props.
### withHandleRecommendation props
`recommendationHandler` namespace contains the following fields:
Name|Type|Description
---|---|---
createRecommendation |`(reduxFormValues, modalProps) => any`|creates a recommendation for the manuscript
onEditorialRecommendation |`(reduxFormValues, modalProps) => any`|handles the recommendation for the manuscript
_Note: The functions must be used withing a modal_
```javascript
const HERecommendationPanel = ({ createRecommendation }) => (
<Modal>
<span>Recommend the manuscript for:</span>
<select>
<option>Approve</option>
<option>Reject</option>
<option>Minor revision</option>
<option>Major revision</option>
</select>
<button onClick={() => createRecommendation(reduxFormValues, { ...modalProps, setFetching })}>
Submit
</button>
</Modal>
)
const EICDecisionPanel = ({ onEditorialRecommendation }) => (
<Modal>
<span>Take decision to:</span>
<select>
<option>Approve</option>
<option>Reject</option>
<option>Minor revision</option>
<option>Major revision</option>
</select>
<button onClick={() => onEditorialRecommendation(reduxFormValues, { ...modalProps, setFetching })}>
Submit
</button>
</Modal>
)
```
## Hindawi Handling Editor Invite HOC.
Injects `assignHE`, `revokeHE` and `onHEResponse` handlers as props.
### withInviteHandlingEditor props
`inviteHandlingEditor` namespace contains the following fields:
Name|Type|Description
---|---|---
assignHE |`(email, modalProps) => any`|sends an invitation to the handling editor
revokeHE |`(invitationId, modalProps) => any`|revokes a sent invitation to the handling editor
onHEResponse |`(reduxFormValues, modalProps) => any`|handles the handling editor's response
_Note: The functions must be used withing a modal_
```javascript
const EditorInChiefPanel = ({ assignHE, revokeHE }) => (
<Modal>
<span>Handlin d'Editor</span>
<button onClick={() => assignHE(email, { ...modalProps, setFetching })}>
Resend Invitation
</button>
<button
onClick={() => revokeHE(invitationId, { ...modalProps, setFetching })}
>
Cancel Invitation
</button>
</Modal>
)
const HandlingEditorPanel = ({ onHeResponse }) => (
<Modal>
<span>Accept invitation?</span>
<button
onClick={() => onHeResponse(reduxFormValues, { ...modalProps, setFetching })}
>
Yes
</button>
<button
onClick={() => onHeResponse(reduxFormValues, { ...modalProps, setFetching })}
>
No
</button>
</Modal>
)
```
## Hindawi Handling Editor Invite HOC.
Injects `assignHE`, `revokeHE` and `onHEResponse` handlers as props.
### withInviteHandlingEditor props
* `inviteHandlingEditor: object`: namespace containing the following fields:
* `assignHE: function`: sends an invitation to the handling editor.
* `revokeHE: function`: revokes a sent invitation to the handling editor.
* `onHeResponse: function`: handles the handling editor's response.
```javascript
const EditorInChiefPanel = ({ assignHE, revokeHE }) => (
<Modal>
<span>Handlin d'Editor</span>
<button onClick={() => assignHE(email, {...modalProps, setFetching})}>Resend Invitation</button>
<button onClick={() => revokeHE(invitationId, {...modalProps, setFetching})}>Cancel Invitation</button>
</Modal>
)
const HandlingEditorPanel = ({ onHeResponse }) => (
<Modal>
<span>Accept invitation?</span>
<button onClick={() => onHeResponse(values, {...modalProps, setFetching})}>Yes</button>
<button onClick={() => onHeResponse(values, {...modalProps, setFetching})}>No</button>
</Modal>
)
```
......@@ -4,12 +4,16 @@ Injects `onInviteReviewer`, `onInvitePublonReviewer`, `onResendInviteReviewer`,
### withInviteReviewer props
* `inviteReviewer: object`: namespace containing the following fields:
* `onInviteReviewer: function`: sends an invitation to the reviewer.
* `onInvitePublonReviewer: function`: sends an invitation to a Publon reviewer.
* `onResendInviteReviewer: function`: resends an invitation to an already invited reviewer.
* `onRevokeInviteReviewer: function`: cancels an invitation to an invited reviewer.
* `onReviewerResponse: function`: handles the reviewer response to the invitation.
`inviteReviewer` namespace contains the following fields:
Name|Type|Description
---|---|---
onInviteReviewer|`(reduxFormValues, modalProps) => any`|sends an invitation to the reviewer
onInvitePublonReviewer|`(reduxFormValues, modalProps) => any`|sends an invitation to a Publon reviewer
onResendInviteReviewer|`(email, modalProps) => any`|resends an invitation to an already invited reviewer
onRevokeInviteReviewer|`(invitationId, modalProps) => any`|cancels an invitation to an invited reviewer
onReviewerResponse|`(reduxFormValues, modalProps) => any`|handles the reviewer response to the invitation
_Note: The functions must be used withing a modal_
```javascript
const InviteReviewer = ({
......@@ -62,12 +66,16 @@ const Invitation = ({ onReviewerResponse }) => (
<Modal>
<span>Accept invitation?</span>
<button
onClick={() => onReviewerResponse(values, { ...modalProps, setFetching })}
onClick={() =>
onReviewerResponse(reduxFormValues, { ...modalProps, setFetching })
}
>
Yes
</button>
<button
onClick={() => onReviewerResponse(values, { ...modalProps, setFetching })}
onClick={() =>
onReviewerResponse(reduxFormValues, { ...modalProps, setFetching })
}
>
No
</button>
......
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