Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,16 @@ public void setShowAccessPopup(boolean showAccessPopup) {} // dummy set method
//fails silently. This is because they are only granted editDataset permissions
//for that scope after the creation is completed. -Matthew 4.7.1
public void restrictFiles(boolean restricted) throws UnsupportedOperationException{

//First make sure they've even selected file(s) to restrict....
if (this.getSelectedFiles().isEmpty()) {
if (restricted) {
PrimeFaces.current().executeScript("PF('selectFilesForRestrictEditFilesPage').show()");
} else {
PrimeFaces.current().executeScript("PF('selectFilesForUnRestrictEditFilesPage').show()");
}
return;
}

// since we are restricted files, first set the previously restricted file list, so we can compare for
// determining whether to show the access popup
Expand Down
18 changes: 18 additions & 0 deletions src/main/webapp/editdatafiles.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@
</div>
</ui:fragment>
<!-- END: Create/Save Dataset Button Panel -->
<p:dialog id="selectFilesForRestrictEditFilesPage" styleClass="smallPopUp"
header="#{bundle['dataset.noSelectedFiles.header']}" widgetVar="selectFilesForRestrictEditFilesPage" modal="true">
<p class="text-danger"><span class="glyphicon glyphicon-exclamation-sign"/> #{bundle['dataset.noSelectedFilesForRestrict']}</p>
<div class="button-block">
<button class="btn btn-default" onclick="PF('selectFilesForRestrictEditFilesPage').hide();" type="button">
#{bundle.close}
</button>
</div>
</p:dialog>
<p:dialog id="selectFilesForUnRestrictEditFilesPage" styleClass="smallPopUp"
header="#{bundle['dataset.noSelectedFiles.header']}" widgetVar="selectFilesForUnRestrictEditFilesPage" modal="true">
<p class="text-danger"><span class="glyphicon glyphicon-exclamation-sign"/> #{bundle['dataset.noSelectedFilesForUnRestrict']}</p>
<div class="button-block">
<button class="btn btn-default" onclick="PF('selectFilesForUnRestrictEditFilesPage').hide();" type="button">
#{bundle.close}
</button>
</div>
</p:dialog>
</h:form>

<p:blockUI block="datasetForm" widgetVar="blockFileForm"/>
Expand Down