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
17 changes: 16 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/ManageGroupsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import javax.persistence.PersistenceContext;
import org.apache.commons.lang3.StringUtils;


/**
* @author michaelsuo
*/
Expand Down Expand Up @@ -95,10 +96,24 @@ public String init() {
return permissionsWrapper.notAuthorized();
}
explicitGroups = new LinkedList<>(explicitGroupService.findByOwner(getDataverseId()));

renderDeletePopup = false;
return null;
}

private boolean renderDeletePopup = false;

public boolean isRenderDeletePopup() {
return renderDeletePopup;
}

public void setRenderDeletePopup(boolean renderDeletePopup) {
this.renderDeletePopup = renderDeletePopup;
}

public void clickDeleteGroup(ExplicitGroup selectedGroup) {
setRenderDeletePopup(true);
this.selectedGroup = selectedGroup;
}

public void setSelectedGroup(ExplicitGroup selectedGroup) {
this.selectedGroup = selectedGroup;
Expand Down
7 changes: 5 additions & 2 deletions src/main/webapp/explicitGroup-new-dialog.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<p:panelGrid columns="2" styleClass="noBorders">
<p:inputText id="explicitGroupName" styleClass="form-control" value="#{manageGroupsPage.explicitGroupName}"
required="#{param['DO_GROUP_VALIDATION']}"
requiredMessage="#{bundle['dataverse.permissions.explicitGroupEditDialog.groupName.required']}"/>
requiredMessage="#{bundle['dataverse.permissions.explicitGroupEditDialog.groupName.required']}"
onkeypress="return event.keyCode !== 13;"/>
<p:message for="explicitGroupName"/>
</p:panelGrid>
</div>
Expand All @@ -41,7 +42,8 @@
required="#{param['DO_GROUP_VALIDATION']}"
requiredMessage="#{bundle['dataverse.permissions.explicitGroupEditDialog.groupIdentifier.required']}"
validator="#{manageGroupsPage.validateGroupIdentifier}"
binding="#{manageGroupsPage.explicitGroupIdentifierField}"/>
binding="#{manageGroupsPage.explicitGroupIdentifierField}"
onkeypress="return event.keyCode !== 13;"/>
<p:message for="explicitGroupIdentifier"/>
</p:panelGrid>
<p class="help-block">#{bundle['dataverse.permissions.explicitGroupEditDialog.groupIdentifier.helpText']}</p>
Expand All @@ -67,6 +69,7 @@
emptyMessage="#{bundle['dataverse.permissions.usersOrGroups.assignDialog.userOrGroup.invalidMsg']}"
value="#{manageGroupsPage.newExplicitGroupRoleAssignees}"
completeMethod="#{manageGroupsPage.completeRoleAssignee}"
onkeypress="return event.keyCode !== 13;"
var="roleAssignee"
itemLabel="#{roleAssignee.displayInfo.title}" itemValue="#{roleAssignee}" converter="roleAssigneeConverter">
<p:column>
Expand Down
7 changes: 4 additions & 3 deletions src/main/webapp/manage-groups.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<span class="glyphicon glyphicon-edit"></span>
</p:commandLink>
<p:commandLink styleClass="btn btn-default bootstrap-button-tooltip"
action="#{manageGroupsPage.setSelectedGroup(explicitGroup)}"
action="#{manageGroupsPage.clickDeleteGroup(explicitGroup)}"
update="@form"
oncomplete="PF('deleteConfirmation').show()"
title="#{bundle['dataverse.manageGroups.tab.action.btn.delete']}">
Expand All @@ -92,7 +92,7 @@
<span class="glyphicon glyphicon-warning-sign text-warning"/> <span class="text-warning">#{bundle['dataverse.manageGroups.tab.action.btn.delete.dialog.tip']}</span>
</p>
<div class="button-block">
<p:commandButton styleClass="btn btn-default" value="#{bundle.continue}" onclick="PF('deleteConfirmation').hide()" action="#{manageGroupsPage.deleteGroup()}" update="manageGroupsForm,messagePanel"/>
<p:commandButton styleClass="btn btn-default" value="#{bundle.continue}" rendered="#{manageGroupsPage.renderDeletePopup}" onclick="PF('deleteConfirmation').hide()" action="#{manageGroupsPage.deleteGroup()}" update="manageGroupsForm,messagePanel"/>
<p:commandButton styleClass="btn btn-link" value="#{bundle.cancel}" onclick="PF('deleteConfirmation').hide()"/>
</div>
</p:dialog>
Expand Down Expand Up @@ -122,6 +122,7 @@
value="#{manageGroupsPage.selectedGroupAddRoleAssignees}"
completeMethod="#{manageGroupsPage.completeRoleAssignee}"
var="roleAssignee"
onkeypress="return event.keyCode !== 13;"
styleClass="DropdownPopup" panelStyleClass="DropdownPopupPanel"
itemLabel="#{roleAssignee.displayInfo.title}" itemValue="#{roleAssignee}" converter="roleAssigneeConverter">
<p:column>
Expand Down Expand Up @@ -166,7 +167,7 @@
</p:dataTable>
<!-- Add Group Members -->
<div class="button-block">
<p:commandButton id="saveGroup" styleClass="btn btn-default"
<p:commandButton id="saveGroup" styleClass="btn btn-default" rendered="#{manageGroupsPage.getSelectedGroup()!=null}"
actionListener="#{manageGroupsPage.saveExplicitGroup}"
value="#{bundle.saveChanges}"
update="manageGroupsForm,messagePanel">
Expand Down