Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/dependency-…
Browse files Browse the repository at this point in the history
…upgrade
  • Loading branch information
tonydamage committed May 15, 2023
2 parents f6a3abb + a4e3574 commit 1cdf9df
Show file tree
Hide file tree
Showing 149 changed files with 2,330 additions and 1,460 deletions.
File renamed without changes.
2 changes: 0 additions & 2 deletions gui/admin-gui/src/frontend/js/vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import '../../../node_modules/select2/dist/js/select2';

import '../../../node_modules/sparklines';

import './passwords';

import '../../../node_modules/ace-builds/src-noconflict/ace';

ace.config.setModuleUrl('ace/theme/eclipse',
Expand Down
4 changes: 0 additions & 4 deletions gui/admin-gui/src/frontend/scss/midpoint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1220,10 +1220,6 @@ td .prism-property-value {
.card.card-outline,
.card.card-outline-left,
.card.card-outline-tabs {
& .card-header .search-panel-form a {
border-top: 0 !important;
}

& > .card-header > .card-tools > a.btn.btn-tool {
border-top: 0 !important;
}
Expand Down
13 changes: 13 additions & 0 deletions gui/admin-gui/src/frontend/scss/vendors-fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*!
* 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.
*/

@import "../../../node_modules/@fontsource/source-sans-pro/300.css";
@import "../../../node_modules/@fontsource/source-sans-pro/400.css";
@import "../../../node_modules/@fontsource/source-sans-pro/400-italic.css";
@import "../../../node_modules/@fontsource/source-sans-pro/700.css";

@import "../../../node_modules/@fortawesome/fontawesome-free/css/all.css";
6 changes: 0 additions & 6 deletions gui/admin-gui/src/frontend/scss/vendors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@
*/
@import "../../../node_modules/flag-icons/css/flag-icons.css";

@import "../../../node_modules/@fontsource/source-sans-pro/300.css";
@import "../../../node_modules/@fontsource/source-sans-pro/400.css";
@import "../../../node_modules/@fontsource/source-sans-pro/400-italic.css";
@import "../../../node_modules/@fontsource/source-sans-pro/700.css";

@import "midpoint-variables";

@import "../../../node_modules/admin-lte/build/scss/adminlte";
@import "../../../node_modules/overlayscrollbars/css/OverlayScrollbars.css";
@import "../../../node_modules/@fortawesome/fontawesome-free/css/all.css";
@import "../../../node_modules/datatables.net-bs4/css/dataTables.bootstrap4";

@import "../../../node_modules/bootstrap-select/dist/css/bootstrap-select.css";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
import java.util.List;
import java.util.Objects;

import com.evolveum.midpoint.gui.api.page.PageAdminLTE;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;

import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.ajax.AjaxChannel;
import org.apache.wicket.ajax.AjaxRequestTarget;
Expand All @@ -26,18 +20,26 @@
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.feedback.FeedbackMessage;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.markup.html.form.PasswordTextField;
import org.apache.wicket.model.*;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.Url;
import org.apache.wicket.request.resource.UrlResourceReference;
import org.apache.wicket.validation.IValidatable;
import org.apache.wicket.validation.IValidator;
import org.apache.wicket.validation.ValidationError;
import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.authentication.api.util.AuthUtil;
import com.evolveum.midpoint.gui.api.page.PageAdminLTE;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.model.api.validator.StringLimitationResult;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.security.api.MidPointPrincipal;
Expand All @@ -46,6 +48,11 @@
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.prism.InputPanel;
import com.evolveum.midpoint.web.component.util.EnableBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CredentialsPolicyType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ValuePolicyType;
import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType;

/**
Expand Down Expand Up @@ -87,6 +94,13 @@ public <F extends FocusType> PasswordPanel(String id, IModel<ProtectedStringType
initLayout();
}

@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);

response.render(JavaScriptHeaderItem.forReference(new UrlResourceReference(Url.parse("static/vendors-passwords.js")).setContextRelative(true)));
}

@Override
protected void onInitialize() {
super.onInitialize();
Expand Down Expand Up @@ -217,7 +231,6 @@ private String getPasswordMatched(String password1, String password2) {
return "";
}


protected boolean canEditPassword() {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

<link href="css/font-evosome.css" type="text/css" rel="stylesheet"/>

<link type="text/css" rel="stylesheet" href="static/vendors-fonts.css"/>
<link type="text/css" rel="stylesheet" href="static/vendors.css"/>
<link type="text/css" rel="stylesheet" href="static/midpoint.css"/>
<link type="text/css" rel="stylesheet" href="css/overlay.css"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
import com.evolveum.midpoint.web.component.prism.ValueStatus;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.page.admin.certification.handlers.CertGuiHandlerRegistry;
import com.evolveum.midpoint.web.page.error.PageError404;
import com.evolveum.midpoint.web.security.MidPointApplication;
import com.evolveum.midpoint.web.security.MidPointAuthWebSession;
Expand Down Expand Up @@ -246,6 +247,9 @@ public abstract class PageAdminLTE extends WebPage implements ModelServiceLocato
@SpringBean
private SimulationResultManager simulationResultManager;

@SpringBean
private CertGuiHandlerRegistry certGuiHandlerRegistry;

// No need for this to store in session. It is used only during single init and render.
private transient Task pageTask;

Expand Down Expand Up @@ -546,6 +550,10 @@ public SimulationResultManager getSimulationResultManager() {
return simulationResultManager;
}

public CertGuiHandlerRegistry getCertGuiHandlerRegistry() {
return certGuiHandlerRegistry;
}

public MidPointApplication getMidpointApplication() {
return (MidPointApplication) getApplication();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public SearchableItemsDefinitions additionalSearchContext(SearchContext ctx) {
));

SEARCHABLE_OBJECTS.put(CaseWorkItemType.class, Arrays.asList(
ItemPath.create(AbstractWorkItemType.F_NAME),
ItemPath.create(CaseWorkItemType.F_ASSIGNEE_REF),
ItemPath.create(CaseWorkItemType.F_ORIGINAL_ASSIGNEE_REF),
ItemPath.create(PrismConstants.T_PARENT, CaseType.F_STATE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div class="search-item-field" wicket:id="valueTextField" style="float: left;" />
<div style="float: left;">
<a wicket:id="editButton" class="btn btn-xs btn-default dropdown-toggle" style="margin-top: 5px; border: none !important;" data-toggle="dropdown">
<i class="fa fa-edit fa-lg"/>
<div class="search-item-field" wicket:id="valueTextField" />
<div class="d-flex">
<a wicket:id="remove" class="btn btn-xs border-0" wicket:message="title:PopoverSearchPanel.removeValue">
<i class="fa fa-trash"/>
</a>
<a wicket:id="editButton" class="btn btn-xs border-0">
<i class="fa fa-edit"/>
</a>
<wicket:child />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.input.TextPanel;

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.model.IModel;
Expand All @@ -27,6 +30,7 @@ public abstract class PopoverSearchPanel<T> extends BasePanel<T> {
private static final String ID_EDIT_BUTTON = "editButton";
private static final String ID_POPOVER_PANEL = "popoverPanel";
private static final String ID_POPOVER = "popover";
private static final String ID_REMOVE="remove";

public PopoverSearchPanel(String id) {
super(id);
Expand All @@ -44,8 +48,9 @@ protected void onInitialize() {

private void initLayout() {
setOutputMarkupId(true);
add(AttributeAppender.append("class", "d-flex align-items-center"));

TextPanel<String> textField = new TextPanel<String>(ID_TEXT_FIELD, getTextValue());
TextPanel<String> textField = new TextPanel<>(ID_TEXT_FIELD, getTextValue());
textField.setOutputMarkupId(true);
textField.add(AttributeAppender.append("title", getTextValue().getObject()));
textField.setEnabled(false);
Expand All @@ -61,16 +66,26 @@ public Component getPopoverReferenceComponent() {
};
add(popover);

AjaxButton setDateButton = new AjaxButton(ID_EDIT_BUTTON) {
AjaxButton edit = new AjaxButton(ID_EDIT_BUTTON) {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
popover.toggle(target);
}
};
setDateButton.setOutputMarkupId(true);
add(setDateButton);
edit.setOutputMarkupId(true);
add(edit);

AjaxLink<?> remove = new AjaxLink<>(ID_REMOVE) {

@Override
public void onClick(AjaxRequestTarget target) {
removeSearchValue(target);
}
};
remove.add(new VisibleBehaviour(() -> isRemoveVisible()));
add(remove);

WebMarkupContainer searchPopupPanel = createPopupPopoverPanel(ID_POPOVER_PANEL);
popover.add(searchPopupPanel);
Expand All @@ -93,4 +108,12 @@ public void togglePopover(AjaxRequestTarget target, Component button, Component
public Boolean isItemPanelEnabled() {
return true;
}

protected boolean isRemoveVisible() {
return false;
}

protected void removeSearchValue(AjaxRequestTarget target) {

}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,44 +48,34 @@ protected void onInitialize(){
initLayout();
}

private <O extends ObjectType> void initLayout(){
private void initLayout(){
setOutputMarkupId(true);
}

AjaxButton selectObject = new AjaxButton(ID_SELECT_OBJECT_BUTTON) {

private <O extends ObjectType> void selectObjectPerformed(AjaxRequestTarget target) {
List<QName> supportedTypes = getSupportedTargetList();
if (CollectionUtils.isEmpty(supportedTypes)) {
supportedTypes = WebComponentUtil.createObjectTypeList();
}
ObjectBrowserPanel<O> objectBrowserPanel = new ObjectBrowserPanel<>(
getPageBase().getMainPopupBodyId(), null, supportedTypes, false, getPageBase(),
null) {
private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
List<QName> supportedTypes = getSupportedTargetList();
if (CollectionUtils.isEmpty(supportedTypes)) {
supportedTypes = WebComponentUtil.createObjectTypeList();
}
ObjectBrowserPanel<O> objectBrowserPanel = new ObjectBrowserPanel<>(
getPageBase().getMainPopupBodyId(), null, supportedTypes, false, getPageBase(),
null) {
private static final long serialVersionUID = 1L;

@Override
protected void onSelectPerformed(AjaxRequestTarget target, O object) {
getPageBase().hideMainPopup(target);
ObjectReferenceType ort = new ObjectReferenceType();
ort.setOid(object.getOid());
ort.setTargetName(object.getName());
ort.setType(object.asPrismObject().getComplexTypeDefinition().getTypeName());
ReferenceValueSearchPanel.this.getModel().setObject(ort);
referenceValueUpdated(ort, target);
target.add(ReferenceValueSearchPanel.this);
}
};

getPageBase().showMainPopup(objectBrowserPanel, target);
protected void onSelectPerformed(AjaxRequestTarget target, O object) {
getPageBase().hideMainPopup(target);
ObjectReferenceType ort = new ObjectReferenceType();
ort.setOid(object.getOid());
ort.setTargetName(object.getName());
ort.setType(object.asPrismObject().getComplexTypeDefinition().getTypeName());
ReferenceValueSearchPanel.this.getModel().setObject(ort);
referenceValueUpdated(ort, target);
target.add(ReferenceValueSearchPanel.this);
}
};
selectObject.setOutputMarkupId(true);
selectObject.add(new VisibleBehaviour(this::notDisplayedInPopup));
selectObject.add(AttributeAppender.append("title", createStringResource("ReferenceValueSearchPopupPanel.selectObject")));
add(selectObject);

getPageBase().showMainPopup(objectBrowserPanel, target);
}

@Override
Expand Down Expand Up @@ -119,9 +109,35 @@ protected Boolean isItemPanelEnabled() {
protected boolean isAllowedNotFoundObjectRef() {
return ReferenceValueSearchPanel.this.isAllowedNotFoundObjectRef();
}

@Override
protected boolean isChooseObjectVisible() {
return notDisplayedInPopup();
}

@Override
protected void chooseObjectPerformed(AjaxRequestTarget target) {
selectObjectPerformed(target);
}
};
}

@Override
protected boolean isRemoveVisible() {
return true;
}

@Override
protected void removeSearchValue(AjaxRequestTarget target) {
ObjectReferenceType ref = getModelObject();
ref.asReferenceValue().setObject(null);
ref.setOid(null);
ref.setTargetName(null);
ref.setRelation(null);

target.add(this);
}

@Override
protected LoadableModel<String> getTextValue() {
return new LoadableModel<String>() {
Expand Down

0 comments on commit 1cdf9df

Please sign in to comment.