From 0f3b9a5adb8c70e6f6f5a2442c767f51a4dc937e Mon Sep 17 00:00:00 2001 From: vimal1083 <vimal1083@gmail.com> Date: Thu, 12 Nov 2020 14:56:40 +0530 Subject: [PATCH] Add show determination button --- .../src/app/src/containers/Determination.js | 16 ++++++++++++---- .../src/app/src/containers/DisplayPanel/index.js | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/hypha/static_src/src/app/src/containers/Determination.js b/hypha/static_src/src/app/src/containers/Determination.js index 662486338..f4ec2cd3d 100644 --- a/hypha/static_src/src/app/src/containers/Determination.js +++ b/hypha/static_src/src/app/src/containers/Determination.js @@ -34,10 +34,18 @@ class DeterminationContainer extends React.PureComponent { </> } - {this.props.determinationDraftStatus && - <div className="status-actions"><button onClick = {() => this.props.toggleDeterminationForm(true)} className="button button--primary button--half-width">Update draft</button></div>} - {!this.props.determinationDraftStatus && - this.props.submission.actionButtons.addDetermination && <div className="status-actions"><button onClick = {() => this.props.toggleDeterminationForm(true)} className="button button--primary button--full-width">Add determination</button></div>} + {this.props.submission.actionButtons.showDeterminationButton && this.props.determinationDraftStatus && + <div className="status-actions"> + <button onClick = {() => this.props.toggleDeterminationForm(true)} className="button button--primary button--half-width"> + Update draft + </button> + </div>} + { this.props.submission.actionButtons.showDeterminationButton && !this.props.determinationDraftStatus && + <div className="status-actions"> + <button onClick = {() => this.props.toggleDeterminationForm(true)} className="button button--primary button--full-width"> + Add determination + </button> + </div>} </SidebarBlock> : null } diff --git a/hypha/static_src/src/app/src/containers/DisplayPanel/index.js b/hypha/static_src/src/app/src/containers/DisplayPanel/index.js index 48d4a144e..139337f2b 100644 --- a/hypha/static_src/src/app/src/containers/DisplayPanel/index.js +++ b/hypha/static_src/src/app/src/containers/DisplayPanel/index.js @@ -70,7 +70,8 @@ const DisplayPanel = props => { let tabs = [ <Tab button="Status" key="status"> - <Determination submissionID={submissionID} submission={submission}/> + { submission ? submission.isDeterminationFormAttached && + <Determination submissionID={submissionID} submission={submission}/> : null} <ScreeningOutcome submissionID={submissionID} /> <StatusActions submissionID={submissionID} /> <ReviewInformation submissionID={submissionID} /> -- GitLab