Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/password-reset
Browse files Browse the repository at this point in the history
* 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
katkav committed Feb 17, 2023
2 parents 701b5d3 + 52717c8 commit 8445e5f
Show file tree
Hide file tree
Showing 231 changed files with 6,973 additions and 3,124 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -813,14 +813,14 @@ ij_groovy_align_multiline_binary_operation = false
ij_groovy_align_multiline_chained_methods = false
ij_groovy_align_multiline_extends_list = false
ij_groovy_align_multiline_for = true
ij_groovy_align_multiline_list_or_map = true
ij_groovy_align_multiline_list_or_map = false
ij_groovy_align_multiline_method_parentheses = false
ij_groovy_align_multiline_parameters = true
ij_groovy_align_multiline_parameters_in_calls = false
ij_groovy_align_multiline_resources = true
ij_groovy_align_multiline_ternary_operation = false
ij_groovy_align_multiline_throws_list = false
ij_groovy_align_named_args_in_map = true
ij_groovy_align_named_args_in_map = false
ij_groovy_align_throws_keyword = false
ij_groovy_array_initializer_new_line_after_left_brace = false
ij_groovy_array_initializer_right_brace_on_new_line = false
Expand Down
14 changes: 14 additions & 0 deletions gui/admin-gui/src/frontend/scss/midpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1814,3 +1814,17 @@ th.debug-list-buttons {
}
}
}

.simple-container {

& .simple-container-header {

padding: 0.75rem 0;

& .simple-container-title {
font-size: 1.1rem;
font-weight: 400;
margin-bottom: 0.25rem;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

/**
* @author semancik
*
*/
public class GuiStyleConstants {

public static final String ICON_FAR_COPY="far fa-copy";
public static final String ICON_FAR_COPY = "far fa-copy";
public static final String ICON_FAR_ADDRESS_CARD = "far fa-address-card";
public static final String ICON_FAR_CLOCK = "far fa-clock";
public static final String ICON_FA_BED = "fa fa-bed";
Expand Down Expand Up @@ -111,7 +110,7 @@ public class GuiStyleConstants {
public static final String CLASS_ICON_PROFILE = "fa fa-user";
public static final String CLASS_ICON_CREDENTIALS = "fa fa-shield-alt";
public static final String CLASS_ICON_REQUEST = "fa fa-pen-square";
public static final String CLASS_ICON_REQUEST_ACCESS ="fas fa-plus-circle";
public static final String CLASS_ICON_REQUEST_ACCESS = "fas fa-plus-circle";
public static final String CLASS_ICON_CONSENT = "fa fa-check-square";

public static final String CLASS_APPROVAL_OUTCOME_ICON_UNKNOWN_COLORED = "fa fa-check text-warning";
Expand Down Expand Up @@ -285,4 +284,6 @@ public class GuiStyleConstants {
public static final String CLASS_SIMULATION_RESULT = "fa-solid fa-flask";

public static final String CLASS_MARK = "fa-solid fa-tag";

public static final String CLASS_AUDIT = "fa-solid fa-magnifying-glass-chart";
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected Component createButtonContent(String id, IModel<Toggle<O>> model) {
icon.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(model.getObject().getIconCss())));
defaultButtonContent.add(icon);

Label label = new Label(ID_LABEL, () -> model.getObject().getLabel());
Label label = new Label(ID_LABEL, () -> getString(model.getObject().getLabel(), null, model.getObject().getLabel()));
label.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(model.getObject().getLabel())));
defaultButtonContent.add(label);

Expand Down
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;
}
}
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>
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);
}
};
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
</a>
<h3 class="mb-0" wicket:id="title"/>
<div class="flex-grow-1" wicket:id="content"/>
<a class="btn btn-success" wicket:id="next">
<wicket:message key="NavigationPanel.next"/>
<span wicket:id="nextLabel"/>
<i class="fas fa-arrow-right ml-2"></i>
</a>
<a wicket:id="next"/>

<wicket:fragment wicket:id="nextFragment">
<a wicket:id="nextLink">
<wicket:message key="NavigationPanel.next"/>
<span wicket:id="nextLabel"/>
<i class="fas fa-arrow-right ml-2"></i>
</a>
</wicket:fragment>
</wicket:panel>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.IModel;
import org.jetbrains.annotations.NotNull;

Expand All @@ -31,6 +32,8 @@ public class NavigationPanel extends BasePanel {
private static final String ID_TITLE = "title";
private static final String ID_CONTENT = "content";
private static final String ID_NEXT = "next";
private static final String ID_NEXT_FRAGMENT = "nextFragment";
private static final String ID_NEXT_LINK = "nextLink";
private static final String ID_NEXT_LABEL = "nextLabel";

public NavigationPanel(String id) {
Expand All @@ -44,7 +47,7 @@ private void initLayout() {

AjaxLink back = createBackButton(ID_BACK);
add(back);
AjaxLink next = createNextButton(ID_NEXT, createNextTitleModel());
Component next = createNextButton(ID_NEXT, createNextTitleModel());
add(next);

add(new Label(ID_TITLE, createTitleModel()));
Expand All @@ -68,21 +71,26 @@ protected IModel<String> createTitleModel() {
return () -> null;
}

protected AjaxLink createNextButton(String id, IModel<String> nextTitle) {
AjaxLink next = new AjaxLink<>(id) {
protected Component createNextButton(String id, IModel<String> nextTitle) {
Fragment next = new Fragment(id, ID_NEXT_FRAGMENT, this);
next.setRenderBodyOnly(true);

AjaxLink nextLink = new AjaxLink<>(ID_NEXT_LINK) {

@Override
public void onClick(AjaxRequestTarget target) {
onNextPerformed(target);
}
};
next.setOutputMarkupId(true);
next.setOutputMarkupPlaceholderTag(true);
WebComponentUtil.addDisabledClassBehavior(next);
nextLink.add(AttributeAppender.append("class", "btn btn-success"));
nextLink.setOutputMarkupId(true);
nextLink.setOutputMarkupPlaceholderTag(true);
nextLink.add(new BehaviourDelegator(() -> getNextVisibilityBehaviour()));
WebComponentUtil.addDisabledClassBehavior(nextLink);

next.add(new BehaviourDelegator(() -> getNextVisibilityBehaviour()));
nextLink.add(new Label(ID_NEXT_LABEL, nextTitle));
next.add(nextLink);

next.add(new Label(ID_NEXT_LABEL, nextTitle));
return next;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public PageAdminLTE(PageParameters parameters) {
Validate.notNull(taskManager, "Task manager was not injected.");
Validate.notNull(reportManager, "Report manager was not injected.");

MidPointAuthWebSession.getSession().setClientCustomization();
MidPointAuthWebSession.get().setClientCustomization();

add(new NewWindowNotifyingBehavior());
}
Expand Down

0 comments on commit 8445e5f

Please sign in to comment.