Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Sep 28, 2022
2 parents 72b2d2a + e24bb4c commit 03f082d
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ protected void searchPerformed(AjaxRequestTarget target){

private void deletePerformed(AjaxRequestTarget target) {
getModelObject().setVisible(false);
getModelObject().setValue(getModelObject().getDefaultValue());
SearchPanel panel = findParent(SearchPanel.class);
panel.displayedSearchItemsModelReset();
panel.refreshSearchForm(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public VariablesMap getFilterVariables(VariablesMap defaultVariables, PageBase p
VariablesMap variables = defaultVariables == null ? new VariablesMap() : defaultVariables;
List<AbstractSearchItemWrapper> items = getItems();
items.forEach(item -> {
if (StringUtils.isNotEmpty(item.getParameterName()) && item.isApplyFilter(SearchBoxModeType.BASIC)) {
if (StringUtils.isNotEmpty(item.getParameterName())) {
Object parameterValue = item.getValue() != null ? item.getValue().getValue() : null;
TypedValue value = new TypedValue(parameterValue, item.getParameterValueType());
variables.put(item.getParameterName(), value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ public static <C extends Containerable> PropertySearchItemWrapper createPropert
if (searchItemWrapper instanceof DateSearchItemWrapper) {
((DateSearchItemWrapper) searchItemWrapper).setInterval(false);
}
searchItemWrapper.setCanConfigure(false);
}

if (item.isVisibleByDefault() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@
<wicket:panel>
<div class="d-flex flex-wrap gap-2">
<div class="col-md-5">
<label class="col-form-label">
<wicket:message key="ChangePasswordPanel.currentPassword"/>
</label>
<div class="">
<div class="password-parent" style="height:30px; position: relative;">
<div class="col-md-12" style="padding: 0px !important;">
<input class="form-control form-control-sm" type="password" autocomplete="new-password" wicket:id="currentPassword" autofocus style="padding-right: 26px;"/>
</div>
<div style="position: absolute; right: 8px; top: 8px; z-index: 5;">
<i class="fa fa-eye" style="float:right;cursor: pointer; color: #555555;" onclick="MidPointTheme.showPassword(this)"></i>
<wicket:enclosure child="currentPassword">
<label class="col-form-label">
<wicket:message key="ChangePasswordPanel.currentPassword"/>
</label>
<div class="">
<div class="password-parent" style="height:30px; position: relative;">
<div class="col-md-12" style="padding: 0px !important;">
<input class="form-control form-control-sm" type="password" autocomplete="new-password" wicket:id="currentPassword" autofocus style="padding-right: 26px;"/>
</div>
<div style="position: absolute; right: 8px; top: 8px; z-index: 5;">
<i class="fa fa-eye" style="float:right;cursor: pointer; color: #555555;" onclick="MidPointTheme.showPassword(this)"></i>
</div>
</div>
</div>
</div>
</wicket:enclosure>
<label class="col-form-label" wicket:id="passwordLabel"/>
<div class="">
<div class="password-panel" wicket:id="passwordPanel"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.evolveum.midpoint.web.component.progress.ProgressReporter;
import com.evolveum.midpoint.web.component.util.EnableBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour;
import com.evolveum.midpoint.web.security.MidPointApplication;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
Expand Down Expand Up @@ -114,7 +115,19 @@ public void setObject(String value) {
PasswordTextField currentPasswordField =
new PasswordTextField(ID_CURRENT_PASSWORD_FIELD, currentPasswordModel);
currentPasswordField.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
currentPasswordField.add(new EnableBehaviour(() -> !savedPassword));
currentPasswordField.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;

@Override
public boolean isVisible() {
return isCheckOldPassword();
}

@Override
public boolean isEnabled() {
return !savedPassword;
}
});
currentPasswordField.setRequired(false);
currentPasswordField.setResetPassword(false);
currentPasswordField.setOutputMarkupId(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:extend>
<div class="mb-3" wicket:id="propagatePasswordCheckbox"/>
<div wicket:id="individualSystemsContainer" class="mb-3">
<div class="card card-outline card-secondary password-propagation">
<div class="card-header">
<wicket:message key="ChangePasswordPanel.individualSystems"/>
</div>
<div class="box-body">
<div wicket:id="individualSystemsTable"/>
<wicket:enclosure child="individualSystemsContainer">
<div class="mb-3" wicket:id="propagatePasswordCheckbox"/>
<div wicket:id="individualSystemsContainer" class="mb-3">
<div class="card card-outline card-secondary password-propagation">
<div class="card-header">
<wicket:message key="ChangePasswordPanel.individualSystems"/>
</div>
<div class="box-body">
<div wicket:id="individualSystemsTable"/>
</div>
</div>
</div>
</div>
</wicket:enclosure>
</wicket:extend>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ public void onUpdate(AjaxRequestTarget target) {

WebMarkupContainer individualSystemsContainer = new WebMarkupContainer(ID_INDIVIDUAL_SYSTEMS_CONTAINER);
individualSystemsContainer.setOutputMarkupId(true);
individualSystemsContainer.add(new VisibleBehaviour(() -> propagatePasswordCheckbox.getCheckboxModel().getObject() != null
&& propagatePasswordCheckbox.getCheckboxModel().getObject() || showResultInTable));
individualSystemsContainer.add(new VisibleBehaviour(this::isIndividualSystemsContainerVisible));
add(individualSystemsContainer);

provider = new ListDataProvider<>(PropagatePasswordPanel.this, getShadowListModel());
Expand All @@ -122,6 +121,17 @@ protected boolean hideFooterIfSinglePage() {
individualSystemsContainer.add(provisioningTable);
}

private boolean isIndividualSystemsContainerVisible() {
CheckBoxPanel propagateCheckBox = getPropagatePasswordCheckbox();
return shouldLoadAccounts() &&
(propagateCheckBox.getCheckboxModel().getObject() != null
&& propagateCheckBox.getCheckboxModel().getObject() || showResultInTable);
}

private CheckBoxPanel getPropagatePasswordCheckbox() {
return (CheckBoxPanel) get(ID_PROPAGATE_PASSWORD_CHECKBOX);
}

private IModel<List<PasswordAccountDto>> getShadowListModel() {
return new LoadableDetachableModel<>() {
@Override
Expand Down

0 comments on commit 03f082d

Please sign in to comment.