Skip to content

Commit

Permalink
Refactoring/#931 update JQuery UI dashboard webjars (#932)
Browse files Browse the repository at this point in the history
Fixes #931: Use JQuery UI webjars
  • Loading branch information
mcr-paulanand authored Jun 7, 2024
1 parent 68b46f4 commit 6ae9d86
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
10 changes: 10 additions & 0 deletions dashboard-parent/dashboard-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
<artifactId>xstream</artifactId>
</dependency>

<!-- WebJars -->
<dependency>
<groupId>de.agilecoders.wicket.webjars</groupId>
<artifactId>wicket-webjars</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery-ui</artifactId>
</dependency>

<!-- Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
requires org.apache.wicket.util;
requires xstream;
requires com.google.gson;
requires de.agilecoders.wicket.webjars;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.apache.wicket.MetaDataKey;
import org.apache.wicket.request.resource.PackageResourceReference;
import org.apache.wicket.request.resource.ResourceReference;
import de.agilecoders.wicket.webjars.request.resource.WebjarsJavaScriptResourceReference;

/**
* {@link DashboardSettings} which allows to specify set of resources for inclusion in an page header
Expand All @@ -32,8 +33,7 @@ public class DashboardSettings {
DashboardSettings.class, "res/dashboard.css");
private ResourceReference rtlCssReference = new PackageResourceReference(
DashboardSettings.class, "res/dashboard-rtl.css");
private ResourceReference jqueryUIReference = new PackageResourceReference(
DashboardSettings.class, "res/jquery-ui-1.13.0.min.js");
private ResourceReference jqueryUIReference = new WebjarsJavaScriptResourceReference("jquery-ui/current/jquery-ui.js");

private boolean includeJQueryUI = true;
private boolean includeJavaScript = true;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;

import de.agilecoders.wicket.webjars.WicketWebjars;
import org.apache.wicket.Application;
import org.apache.wicket.MetaDataKey;
import org.apache.wicket.Page;
Expand Down Expand Up @@ -36,6 +37,7 @@ public Class<? extends Page> getHomePage() {
@Override
protected void init() {
super.init();
WicketWebjars.install(this);
DashboardContext dashboardContext = this.getMetaData(DashboardContextInitializer.DASHBOARD_CONTEXT_KEY);
WidgetDescriptor widgetDescriptor;
dashboardContext.getWidgetRegistry().registerWidget(widgetDescriptor = new MyWidgetDescriptor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import static org.wicketstuff.dashboard.DashboardContextInitializer.getDashboardContext;

import de.agilecoders.wicket.webjars.WicketWebjars;
import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;
import org.wicketstuff.dashboard.Dashboard;
Expand All @@ -39,6 +40,7 @@ public static WicketApplication get() {
@Override
public void init() {
super.init();
WicketWebjars.install(this);

getCspSettings().blocking().disabled();

Expand Down

0 comments on commit 6ae9d86

Please sign in to comment.