diff --git a/packages/component-faraday-ui/src/contextualBoxes/ResponseToRevisionRequest.js b/packages/component-faraday-ui/src/contextualBoxes/ResponseToRevisionRequest.js index 812b986e6585743c53c5e39f46000faf465dbc05..487d83cb1fa6c387883a108fd1f8644897711ce9 100644 --- a/packages/component-faraday-ui/src/contextualBoxes/ResponseToRevisionRequest.js +++ b/packages/component-faraday-ui/src/contextualBoxes/ResponseToRevisionRequest.js @@ -2,8 +2,18 @@ import React from 'react' import { ContextualBox, AuthorReply } from '../' -const ResponseToRevisionRequest = ({ fragment, authorReply }) => ( - <ContextualBox label="Response to Revision Request" mb={2}> +const ResponseToRevisionRequest = ({ + fragment, + authorReply, + expanded, + toggle, +}) => ( + <ContextualBox + expanded={expanded} + label="Response to Revision Request" + mb={2} + toggle={toggle} + > <AuthorReply fragment={fragment} reply={authorReply} /> </ContextualBox> ) diff --git a/packages/component-manuscript/src/components/ManuscriptLayout.js b/packages/component-manuscript/src/components/ManuscriptLayout.js index 250226f55c9edd7842943b7d2f331958bd2f444d..9c39e9a6c7c722d76d281c73ebc0adb3ac8e777a 100644 --- a/packages/component-manuscript/src/components/ManuscriptLayout.js +++ b/packages/component-manuscript/src/components/ManuscriptLayout.js @@ -56,6 +56,8 @@ const ManuscriptLayout = ({ toggleReviewerRecommendations, reviewerRecommendationExpanded, authorResponseToRevisonRequest, + toggleResponeToRevisionRequest, + responseToRevisionRequestExpanded, shouldReview, submittedOwnRecommendation, reviewerReports, @@ -68,6 +70,7 @@ const ManuscriptLayout = ({ inviteReviewer, recommendationHandler, inviteHandlingEditor, + versions, }) => ( <Root pb={30}> @@ -131,7 +134,9 @@ const ManuscriptLayout = ({ {authorResponseToRevisonRequest.content && ( <ResponseToRevisionRequest authorReply={authorResponseToRevisonRequest.content} + expanded={responseToRevisionRequestExpanded} fragment={fragment} + toggle={toggleResponeToRevisionRequest} /> )} diff --git a/packages/component-manuscript/src/components/ManuscriptPage.js b/packages/component-manuscript/src/components/ManuscriptPage.js index 9f18761f49a31b68c4cade5c8388f8e99495c86f..f51c7f7ab0af1a3571d4cec79743232981fce08f 100644 --- a/packages/component-manuscript/src/components/ManuscriptPage.js +++ b/packages/component-manuscript/src/components/ManuscriptPage.js @@ -286,6 +286,10 @@ export default compose( toggleEditorialComments: toggle, editorialCommentsExpanded: expanded, })), + fromRenderProps(RemoteOpener, ({ toggle, expanded }) => ({ + toggleResponeToRevisionRequest: toggle, + responseToRevisionRequestExpanded: expanded, + })), withProps(({ currentUser, collection, submittedOwnRecommendation }) => ({ getSignedUrl, shouldReview: @@ -311,6 +315,7 @@ export default compose( hasManuscriptFailure, fetchUpdatedCollection, editorialRecommendations, + authorResponseToRevisonRequest, currentUser: { isEIC, isInvitedHE, @@ -351,7 +356,7 @@ export default compose( this.props.toggleReviewerResponse() } - if (shouldReview) { + if (shouldReview && !authorResponseToRevisonRequest.content) { this.props.toggleReviewerRecommendations() } @@ -370,6 +375,10 @@ export default compose( if (canSubmitRevision) { this.props.toggleEditorialComments() } + + if (authorResponseToRevisonRequest.content) { + this.props.toggleResponeToRevisionRequest() + } }, componentDidUpdate(prevProps) { const {