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 Oct 18, 2022
2 parents 453a1a6 + 5ab956a commit bca3647
Show file tree
Hide file tree
Showing 13 changed files with 211 additions and 77 deletions.
107 changes: 63 additions & 44 deletions gui/admin-gui/src/frontend/js/midpoint-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export default class MidPointTheme {
constructor() {
const self = this;

$(window).on('load', function() {
$(window).on('load', function () {
//dom not only ready, but everything is loaded MID-3668
$("body").removeClass("custom-hold-transition");

self.initAjaxStatusSigns();
self.initAjaxStatusSigns();

Wicket.Event.subscribe('/ajax/call/failure', function( attrs, jqXHR, textStatus, jqEvent, errorThrown ) {
Wicket.Event.subscribe('/ajax/call/failure', function (attrs, jqXHR, textStatus, jqEvent, errorThrown) {
console.error("Ajax call failure:\n" + JSON.stringify(attrs.target.location)
+ "\nStatus:\n" + JSON.stringify(textStatus));
});
Expand All @@ -33,67 +33,70 @@ export default class MidPointTheme {
// expand the panel
$(this).nextUntil('.nav-header').slideDown();
$(this).removeClass('closed');
}
else {
} else {
// collapse the panel
$(this).nextUntil('.nav-header').slideUp();
$(this).addClass('closed');
}
});
});

!function($) {
$.fn.passwordFieldValidatorPopover = function(inputId, popover) {
return this.each(function() {
!function ($) {
$.fn.passwordFieldValidatorPopover = function (inputId, popover) {
return this.each(function () {

var parent = $(this).parent();

var showPopover=function(){
parent.find(inputId).each(function() {
var itemH=$(this).innerHeight() + 27;
parent.find(popover).fadeIn(300).css({top:itemH, left:0}).css("display", "block");
var showPopover = function () {
parent.find(inputId).each(function () {
var itemH = $(this).innerHeight() + 27;
parent.find(popover).fadeIn(300).css({top: itemH, left: 0}).css("display", "block");
});
}

showPopover();
$(this).on("focus", function(){showPopover();});
$(this).on("focus", function () {
showPopover();
});

var deletePopover=function(){
var deletePopover = function () {
parent.find(popover).fadeIn(300).css("display", "none");
};

$(this).on("blur", function(){
$(this).on("blur", function () {
deletePopover();
});
});
};

$.fn.passwordValidatorPopover = function(inputId, popover) {
return this.each(function() {
$.fn.passwordValidatorPopover = function (inputId, popover) {
return this.each(function () {

var parent = $(this).parent();

var showPopover=function(){
var showPopover = function () {
if (parent.find(inputId + ":hover").length != 0) {
parent.find(inputId).each(function() {
var itemH=$(this).innerHeight() + 9;
parent.find(popover).fadeIn(300).css({top:itemH, left:0}).css("display", "block");
parent.find(inputId).each(function () {
var itemH = $(this).innerHeight() + 9;
parent.find(popover).fadeIn(300).css({top: itemH, left: 0}).css("display", "block");
});
}
}

$(this).on("mouseenter", function(){showPopover();});
$(this).on("mouseenter", function () {
showPopover();
});

var deletePopover=function(){
var deletePopover = function () {
parent.find(popover).fadeIn(300).css("display", "none");
};

$(this).on("mouseleave", function(){
$(this).on("mouseleave", function () {
if (parent.find(popover + ":hover").length == 0) {
deletePopover();
}
});
parent.find(popover).on("mouseleave", function(){
parent.find(popover).on("mouseleave", function () {
if (parent.find(inputId + ":hover").length == 0) {
deletePopover();
}
Expand All @@ -102,19 +105,19 @@ export default class MidPointTheme {
};
}(window.jQuery);

(function($) {
$.fn.updateParentClass = function(successClass, parentSuccessClass, parentId, failClass, parentFailClass) {
(function ($) {
$.fn.updateParentClass = function (successClass, parentSuccessClass, parentId, failClass, parentFailClass) {
var child = this;
var parent = $("#" + parentId);

if (child.hasClass(successClass)){
if (child.hasClass(successClass)) {
if (parent.hasClass(parentFailClass)) {
parent.removeClass(parentFailClass);
}
if (!parent.hasClass(parentSuccessClass)) {
parent.addClass(parentSuccessClass);
}
} else if (child.hasClass(failClass)){
} else if (child.hasClass(failClass)) {
if (parent.hasClass(parentSuccessClass)) {
parent.removeClass(parentSuccessClass);
}
Expand All @@ -137,14 +140,15 @@ export default class MidPointTheme {
}
$(this).tooltip({html: true, whiteList: wl, 'container': container});
$(this).tooltip("show");
};
}
;
});
});

jQuery(function ($) {
$(".word-break-longer-text").css("word-break", function(index, origValue){
$(".word-break-longer-text").css("word-break", function (index, origValue) {

var textOfColumn = $(".word-break-longer-text")[index].innerText;
var textOfColumn = $(".word-break-longer-text")[index].innerText;
if (textOfColumn != '' && textOfColumn != ' ') {
var numberOfChars = 15;
var controlValue = numberOfChars;
Expand Down Expand Up @@ -190,11 +194,11 @@ export default class MidPointTheme {
clickFuncWicket6(eventData) {
var clickedElement = (window.event) ? event.srcElement : eventData.target;
if ((clickedElement.tagName.toUpperCase() == 'BUTTON'
|| clickedElement.tagName.toUpperCase() == 'A'
|| clickedElement.parentNode.tagName.toUpperCase() == 'A'
|| (clickedElement.tagName.toUpperCase() == 'INPUT'
&& (clickedElement.type.toUpperCase() == 'BUTTON'
|| clickedElement.type.toUpperCase() == 'SUBMIT')))
|| clickedElement.tagName.toUpperCase() == 'A'
|| clickedElement.parentNode.tagName.toUpperCase() == 'A'
|| (clickedElement.tagName.toUpperCase() == 'INPUT'
&& (clickedElement.type.toUpperCase() == 'BUTTON'
|| clickedElement.type.toUpperCase() == 'SUBMIT')))
&& clickedElement.parentNode.id.toUpperCase() != 'NOBUSY'
&& clickedElement.disabled == 'false') {
showAjaxStatusSign();
Expand All @@ -208,11 +212,11 @@ export default class MidPointTheme {

const self = this;

Wicket.Event.subscribe('/ajax/call/beforeSend', function( attributes, jqXHR, settings ) {
Wicket.Event.subscribe('/ajax/call/beforeSend', function (attributes, jqXHR, settings) {
self.showAjaxStatusSign();
});

Wicket.Event.subscribe('/ajax/call/complete', function( attributes, jqXHR, textStatus) {
Wicket.Event.subscribe('/ajax/call/complete', function (attributes, jqXHR, textStatus) {
self.hideAjaxStatusSign();
});
}
Expand All @@ -235,7 +239,8 @@ export default class MidPointTheme {
for (i = 0; i < tooltips.length; ++i) {
tooltips[i].style.display = 'none';
}
};
}
;
}

/**
Expand Down Expand Up @@ -277,13 +282,13 @@ export default class MidPointTheme {

updateHeight(elementId, add, substract) {
updateHeightReal(elementId, add, substract);
$(window).resize(function() {
$(window).resize(function () {
updateHeightReal(elementId, add, substract);
});
}

updateHeightReal(elementId, add, substract) {
$('#' + elementId).css("height","0px");
$('#' + elementId).css("height", "0px");

var documentHeight = $(document).innerHeight();
var elementHeight = $('#' + elementId).outerHeight(true);
Expand Down Expand Up @@ -320,7 +325,7 @@ export default class MidPointTheme {
* @param positionId
*/
initPageSizePopover(buttonId, popoverId, positionId) {
console.log("initPageSizePopover('" + buttonId + "','" + popoverId + "','" + positionId +"')");
console.log("initPageSizePopover('" + buttonId + "','" + popoverId + "','" + positionId + "')");

var button = $('#' + buttonId);
button.click(function () {
Expand Down Expand Up @@ -426,7 +431,7 @@ export default class MidPointTheme {
popover.find('input[type=text],textarea,select').filter(':visible:first').focus();

//this will catch ESC or ENTER and fake close or update button click
popover.find('input[type=text],textarea,select').off('keyup.search').on('keyup.search', function(e) {
popover.find('input[type=text],textarea,select').off('keyup.search').on('keyup.search', function (e) {
if (e.keyCode == 27) {
popover.find('[data-type="close"]').click();
} else if (e.keyCode == 13) {
Expand Down Expand Up @@ -527,4 +532,18 @@ export default class MidPointTheme {

input.val(value);
}

initResponsiveTable() {
$('.table-responsive').on('show.bs.dropdown', function (e) {
const $dropdownMenu = $(e.target).find('.dropdown-menu'),
menuHeight = $dropdownMenu.outerHeight(true);
const extraHeight = 20;

$('.table-responsive').css("min-height", menuHeight + extraHeight + "px");
});

$('.table-responsive').on('hide.bs.dropdown', function () {
$('.table-responsive').css("min-height", "auto");
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private <F extends FocusType> void initLayout(PrismObject<F> object) {
@Override
protected List<StringLimitationResult> load() {
ValuePolicyType valuePolicy = null;
if (!object.canRepresent(ResourceType.class)) {
if (object == null || !object.canRepresent(ResourceType.class)) {
//we skip getting value policy for ResourceType because it is some protected string from connector configuration
valuePolicy = getValuePolicy(object);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public abstract class ContainerableListPanel<C extends Containerable, PO extends
private static final String OPERATION_LOAD_LOOKUP_TABLE = DOT_CLASS + "loadLookupTable";
private static final String ID_ITEMS_TABLE = "itemsTable";
private static final String ID_BUTTON_BAR = "buttonBar";
// private static final String ID_BUTTON_REPEATER = "buttonsRepeater";
// private static final String ID_BUTTON_REPEATER = "buttonsRepeater";
private static final String ID_BUTTON = "button";

private final Class<C> defaultType;
Expand Down Expand Up @@ -359,7 +359,7 @@ private int getDefaultPageSize() {
}

if (getTableId() != null) {
return getSession().getSessionStorage().getUserProfile().getPagingSize(getTableId());
return getSession().getSessionStorage().getUserProfile().getPagingSize(getTableId());
}

return UserProfileStorage.DEFAULT_PAGING_SIZE;
Expand Down Expand Up @@ -453,7 +453,7 @@ private List<IColumn<PO, String>> createColumns() {
InlineMenuButtonColumn<PO> actionsColumn = new InlineMenuButtonColumn<>(menuItems, getPageBase()) {
@Override
public String getCssClass() {
return "inline-menu-column";
return "inline-menu-column ";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,31 @@
<wicket:panel xmlns:wicket="http://wicket.apache.org">

<div class="row" style="display:-webkit-box; display:-webkit-flex; display:-ms-flexbox; display:flex;">
<div class="col-md-4">
<div class="col-12 col-xl-4">
<div style="height: 100%; max-height:800px; padding-bottom:20px;" wicket:id="treePanel"/>
</div>
<div class="col-md-8">
<div class="col-12 col-xl-8">
<div class="card object-user-box" wicket:id="managerContainer">
<div class="card-header">
<h3 class="card-title"><wicket:message key="TreeTablePanel.managers"/></h3>
</div>
<div class="card-header">
<h3 class="card-title">
<wicket:message key="TreeTablePanel.managers"/>
</h3>
</div>
<div class="card-body">
<div wicket:id="managerTable">
<div wicket:id="managerSummary" />
<div wicket:id="managerSummary"/>
</div>
</div>
</div>

<div class="card card-primary">
<div class="card-header">
<h3 class="card-title"><wicket:message key="TreeTablePanel.members"/></h3>
<h3 class="card-title">
<wicket:message key="TreeTablePanel.members"/>
</h3>
</div>
<div class="card-body">
<div wicket:id="memberPanel" />
<div wicket:id="memberPanel"/>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

package com.evolveum.midpoint.gui.impl.page.admin.systemconfiguration.component;

import org.apache.wicket.markup.html.panel.Panel;

import com.evolveum.midpoint.common.configuration.api.ProfilingMode;
import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper;
import com.evolveum.midpoint.gui.api.prism.wrapper.ItemMandatoryHandler;
import com.evolveum.midpoint.gui.impl.factory.wrapper.ProfilingClassLoggerWrapperFactoryImpl;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
Expand All @@ -22,13 +24,11 @@
import com.evolveum.midpoint.web.application.PanelDisplay;
import com.evolveum.midpoint.web.application.PanelInstance;
import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.web.component.prism.ItemVisibility;
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.wicket.markup.html.panel.Panel;

import javax.xml.namespace.QName;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ClassLoggerConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ProfilingConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType;

@PanelType(name = "profilingPanel")
@PanelInstance(
Expand Down Expand Up @@ -60,7 +60,13 @@ protected void initLayout() {

SingleContainerPanel panel = new SingleContainerPanel(ID_MAIN_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(SystemConfigurationType.F_PROFILING_CONFIGURATION)),
ProfilingConfigurationType.COMPLEX_TYPE);
ProfilingConfigurationType.COMPLEX_TYPE) {

@Override
protected ItemMandatoryHandler getMandatoryHandler() {
return (itemWrapper -> false);
}
};
add(panel);

PrismContainerWrapperModel<SystemConfigurationType, ClassLoggerConfigurationType> profilingLogger =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:extend>
<wicket:enclosure child="individualSystemsContainer">
<wicket:enclosure child="propagatePasswordCheckbox">
<div class="mb-3" wicket:id="propagatePasswordCheckbox"/>
<div wicket:id="individualSystemsContainer" class="mb-3">
<div class="card card-outline card-secondary password-propagation">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public void onUpdate(AjaxRequestTarget target) {
}

};
propagatePasswordCheckbox.add(new VisibleBehaviour(this::shouldLoadAccounts));
propagatePasswordCheckbox.setOutputMarkupId(true);
add(propagatePasswordCheckbox);

Expand All @@ -123,9 +124,8 @@ protected boolean hideFooterIfSinglePage() {

private boolean isIndividualSystemsContainerVisible() {
CheckBoxPanel propagateCheckBox = getPropagatePasswordCheckbox();
return shouldLoadAccounts() &&
(propagateCheckBox.getCheckboxModel().getObject() != null
&& propagateCheckBox.getCheckboxModel().getObject() || showResultInTable);
return propagateCheckBox.getCheckboxModel().getObject() != null
&& propagateCheckBox.getCheckboxModel().getObject() || showResultInTable;
}

private CheckBoxPanel getPropagatePasswordCheckbox() {
Expand Down

0 comments on commit bca3647

Please sign in to comment.