Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jul 8, 2021
2 parents b667337 + e713557 commit 48f44e2
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.evolveum.midpoint.schema.*;
import com.evolveum.midpoint.web.component.progress.ProgressReporter;

import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.page.admin.home.dto.MyCredentialsDto;
import com.evolveum.midpoint.web.page.self.component.SecurityQuestionsPanel;
import com.evolveum.midpoint.web.security.MidPointApplication;
Expand Down Expand Up @@ -69,9 +70,9 @@ public abstract class PageAbstractSelfCredentials extends PageSelf {
private static final String DOT_CLASS = PageSelfCredentials.class.getName() + ".";
private static final String OPERATION_SAVE_PASSWORD = DOT_CLASS + "savePassword";
private static final String OPERATION_CHECK_PASSWORD = DOT_CLASS + "checkPassword";
private static final String OPERATION_SAVE_QUESTIONS = DOT_CLASS + "saveSecurityQuestions";

private final IModel<MyCredentialsDto> model;
private boolean savedPassword = false;

public PageAbstractSelfCredentials() {
model = new LoadableModel<MyCredentialsDto>(false) {
Expand Down Expand Up @@ -157,6 +158,7 @@ protected void onSubmit(AjaxRequestTarget target) {
onSavePerformed(target);
}
};
save.add(new VisibleBehaviour(() -> !this.savedPassword));
mainForm.setDefaultButton(save);
mainForm.add(save);

Expand Down Expand Up @@ -283,6 +285,10 @@ protected void onSavePerformed(AjaxRequestTarget target) {
info(createStringResource("PageAbstractSelfCredentials.message.resultInTable").getString());
}
}
if (!result.isError()) {
this.savedPassword = true;
target.add(getSaveButton());
}
}

finishChangePassword(result, target, showFeedback);
Expand All @@ -296,6 +302,10 @@ protected Component getActualTabPanel(){
return get(createComponentPath(ID_MAIN_FORM, ID_TAB_PANEL, TabbedPanel.TAB_PANEL_ID));
}

protected Component getSaveButton(){
return get(createComponentPath(ID_MAIN_FORM, ID_SAVE_BUTTON));
}

protected void setNullEncryptedPasswordData() {
MyPasswordsDto dto = getPasswordDto();
ProtectedStringType password = dto.getPassword();
Expand Down

0 comments on commit 48f44e2

Please sign in to comment.