Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
* 'master' of github.com:Evolveum/midpoint:
  MID-6271 responsiveness on task activities item processing panel
  sequence element wrong location
  schema for available filters (saved search)
  MID-6271 getting rid of "box", replacing by "card" classes, cleanup on task activities item processing panel, removing obsolete panels/classes
  • Loading branch information
katkav committed May 18, 2022
2 parents f52fdf9 + cc7c57a commit aa0499a
Show file tree
Hide file tree
Showing 44 changed files with 275 additions and 630 deletions.
6 changes: 6 additions & 0 deletions gui/admin-gui/src/frontend/scss/midpoint-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1818,3 +1818,9 @@ span.yui-skin-sam {
.login-footer {
font-size: 13px;
}

.info-box.activity-item-processing > .info-box-content > .progress-description {
overflow-wrap: break-word;
word-break: break-word;
max-width: 50vw;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class GuiStyleConstants {
public static final String ICON_FA_POWER_OFF = "fa fa-power-off";
public static final String ICON_FA_SPINNER = "fa fa-spinner";

public static final String CLASS_BOX = "box";
public static final String CLASS_BOX_DEFAULT = "box-default";
public static final String CLASS_BOX = "card";
public static final String CLASS_BOX_DEFAULT = "card-default";

public static final String CLASS_DASHBOARD_ICON = "fa fa-tachometer-alt";

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

<wicket:panel xmlns:wicket="http://wicket.apache.org">

<div wicket:id="objectDeltaOperationMarkup" class="box">
<div wicket:id="objectDeltaOperationMarkup" class="card">
<table class="table table-striped">
<tr>
<td><wicket:message key="ObjectDeltaOperationType.resourceName" /></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,34 +132,34 @@ public void headerOnClickPerformed(AjaxRequestTarget target, IModel<SceneDto> mo

private String getBoxCssClass() {
if (getModel().getObject() == null) {
return " box-primary";
return "card-primary";
}

if (getModel().getObject().getExecutionResult() == null) {
return " box-primary";
return "card-primary";
}

if (getModel().getObject().getExecutionResult().getStatus() == null) {
return " box-primary";
return "card-primary";
}

OperationResultStatusType status = getModel().getObject().getExecutionResult().getStatus();
switch (status) {
case PARTIAL_ERROR:
case FATAL_ERROR:
return " box-danger";
return "card-danger";
case WARNING:
case UNKNOWN:
case HANDLED_ERROR:
return " box-warning";
return "card-warning";
case IN_PROGRESS:
case NOT_APPLICABLE:
return " box-primary";
return "card-primary";
case SUCCESS:
return " box-success";
return "card-success";

}
return " box-primary";
return "card-primary";

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ <h3 class="card-title" wicket:id="message">
<i class="mr-2 fa" wicket:id="iconType"></i>
<span wicket:id="messageLabel"/>
</h3>
<a class="box-title" wicket:id="backgroundTask">
<a class="card-title" wicket:id="backgroundTask">
<wicket:message key="OperationResultPanel.showTask"/>
</a>
<a class="box-title" wicket:id="case">
<a class="card-title" wicket:id="case">
<wicket:message key="OperationResultPanel.showCase"/>
</a>
<div class="card-tools">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3606,19 +3606,34 @@ public static String getReferenceObjectTextValue(ObjectReferenceType ref, PrismR
}

public static String formatDurationWordsForLocal(long durationMillis, boolean suppressLeadingZeroElements,
boolean suppressTrailingZeroElements, PageBase pageBase) {
boolean suppressTrailingZeroElements) {
return formatDurationWordsForLocal(durationMillis, suppressLeadingZeroElements, suppressTrailingZeroElements, null);
}

/**
* uses the one without "comp" parameter
* @param durationMillis
* @param suppressLeadingZeroElements
* @param suppressTrailingZeroElements
* @param comp
* @return
*/
@Deprecated
public static String formatDurationWordsForLocal(long durationMillis, boolean suppressLeadingZeroElements,
boolean suppressTrailingZeroElements, Component comp) {

Localizer localizer = comp != null ? comp.getLocalizer() : Application.get().getResourceSettings().getLocalizer();

String duration = formatDuration(durationMillis, suppressLeadingZeroElements, suppressTrailingZeroElements);
// String duration = DurationFormatUtils.formatDurationWords(durationMillis, suppressLeadingZeroElements, suppressTrailingZeroElements);

duration = StringUtils.replaceOnce(duration, "seconds", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.seconds").getString());
duration = StringUtils.replaceOnce(duration, "minutes", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.minutes").getString());
duration = StringUtils.replaceOnce(duration, "hours", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.hours").getString());
duration = StringUtils.replaceOnce(duration, "days", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.days").getString());
duration = StringUtils.replaceOnce(duration, "second", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.second").getString());
duration = StringUtils.replaceOnce(duration, "minute", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.minute").getString());
duration = StringUtils.replaceOnce(duration, "hour", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.hour").getString());
duration = StringUtils.replaceOnce(duration, "day", pageBase.createStringResource("WebComponentUtil.formatDurationWordsForLocal.day").getString());
duration = StringUtils.replaceOnce(duration, "seconds", localizer.getString("WebComponentUtil.formatDurationWordsForLocal.seconds", comp));
duration = StringUtils.replaceOnce(duration, "minutes", localizer.getString("WebComponentUtil.formatDurationWordsForLocal.minutes", comp));
duration = StringUtils.replaceOnce(duration, "hours", localizer.getString("WebComponentUtil.formatDurationWordsForLocal.hours", comp));
duration = StringUtils.replaceOnce(duration, "days", localizer.getString("WebComponentUtil.formatDurationWordsForLocal.days", comp));
duration = StringUtils.replaceOnce(duration, "second", localizer.getString("WebComponentUtil.formatDurationWordsForLocal.second", comp));
duration = StringUtils.replaceOnce(duration, "minute", localizer.getString("WebComponentUtil.formatDurationWordsForLocal.minute", comp));
duration = StringUtils.replaceOnce(duration, "hour", localizer.getString("WebComponentUtil.formatDurationWordsForLocal.hour", comp));
duration = StringUtils.replaceOnce(duration, "day", localizer.getString("WebComponentUtil.formatDurationWordsForLocal.day", comp));

return duration;
}
Expand Down Expand Up @@ -4792,27 +4807,27 @@ public static List<SceneDto> computeChangesCategorizationList(ChangesByState cha
OperationResult thisOpResult) throws SchemaException, ExpressionEvaluationException {
List<SceneDto> changes = new ArrayList<>();
if (!changesByState.getApplied().isEmpty()) {
changes.add(createTaskChangesDto("TaskDto.changesApplied", "box-solid box-success", changesByState.getApplied(),
changes.add(createTaskChangesDto("TaskDto.changesApplied", "card-success", changesByState.getApplied(),
modelInteractionService, prismContext, objectRef, opTask, thisOpResult));
}
if (!changesByState.getBeingApplied().isEmpty()) {
changes.add(createTaskChangesDto("TaskDto.changesBeingApplied", "box-solid box-info", changesByState.getBeingApplied(),
changes.add(createTaskChangesDto("TaskDto.changesBeingApplied", "card-info", changesByState.getBeingApplied(),
modelInteractionService, prismContext, objectRef, opTask, thisOpResult));
}
if (!changesByState.getWaitingToBeApplied().isEmpty()) {
changes.add(createTaskChangesDto("TaskDto.changesWaitingToBeApplied", "box-solid box-warning",
changes.add(createTaskChangesDto("TaskDto.changesWaitingToBeApplied", "card-warning",
changesByState.getWaitingToBeApplied(), modelInteractionService, prismContext, objectRef, opTask, thisOpResult));
}
if (!changesByState.getWaitingToBeApproved().isEmpty()) {
changes.add(createTaskChangesDto("TaskDto.changesWaitingToBeApproved", "box-solid box-primary",
changes.add(createTaskChangesDto("TaskDto.changesWaitingToBeApproved", "card-primary",
changesByState.getWaitingToBeApproved(), modelInteractionService, prismContext, objectRef, opTask, thisOpResult));
}
if (!changesByState.getRejected().isEmpty()) {
changes.add(createTaskChangesDto("TaskDto.changesRejected", "box-solid box-danger", changesByState.getRejected(),
changes.add(createTaskChangesDto("TaskDto.changesRejected", "card-danger", changesByState.getRejected(),
modelInteractionService, prismContext, objectRef, opTask, thisOpResult));
}
if (!changesByState.getCanceled().isEmpty()) {
changes.add(createTaskChangesDto("TaskDto.changesCanceled", "box-solid box-danger", changesByState.getCanceled(),
changes.add(createTaskChangesDto("TaskDto.changesCanceled", "card-danger", changesByState.getCanceled(),
modelInteractionService, prismContext, objectRef, opTask, thisOpResult));
}
return changes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</div>
</wicket:enclosure>
<span class="progress-description" wicket:id="description"/>
<span class="progress-description" wicket:id="description2"/>
</div>
</wicket:panel>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class InfoBox extends BasePanel<InfoBoxData> {
private static final String ID_NUMBER = "number";
private static final String ID_PROGRESS = "progress";
private static final String ID_DESCRIPTION = "description";
public static final String ID_DESCRIPTION_2 = "description2";
private static final String ID_ICON = "icon";
private static final String ID_ICON_CONTAINER = "iconContainer";

Expand Down Expand Up @@ -77,9 +78,10 @@ protected void onEvent(AjaxRequestTarget target) {
};
add(linkClick);

addLabel(ID_TEXT, () -> getModelObject().getText());
addLabel(ID_NUMBER, () -> getModelObject().getNumber());
addLabel(ID_DESCRIPTION, () -> getModelObject().getDescription());
add(createLabel(ID_TEXT, () -> getModelObject().getText()));
add(createLabel(ID_NUMBER, () -> getModelObject().getNumber()));
add(createLabel(ID_DESCRIPTION, () -> getModelObject().getDescription()));
add(createLabel(ID_DESCRIPTION_2, () -> getModelObject().getDescription2()));

WebMarkupContainer progress = new WebMarkupContainer(ID_PROGRESS);
progress.add(new VisibleBehaviour(() -> getModelObject().getProgress() != null));
Expand All @@ -96,9 +98,9 @@ protected void onEvent(AjaxRequestTarget target) {
iconContainer.add(icon);
}

private void addLabel(String id, IModel model) {
protected Component createLabel(String id, IModel model) {
Label label = new Label(id, model);
label.add(new VisibleBehaviour(() -> model.getObject() != null));
add(label);
return label;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

package com.evolveum.midpoint.gui.impl.component.box;

import org.apache.wicket.request.component.IRequestablePage;

import java.io.Serializable;

import org.apache.wicket.request.component.IRequestablePage;

/**
* Created by Viliam Repan (lazyman).
*/
Expand All @@ -24,6 +24,8 @@ public class InfoBoxData implements Serializable {

private String description;

private String description2;

private String icon;

private String infoBoxCssClass;
Expand Down Expand Up @@ -73,6 +75,14 @@ public void setDescription(String description) {
this.description = description;
}

public String getDescription2() {
return description2;
}

public void setDescription2(String description2) {
this.description2 = description2;
}

public String getIcon() {
return icon;
}
Expand Down

This file was deleted.

0 comments on commit aa0499a

Please sign in to comment.