Skip to content

Commit

Permalink
Adds enablePublishWithExistingDOI configuration
Browse files Browse the repository at this point in the history
closes #2202
  • Loading branch information
helbashandy committed Oct 17, 2023
1 parent e967576 commit 0c1884a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/js/models/AppModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,15 @@ define(['jquery', 'underscore', 'backbone'],
*/
isJSONLDEnabled: true,

/**
* If true, users can see a "Publish" button in the MetadataView if enablePublishDOI is also enabled,
* even if a DOI is assigned to the dataset
* If false, the publish button will not show up when a DOI is already assigned to the dataset.
* @type {boolean}
* @default false
*/
enablePublishWithExistingDOI: false,

/**
* If true, users can see a "Publish" button in the MetadataView, which makes the metadata
* document public and gives it a DOI identifier.
Expand Down
3 changes: 2 additions & 1 deletion src/js/views/MetadataView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,8 @@ define(['jquery',
//Determine if this metadata can be published.
// The Publish feature has to be enabled in the app.
// The model cannot already have a DOI
var canBePublished = MetacatUI.appModel.get("enablePublishDOI") && !view.model.isDOI();
var canBePublished = MetacatUI.appModel.get("enablePublishDOI") &&
(MetacatUI.appModel.get("enablePublishWithExistingDOI") || !view.model.isDOI());

//If publishing is enabled, check if only certain users and groups can publish metadata
if (canBePublished) {
Expand Down

0 comments on commit 0c1884a

Please sign in to comment.