Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Feb 16, 2023
2 parents cff80dd + 086b62a commit a64f164
Show file tree
Hide file tree
Showing 58 changed files with 1,828 additions and 346 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

/**
* @author semancik
*
*/
public class GuiStyleConstants {

public static final String ICON_FAR_COPY="far fa-copy";
public static final String ICON_FAR_COPY = "far fa-copy";
public static final String ICON_FAR_ADDRESS_CARD = "far fa-address-card";
public static final String ICON_FAR_CLOCK = "far fa-clock";
public static final String ICON_FA_BED = "fa fa-bed";
Expand Down Expand Up @@ -111,7 +110,7 @@ public class GuiStyleConstants {
public static final String CLASS_ICON_PROFILE = "fa fa-user";
public static final String CLASS_ICON_CREDENTIALS = "fa fa-shield-alt";
public static final String CLASS_ICON_REQUEST = "fa fa-pen-square";
public static final String CLASS_ICON_REQUEST_ACCESS ="fas fa-plus-circle";
public static final String CLASS_ICON_REQUEST_ACCESS = "fas fa-plus-circle";
public static final String CLASS_ICON_CONSENT = "fa fa-check-square";

public static final String CLASS_APPROVAL_OUTCOME_ICON_UNKNOWN_COLORED = "fa fa-check text-warning";
Expand Down Expand Up @@ -285,4 +284,6 @@ public class GuiStyleConstants {
public static final String CLASS_SIMULATION_RESULT = "fa-solid fa-flask";

public static final String CLASS_MARK = "fa-solid fa-tag";

public static final String CLASS_AUDIT = "fa-solid fa-magnifying-glass-chart";
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected Component createButtonContent(String id, IModel<Toggle<O>> model) {
icon.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(model.getObject().getIconCss())));
defaultButtonContent.add(icon);

Label label = new Label(ID_LABEL, () -> model.getObject().getLabel());
Label label = new Label(ID_LABEL, () -> getString(model.getObject().getLabel(), null, model.getObject().getLabel()));
label.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(model.getObject().getLabel())));
defaultButtonContent.add(label);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import com.evolveum.midpoint.util.LocalizableMessage;

public class ProgressBar {
import java.io.Serializable;

public class ProgressBar implements Serializable {

public enum State {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import javax.xml.namespace.QName;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.reflect.ConstructorUtils;
Expand Down Expand Up @@ -2284,7 +2285,10 @@ public static String createShadowIcon(PrismObject<ShadowType> object) {
return GuiStyleConstants.CLASS_SHADOW_ICON_PROTECTED;
}

ShadowKindType kind = shadow.getKind();
return createShadowIcon(shadow.getKind());
}

public static String createShadowIcon(@Nullable ShadowKindType kind) {
if (kind == null) {
return GuiStyleConstants.CLASS_SHADOW_ICON_UNKNOWN;
}
Expand Down Expand Up @@ -3711,7 +3715,6 @@ public static List<ResourceAssociationDefinition> getRefinedAssociationDefinitio

public static ResourceObjectDefinition getResourceObjectDefinition(ConstructionType construction, PageBase pageBase) throws CommonException {

PrismContext prismContext = pageBase.getPrismContext();
if (construction == null) {
return null;
}
Expand Down Expand Up @@ -5621,4 +5624,15 @@ public static ItemPath getPath(GuiObjectColumnType column) {

return column.getPath().getItemPath();
}

public static boolean isEnabledExperimentalFeatures() {
GuiProfiledPrincipal principal = AuthUtil.getPrincipalUser();
if (principal == null) {
return false;
}

CompiledGuiProfile profile = principal.getCompiledGuiProfile();

return profile != null && BooleanUtils.isTrue(profile.isEnableExperimentalFeatures());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
<span class="btn btn-tool mt-0">
<i class="p-1" wicket:id="infoIcon"/>
</span>
<button class="ml-auto btn btn-sm btn-primary" wicket:id="resetButton">
<wicket:message key="ExpressionPanel.resetButton"/>
</button>
<div class="ml-auto">
<button class="ml-auto btn btn-sm btn-primary" wicket:id="resetButton">
<wicket:message key="ExpressionPanel.resetButton"/>
</button>
</div>
</div>
<div wicket:id="evaluatorPanel"/>
</wicket:panel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ private MainMenuItem createReportsItems() {
}

private MainMenuItem createAuditItems() {
return createMainMenuItem("PageAuditLogViewer.menuName", GuiStyleConstants.CLASS_TODO_FIXME_NOT_YET_DEFINED, PageAuditLogViewer.class);
return createMainMenuItem("PageAuditLogViewer.menuName", GuiStyleConstants.CLASS_AUDIT, PageAuditLogViewer.class);
}

private MainMenuItem createSimulationItems() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,13 @@
<wicket:panel>
<wicket:enclosure child="tilesContainer">
<div class="d-flex flex-column flex-grow-1">
<div wicket:id="tilesHeader"/>
<div class="card d-flex flex-column p-3 mb-0 mt-4" style="min-height: 5.4rem;" wicket:id="selectedItemsContainer">
<span>
<wicket:message key="SelectObjectClassesStepPanel.selectedItem"/>
</span>
<div class="d-flex flex-wrap gap-2">
<wicket:container wicket:id="selectedItemContainer">
<div class="btn-sm btn-primary d-flex mr-2" style="cursor: auto;">
<div class="text-break" wicket:id="selectedItem"/>
<a wicket:id="deselectButton">
<i class="fa fa-xmark ml-2 text-white"></i>
</a>
</div>
</wicket:container>
</div>
</div>
<div class="row pt-3" wicket:id="tilesContainer">
<div wicket:id="header"/>
<div class="row pt-3 card-footer mx-0" wicket:id="tilesContainer">
<div wicket:id="tiles" style="min-height: 250px;">
<div wicket:id="tile"/>
</div>
</div>
<div class="d-flex" wicket:id="footerContainer">
<div class="d-flex card-header" wicket:id="footerContainer">
<div class="d-flex">
<div wicket:id="buttonToolbar"/>
</div>
Expand All @@ -40,5 +25,33 @@
</wicket:enclosure>

<div wicket:id="table"/>

</wicket:panel>

<wicket:fragment wicket:id="headerFragment">
<div class="d-flex flex-column">
<div class="card-header d-flex">
<div class="mr-auto pr-4">
<div wicket:id="viewToggle"/>
</div>
<div class="ml-auto" wicket:id="panelHeader"/>
</div>
<div class="card-header d-flex flex-column" style="min-height: 5.4rem;" wicket:id="selectedItemsContainer">
<span>
<wicket:message key="SelectObjectClassesStepPanel.selectedItem"/>
</span>
<div class="d-flex flex-wrap gap-2">
<wicket:container wicket:id="selectedItemContainer">
<div class="btn-sm btn-primary d-flex mr-2" style="cursor: auto;">
<div class="text-break" wicket:id="selectedItem"/>
<a wicket:id="deselectButton">
<i class="fa fa-xmark ml-2 text-white"></i>
</a>
</div>
</wicket:container>
</div>
</div>
</div>
</wicket:fragment>

</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.evolveum.midpoint.gui.impl.component.tile;

import com.evolveum.midpoint.gui.impl.component.data.provider.SelectableBeanDataProvider;
import com.evolveum.midpoint.gui.impl.page.admin.resource.component.TemplateTile;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.gui.impl.component.data.provider.SelectableBeanObjectDataProvider;
Expand All @@ -10,11 +11,14 @@

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
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.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

import java.io.Serializable;
import java.util.List;
Expand All @@ -29,20 +33,27 @@ public abstract class MultiSelectTileTablePanel<E extends Serializable, O extend
public MultiSelectTileTablePanel(
String id,
UserProfileStorage.TableId tableId) {
super(id, tableId);
this(id, Model.of(ViewToggle.TILE), tableId);
}

@Override
protected void onInitialize() {
super.onInitialize();
initLayout();
public MultiSelectTileTablePanel(
String id,
IModel<ViewToggle> viewToggle,
UserProfileStorage.TableId tableId) {
super(id, viewToggle, tableId);
}

private void initLayout(){
@Override
protected Fragment createHeaderFragment(String id) {
Fragment headerFragment = super.createHeaderFragment(id);

headerFragment.add(AttributeAppender.replace("class", ""));


WebMarkupContainer selectedItemsContainer = new WebMarkupContainer(ID_SELECTED_ITEMS_CONTAINER);
selectedItemsContainer.setOutputMarkupId(true);
selectedItemsContainer.add(new VisibleBehaviour(() -> isSelectedItemsPanelVisible()));
add(selectedItemsContainer);
headerFragment.add(selectedItemsContainer);

ListView<E> selectedContainer = new ListView<>(
ID_SELECTED_ITEM_CONTAINER,
Expand All @@ -65,6 +76,7 @@ public void onClick(AjaxRequestTarget target) {
};
selectedContainer.setOutputMarkupId(true);
selectedItemsContainer.add(selectedContainer);
return headerFragment;
}

protected boolean isSelectedItemsPanelVisible() {
Expand All @@ -78,7 +90,7 @@ public void refresh(AjaxRequestTarget target) {
}

protected Component getSelectedItemPanel() {
return get(ID_SELECTED_ITEMS_CONTAINER);
return get(createComponentPath(ID_HEADER, ID_SELECTED_ITEMS_CONTAINER));
}

protected abstract void deselectItem(E entry);
Expand All @@ -101,12 +113,24 @@ protected void onClick(AjaxRequestTarget target) {
super.onClick(target);
getModelObject().getValue().setSelected(getModelObject().isSelected());

processSelectOrDeselectItem(getModelObject());
processSelectOrDeselectItem(getModelObject().getValue());
target.add(getSelectedItemPanel());
}
};
}

protected void processSelectOrDeselectItem(TemplateTile<SelectableBean<O>> tile) {
void onSelectTableRow(IModel<SelectableBean<O>> model, AjaxRequestTarget target) {
boolean oldState = model.getObject().isSelected();

model.getObject().setSelected(!oldState);
processSelectOrDeselectItem(model.getObject());
if (model.getObject().isSelected()) {
((SelectableBeanDataProvider) getProvider()).getSelected().add(model.getObject().getValue());
}

refresh(target);
}

protected void processSelectOrDeselectItem(SelectableBean<O> value) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!--
~ Copyright (c) 2010-2017 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>
<wicket:enclosure child="tilesContainer">
<div class="d-flex flex-column flex-grow-1">
<div class="card-header" wicket:id="header"/>
<div class="row justify-content-center pt-3 card-footer mx-0" wicket:id="tilesContainer">
<div wicket:id="tiles" style="min-height: 250px;">
<div wicket:id="tile"/>
</div>
</div>
<div class="d-flex card-header" wicket:id="footerContainer">
<div class="d-flex">
<div wicket:id="buttonToolbar"/>
</div>
<div class="ml-auto align-self-end" wicket:id="tilesPaging"/>
</div>
</div>
</wicket:enclosure>

<div wicket:id="table"/>
</wicket:panel>
<wicket:fragment wicket:id="headerFragment">
<div class="d-flex">
<div class="mr-auto pr-4">
<div wicket:id="viewToggle"/>
</div>
<div class="ml-auto" wicket:id="panelHeader"/>
</div>
</wicket:fragment>
</html>

0 comments on commit a64f164

Please sign in to comment.