code cleanup
This commit is contained in:
parent
e40bb43154
commit
ae26c1134f
6 changed files with 8 additions and 27 deletions
5
pom.xml
5
pom.xml
|
@ -151,11 +151,6 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<!-- <configuration> -->
|
|
||||||
<!-- <systemPropertyVariables> -->
|
|
||||||
<!-- <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile> -->
|
|
||||||
<!-- </systemPropertyVariables> -->
|
|
||||||
<!-- </configuration> -->
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
|
@ -10,7 +10,6 @@ package ch.ethz.seb.sebserver.gui.content;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
|
@ -50,7 +49,6 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.Ge
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser.EntityGrantCheck;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser.EntityGrantCheck;
|
||||||
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
|
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
|
||||||
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.CustomVariant;
|
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
@Component
|
@Component
|
||||||
|
@ -170,7 +168,7 @@ public class ConfigTemplateAttributeForm implements TemplateComposer {
|
||||||
widgetFactory.addFormSubContextHeader(
|
widgetFactory.addFormSubContextHeader(
|
||||||
valSpace,
|
valSpace,
|
||||||
FORM_VALUE_TEXT_KEY,
|
FORM_VALUE_TEXT_KEY,
|
||||||
FORM_VALUE_TOOLTIP_TEXT_KEY );
|
FORM_VALUE_TOOLTIP_TEXT_KEY);
|
||||||
|
|
||||||
final Composite grid = new Composite(valSpace, SWT.NONE);
|
final Composite grid = new Composite(valSpace, SWT.NONE);
|
||||||
grid.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
|
grid.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
|
||||||
|
|
|
@ -14,7 +14,6 @@ import java.util.Set;
|
||||||
import java.util.function.BooleanSupplier;
|
import java.util.function.BooleanSupplier;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import ch.ethz.seb.sebserver.gbl.model.sebconfig.SebClientConfig;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
@ -83,8 +82,6 @@ public class LmsSetupForm implements TemplateComposer {
|
||||||
new LocTextKey("sebserver.lmssetup.form.name");
|
new LocTextKey("sebserver.lmssetup.form.name");
|
||||||
private static final LocTextKey FORM_INSTITUTION_TEXT_KEY =
|
private static final LocTextKey FORM_INSTITUTION_TEXT_KEY =
|
||||||
new LocTextKey("sebserver.lmssetup.form.institution");
|
new LocTextKey("sebserver.lmssetup.form.institution");
|
||||||
private static final LocTextKey FORM_PROXY_KEY =
|
|
||||||
new LocTextKey("sebserver.lmssetup.form.proxy");
|
|
||||||
private static final LocTextKey FORM_PROXY_CHECK_KEY =
|
private static final LocTextKey FORM_PROXY_CHECK_KEY =
|
||||||
new LocTextKey("sebserver.lmssetup.form.proxy.check");
|
new LocTextKey("sebserver.lmssetup.form.proxy.check");
|
||||||
private static final LocTextKey FORM_PROXY_HOST_KEY =
|
private static final LocTextKey FORM_PROXY_HOST_KEY =
|
||||||
|
@ -102,8 +99,7 @@ public class LmsSetupForm implements TemplateComposer {
|
||||||
Domain.LMS_SETUP.ATTR_LMS_PROXY_HOST,
|
Domain.LMS_SETUP.ATTR_LMS_PROXY_HOST,
|
||||||
Domain.LMS_SETUP.ATTR_LMS_PROXY_PORT,
|
Domain.LMS_SETUP.ATTR_LMS_PROXY_PORT,
|
||||||
Domain.LMS_SETUP.ATTR_LMS_PROXY_AUTH_USERNAME,
|
Domain.LMS_SETUP.ATTR_LMS_PROXY_AUTH_USERNAME,
|
||||||
Domain.LMS_SETUP.ATTR_LMS_PROXY_AUTH_SECRET
|
Domain.LMS_SETUP.ATTR_LMS_PROXY_AUTH_SECRET));
|
||||||
));
|
|
||||||
|
|
||||||
private final PageService pageService;
|
private final PageService pageService;
|
||||||
private final ResourceService resourceService;
|
private final ResourceService resourceService;
|
||||||
|
@ -227,7 +223,6 @@ public class LmsSetupForm implements TemplateComposer {
|
||||||
.asPasswordField()
|
.asPasswordField()
|
||||||
.mandatory(!readonly))
|
.mandatory(!readonly))
|
||||||
|
|
||||||
|
|
||||||
.addFieldIf(
|
.addFieldIf(
|
||||||
isEdit,
|
isEdit,
|
||||||
() -> FormBuilder.checkbox(
|
() -> FormBuilder.checkbox(
|
||||||
|
@ -286,20 +281,18 @@ public class LmsSetupForm implements TemplateComposer {
|
||||||
if (!readonly) {
|
if (!readonly) {
|
||||||
formHandle.process(
|
formHandle.process(
|
||||||
PROXY_ATTRIBUTES::contains,
|
PROXY_ATTRIBUTES::contains,
|
||||||
ffa -> ffa.setVisible(withProxy)
|
ffa -> ffa.setVisible(withProxy));
|
||||||
);
|
|
||||||
formHandle.getForm().getFieldInput("FORM_PROXY_CHECK")
|
formHandle.getForm().getFieldInput("FORM_PROXY_CHECK")
|
||||||
.addListener(SWT.Selection, event -> formHandle.process(
|
.addListener(SWT.Selection, event -> formHandle.process(
|
||||||
PROXY_ATTRIBUTES::contains,
|
PROXY_ATTRIBUTES::contains,
|
||||||
ffa -> {
|
ffa -> {
|
||||||
boolean selected = ((Button) event.widget).getSelection();
|
final boolean selected = ((Button) event.widget).getSelection();
|
||||||
ffa.setVisible(selected);
|
ffa.setVisible(selected);
|
||||||
if (!selected) {
|
if (!selected) {
|
||||||
ffa.resetError();
|
ffa.resetError();
|
||||||
ffa.setStringValue("");
|
ffa.setStringValue("");
|
||||||
}
|
}
|
||||||
}
|
}));
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// propagate content actions to action-pane
|
// propagate content actions to action-pane
|
||||||
|
|
|
@ -51,7 +51,6 @@ import ch.ethz.seb.sebserver.gui.table.ColumnDefinition;
|
||||||
import ch.ethz.seb.sebserver.gui.table.ColumnDefinition.TableFilterAttribute;
|
import ch.ethz.seb.sebserver.gui.table.ColumnDefinition.TableFilterAttribute;
|
||||||
import ch.ethz.seb.sebserver.gui.table.TableFilter.CriteriaType;
|
import ch.ethz.seb.sebserver.gui.table.TableFilter.CriteriaType;
|
||||||
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
|
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
|
||||||
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.CustomVariant;
|
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
@Component
|
@Component
|
||||||
|
@ -172,8 +171,7 @@ public class MonitoringClientConnection implements TemplateComposer {
|
||||||
widgetFactory.addFormSubContextHeader(
|
widgetFactory.addFormSubContextHeader(
|
||||||
content,
|
content,
|
||||||
EVENT_LIST_TITLE_KEY,
|
EVENT_LIST_TITLE_KEY,
|
||||||
EVENT_LIST_TITLE_TOOLTIP_KEY
|
EVENT_LIST_TITLE_TOOLTIP_KEY);
|
||||||
);
|
|
||||||
|
|
||||||
final PageService.PageActionBuilder actionBuilder = this.pageService
|
final PageService.PageActionBuilder actionBuilder = this.pageService
|
||||||
.pageActionBuilder(
|
.pageActionBuilder(
|
||||||
|
|
|
@ -74,8 +74,6 @@ public class UserActivityLogs implements TemplateComposer {
|
||||||
new LocTextKey("sebserver.userlogs.form.user");
|
new LocTextKey("sebserver.userlogs.form.user");
|
||||||
private static final LocTextKey FORM_DATE_TEXT_KEY =
|
private static final LocTextKey FORM_DATE_TEXT_KEY =
|
||||||
new LocTextKey("sebserver.userlogs.form.dateTime");
|
new LocTextKey("sebserver.userlogs.form.dateTime");
|
||||||
private static final LocTextKey FORM_DETAILS_DATE_TEXT_KEY =
|
|
||||||
new LocTextKey("sebserver.userlogs.form.dateTime");
|
|
||||||
private static final LocTextKey FORM_ACTIVITY_TEXT_KEY =
|
private static final LocTextKey FORM_ACTIVITY_TEXT_KEY =
|
||||||
new LocTextKey("sebserver.userlogs.form.activityType");
|
new LocTextKey("sebserver.userlogs.form.activityType");
|
||||||
private static final LocTextKey FORM_ENTITY_TYPE_TEXT_KEY =
|
private static final LocTextKey FORM_ENTITY_TYPE_TEXT_KEY =
|
||||||
|
@ -85,7 +83,6 @@ public class UserActivityLogs implements TemplateComposer {
|
||||||
private static final LocTextKey FORM_MESSAGE_TEXT_KEY =
|
private static final LocTextKey FORM_MESSAGE_TEXT_KEY =
|
||||||
new LocTextKey("sebserver.userlogs.form.message");
|
new LocTextKey("sebserver.userlogs.form.message");
|
||||||
|
|
||||||
|
|
||||||
private final TableFilterAttribute institutionFilter;
|
private final TableFilterAttribute institutionFilter;
|
||||||
private final TableFilterAttribute userNameFilter =
|
private final TableFilterAttribute userNameFilter =
|
||||||
new TableFilterAttribute(CriteriaType.TEXT, UserActivityLog.FILTER_ATTR_USER_NAME);
|
new TableFilterAttribute(CriteriaType.TEXT, UserActivityLog.FILTER_ATTR_USER_NAME);
|
||||||
|
@ -274,7 +271,7 @@ public class UserActivityLogs implements TemplateComposer {
|
||||||
userActivityLog.entityId))
|
userActivityLog.entityId))
|
||||||
.addField(FormBuilder.text(
|
.addField(FormBuilder.text(
|
||||||
Domain.USER_ACTIVITY_LOG.ATTR_TIMESTAMP,
|
Domain.USER_ACTIVITY_LOG.ATTR_TIMESTAMP,
|
||||||
FORM_DETAILS_DATE_TEXT_KEY,
|
FORM_DATE_TEXT_KEY,
|
||||||
this.widgetFactory.getI18nSupport()
|
this.widgetFactory.getI18nSupport()
|
||||||
.formatDisplayDateTime(Utils.toDateTimeUTC(userActivityLog.timestamp)) + " " +
|
.formatDisplayDateTime(Utils.toDateTimeUTC(userActivityLog.timestamp)) + " " +
|
||||||
this.i18nSupport.getUsersTimeZoneTitleSuffix()))
|
this.i18nSupport.getUsersTimeZoneTitleSuffix()))
|
||||||
|
|
|
@ -84,7 +84,7 @@ public enum ActionDefinition {
|
||||||
new LocTextKey("sebserver.useraccount.action.new"),
|
new LocTextKey("sebserver.useraccount.action.new"),
|
||||||
ImageIcon.USER,
|
ImageIcon.USER,
|
||||||
PageStateDefinitionImpl.USER_ACCOUNT_EDIT,
|
PageStateDefinitionImpl.USER_ACCOUNT_EDIT,
|
||||||
ActionCategory.FORM.LIST_VARIA),
|
ActionCategory.LIST_VARIA),
|
||||||
USER_ACCOUNT_VIEW_FROM_LIST(
|
USER_ACCOUNT_VIEW_FROM_LIST(
|
||||||
new LocTextKey("sebserver.useraccount.action.view"),
|
new LocTextKey("sebserver.useraccount.action.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
|
|
Loading…
Reference in a new issue