From efa2eeda37b9f569618601b50a685b2c235a7205 Mon Sep 17 00:00:00 2001 From: Max Chopart Date: Thu, 7 Dec 2023 11:35:29 +0100 Subject: [PATCH] [New #26] Added export records UI --- js/components/record/Records.js | 24 ++++++++++++++++-------- js/i18n/cs.js | 1 + js/i18n/en.js | 1 + 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/js/components/record/Records.js b/js/components/record/Records.js index 6ccd6b3b..97e57149 100644 --- a/js/components/record/Records.js +++ b/js/components/record/Records.js @@ -32,10 +32,11 @@ class Records extends React.Component { } render() { - const {showAlert, recordDeleted, formTemplate} = this.props; + const {showAlert, recordDeleted, formTemplate, recordsLoaded} = this.props; const showCreateButton = STUDY_CREATE_AT_MOST_ONE_RECORD ? (!this.props.recordsLoaded.records || (this.props.recordsLoaded.records.length < 1)) : true; + const showExportButton = !!recordsLoaded.records; const createRecordDisabled = STUDY_CLOSED_FOR_ADDITION && (!this._isAdmin()); @@ -53,13 +54,20 @@ class Records extends React.Component { -
- {showCreateButton - ? - : null} +
+
+ {showCreateButton + ? + : null} +
+
+ {showExportButton ? + + : null} +
{showAlert && recordDeleted.status === ACTION_STATUS.ERROR &&