fixed user multi selection
This commit is contained in:
parent
a076c62d46
commit
db143e1b37
3 changed files with 49 additions and 43 deletions
|
@ -21,6 +21,7 @@ import javax.validation.constraints.NotEmpty;
|
|||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import ch.ethz.seb.sebserver.gbl.model.EntityName;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -243,6 +244,14 @@ public final class UserInfo implements UserAccount, Serializable {
|
|||
return new EntityKey(this.uuid, entityType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityName toName() {
|
||||
return new EntityName(
|
||||
this.getModelId(),
|
||||
this.entityType(),
|
||||
this.getUsername() + " (" + this.getSurname() + " " + this.getName() + ")");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
|
|
@ -74,6 +74,7 @@ public final class MultiSelectionCombo extends Composite implements Selection {
|
|||
this.dropDown = new DropDown(this.textInput, SWT.NONE);
|
||||
this.textInput.addListener(SWT.FocusIn, event -> openDropDown());
|
||||
this.textInput.addListener(SWT.Modify, event -> openDropDown());
|
||||
this.textInput.addListener(SWT.MouseUp, event -> openDropDown());
|
||||
this.dropDown.addListener(SWT.Selection, event -> {
|
||||
final int selectionIndex = this.dropDown.getSelectionIndex();
|
||||
if (selectionIndex >= 0) {
|
||||
|
@ -171,7 +172,6 @@ public final class MultiSelectionCombo extends Composite implements Selection {
|
|||
this.availableValues.remove(item);
|
||||
PageService.updateScrolledComposite(this);
|
||||
this.updateAnchor.layout(true, true);
|
||||
|
||||
}
|
||||
|
||||
private void removeComboSelection(final Event event) {
|
||||
|
|
|
@ -89,8 +89,6 @@ class AdminUserInitializer {
|
|||
}
|
||||
} else {
|
||||
final CharSequence generateAdminPassword = this.generateAdminPassword();
|
||||
if (generateAdminPassword != null) {
|
||||
|
||||
Long institutionId = this.institutionDAO.allMatching(new FilterMap())
|
||||
.getOrElse(Collections::emptyList)
|
||||
.stream()
|
||||
|
@ -133,7 +131,6 @@ class AdminUserInitializer {
|
|||
})
|
||||
.getOrThrow();
|
||||
}
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
SEBServerInit.INIT_LOGGER.error("---->");
|
||||
SEBServerInit.INIT_LOGGER.error("----> SEB Server initial admin-account creation failed: ", e);
|
||||
|
@ -161,7 +158,7 @@ class AdminUserInitializer {
|
|||
return ClientCredentialServiceImpl.generateClientSecret();
|
||||
} catch (final Exception e) {
|
||||
log.error("Unable to generate admin password: ", e);
|
||||
return null;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue