fixed some GUI issues

This commit is contained in:
anhefti 2021-01-27 17:24:30 +01:00
parent 4734b1a3b3
commit 8bf00bf413
2 changed files with 26 additions and 11 deletions

View file

@ -102,6 +102,12 @@ public class SEBClientConfigForm implements TemplateComposer {
SEBClientConfig.ATTR_FALLBACK_PASSWORD_CONFIRM, SEBClientConfig.ATTR_FALLBACK_PASSWORD_CONFIRM,
SEBClientConfig.ATTR_QUIT_PASSWORD, SEBClientConfig.ATTR_QUIT_PASSWORD,
SEBClientConfig.ATTR_QUIT_PASSWORD_CONFIRM)); SEBClientConfig.ATTR_QUIT_PASSWORD_CONFIRM));
private static final Set<String> FALLBACK_RESET_ATTRIBUTES = new HashSet<>(Arrays.asList(
SEBClientConfig.ATTR_FALLBACK_START_URL,
SEBClientConfig.ATTR_FALLBACK_PASSWORD,
SEBClientConfig.ATTR_FALLBACK_PASSWORD_CONFIRM,
SEBClientConfig.ATTR_QUIT_PASSWORD,
SEBClientConfig.ATTR_QUIT_PASSWORD_CONFIRM));
private static final String FALLBACK_DEFAULT_TIME = String.valueOf(30 * Constants.SECOND_IN_MILLIS); private static final String FALLBACK_DEFAULT_TIME = String.valueOf(30 * Constants.SECOND_IN_MILLIS);
private static final String FALLBACK_DEFAULT_ATTEMPTS = String.valueOf(5); private static final String FALLBACK_DEFAULT_ATTEMPTS = String.valueOf(5);
@ -306,16 +312,23 @@ public class SEBClientConfigForm implements TemplateComposer {
if (!isReadonly) { if (!isReadonly) {
formHandle.getForm().getFieldInput(SEBClientConfig.ATTR_FALLBACK) formHandle.getForm().getFieldInput(SEBClientConfig.ATTR_FALLBACK)
.addListener(SWT.Selection, event -> formHandle.process( .addListener(SWT.Selection, event -> {
FALLBACK_ATTRIBUTES::contains, formHandle.process(
ffa -> { FALLBACK_ATTRIBUTES::contains,
final boolean selected = ((Button) event.widget).getSelection(); ffa -> {
ffa.setVisible(selected); final boolean selected = ((Button) event.widget).getSelection();
if (!selected && ffa.hasError()) { ffa.setVisible(selected);
ffa.resetError(); });
ffa.setStringValue(StringUtils.EMPTY); formHandle.process(
} FALLBACK_RESET_ATTRIBUTES::contains,
})); ffa -> {
final boolean selected = ((Button) event.widget).getSelection();
if (!selected) {
ffa.resetError();
ffa.setStringValue(StringUtils.EMPTY);
}
});
});
} }
final UrlLauncher urlLauncher = RWT.getClient().getService(UrlLauncher.class); final UrlLauncher urlLauncher = RWT.getClient().getService(UrlLauncher.class);

View file

@ -659,7 +659,7 @@ public class ResourceService {
public List<Tuple<String>> getExamConfigTemplateResources() { public List<Tuple<String>> getExamConfigTemplateResources() {
final UserInfo userInfo = this.currentUser.get(); final UserInfo userInfo = this.currentUser.get();
return this.restService.getBuilder(GetExamConfigNodes.class) final List<Tuple<String>> collect = this.restService.getBuilder(GetExamConfigNodes.class)
.withQueryParam(Entity.FILTER_ATTR_INSTITUTION, String.valueOf(userInfo.getInstitutionId())) .withQueryParam(Entity.FILTER_ATTR_INSTITUTION, String.valueOf(userInfo.getInstitutionId()))
.withQueryParam(ConfigurationNode.FILTER_ATTR_TYPE, ConfigurationType.TEMPLATE.name()) .withQueryParam(ConfigurationNode.FILTER_ATTR_TYPE, ConfigurationType.TEMPLATE.name())
.call() .call()
@ -668,6 +668,8 @@ public class ResourceService {
.map(node -> new Tuple<>(node.getModelId(), node.name)) .map(node -> new Tuple<>(node.getModelId(), node.name))
.sorted(RESOURCE_COMPARATOR) .sorted(RESOURCE_COMPARATOR)
.collect(Collectors.toList()); .collect(Collectors.toList());
collect.add(0, new Tuple<>(null, ""));
return collect;
} }
public List<Tuple<String>> sebRestrictionWhiteListResources() { public List<Tuple<String>> sebRestrictionWhiteListResources() {