-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feature/password-reset
* origin/master: (54 commits) PRV getObject() parameterization fixes + cleanup around touched classes Add first simulation report tests Fix TestImportRecon Add more sim tests into TestMultiResource Fix the build, sorry for that Fix multi-resource simulation scenarios simulation ui, changes panel now works with one or more object deltas simulation ui, changes panel cleanup change step with basic setting for construction to selecting resource object types (role wizard) CSV report tests: runTest extracted higher as testClassicExport() audit log icon for menu OperationPerformanceInformation: added toString for debug purposes report script errors state the name of subreport/column clearly now simulation ui, related objects widget paging and css fixes + added currently displayed object first if needed simulation ui, visualization container expand/collapse simulation ui, visualization panels implementation started & checkstyle fix simulation ui, continuous code cleanup simulation ui, new changes panel implementation started CollectionExportController: fixed second evaluation of asRow subreport.. crazy redirects fix (one bean was not serializable) ...
- Loading branch information
Showing
231 changed files
with
6,973 additions
and
3,124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...in-gui/src/main/java/com/evolveum/midpoint/gui/api/component/progressbar/ProgressBar.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package com.evolveum.midpoint.gui.api.component.progressbar; | ||
|
||
import com.evolveum.midpoint.util.LocalizableMessage; | ||
|
||
import java.io.Serializable; | ||
|
||
public class ProgressBar implements Serializable { | ||
|
||
public enum State { | ||
|
||
SUCCESS("bg-success"), | ||
INFO("bg-info"), | ||
DANGER("bg-danger"), | ||
WARNINIG("bg-warning"), | ||
SECONDARY("bg-secondary"), | ||
PRIMARY("bg-primary"); | ||
|
||
private String cssClass; | ||
|
||
State(String cssClass) { | ||
this.cssClass = cssClass; | ||
} | ||
|
||
public String getCssClass() { | ||
return cssClass; | ||
} | ||
} | ||
|
||
private double value; | ||
|
||
private State state; | ||
|
||
private LocalizableMessage text; | ||
|
||
public ProgressBar(double value, State state) { | ||
this(value, state, null); | ||
} | ||
|
||
public ProgressBar(double value, State state, LocalizableMessage text) { | ||
this.value = value; | ||
this.state = state; | ||
this.text = text; | ||
} | ||
|
||
public double getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(double value) { | ||
this.value = value; | ||
} | ||
|
||
public State getState() { | ||
return state; | ||
} | ||
|
||
public void setState(State state) { | ||
this.state = state; | ||
} | ||
|
||
public LocalizableMessage getText() { | ||
return text; | ||
} | ||
|
||
public void setText(LocalizableMessage text) { | ||
this.text = text; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...i/src/main/java/com/evolveum/midpoint/gui/api/component/progressbar/ProgressBarPanel.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- | ||
~ Copyright (c) 2016 Evolveum | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
<wicket:panel> | ||
<div class="progress rounded mb-0"> | ||
<wicket:container wicket:id="bars"> | ||
<div class="progress-bar" wicket:id="bar"/> | ||
</wicket:container> | ||
</div> | ||
<div class="text-sm text-secondary" wicket:id="text"/> | ||
</wicket:panel> | ||
</html> |
88 changes: 88 additions & 0 deletions
88
...i/src/main/java/com/evolveum/midpoint/gui/api/component/progressbar/ProgressBarPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Copyright (c) 2016-2021 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.gui.api.component.progressbar; | ||
|
||
import java.util.List; | ||
|
||
import com.evolveum.midpoint.web.component.util.VisibleBehaviour; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
import org.apache.wicket.Component; | ||
import org.apache.wicket.behavior.AttributeAppender; | ||
import org.apache.wicket.markup.ComponentTag; | ||
import org.apache.wicket.markup.html.WebComponent; | ||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.markup.html.list.ListItem; | ||
import org.apache.wicket.markup.html.list.ListView; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.LoadableDetachableModel; | ||
|
||
import com.evolveum.midpoint.gui.api.component.BasePanel; | ||
import com.evolveum.midpoint.gui.api.util.WebComponentUtil; | ||
|
||
/** | ||
* @author semancik | ||
*/ | ||
public class ProgressBarPanel extends BasePanel<List<ProgressBar>> { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private static final String ID_BARS = "bars"; | ||
private static final String ID_BAR = "bar"; | ||
private static final String ID_TEXT = "text"; | ||
|
||
public ProgressBarPanel(String id, IModel<List<ProgressBar>> model) { | ||
super(id, model); | ||
|
||
initLayout(); | ||
} | ||
|
||
@Override | ||
protected void onComponentTag(ComponentTag tag) { | ||
super.onComponentTag(tag); | ||
|
||
checkComponentTag(tag, "div"); | ||
} | ||
|
||
private void initLayout() { | ||
ListView<ProgressBar> bars = new ListView<>(ID_BARS, getModelObject()) { | ||
@Override | ||
protected void populateItem(ListItem<ProgressBar> item) { | ||
item.add(createBar(ID_BAR, item.getModel())); | ||
} | ||
}; | ||
add(bars); | ||
|
||
IModel<String> textModel = createTextModel(getModel()); | ||
Label text = new Label(ID_TEXT, textModel); | ||
text.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(textModel.getObject()))); | ||
add(text); | ||
} | ||
|
||
private Component createBar(String id, IModel<ProgressBar> model) { | ||
WebComponent bar = new WebComponent(id); | ||
bar.add(AttributeAppender.append("class", () -> model.getObject().getState().getCssClass())); | ||
bar.add(AttributeAppender.append("style", () -> "width: " + model.getObject().getValue() + "%;")); | ||
|
||
return bar; | ||
} | ||
|
||
protected IModel<String> createTextModel(IModel<List<ProgressBar>> model) { | ||
return new LoadableDetachableModel<>() { | ||
|
||
@Override | ||
protected String load() { | ||
Object[] texts = model.getObject().stream() | ||
.filter(bar -> bar.getText() != null) | ||
.map(bar -> WebComponentUtil.translateMessage(bar.getText())) | ||
.filter(StringUtils::isNotEmpty) | ||
.toArray(); | ||
|
||
return StringUtils.joinWith(" / ", texts); | ||
} | ||
}; | ||
} | ||
} |
44 changes: 0 additions & 44 deletions
44
...i/src/main/java/com/evolveum/midpoint/gui/api/component/progressbar/ProgressbarPanel.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.