Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
Johaney-s committed Dec 6, 2021
2 parents cd932bd + 0f1d3ad commit c4b9932
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 3 deletions.
1 change: 0 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
}],
["@semantic-release/github", {
"assets": [
{"path": "perun-wui-admin/target/perun-wui-admin.war"},
{"path": "perun-wui-registrar/target/perun-wui-registrar.war"},
{"path": "perun-wui-consolidator/target/perun-wui-consolidator.war"},
{"path": "perun-wui-pwdreset/target/perun-wui-pwdreset.war"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ public interface PerunRegistrarTranslation extends PerunTranslation {
@DefaultMessage("Passwords doesn`t match!")
public String passMismatch();

@DefaultMessage("Confirm password!")
public String secondPassEmpty();

@DefaultMessage("Enter password")
public String enterPassword();

@DefaultMessage("Confirm password")
public String confirmPassword();

@DefaultMessage("Checking...")
public String checkingLogin();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ protected Widget initWidget() {
ExtendedPasswordTextBox box = new ExtendedPasswordTextBox();
box.setMaxLength(MAX_LENGTH);
box.addStyleName("passwordFormItemFirst");
box.setPlaceholder(getTranslation().enterPassword());

ExtendedPasswordTextBox box2 = new ExtendedPasswordTextBox();
box2.setMaxLength(MAX_LENGTH);
box2.addStyleName("passwordFormItemLast");
box2.setPlaceholder(getTranslation().confirmPassword());

if (getItemData().getFormItem().getRegex() != null) {
box.setRegex(getItemData().getFormItem().getRegex());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public boolean validateLocal(Password password) {

// check typos
if (!password.getPassword().getValue().equals(password.getPasswordSecond().getValue())) {
if (isNullOrEmpty(password.getPasswordSecond().getValue())) {
setResult(Result.SECOND_PASSWORD_EMPTY);
password.setStatus(getTransl().secondPassEmpty(), ValidationState.WARNING);
return false;
}
setResult(Result.PASSWORD_MISSMATCH);
password.setStatus(getTransl().passMismatch(), ValidationState.ERROR);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public boolean validateLocal(Password password) {
}

if (!password.getPassword().getValue().equals(password.getPasswordSecond().getValue())) {
if (isNullOrEmpty(password.getPasswordSecond().getValue())) {
setResult(Result.SECOND_PASSWORD_EMPTY);
password.setStatus(getTransl().secondPassEmpty(), ValidationState.WARNING);
return false;
}
setResult(Result.PASSWORD_MISSMATCH);
password.setStatus(getTransl().passMismatch(), ValidationState.ERROR);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ enum Result {
CANT_CHECK_LOGIN,
EMPTY_PASSWORD,
PASSWORD_MISSMATCH,
MUST_VALIDATE_EMAIL
MUST_VALIDATE_EMAIL,
SECOND_PASSWORD_EMPTY
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ incorrectEmail=Neplatný formát e-mailové adresy!
checkAndSubmit=Zkontrolovat a odeslat formulář
passEmpty=Heslo <b>nesmí být prázdné!</b>
passMismatch=Hesla se neshodují!
secondPassEmpty=Potvrďte heslo!
enterPassword=Zadejte heslo
confirmPassword=Potvrďte heslo
checkingLogin=Kontroluji...
loginNotAvailable=Uživatelské jméno <b>není dostupné!</b> Zvolte prosím jiné.
checkingLoginFailed=Kontrola dostupnosti selhala! Prosím, zkontrolujte svoje internetové připojení a zkuste to znovu.
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<!-- PERUN MODULES -->
<modules>
<module>perun-wui-core</module>
<module>perun-wui-admin</module>
<module>perun-wui-registrar</module>
<module>perun-wui-consolidator</module>
<module>perun-wui-pwdreset</module>
Expand Down

0 comments on commit c4b9932

Please sign in to comment.