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 May 23, 2022
2 parents cf24497 + 1c2f0d4 commit fd6cd35
Show file tree
Hide file tree
Showing 41 changed files with 593 additions and 791 deletions.
6 changes: 4 additions & 2 deletions gui/admin-gui/src/frontend/js/ace-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $.aceEditors = {};

export default class MidPointAceEditor {

initEditor(textAreaId, readonly, resize, height, minHeight, mode) {
initEditor(textAreaId, readonly, resize, height, minHeight, mode, dark) {
var jqTextArea = '#' + textAreaId;
var editorId = textAreaId + ACE_EDITOR_POSTFIX;
var jqEditor = '#' + editorId;
Expand All @@ -29,8 +29,10 @@ export default class MidPointAceEditor {

ace.require("ace/ext/language_tools");

var themeValue = dark ? 'ace/theme/idle_fingers' : 'ace/theme/eclipse';

var editor = ace.edit(editorId,{
theme: 'ace/theme/eclipse',
theme: themeValue,
mode: 'ace/mode/xml',
highlightActiveLine : true,
highlightSelectedWord: true,
Expand Down
2 changes: 2 additions & 0 deletions gui/admin-gui/src/frontend/js/vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import '../../../node_modules/ace-builds/src-noconflict/ace';

ace.config.setModuleUrl('ace/theme/eclipse',
require('../../../node_modules/ace-builds/src-noconflict/theme-eclipse.js'));
ace.config.setModuleUrl('ace/theme/eclipse',
require('../../../node_modules/ace-builds/src-noconflict/theme-idle_fingers.js'));
ace.config.setModuleUrl('ace/mode/xml',
require('../../../node_modules/ace-builds/src-noconflict/mode-xml.js'));
ace.config.setModuleUrl('ace/ext/language_tools',
Expand Down
88 changes: 9 additions & 79 deletions gui/admin-gui/src/frontend/scss/midpoint-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1299,41 +1299,6 @@ td .prism-property-value {
}
}

.metadata {

border-radius: 0px;
border-left: 1px solid #f4f4f4;
border-right: 1px solid #f4f4f4;
border-bottom: none;
border-top: none;

.panel-default {
border-color: #ffffff;
}

.panel {
margin-bottom: 0px;
box-shadow: none;
}

.panel-body {
padding: 5px;
}

.info-box {
min-height: 50px;
}

.info-box-icon {
height: 50px;
line-height: normal;
}

.info-box-icon-ethereal-image {
font-size: 40px;
}
}

.metadata div.prism-container {
// Removing the "top horizontal line" above metadata label and icon.
// HACK We should rather re-structure the code and provide custom css class.
Expand All @@ -1342,11 +1307,10 @@ td .prism-property-value {
}

.metadata-block {
padding-top: 5px;
padding-top: 5px;
}

.metadata-properties {
padding-left: 40px;

.metadata-property {
padding-left: 0px;
Expand All @@ -1370,49 +1334,15 @@ td .prism-property-value {

}

// Tag icon in metadata "tab"
.metadata-nav > li > a::before {
font-family: "FontAwesome";
padding-right: 0.5em;
content: "\f02b";
}

.contains-active-tab {
border-bottom: 1px solid #eeeeee;
}

.contains-active-tab > ul > li > a.metadata-tab {
margin-top: 0px;
border-top: 3px solid transparent;
border-radius: 0px;
border-left: none;
border-right: none;
border-bottom: none;
background-color: transparent;
}

.metadata-tab {
margin-top: 2px;
border: 1px solid #dddddd;
border-radius: 3px;
padding: 3px 10px !important;
float: left;
padding-bottom: 5px !important;
background-color: #f7f7f7;

font-size: 75%;
color: #000;
text-align: center;
white-space: nowrap;

}
.metadata {

.metadata-tab-active {
border-top: 3px solid #3c8dbc !important;
border-right: 1px solid #f4f4f4 !important;
border-left: 1px solid #f4f4f4 !important;
background-color: #ffffff !important;
border-bottom: 1px solid transparent !important;
& .card .nav-item > a.nav-link::before,
& .tags > a.btn::before {
font-family: "Font Awesome 5 Free";
font-weight: 900;
padding-right: 0.5em;
content: "\f02b";
}
}

.acquisition {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
import org.apache.wicket.model.IModel;
import org.jetbrains.annotations.NotNull;

/**
* use pure lambda eg. not new ReadOnlyModel(() -> xxx) but () -> xxx
* @param <T>
*/
@Deprecated
public class ReadOnlyModel<T> implements IModel<T> {

@NotNull private final SerializableSupplier<T> objectSupplier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,25 @@
<li class="nav-item dropdown">
<div wicket:id="locale"/>
</li>
<li class="nav-item">
<a class="nav-link" href="#" wicket:id="mode"/>
</li>
<li class="nav-item">
<form method="post" wicket:id="logoutForm">
<div wicket:id="csrfField"/>
<button type="submit" class="btn btn-link nav-link" wicket:message="title:PageBase.logout">
<i class="fas fa-power-off"></i>
</button>
</form>
</li>
<wicket:enclosure child="mode">
<li class="nav-item">
<a class="nav-link" href="#" wicket:id="mode"/>
</li>
</wicket:enclosure>
<wicket:enclosure child="logoutForm">
<li class="nav-item">
<form method="post" wicket:id="logoutForm">
<button type="submit" class="btn btn-link nav-link" wicket:message="title:PageBase.logout">
<i class="fas fa-power-off"></i>
</button>
</form>
</li>
</wicket:enclosure>
</ul>
</nav>

<wicket:enclosure child="sidebarMenu">
<aside class="main-sidebar sidebar-wqlight-lightblue" wicket:id="sidebarMenu"/>
<aside class="main-sidebar" wicket:id="sidebarMenu"/>
</wicket:enclosure>

<div class="content-wrapper" style="min-height: 916px; overflow: auto; overflow-x: hidden;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import java.util.*;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.web.component.AjaxIconButton;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
Expand Down Expand Up @@ -66,6 +64,7 @@
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.application.AsyncWebProcessManager;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.AjaxIconButton;
import com.evolveum.midpoint.web.component.breadcrumbs.Breadcrumb;
import com.evolveum.midpoint.web.component.dialog.MainPopupDialog;
import com.evolveum.midpoint.web.component.dialog.Popupable;
Expand All @@ -80,7 +79,6 @@
import com.evolveum.midpoint.web.page.self.PageAssignmentsList;
import com.evolveum.midpoint.web.page.self.PageSelf;
import com.evolveum.midpoint.web.security.MidPointApplication;
import com.evolveum.midpoint.web.security.MidPointAuthWebSession;
import com.evolveum.midpoint.web.security.util.SecurityUtils;
import com.evolveum.midpoint.web.session.SessionStorage;
import com.evolveum.midpoint.web.session.UserProfileStorage;
Expand Down Expand Up @@ -123,7 +121,6 @@ public abstract class PageBase extends PageAdminLTE {
public static final String PARAMETER_DASHBOARD_WIDGET_NAME = "dashboardWidgetName";
public static final String PARAMETER_SEARCH_BY_NAME = "name";
private static final String ID_LOGOUT_FORM = "logoutForm";
private static final String ID_CSRF_FIELD = "csrfField";

private static final Trace LOGGER = TraceManager.getTrace(PageBase.class);

Expand Down Expand Up @@ -284,26 +281,21 @@ public void onClick(AjaxRequestTarget target) {
target.add(PageBase.this);
}
};
mode.add(new VisibleBehaviour(() -> WebModelServiceUtils.isEnableExperimentalFeature(this)));
container.add(mode);

MidpointForm<?> form = new MidpointForm<>(ID_LOGOUT_FORM);
form.add(AttributeModifier.replace("action", () ->
SecurityUtils.getPathForLogoutWithContextPath(getRequest().getContextPath(), getAuthenticatedModule().getPrefix())));
form.add(new VisibleBehaviour(() -> AuthUtil.getPrincipalUser() != null));
form.add(AttributeModifier.replace("action", () -> getUrlForLogout()));

WebMarkupContainer csrfField = SecurityUtils.createHiddenInputForCsrf(ID_CSRF_FIELD);
form.add(csrfField);
container.add(form);
}

private ModuleAuthentication getAuthenticatedModule() {
ModuleAuthentication moduleAuthentication = AuthUtil.getAuthenticatedModule();
private String getUrlForLogout() {
ModuleAuthentication module = AuthUtil.getAuthenticatedModule();

if (moduleAuthentication == null) {
String message = "Unauthenticated request";
throw new IllegalArgumentException(message);
}
return moduleAuthentication;
String prefix = module != null ? module.getPrefix() : "";

return SecurityUtils.getPathForLogoutWithContextPath(getRequest().getContextPath(), prefix);
}

private void initTitleLayout(WebMarkupContainer mainHeader) {
Expand Down Expand Up @@ -461,11 +453,11 @@ public String getObject() {
mainHeader.add(createHeaderColorStyleModel(false));

LeftMenuPanel sidebarMenu = new LeftMenuPanel(ID_SIDEBAR_MENU);
sidebarMenu.add(AttributeAppender.append("class",
() -> getSessionStorage().getMode() == SessionStorage.Mode.DARK ? "sidebar-dark-lightblue" : "sidebar-light-lightblue"));
sidebarMenu.add(createUserStatusBehaviour());
add(sidebarMenu);



WebMarkupContainer feedbackContainer = new WebMarkupContainer(ID_FEEDBACK_CONTAINER);
feedbackContainer.setOutputMarkupId(true);
feedbackContainer.setOutputMarkupPlaceholderTag(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public org.apache.wicket.Component createPanel(PrismReferencePanelContext<Object
new AutoCompleteReferenceRenderer(),
panelCtx.getPageBase());
panel.setOutputMarkupId(true);
panel.add(AttributeAppender.append("style", "padding-top:5px")); //ugly hack to be aligned with prism-property-label
return panel;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ public void register() {

@Override
public org.apache.wicket.Component createPanel(PrismPropertyPanelContext<T> panelCtx) {
Label label = new Label(panelCtx.getComponentId(), panelCtx.getRealValueStringModel());
label.add(AttributeAppender.append("style", "padding-top:5px;")); // because prism-property-label has this
return label;
return new Label(panelCtx.getComponentId(), panelCtx.getRealValueStringModel());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public Integer getOrder() {
public org.apache.wicket.Component createPanel(PrismReferencePanelContext<ObjectReferenceType> panelCtx) {
LinkedReferencePanel<?> panel = new LinkedReferencePanel<>(panelCtx.getComponentId(), panelCtx.getRealValueModel());
panel.setOutputMarkupId(true);
panel.add(AttributeAppender.append("style", "padding-top:5px")); //ugly hack to be aligned with prism-property-label
return panel;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,13 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>

<div class="panel panel-default metadata">
<div class="panel-body">
<div wicket:id="header"/>
<div class="container-wrapper">

<div wicket:id="values">
<div wicket:id="value"/>
</div>

<div class="metadata">
<div wicket:id="header"/>
<div class="container-wrapper">
<div wicket:id="values">
<div wicket:id="value"/>
</div>
</div>
</div>
<!-- <div class="container-wrapper">-->
<!-- <div class="panel panel-default" wicket:id="values">-->
<!-- <div class="panel-body" wicket:id="panel">-->
<!-- <div wicket:id="nonContainers">-->
<!-- <wicket:enclosure child="values">-->
<!-- <div class="col-md-4" wicket:id="label"></div>-->
<!-- <div class="col-md-8" wicket:id="values">-->
<!-- <div wicket:id="value"></div>-->
<!-- </div>-->
<!-- </wicket:enclosure>-->
<!-- </div>-->
<!-- <div style="padding-left: 20px" wicket:id="containers">-->
<!-- <div wicket:id="container"></div>-->
<!-- </div>-->

<!-- </div>-->

<!-- </div>-->
<!-- </div>-->
</wicket:panel>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public MetadataContainerPanel(String id, IModel<PrismContainerWrapper<C>> model,
super(id, model, settings);
}


@Override
protected boolean getHeaderVisibility() {
return false;
Expand All @@ -46,5 +45,4 @@ protected Component createValuePanel(ListItem<PrismContainerValueWrapper<C>> ite
item.add(panel);
return panel;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>

<div class="metadata-properties">
<div class="metadata-properties my-3">
<div wicket:id="propertiesLabel">
<div wicket:id="properties" class="property-stripe">
<div class="row metadata-property" wicket:id="property"/>
<div wicket:id="properties">
<div class="row metadata-property my-1" wicket:id="property"/>
</div>
</div>

Expand Down

0 comments on commit fd6cd35

Please sign in to comment.