From 24c3d31e5818b01b1017de18d8c0bd8845036ea7 Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 7 Aug 2019 15:47:46 +0200 Subject: [PATCH] SEBSERV-78 SEBSERV-77 fixed --- .../gui/content/activity/ActivitiesPane.java | 2 +- .../gui/form/SelectionFieldBuilder.java | 6 +-- .../sebserver/gui/form/TextFieldBuilder.java | 8 ++-- .../seb/sebserver/gui/table/TableFilter.java | 3 +- .../gui/widget/MultiSelectionCombo.java | 12 ++++-- .../sebserver/gui/widget/WidgetFactory.java | 39 ++++++++++++++----- src/main/resources/messages.properties | 3 +- src/main/resources/static/css/sebserver.css | 9 ++++- 8 files changed, 58 insertions(+), 24 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java index 14b86c00..58687e0a 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java @@ -94,7 +94,7 @@ public class ActivitiesPane implements TemplateComposer { .newAction(ActionDefinition.INSTITUTION_VIEW_LIST) .create()); - } else { + } else if (userInfo.hasRole(UserRole.INSTITUTIONAL_ADMIN)) { // otherwise show the form of the institution for current user final TreeItem institutions = this.widgetFactory.treeItemLocalized( navigation, diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/form/SelectionFieldBuilder.java b/src/main/java/ch/ethz/seb/sebserver/gui/form/SelectionFieldBuilder.java index 4aff2c70..03f9357f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/form/SelectionFieldBuilder.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/form/SelectionFieldBuilder.java @@ -109,7 +109,7 @@ public final class SelectionFieldBuilder extends FieldBuilder { composite.setLayout(gridLayout); if (StringUtils.isBlank(this.value)) { final Label label = new Label(composite, SWT.NONE); - final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); + final GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, true); label.setLayoutData(gridData); label.setText(this.value); } else { @@ -131,7 +131,7 @@ public final class SelectionFieldBuilder extends FieldBuilder { private Text buildReadonlyLabel(final Composite composite, final String valueKey, final int hspan) { final Text label = new Text(composite, SWT.READ_ONLY); - final GridData gridData = new GridData(SWT.LEFT, SWT.TOP, true, false, hspan, 1); + final GridData gridData = new GridData(SWT.LEFT, SWT.TOP, true, true, hspan, 1); gridData.verticalIndent = 0; gridData.horizontalIndent = 0; label.setLayoutData(gridData); @@ -141,7 +141,7 @@ public final class SelectionFieldBuilder extends FieldBuilder { .findFirst() .map(tuple -> tuple._2) .orElse(Constants.EMPTY_NOTE); - final Consumer