Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Jun 10, 2022
2 parents 0e03a5b + 47f61a1 commit 3979fbe
Show file tree
Hide file tree
Showing 105 changed files with 2,983 additions and 1,462 deletions.
12 changes: 6 additions & 6 deletions gui/admin-gui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

134 changes: 134 additions & 0 deletions gui/admin-gui/src/frontend/scss/_list-group-menu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*!
* 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.
*/

@mixin list-reset() {
list-style: none;
padding-left: 0;
margin-bottom: 0;
}

@mixin list-group-menu() {
display: flex;
flex-direction: column;
width: 100%;
min-width: 273px;

@include list-reset();

& ul, li {
// reset browser default to be sure
@include list-reset();
}

@include border-radius($list-group-border-radius);
}

@mixin list-group-menu-item() {
display: flex;
flex-direction: column;
color: $list-group-color;
background-color: $list-group-bg;

& > a {
display: flex;
flex-wrap: wrap;
align-items: center;
// todo for "sm" version 0.5rem 1rem
padding: $list-group-item-padding-y $list-group-item-padding-x;
color: inherit;

@include hover-focus() {
z-index: 1; // Place hover/focus items above their siblings for proper border styling
color: $list-group-action-hover-color;
text-decoration: none;
background-color: $list-group-hover-bg;
}

&.disabled,
&:disabled {
color: $list-group-disabled-color;
pointer-events: none;
background-color: $list-group-disabled-bg;
}

// Include both here for `<a>`s and `<button>`s
&.active {
z-index: 2; // Place active items above their siblings for proper border styling
color: $list-group-active-color;
background-color: $list-group-active-bg;
border-color: $list-group-active-border-color;
}

&:active {
color: $list-group-action-active-color;
background-color: $list-group-action-active-bg;
}

& > i.icon {
margin-right: 1rem;
}

& > span.label {
flex-grow: 1;
}
}
}

.list-group-menu {
@include list-group-menu();
}

.list-group-menu-item {
@include list-group-menu-item;

border: $list-group-border-width solid $list-group-border-color;

&:first-child {
@include border-top-radius(inherit);

& > a {
@include border-top-radius(inherit);
}
}

&:last-child {
@include border-bottom-radius(inherit);

& > a:last-child {
@include border-bottom-radius(inherit);
}
}

& + & {
border-top-width: 0;

&.active {
margin-top: -$list-group-border-width;
border-top-width: $list-group-border-width;
}
}
}

.list-group-submenu {
@include list-group-menu();
}

.list-group-submenu-item {
@include list-group-menu-item;

& .list-group-submenu > .list-group-submenu-item > a {
padding-left: 3.25rem;
}

& > a {
padding-left: 2rem;
}
}

@include dark-mode () {
// todo dark mode
}
2 changes: 2 additions & 0 deletions gui/admin-gui/src/frontend/scss/_tiles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@
@include selectable-tile();

& > .logo {
min-width: 84px;
width: 84px;
height: 84px;
min-height: 84px;
border-radius: 108px;
background-color: rgba(60, 141, 188, 0.1);
}
Expand Down
21 changes: 3 additions & 18 deletions gui/admin-gui/src/frontend/scss/midpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@import "prism-forms";
@import "midpoint-utils";
@import "details-menu";
@import "list-group-menu";
@import "wicket";
@import "bs-stepper-custom";

Expand Down Expand Up @@ -1224,11 +1225,11 @@ td .prism-property-value {
// handling dark mode, would be automatically fixed when we get rid of .search-item and .search-item-label and
// replace them with vendor css utility classes
.dark-mode .search-item {
background-color: lighten($dark, 7.5%) !important;
background-color: $gray-800 !important;
color: $white !important;
}

@include bg-variant(".search-item", $light, true);
@include bg-variant(".search-item", $gray-300, true);

// deprecated, uses should be replaced by "d-flex gap-1 pl-1 bg-light rounded-sm align-items-center"
.search-item {
Expand Down Expand Up @@ -1695,22 +1696,6 @@ th.debug-list-buttons {
// }
//}

.details-menu-panel {
min-width: 273px;

& > ul {
width: 100%;
margin: 0;
padding: 0;
list-style: none;

& > li {
display: flex;
flex-flow: column;
}
}
}

.col-5i,
.col-sm-5i,
.col-md-5i,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!--
~ Copyright (c) 2010-2018 Evolveum
~ 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.
-->

<!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 class="d-flex flex-column align-items-center mt-5">
<h2 class="mb-3" wicket:id="text"/>
<h5 class="text-secondary mb-5" wicket:id="subText"/>

<wicket:child/>
<div class="d-flex gap-3 justify-content-center mt-5">
<a class="btn btn-outline-primary" wicket:id="back">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,37 @@

import com.evolveum.midpoint.web.component.AjaxSubmitButton;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;

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


/**
* @author lskublik
*/
public class BasicWizardPanel extends WizardStepPanel {
public class BasicWizardPanel<T> extends WizardStepPanel<T> {

private static final long serialVersionUID = 1L;

private static final String ID_TEXT = "text";
private static final String ID_SUBTEXT = "subText";
private static final String ID_BACK = "back";
private static final String ID_NEXT = "next";
private static final String ID_NEXT_LABEL = "nextLabel";

public BasicWizardPanel() {
}

public BasicWizardPanel(IModel<T> model) {
super(model);
}

@Override
protected void onInitialize() {
super.onInitialize();
Expand All @@ -37,9 +48,13 @@ protected void onInitialize() {
}

private void initLayout() {
Label mainText = new Label(ID_TEXT, getTextModel());
mainText.add(new VisibleBehaviour(() -> getTextModel().getObject() != null));
add(mainText);

add(new Label(ID_TEXT, getTextModel()));
add(new Label(ID_SUBTEXT, getSubTextModel()));
Label secondaryText = new Label(ID_SUBTEXT, getSubTextModel());
secondaryText.add(new VisibleBehaviour(() -> getSubTextModel().getObject() != null));
add(secondaryText);

AjaxLink back = new AjaxLink<>(ID_BACK) {

Expand All @@ -51,6 +66,7 @@ public void onClick(AjaxRequestTarget target) {
back.add(getBackBehaviour());
back.setOutputMarkupId(true);
back.setOutputMarkupPlaceholderTag(true);
back.add(AttributeAppender.append("class", () -> !back.isEnabledInHierarchy() ? "disabled" : null));
add(back);

AjaxSubmitButton next = new AjaxSubmitButton(ID_NEXT) {
Expand All @@ -68,12 +84,14 @@ protected void onError(AjaxRequestTarget target) {
next.add(getNextBehaviour());
next.setOutputMarkupId(true);
next.setOutputMarkupPlaceholderTag(true);
next.setDefaultFormProcessing(true);
next.add(AttributeAppender.append("class", () -> !next.isEnabledInHierarchy() ? "disabled" : null));
add(next);

Label nextLabel = new Label(ID_NEXT_LABEL, createNextStepLabel());
Label nextLabel = new Label(ID_NEXT_LABEL, () -> {
WizardStep step = getWizard().getNextPanel();
return step != null ? step.getTitle().getObject() : null;
});
next.add(nextLabel);

}

protected void updateFeedbackPanels(AjaxRequestTarget target) {
Expand All @@ -83,38 +101,38 @@ protected WebMarkupContainer createContentPanel(String id) {
return new WebMarkupContainer(id);
}

protected IModel<?> getTextModel() {
return Model.of();
protected AjaxLink getNext() {
return (AjaxLink) get(ID_NEXT);
}

protected IModel<?> getSubTextModel() {
protected AjaxLink getBack() {
return (AjaxLink) get(ID_BACK);
}

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

private IModel<?> createNextStepLabel() {
WizardStep nextPanel = getWizard().getNextPanel();
if (nextPanel != null){
return nextPanel.getTitle();
}
protected IModel<String> getSubTextModel() {
return Model.of();
}

private void onNextPerformed(AjaxRequestTarget target) {
protected void onNextPerformed(AjaxRequestTarget target) {
getWizard().next();
target.add(getParent());
target.add(getWizard().getPanel());
}

private void onBackPerformed(AjaxRequestTarget target) {
int index = getWizard().getActiveStepIndex();
if (index > 0) {
getWizard().previous();
target.add(getParent());
target.add(getWizard().getPanel());
return;
}
onBackBeforeWizardPerformed(target);
onBackAfterWizardPerformed(target);
}

protected void onBackBeforeWizardPerformed(AjaxRequestTarget target) {
protected void onBackAfterWizardPerformed(AjaxRequestTarget target) {
getPageBase().redirectBack();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void onClick(AjaxRequestTarget target) {
};
next.setOutputMarkupId(true);
next.setOutputMarkupPlaceholderTag(true);
next.add(AttributeAppender.append("class", () -> !next.isEnabledInHierarchy() ? "disabled" : null));

next.add(new Label(ID_NEXT_LABEL, nextPanelTitle));
next.add(getNextVisibilityBehaviour());
Expand All @@ -94,6 +95,7 @@ public void onClick(AjaxRequestTarget target) {
};
back.setOutputMarkupId(true);
back.setOutputMarkupPlaceholderTag(true);
back.add(AttributeAppender.append("class", () -> !back.isEnabledInHierarchy() ? "disabled" : null));

return back;
}
Expand Down

0 comments on commit 3979fbe

Please sign in to comment.