Skip to content

Commit

Permalink
small clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Mar 31, 2023
1 parent 885de53 commit e55ff6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import com.evolveum.midpoint.authentication.api.authorization.PageDescriptor;
import com.evolveum.midpoint.authentication.api.authorization.Url;

import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.TabbedPanel;
import com.evolveum.midpoint.web.component.form.MidpointForm;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
Expand Down Expand Up @@ -67,8 +65,7 @@ protected void onInitialize() {
private void initLayout() {
Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);

List<ITab> tabs = new ArrayList<>();
tabs.addAll(createTabs());
List<ITab> tabs = new ArrayList<>(createTabs());

TabbedPanel<ITab> credentialsTabPanel = WebComponentUtil.createTabPanel(ID_TAB_PANEL, this, tabs, null);
credentialsTabPanel.setOutputMarkupId(true);
Expand All @@ -86,7 +83,7 @@ private Collection<? extends ITab> createTabs(){

@Override
public WebMarkupContainer getPanel(String panelId) {
return new PropagatePasswordPanel(panelId, new LoadableDetachableModel<FocusType>() {
return new PropagatePasswordPanel<>(panelId, new LoadableDetachableModel<>() {
private static final long serialVersionUID = 1L;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.evolveum.midpoint.schema.util.MiscSchemaUtil;

import com.evolveum.midpoint.authentication.api.util.AuthUtil;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.AjaxSubmitButton;
import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType;

Expand Down Expand Up @@ -127,7 +126,7 @@ private PasswordQuestionsDto loadPageModel() {
//rest of the questions
int difference = questionSize - userQuestionList.size();
dto.getActualQuestionAnswers().addAll(executeAddingQuestions(difference, userQuestionList.size(), questionsDef));
} else if (questionSize <= userQuestionList.size()) {
} else {
//QUESTION NUMBER SMALLER THAN QUESTION LIST OR EQUALS TO QUESTION LIST
dto.getActualQuestionAnswers().addAll(executePasswordQuestionsAndAnswers(userQuestionList, questionsDef, 0));
}
Expand Down Expand Up @@ -170,7 +169,7 @@ public List<SecurityQuestionAnswerDTO> createUsersSecurityQuestionsList(PrismObj
}

public void initLayout() {
add(new ListView<SecurityQuestionAnswerDTO>(ID_SECURITY_QUESTIONS_PANEL, getModelObject().getActualQuestionAnswers()) {
add(new ListView<>(ID_SECURITY_QUESTIONS_PANEL, getModelObject().getActualQuestionAnswers()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<SecurityQuestionAnswerDTO> item) {
Expand Down Expand Up @@ -283,14 +282,11 @@ public void onSavePerformed(AjaxRequestTarget target) {
List<SecurityQuestionAnswerType> answerTypeList = new ArrayList<>();

try {
int listnum = 0;
for (SecurityQuestionAnswerDTO answerDto : getModelObject().getActualQuestionAnswers()) {
SecurityQuestionAnswerType answerType = new SecurityQuestionAnswerType();
ProtectedStringType answer = new ProtectedStringType();

if (StringUtils.isEmpty(answerDto.getPwdAnswer())) {
// warn(getString("SecurityQuestionsPanel.emptySecurityQuestionAnswerFiled"));
// target.add(getPageBase().getFeedbackPanel());
continue;
}
answer.setClearValue(answerDto.getPwdAnswer());
Expand All @@ -301,8 +297,6 @@ public void onSavePerformed(AjaxRequestTarget target) {

answerType.setQuestionIdentifier(answerDto.getPwdQuestionIdentifier());
answerTypeList.add(answerType);
listnum++;

}

// fill in answerType data here
Expand Down

0 comments on commit e55ff6d

Please sign in to comment.