Skip to content

Commit

Permalink
Implemented MID-3288: Add explanation text for options
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Dec 7, 2017
1 parent dc9f0c5 commit 55db26a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 60 deletions.
Expand Up @@ -22,39 +22,39 @@
<h3 class="box-title"><wicket:message key="ExecuteChangeOptionsPanel.options"/></h3>
</div>
<div class="box-body">
<div class="option-checkbox">
<div class="option-checkbox" wicket:id="forceContainer">
<div class="checkbox">
<label>
<input type="checkbox" wicket:id="force">
<wicket:message key="ExecuteChangeOptionsPanel.label.force"/>
</label>
</div>
</div>
<div class="option-checkbox" wicket:id="reconcileLabel">
<div class="option-checkbox" wicket:id="reconcileContainer">
<div class="checkbox">
<label>
<input type="checkbox" wicket:id="reconcile">
<wicket:message key="ExecuteChangeOptionsPanel.label.reconcile"/>
</label>
</div>
</div>
<div class="option-checkbox" wicket:id="reconcileAffectedLabel">
<div class="option-checkbox" wicket:id="reconcileAffectedContainer">
<div class="checkbox">
<label>
<input type="checkbox" wicket:id="reconcileAffected">
<wicket:message key="ExecuteChangeOptionsPanel.label.reconcileAffected"/>
</label>
</div>
</div>
<div class="option-checkbox">
<div class="option-checkbox" wicket:id="executeAfterAllApprovalsContainer">
<div class="checkbox">
<label>
<input type="checkbox" wicket:id="executeAfterAllApprovals">
<wicket:message key="ExecuteChangeOptionsPanel.label.executeAfterAllApprovals"/>
</label>
</div>
</div>
<div class="option-checkbox" wicket:id="keepDisplayingResultsLabel">
<div class="option-checkbox" wicket:id="keepDisplayingResultsContainer">
<div class="checkbox">
<label>
<input type="checkbox" wicket:id="keepDisplayingResults">
Expand Down
Expand Up @@ -17,7 +17,7 @@
package com.evolveum.midpoint.web.page.admin.users.component;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.model.IModel;
Expand All @@ -30,17 +30,25 @@ public class ExecuteChangeOptionsPanel extends BasePanel<ExecuteChangeOptionsDto
private static final long serialVersionUID = 1L;

private static final String ID_FORCE = "force";
private static final String ID_FORCE_CONTAINER = "forceContainer";
private static final String ID_RECONCILE = "reconcile";
private static final String ID_RECONCILE_LABEL = "reconcileLabel";
private static final String ID_RECONCILE_CONTAINER = "reconcileContainer";
private static final String ID_RECONCILE_AFFECTED = "reconcileAffected";
private static final String ID_RECONCILE_AFFECTED_LABEL = "reconcileAffectedLabel";
private static final String ID_RECONCILE_AFFECTED_CONTAINER = "reconcileAffectedContainer";
private static final String ID_EXECUTE_AFTER_ALL_APPROVALS = "executeAfterAllApprovals";
private static final String ID_EXECUTE_AFTER_ALL_APPROVALS_CONTAINER = "executeAfterAllApprovalsContainer";
private static final String ID_KEEP_DISPLAYING_RESULTS = "keepDisplayingResults";
private static final String ID_KEEP_DISPLAYING_RESULTS_LABEL = "keepDisplayingResultsLabel";
private static final String ID_KEEP_DISPLAYING_RESULTS_CONTAINER = "keepDisplayingResultsContainer";

private boolean showReconcile;
private boolean showReconcileAffected;
private boolean showKeepDisplayingResults;
private static final String FORCE_HELP = "ExecuteChangeOptionsPanel.label.force.help";
private static final String RECONCILE_HELP = "ExecuteChangeOptionsPanel.label.reconcile.help";
private static final String RECONCILE_AFFECTED_HELP = "ExecuteChangeOptionsPanel.label.reconcileAffected.help";
private static final String EXECUTE_AFTER_ALL_APPROVALS_HELP = "ExecuteChangeOptionsPanel.label.executeAfterAllApprovals.help";
private static final String KEEP_DISPLAYING_RESULTS_HELP = "ExecuteChangeOptionsPanel.label.keepDisplayingResults.help";

private final boolean showReconcile;
private final boolean showReconcileAffected;
private final boolean showKeepDisplayingResults;

public ExecuteChangeOptionsPanel(String id, IModel<ExecuteChangeOptionsDto> model, boolean showReconcile, boolean showReconcileAffected) {
super(id, model);
Expand All @@ -59,60 +67,32 @@ public ExecuteChangeOptionsPanel(String id, IModel<ExecuteChangeOptionsDto> mode
}

private void initLayout() {
CheckBox force = new CheckBox(ID_FORCE,
new PropertyModel<Boolean>(getModel(), ExecuteChangeOptionsDto.F_FORCE));
add(force);

WebMarkupContainer reconcileLabel = new WebMarkupContainer(ID_RECONCILE_LABEL);
reconcileLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;

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

});
add(reconcileLabel);

CheckBox reconcile = new CheckBox(ID_RECONCILE,
new PropertyModel<Boolean>(getModel(), ExecuteChangeOptionsDto.F_RECONCILE));
reconcileLabel.add(reconcile);

WebMarkupContainer reconcileAffectedLabel = new WebMarkupContainer(ID_RECONCILE_AFFECTED_LABEL);
reconcileAffectedLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
CheckBox force = new CheckBox(ID_FORCE, new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_FORCE));
createContainer(ID_FORCE_CONTAINER, force, true, FORCE_HELP);

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

});
add(reconcileAffectedLabel);
CheckBox reconcile = new CheckBox(ID_RECONCILE, new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_RECONCILE));
createContainer(ID_RECONCILE_CONTAINER, reconcile, showReconcile, RECONCILE_HELP);

CheckBox reconcileAffected = new CheckBox(ID_RECONCILE_AFFECTED,
new PropertyModel<Boolean>(getModel(), ExecuteChangeOptionsDto.F_RECONCILE_AFFECTED));
reconcileAffectedLabel.add(reconcileAffected);
new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_RECONCILE_AFFECTED));
createContainer(ID_RECONCILE_AFFECTED_CONTAINER, reconcileAffected, showReconcileAffected, RECONCILE_AFFECTED_HELP);

CheckBox executeAfterAllApprovals = new CheckBox(ID_EXECUTE_AFTER_ALL_APPROVALS,
new PropertyModel<Boolean>(getModel(), ExecuteChangeOptionsDto.F_EXECUTE_AFTER_ALL_APPROVALS));
add(executeAfterAllApprovals);

WebMarkupContainer keepDisplayingResultsLabel = new WebMarkupContainer(ID_KEEP_DISPLAYING_RESULTS_LABEL);
keepDisplayingResultsLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;

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

});
add(keepDisplayingResultsLabel);
new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_EXECUTE_AFTER_ALL_APPROVALS));
createContainer(ID_EXECUTE_AFTER_ALL_APPROVALS_CONTAINER, executeAfterAllApprovals, true, EXECUTE_AFTER_ALL_APPROVALS_HELP);

CheckBox keepDisplayingResults = new CheckBox(ID_KEEP_DISPLAYING_RESULTS,
new PropertyModel<Boolean>(getModel(), ExecuteChangeOptionsDto.F_KEEP_DISPLAYING_RESULTS));
keepDisplayingResultsLabel.add(keepDisplayingResults);
new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_KEEP_DISPLAYING_RESULTS));
createContainer(ID_KEEP_DISPLAYING_RESULTS_CONTAINER, keepDisplayingResults, showKeepDisplayingResults, KEEP_DISPLAYING_RESULTS_HELP);
}

private void createContainer(String containerId, CheckBox content, boolean show, String helpKey) {
WebMarkupContainer container = new WebMarkupContainer(containerId);
container.add(content);
if (show) {
container.add(new AttributeModifier("title", createStringResource(helpKey).getString()));
}
container.setVisible(show);
add(container);
}
}
Expand Up @@ -287,10 +287,18 @@ DropDownChoicePanel.empty=Choose one
DropDownChoicePanel.notDefined=Undefined
EmptyProcessDetailsPanel.message=Process details are not available.
ExecuteChangeOptionsPanel.label.executeAfterAllApprovals=Execute after all approvals
ExecuteChangeOptionsPanel.label.executeAfterAllApprovals.help=If checked, execution of changes is delayed until all the required approvals are gathered. \
If unchecked, partial changes are executed as soon as they are approved - or immediately, if no approval is required.
ExecuteChangeOptionsPanel.label.force=Force
ExecuteChangeOptionsPanel.label.force.help=Force the operation even if it would otherwise fail due to an external failure. E.g. attempt to delete an account that no longer exists on resource may fail without a Force option. \
If this option is used then the operation is finished even if the account does not exist (meaning that - at least - shadow is removed from midPoint repository).
ExecuteChangeOptionsPanel.label.keepDisplayingResults=Keep displaying results
ExecuteChangeOptionsPanel.label.keepDisplayingResults.help=Should the execution results and operational statistics be displayed even after the operation completes? \
If not checked, the page with results and statistics will disappear automatically on operation completion.
ExecuteChangeOptionsPanel.label.reconcileAffected=Reconcile affected objects
ExecuteChangeOptionsPanel.label.reconcileAffected.help=Reconcile affected objects
ExecuteChangeOptionsPanel.label.reconcile=Reconcile
ExecuteChangeOptionsPanel.label.reconcile.help=Option to reconcile focus and all projections while executing changes.
ExecuteChangeOptionsPanel.options=Options
existenceFetchStrategy.nullValid=Choose One
ExportType.CSV=CSV
Expand Down

0 comments on commit 55db26a

Please sign in to comment.