minor bug fixes

This commit is contained in:
anhefti 2019-08-07 16:49:05 +02:00
parent 1e679317ee
commit ddc3a1ea17
4 changed files with 24 additions and 1 deletions

View file

@ -16,10 +16,12 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import ch.ethz.seb.sebserver.gbl.Constants;
import ch.ethz.seb.sebserver.gbl.api.EntityType;
import ch.ethz.seb.sebserver.gbl.api.POSTMapper;
import ch.ethz.seb.sebserver.gbl.model.Activatable;
import ch.ethz.seb.sebserver.gbl.model.Domain.INSTITUTION;
import ch.ethz.seb.sebserver.gbl.model.Entity;
import ch.ethz.seb.sebserver.gbl.model.GrantEntity;
@JsonIgnoreProperties(ignoreUnknown = true)
@ -115,6 +117,17 @@ public final class Institution implements GrantEntity, Activatable {
return this.active;
}
@Override
public Entity printSecureCopy() {
return new Institution(
this.id,
this.name,
this.urlSuffix,
Constants.EMPTY_NOTE,
this.themeName,
this.active);
}
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();

View file

@ -422,6 +422,11 @@ public final class Form implements FormBinding {
return;
}
if (errorMessage == null) {
resetError();
return;
}
if (!this.hasError) {
this.control.setData(RWT.CUSTOM_VARIANT, CustomVariant.ERROR.key);
this.errorLabel.setText("- " + errorMessage);

View file

@ -292,6 +292,11 @@ public class OAuth2AuthorizationContextHolder implements AuthorizationContextHol
@Override
public boolean hasError(final ClientHttpResponse response) throws IOException {
final boolean hasError = super.hasError(response);
if (hasError) {
return hasError;
}
final HttpStatus statusCode = HttpStatus.resolve(response.getRawStatusCode());
return (statusCode != null && statusCode.series() == HttpStatus.Series.SERVER_ERROR);
}

View file

@ -181,7 +181,7 @@ public final class ImageUpload extends Composite {
context.layout();
imageUpload.layout();
imageUpload.loadNewImage = false;
imageUpload.errorHandler.accept("");
imageUpload.errorHandler.accept(null);
}
}