SEBSERV-495 fixed minor errors

This commit is contained in:
anhefti 2023-12-21 13:45:40 +01:00
parent c301016d87
commit cfa9fba9cb
3 changed files with 19 additions and 1 deletions

View file

@ -124,6 +124,13 @@ public class PasswordFieldBuilder implements InputFieldBuilder {
return;
}
if (pwd.length() > 255) {
passwordInputField.showError(viewContext
.getI18nSupport()
.getText(new LocTextKey("sebserver.form.validation.fieldError.size.max", 256)));
return;
}
if (!pwd.equals(confirm)) {
passwordInputField.showError(viewContext
.getI18nSupport()

View file

@ -68,6 +68,9 @@ public class PasswordConfirmInput extends Composite {
}
public CharSequence getValue() {
if (!checkError()) {
return null;
}
final CharSequence value = password.getValue();
if (StringUtils.isNotBlank(value)) {
return cryptor.encrypt(value).getOr(value);
@ -91,10 +94,17 @@ public class PasswordConfirmInput extends Composite {
final CharSequence pwd = this.password.getValue();
final CharSequence confirm = this.confirm.getValue();
if (pwd == null && confirm == null) {
if (pwd == null) {
return false;
}
if (pwd.length() > 255) {
final LocTextKey errmsg = new LocTextKey("sebserver.form.validation.fieldError.size.max", 256);
errorLabel.setText(widgetFactory.getI18nSupport().getText(errmsg));
errorLabel.setVisible(true);
return true;
}
if (!pwd.equals(confirm)) {
errorLabel.setText(widgetFactory.getI18nSupport().getText(VAL_CONFIRM_PWD_TEXT_KEY));
errorLabel.setVisible(true);

View file

@ -98,6 +98,7 @@ sebserver.form.validation.error.message=There is missing or incorrect form data.
sebserver.form.validation.fieldError.size=The size must be between {3} and {4}
sebserver.form.validation.fieldError.name=The Name is mandatory and must have a size between {3} and {4} character
sebserver.form.validation.fieldError.urlSuffix=The URL Suffix must have a size between {3} and {4} character
sebserver.form.validation.fieldError.size.max=The size must be less than {0} character
sebserver.form.validation.fieldError.notNull=This field is mandatory
sebserver.form.validation.fieldError.name.notunique=This name is already in use. Please choose another one.
sebserver.form.validation.fieldError.username.notunique=This Username is already in use. Please choose another one.