Skip to content

Commit

Permalink
Merge branch 'feature/password-reset' of github.com:Evolveum/midpoint…
Browse files Browse the repository at this point in the history
… into feature/password-reset

* 'feature/password-reset' of github.com:Evolveum/midpoint:
  init hint value fix + reset password title and desciption + styles
  simulation ui, delta viewer improvements, html/css improvements
  report-impl: overhaul of TestCsvReportAllAssignments, much faster report
  TestReport/TestTask: added more static factory methods
  ExpressionUtil fix for real value of reference
  ReportUtils: ObjectReferenceType arguments migrated to Referencable
  fixed security policy merging for hint and focus identification modules
  simulation ui, delta viewer improvements, new IconComponent and StyledPanel
  simulation ui, delta viewer improvements
  Fix TestObject class hierarchy
  some html/css cleanup in  visualization panels
  • Loading branch information
katkav committed Feb 20, 2023
2 parents 8d69146 + ec5002b commit c86781e
Show file tree
Hide file tree
Showing 82 changed files with 1,700 additions and 1,096 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2010-2023 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;

import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.WebComponent;
import org.apache.wicket.model.IModel;
import org.jetbrains.annotations.NotNull;

/**
* Created by Viliam Repan (lazyman).
*/
public class IconComponent extends WebComponent {

public IconComponent(@NotNull String id, @NotNull IModel<String> cssClass) {
this(id, cssClass, null);
}

public IconComponent(@NotNull String id, @NotNull IModel<String> cssClass, IModel<String> title) {
super(id);

add(AttributeAppender.append("class", cssClass));

if (title != null) {
add(AttributeAppender.append("title", title));
}
}

@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);

checkComponentTag(tag, "i");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2010-2023 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;

import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.model.IModel;
import org.jetbrains.annotations.NotNull;

/**
* Created by Viliam Repan (lazyman).
*/
public class StyledPanel<T> extends BasePanel<T> {

private static final long serialVersionUID = 1L;

public StyledPanel(@NotNull String id, IModel<T> model, IModel<String> cssClass) {
this(id, model, cssClass, null);
}

public StyledPanel(@NotNull String id, IModel<T> model, IModel<String> cssClass, IModel<String> title) {
super(id, model);

if (cssClass != null) {
add(AttributeAppender.append("class", cssClass));
}

if (title != null) {
add(AttributeAppender.append("title", title));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.evolveum.midpoint.gui.api.factory.GuiComponentFactory;
import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper;
import com.evolveum.midpoint.gui.api.registry.GuiComponentRegistry;
import com.evolveum.midpoint.report.api.ReportConstants;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
Expand Down Expand Up @@ -46,7 +46,7 @@ public Integer getOrder() {
@Override
public <IW extends ItemWrapper<?, ?>> boolean match(IW wrapper) {
return QNameUtil.match(ObjectReferenceType.COMPLEX_TYPE, wrapper.getTypeName())
&& ReportConstants.NS_EXTENSION.equals(wrapper.getItemName().getNamespaceURI())
&& SchemaConstants.NS_REPORT_EXTENSION.equals(wrapper.getItemName().getNamespaceURI())
&& wrapper.getParent() == null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import java.util.Collections;
import java.util.List;

import com.evolveum.midpoint.web.component.prism.show.SimpleVisualizationPanel;

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.WebMarkupContainer;
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 org.apache.wicket.model.Model;

import com.evolveum.midpoint.gui.api.component.BasePanel;
Expand Down Expand Up @@ -59,7 +60,7 @@ public ChangesPanel(String id, IModel<List<ObjectDeltaType>> model) {
private void initModels() {
changesViewModel = Model.of(ChangesView.SIMPLE);

changesModel = new LoadableDetachableModel<>() {
changesModel = new LoadableModel<>(false) {

@Override
protected VisualizationDto load() {
Expand All @@ -68,7 +69,7 @@ protected VisualizationDto load() {
}
};

changesNewModel = new LoadableDetachableModel<>() {
changesNewModel = new LoadableModel<>() {
@Override
protected List<ObjectVisualization> load() {
ObjectDeltaType delta = getModelObject().get(0); // todo improve
Expand Down Expand Up @@ -145,7 +146,7 @@ protected void populateItem(ListItem<ObjectVisualization> item) {
changes.add(new VisibleBehaviour(() -> changesViewModel.getObject() == ChangesView.SIMPLE));
body.add(changes);

VisualizationPanel advanced = new VisualizationPanel(ID_ADVANCED, changesModel);
SimpleVisualizationPanel advanced = new SimpleVisualizationPanel(ID_ADVANCED, changesModel);
advanced.add(new VisibleBehaviour(() -> changesViewModel.getObject() == ChangesView.ADVANCED && changesModel.getObject() != null));
body.add(advanced);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
*/
package com.evolveum.midpoint.gui.impl.page.forgotpassword;

import com.evolveum.midpoint.gui.api.page.PageBase;

import com.evolveum.midpoint.gui.impl.page.login.AbstractPageLogin;
import com.evolveum.midpoint.gui.impl.page.self.credentials.ChangePasswordPanel;
import com.evolveum.midpoint.util.logging.Trace;
Expand Down Expand Up @@ -35,6 +33,7 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;

@PageDescriptor(
Expand Down Expand Up @@ -150,4 +149,14 @@ public Task createSimpleTask(String operation) {
protected void confirmAuthentication() {
}

@Override
protected IModel<String> getLoginPanelTitleModel() {
return createStringResource("PageResetPassword.title");
}

@Override
protected IModel<String> getLoginPanelDescriptionModel() {
return createStringResource("PageResetPassword.description");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,17 @@ <h3 class="card-title">
</div>
</div>

<div class="d-flex flex-wrap gap-2 justify-content-between login-button mb-2">
<button type="submit" class="btn btn-primary login-button">
<div class="d-flex flex-wrap gap-2 justify-content-between mb-2 login-panel-control">
<button type="submit" class="btn btn-primary login-panel-control">
<wicket:message key="PageEmailNonce.continuePasswordResetLabel"/>
</button>

<a class="text-center login-button" wicket:id="back">
<a class="text-center login-panel-control mt-2" style="display: inline-block;" wicket:id="back">
<i class="fas fa-arrow-left mr-2"></i>
<span wicket:id="backButtonLabel" />
</a>
</div>
</form>
<div style="text-align: center">
<h2 wicket:id="resetPasswordInfo"></h2>
</div>
</wicket:extend>

</body>
Expand Down

0 comments on commit c86781e

Please sign in to comment.