Skip to content

Commit

Permalink
GUI fixes for Wicket 10
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed May 22, 2023
1 parent 43746bb commit 55fad71
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 22 deletions.
102 changes: 90 additions & 12 deletions gui/admin-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
<artifactId>spring-boot-starter-security</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
Expand Down Expand Up @@ -117,14 +113,32 @@
<dependency>
<groupId>com.evolveum.commons</groupId>
<artifactId>util</artifactId>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.evolveum.prism</groupId>
<artifactId>prism-api</artifactId>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.evolveum.prism</groupId>
<artifactId>prism-impl</artifactId>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -141,6 +155,12 @@
<groupId>com.evolveum.midpoint.repo</groupId>
<artifactId>repo-common</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.model</groupId>
Expand All @@ -161,6 +181,12 @@
<groupId>com.evolveum.midpoint.model</groupId>
<artifactId>model-common</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.repo</groupId>
Expand Down Expand Up @@ -204,6 +230,12 @@
<artifactId>repo-sql-impl</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.repo</groupId>
Expand All @@ -221,6 +253,12 @@
<groupId>com.evolveum.midpoint.model</groupId>
<artifactId>rest-impl</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -297,6 +335,12 @@
<artifactId>provisioning-impl</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.provisioning</groupId>
Expand All @@ -309,6 +353,12 @@
<artifactId>report-impl</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.model</groupId>
Expand Down Expand Up @@ -375,6 +425,18 @@
<artifactId>wicket-request</artifactId>
</dependency>

<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-commons-fileupload</artifactId>
<version>${wicket.version}</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-ioc</artifactId>
Expand All @@ -388,6 +450,12 @@
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-util</artifactId>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.wicket</groupId>
Expand Down Expand Up @@ -460,10 +528,6 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
Expand Down Expand Up @@ -546,12 +610,24 @@
<groupId>com.evolveum.midpoint.infra</groupId>
<artifactId>test-util</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.repo</groupId>
<artifactId>repo-test-util</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.repo</groupId>
Expand Down Expand Up @@ -627,6 +703,12 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -642,10 +724,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.List;
import javax.xml.namespace.QName;

import org.apache.cxf.common.util.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalDialog;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
Expand Down Expand Up @@ -299,6 +299,7 @@ protected void showAllAssignments(AjaxRequestTarget target) {

}

@Override
protected void reloadMainAssignmentsComponent(AjaxRequestTarget target){
target.add(get(ID_ASSIGNMENTS));
}
Expand All @@ -309,7 +310,7 @@ protected boolean isShowAllAssignmentsVisible(){

protected void addSelectedAssignablePerformed(AjaxRequestTarget target, List<ObjectType> newAssignments,
QName relation, String popupId) {
ModalWindow window = (ModalWindow) get(popupId);
ModalDialog window = (ModalDialog) get(popupId);
if (window != null) {
window.close(target);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.activation.MimeType;
import javax.activation.MimeTypeParseException;
import jakarta.activation.MimeType;
import jakarta.activation.MimeTypeParseException;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.IModel;
import org.apache.wicket.util.time.Duration;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

import java.time.Duration;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -534,7 +534,7 @@ private void startRefreshingProgressPanel(AjaxRequestTarget target) {
ProgressReporter reporter = reporterModel.getProcessData();
int refreshInterval = reporter.getRefreshInterval();

refreshingBehavior = new AjaxSelfUpdatingTimerBehavior(Duration.milliseconds(refreshInterval)) {
refreshingBehavior = new AjaxSelfUpdatingTimerBehavior(Duration.ofMillis(refreshInterval)) {

@Override
protected void onPostProcessTarget(AjaxRequestTarget target) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.util.time.Duration;
import javax.management.Attribute;
import javax.management.AttributeList;
import javax.management.MBeanServer;
Expand All @@ -28,6 +27,7 @@

import java.io.Serializable;
import java.lang.management.ManagementFactory;
import java.time.Duration;
import java.util.Date;

/**
Expand Down Expand Up @@ -140,7 +140,7 @@ private void initLayout() {
final WebMarkupContainer table = new WebMarkupContainer(ID_TABLE);
table.setOutputMarkupId(true);
add(table);
table.add(new AjaxSelfUpdatingTimerBehavior(Duration.milliseconds(10000)));
table.add(new AjaxSelfUpdatingTimerBehavior(Duration.ofMillis(10000)));

Label cpuUsage = new Label(ID_CPU_USAGE, new PropertyModel<>(getModel(), SystemInfoDto.F_CPU_USAGE));
table.add(cpuUsage);
Expand Down Expand Up @@ -177,7 +177,7 @@ public String getObject() {
}

int minutes = (int)(dto.uptime / 1000L / 60L);
return WebComponentUtil.formatDurationWordsForLocal(minutes < 1 ? dto.uptime : (long)minutes * 1000L * 60L, true, true,
return WebComponentUtil.formatDurationWordsForLocal(minutes < 1 ? dto.uptime : minutes * 1000L * 60L, true, true,
SystemInfoPanel.this.getPageBase());
}
};
Expand Down

0 comments on commit 55fad71

Please sign in to comment.