Skip to content

Commit

Permalink
OP-1043 | Remove deleted group from user edit group jcombo box (#2096)
Browse files Browse the repository at this point in the history
* fix(OP-1043): Remove deleted group from user edit group jcombo box

* chore: Reformat code

---------

Co-authored-by: SteveGT96 <[email protected]>
  • Loading branch information
SteveGT96 and SteveGT96 authored Nov 26, 2024
1 parent c1db1d6 commit fed3d55
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/main/java/org/isf/menu/gui/UserEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,20 +340,24 @@ private JComboBox<UserGroup> getUserGroupComboBox() {
if (userGroupComboBox == null) {
userGroupComboBox = new JComboBox<>();
try {
List<UserGroup> group = userBrowsingManager.getUserGroup();
List<UserGroup> groups = userBrowsingManager.getUserGroup();
if (insert) {
if (group != null) {
for (UserGroup elem : group) {
userGroupComboBox.addItem(elem);
if (groups != null) {
for (UserGroup group : groups) {
if (!group.isDeleted()) {
userGroupComboBox.addItem(group);
}
}
}
} else {
UserGroup selectedUserGroup = null;
if (group != null) {
for (UserGroup elem : group) {
userGroupComboBox.addItem(elem);
if (user.getUserGroupName().equals(elem)) {
selectedUserGroup = elem;
if (groups != null) {
for (UserGroup group : groups) {
if (!group.isDeleted()) {
userGroupComboBox.addItem(group);
if (user.getUserGroupName().equals(group)) {
selectedUserGroup = group;
}
}
}
}
Expand Down

0 comments on commit fed3d55

Please sign in to comment.