Skip to content

Commit

Permalink
Merge pull request #3462 from IQSS/3451-Allow-edit-of-draft-in-deacce…
Browse files Browse the repository at this point in the history
…ssion

#1267; #1308; #3451 - move Deaccession fixes to separate branch
  • Loading branch information
kcondon authored Nov 8, 2016
2 parents 6783bde + 150ae7e commit a72d5a3
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 16 deletions.
4 changes: 4 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/Dataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ public boolean isDeaccessioned() {
if (testDsv.isReleased()) {
return false;
}
//Also check for draft version
if (testDsv.isDraft()) {
return false;
}
if (testDsv.isDeaccessioned()) {
hasDeaccessionedVersions = true;
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -2928,7 +2928,13 @@ public Integer getCompareVersionsCount() {
*/
public void postLoadSetVersionTabList(){

if (this.getVersionTabList().isEmpty()){
setVersionTabList(resetVersionTabList());
}

this.setVersionTabListForPostLoad(this.getVersionTabList());


//this.versionTabList = this.resetVersionTabList();
}

Expand Down
6 changes: 5 additions & 1 deletion src/main/webapp/dataset-versions.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@

<!-- start: version number column -->
<p:column>
<ui:fragment rendered="#{versionTab.released or ((versionTab.deaccessioned or versionTab.draft) and permissionServiceBean.on(DatasetPage.dataset).has('ViewUnpublishedDataset'))}">
<ui:fragment rendered="#{versionTab.released
or ((versionTab.deaccessioned or versionTab.draft) and permissionServiceBean.on(DatasetPage.dataset).has('ViewUnpublishedDataset'))}">
<ui:fragment rendered="#{!(versionTab.released or versionTab.deaccessioned)}">
<a id="versionLink" href="/dataset.xhtml?persistentId=#{versionTab.dataset.globalId}&#38;version=#{versionTab.versionState}" class="ui-commandlink ui-widget">
<h:outputText rendered="#{!(versionTab.released or versionTab.deaccessioned)}" value="#{versionTab.versionState}" /></a>
Expand All @@ -64,6 +65,9 @@
<h:outputText rendered="#{versionTab.released or versionTab.deaccessioned}" value="#{versionTab.versionNumber}.#{versionTab.minorVersionNumber}" /></a>
</ui:fragment>
</ui:fragment>
<ui:fragment rendered="#{versionTab.deaccessioned and !permissionServiceBean.on(DatasetPage.dataset).has('ViewUnpublishedDataset')}">
<h:outputText rendered="#{versionTab.released or versionTab.deaccessioned}" value="#{versionTab.versionNumber}.#{versionTab.minorVersionNumber}" />
</ui:fragment>
</p:column><!-- end: version number column -->
<!-- start: description column -->
<p:column>
Expand Down
12 changes: 7 additions & 5 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@
update="linkDatasetForm">
<span class="glyphicon glyphicon-link no-text"/>
</p:commandLink>
<p:commandLink styleClass="btn btn-default bootstrap-button-tooltip"
<p:commandLink styleClass="btn btn-default bootstrap-button-tooltip" rendered="#{!DatasetPage.workingVersion.deaccessioned}"
title="#{bundle['dataset.share.datasetShare']}"
oncomplete="PF('shareDialog').show();sharrre();">
<span class="glyphicon glyphicon-share no-text"/>
</p:commandLink>
</div>
<p:dialog id="shareDialog" header="#{bundle['dataset.share.datasetShare']}" widgetVar="shareDialog" modal="true">
<p:dialog id="shareDialog" header="#{bundle['dataset.share.datasetShare']}" widgetVar="shareDialog" modal="true" rendered="#{!DatasetPage.workingVersion.deaccessioned}">
<p class="help-block"><span class="glyphicon glyphicon-info-sign"/> #{bundle['dataset.share.datasetShare.tip']}</p>

<div id="sharrre-widget" data-url="#{DatasetPage.dataverseSiteUrl}/dataset.xhtml?persistentId=#{dataset.globalId}" data-text="#{bundle['dataset.share.datasetShare.shareText']}"></div>
Expand Down Expand Up @@ -519,15 +519,17 @@
<!-- 4.2.1: the 3 tabs below - metadata, terms and versions: these account for ~100 queries total -->
<!-- a lot of these however, are repeated queries on AuthenticatedUser and RoleAssignment; once these are optimized, the tabs will become very cheap. -->
<p:tab id="metadataMapTab" title="#{bundle['file.dataFilesTab.metadata.header']}"
rendered="#{!DatasetPage.workingVersion.deaccessioned and (empty DatasetPage.editMode or DatasetPage.editMode == 'METADATA')}">
rendered="#{(!DatasetPage.workingVersion.deaccessioned or (DatasetPage.workingVersion.deaccessioned and DatasetPage.canUpdateDataset()))
and (empty DatasetPage.editMode or DatasetPage.editMode == 'METADATA')}">

<div class="button-block tab-header margin-bottom text-right" jsf:rendered="#{empty DatasetPage.editMode and !widgetWrapper.widgetView}">
<p:commandLink type="button" styleClass="btn btn-default" actionListener="#{DatasetPage.edit('METADATA')}" update="@form,:messagePanel" oncomplete="javascript:post_edit_metadata()"
disabled="#{DatasetPage.locked}" rendered="#{DatasetPage.sessionUserAuthenticated and empty DatasetPage.editMode and !widgetWrapper.widgetView
and DatasetPage.canUpdateDataset()}">
and DatasetPage.canUpdateDataset() and !DatasetPage.dataset.deaccessioned }">
<f:setPropertyActionListener target="#{DatasetPage.selectedTabIndex}" value="0" />
<span class="glyphicon glyphicon-pencil"/> #{bundle['file.dataFilesTab.metadata.addBtn']}
</p:commandLink>
<div class="btn-group" jsf:rendered="#{DatasetPage.dataset.released}" >
<div class="btn-group" jsf:rendered="#{DatasetPage.dataset.released and !DatasetPage.dataset.deaccessioned}" >
<button class="btn btn-default dropdown-toggle" type="button" styleClass="btn btn-default" data-toggle="dropdown">
<span class="glyphicon glyphicon-export"/> #{bundle['dataset.exportBtn']} <span class="caret"/></button>
<ul class="dropdown-menu" role="menu">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/file.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
<f:setPropertyActionListener target="#{sendFeedbackDialog.recipient}" value="#{DatasetPage.dataset}"/>
<span class="glyphicon glyphicon-envelope no-text"/>
</p:commandLink>
<p:commandLink styleClass="btn btn-default bootstrap-button-tooltip"
<p:commandLink styleClass="btn btn-default bootstrap-button-tooltip" rendered="#{!FilePage.fileMetadata.datasetVersion.deaccessioned}"
title="#{bundle['dataset.share.datasetShare']}"
oncomplete="PF('shareDialog').show();sharrre();">
<span class="glyphicon glyphicon-share no-text"/>
</p:commandLink>
</div>
<p:dialog id="shareDialog" header="#{bundle['dataset.share.datasetShare']}" widgetVar="shareDialog" modal="true">
<p:dialog id="shareDialog" header="#{bundle['dataset.share.datasetShare']}" widgetVar="shareDialog" modal="true" rendered="#{!FilePage.fileMetadata.datasetVersion.deaccessioned}">
<p class="help-block"><span class="glyphicon glyphicon-info-sign"/> #{bundle['dataset.share.datasetShare.tip']}</p>

<div id="sharrre-widget" data-url="#{systemConfig.dataverseSiteUrl}/dataset.xhtml?persistentId=#{FilePage.fileMetadata.datasetVersion.dataset.globalId}" data-text="#{bundle['dataset.share.datasetShare.shareText']}"></div>
Expand Down
18 changes: 10 additions & 8 deletions src/main/webapp/resources/css/structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,17 @@ td.col-file-action > .button-block, .col-manage-action > .button-block,
div.ui-datatable-header > .button-block, .button-block.tab-header {margin-top:0;}
form.btn-form {display:inline-block;}
.button-block button, .button-block a.btn, .button-block input.btn, .button-block div.btn-group, .button-block span.btn.ui-state-disabled {margin-right:1em;}
.col-manage-action .button-block button, .col-manage-action .button-block a.btn, .col-manage-action .button-block input.btn, .col-manage-action .button-block div.btn-group, .col-manage-action .button-block span.btn.ui-state-disabled {margin-right:0em;}
.button-block span.ingest-warning {margin-right:.5em;}
.button-block div.btn-group div.btn-group {margin-right:0;}

.col-manage-action .button-block button, .col-manage-action .button-block a.btn, .col-manage-action .button-block input.btn,
.col-manage-action .button-block div.btn-group, .col-manage-action .button-block span.btn.ui-state-disabled,
.button-block div.btn-group div.btn-group,
.button-block button.pull-right:first-child, .button-block a.btn.pull-right:first-child, .button-block div.btn-group.pull-right:first-child,
.button-block div.btn-group button, .button-block div.btn-group a.btn {margin-right:0;}
.button-block .btn:last-child, .button-block .btn-group:last-child,
.button-block form.btn-form:last-child .btn-group,
.button-block span.ui-state-disabled:last-child {margin-right:0;}
.button-block.pull-right .btn:last-child {margin-right:0;}
.button-block div.btn-group button, .button-block div.btn-group a.btn,
.button-block .btn:last-child, .button-block div.btn-group:last-child:not(.pull-right),
.button-block form.btn-form:last-child .btn-group,
.button-block span.ui-state-disabled:last-child, .button-block.pull-right .btn:last-child,
.button-block .btn:only-child, .button-block div.btn-group:only-child {margin-right:0;}

.button-block ul.dropdown-menu li.disabled span.ui-commandlink.ui-state-disabled {display: block; padding: 3px 20px; color: #777; background: none; opacity:1.0;}
div.field-add-delete a.btn {margin:0 1em 0 0;}
div.field-add-delete a.btn:last-child {margin-right:0;}
Expand Down

0 comments on commit a72d5a3

Please sign in to comment.