diff --git a/js/components/record/Records.js b/js/components/record/Records.js index 200c148c..e84656f3 100644 --- a/js/components/record/Records.js +++ b/js/components/record/Records.js @@ -1,13 +1,16 @@ +'use strict'; + import React from "react"; import {Button, Card} from "react-bootstrap"; import {injectIntl} from "react-intl"; import withI18n from "../../i18n/withI18n"; import RecordTable from "./RecordTable"; -import {ACTION_STATUS, ALERT_TYPES, ROLE} from "../../constants/DefaultConstants"; +import {ACTION_STATUS, ALERT_TYPES, EXTENSION_CONSTANTS, ROLE} from "../../constants/DefaultConstants"; import AlertMessage from "../AlertMessage"; import {LoaderSmall} from "../Loader"; import PropTypes from "prop-types"; import {processTypeaheadOptions} from "./TypeaheadAnswer"; +import {EXTENSIONS} from "../../../config"; import ExportRecordsDropdown from "./ExportRecordsDropdown"; const STUDY_CLOSED_FOR_ADDITION = false; @@ -35,6 +38,9 @@ class Records extends React.Component { const showCreateButton = STUDY_CREATE_AT_MOST_ONE_RECORD ? (!recordsLoaded.records || (recordsLoaded.records.length < 1)) : true; + const showPublishButton = + this.props.currentUser.role === ROLE.ADMIN + && EXTENSIONS === EXTENSION_CONSTANTS.OPERATOR; const createRecordDisabled = STUDY_CLOSED_FOR_ADDITION && (!this._isAdmin()); @@ -54,11 +60,14 @@ class Records extends React.Component {
{showCreateButton - ? : null} + {showPublishButton ? + + : null}
{showAlert && recordDeleted.status === ACTION_STATUS.ERROR && diff --git a/js/i18n/cs.js b/js/i18n/cs.js index 069c7e1d..3f6508a3 100644 --- a/js/i18n/cs.js +++ b/js/i18n/cs.js @@ -36,6 +36,7 @@ export default { 'reject': 'Odmítnout', 'accept':'Přijmout', 'complete': 'Dokončit', + 'publish': 'Publikovat', 'login.title': Constants.APP_NAME + ' - Přihlášení', 'login.username': 'Uživatelské jméno', diff --git a/js/i18n/en.js b/js/i18n/en.js index 6f0b12eb..44130464 100644 --- a/js/i18n/en.js +++ b/js/i18n/en.js @@ -36,6 +36,7 @@ export default { 'reject': 'Reject', 'accept':'Accept', 'complete': 'Complete', + 'publish': 'Publish', 'login.title': Constants.APP_NAME + ' - Login', 'login.username': 'Username',