Skip to content

Commit

Permalink
Merge pull request IQSS#8734 from IQSS/8646-TOA-on-restrict-file-popup
Browse files Browse the repository at this point in the history
IQSS#8646 carry TOA over to access popup on template change
  • Loading branch information
kcondon authored May 26, 2022
2 parents f1c0600 + 3ea5b20 commit 552dfc8
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -1660,15 +1660,7 @@ public void setSelectedTemplate(Template selectedTemplate) {
public void updateSelectedTemplate(ValueChangeEvent event) {

selectedTemplate = (Template) event.getNewValue();
if (selectedTemplate != null) {
//then create new working version from the selected template
workingVersion.updateDefaultValuesFromTemplate(selectedTemplate);
updateDatasetFieldInputLevels();
} else {
workingVersion.initDefaultValues(licenseServiceBean.getDefault());
updateDatasetFieldInputLevels();
}
resetVersionUI();

}

/*
Expand Down Expand Up @@ -1762,6 +1754,21 @@ public void handleChange() {

public void handleChangeButton() {

if (selectedTemplate != null) {
//then create new working version from the selected template
workingVersion.updateDefaultValuesFromTemplate(selectedTemplate);
updateDatasetFieldInputLevels();
} else {
workingVersion.initDefaultValues(licenseServiceBean.getDefault());
updateDatasetFieldInputLevels();
}
/*
Issue 8646: necessary for the access popup which is shared by the dataset page and the file page
*/
setFileAccessRequest(workingVersion.getTermsOfUseAndAccess().isFileAccessRequest());
setTermsOfAccess(workingVersion.getTermsOfUseAndAccess().getTermsOfAccess());

resetVersionUI();
}

public boolean isShapefileType(FileMetadata fm) {
Expand Down

0 comments on commit 552dfc8

Please sign in to comment.