Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
# Conflicts:
#	gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/wizard/WizardBorder.java
  • Loading branch information
1azyman committed Jun 2, 2022
2 parents d58d43a + 535712f commit f1305f7
Show file tree
Hide file tree
Showing 27 changed files with 1,134 additions and 1,337 deletions.
41 changes: 41 additions & 0 deletions gui/admin-gui/src/frontend/scss/_admin-lte-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,44 @@
color: darken($button-default-color, 10%);
}
}

.col-5i,
.col-sm-5i,
.col-md-5i,
.col-lg-5i,
.col-xl-5i {
position: relative;
width: 100%;
padding-right: 15px;
padding-left: 15px;
}

.col-5i {
flex: 0 0 20%;
max-width: 20%;
}

@media (min-width: 576px){
.col-sm-5i {
flex: 0 0 20%;
max-width: 20%;
}
}
@media (min-width: 768px){
.col-md-5i {
flex: 0 0 20%;
max-width: 20%;
}
}
@media (min-width: 992px){
.col-lg-5i {
flex: 0 0 20%;
max-width: 20%;
}
}
@media (min-width: 1200px){
.col-xl-5i {
flex: 0 0 20%;
max-width: 20%;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public class GuiStyleConstants {

public static final String CLASS_OBJECT_TEMPLATE_ICON = "fa fa-file-alt";

public static final String CLASS_OBJECT_CONNECTOR_ICON = "fa fa-microchip";

public static final String CLASS_REPORT_ICON = "fa fa-chart-pie";

public static final String CLASS_ICON_STYLE = "icon-style-"; //some icon styles start with this string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
~ Copyright (c) 2010-2018 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="d-flex flex-column align-items-center mt-3">
<h2 class="mb-3 font-weight-bold " wicket:id="text"/>
<h5 class="text-secondary" wicket:id="subText"/>
<div wicket:id="content"/>
<div class="d-flex gap-3 justify-content-center mt-5">
<a class="btn btn-outline-primary" wicket:id="back">
<i class="fas fa-arrow-left mr-2"></i>
<wicket:message key="WizardHeader.back"/>
</a>
<a class="btn btn-success" wicket:id="next">
<wicket:message key="WizardHeader.next"/>
<span wicket:id="nextLabel"/>
<i class="fas fa-arrow-right ml-2"></i>
</a>
</div>
</div>
</wicket:panel>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/*
* Copyright (c) 2022 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.wizard;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;

import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

/**
* @author lskublik
*/
public class BasicWizardPanel extends BasePanel implements WizardPanel{

private static final String ID_TEXT = "text";
private static final String ID_SUBTEXT = "subText";

private static final String ID_CONTENT = "content";
private static final String ID_BACK = "back";
private static final String ID_NEXT = "next";
private static final String ID_NEXT_LABEL = "nextLabel";

public BasicWizardPanel(String id) {
super(id);
}

@Override
protected void onInitialize() {
super.onInitialize();

initLayout();
}

private void initLayout() {

add(new Label(ID_TEXT, getTextModel()));
add(new Label(ID_SUBTEXT, getSubTextModel()));

add(createContentPanel(ID_CONTENT));

AjaxLink back = new AjaxLink<>(ID_BACK) {

@Override
public void onClick(AjaxRequestTarget target) {
onBackPerformed(target);
}
};
back.add(getBackBehaviour());
back.setOutputMarkupId(true);
back.setOutputMarkupPlaceholderTag(true);
add(back);

AjaxLink next = new AjaxLink<>(ID_NEXT) {

@Override
public void onClick(AjaxRequestTarget target) {
onNextPerformed(target);
}
};
next.add(getNextBehaviour());
next.setOutputMarkupId(true);
next.setOutputMarkupPlaceholderTag(true);
add(next);

Label nextLabel = new Label(ID_NEXT_LABEL, createNextStepLabel());
next.add(nextLabel);

}

protected Component createContentPanel(String id) {
return new WebMarkupContainer(id);
}

protected IModel<?> getTextModel() {
return Model.of();
}

protected IModel<?> getSubTextModel() {
return Model.of();
}

private IModel<?> createNextStepLabel() {
MarkupContainer parent = getParent();
if (parent instanceof WizardBorder) {
WizardPanel panel = ((WizardBorder) parent).getNextPanel();
return panel.getTitle();
}
return Model.of();
}

private void onNextPerformed(AjaxRequestTarget target) {
MarkupContainer parent = getParent();
if (parent instanceof WizardBorder) {
((WizardBorder) parent).nextStep(target);
}
}

protected void onBackPerformed(AjaxRequestTarget target) {
MarkupContainer parent = getParent();
if (parent instanceof WizardBorder) {
WizardBorder wizard = (WizardBorder) parent;
int index = wizard.getModel().getObject().getActiveStepIndex();
if (index > 0) {
wizard.previousStep(target);
return;
}
}
getPageBase().redirectBack();
}

@Override
public VisibleEnableBehaviour getHeaderBehaviour() {
return VisibleEnableBehaviour.ALWAYS_INVISIBLE;
}
}

0 comments on commit f1305f7

Please sign in to comment.