Skip to content

Commit

Permalink
Small UI refinements for the reset datasource support
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet authored and stuartwdouglas committed Aug 18, 2021
1 parent 9041867 commit db5eab6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public DevConsoleTemplateInfoBuildItem devConsoleInfo(
@BuildStep(onlyIf = IsDevelopment.class)
@Record(value = STATIC_INIT, optional = true)
DevConsoleRouteBuildItem devConsoleCleanDatabaseHandler(DatabaseRecorder recorder) {
return new DevConsoleRouteBuildItem("clean", "POST", recorder.devConsoleCleanDatabaseHandler());
return new DevConsoleRouteBuildItem("reset", "POST", recorder.devConsoleResetDatabaseHandler());
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<a href="{urlbase}/clean" class="badge badge-light">
<i class="fa fa-database fa-fw"></i>
<a href="{urlbase}/reset" class="badge badge-light">
<i class="fa fa-snowplow fa-fw"></i>
Reset Databases</a>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{#include main}
{#title}Clean Databases{/title}
{#title}Reset Databases{/title}
{#body}
<table class="table table-striped">
<thead class="thead-dark">
Expand All @@ -17,7 +17,7 @@
<td>
<form method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="name" value="{db}">
<input id="invoke" type="submit" value="Invoke" class="btn btn-primary btn-sm">
<input id="invoke" type="submit" value="Reset" class="btn btn-primary btn-sm">
</form>
</td>
{/for}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Recorder
public class DatabaseRecorder {

public Handler<RoutingContext> devConsoleCleanDatabaseHandler() {
public Handler<RoutingContext> devConsoleResetDatabaseHandler() {
// the usual issue of Vert.x hanging on to the first TCCL and setting it on all its threads
final ClassLoader currentCl = Thread.currentThread().getContextClassLoader();
return new DevConsolePostHandler() {
Expand All @@ -24,7 +24,7 @@ protected void handlePostAsync(RoutingContext event, MultiMap form) throws Excep
for (DatabaseSchemaProvider i : dbs) {
i.resetDatabase(name);
}
flashMessage(event, "Action invoked");
flashMessage(event, "Database successfully reset");
}
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
artifact: ${project.groupId}:${project.artifactId}:${project.version}
name: "Datasource configuration"
name: "Datasources"
metadata:
keywords:
- "datasource"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void testCleanDatabase() {
RestAssured.when().get("/my-entity/add").then().body(is("MyEntity:added"));
RestAssured.when().get("/my-entity/count").then().body(is("3"));
RestAssured.with()
.redirects().follow(false).formParam("name", "<default>").post("q/dev/io.quarkus.quarkus-datasource/clean")
.redirects().follow(false).formParam("name", "<default>").post("q/dev/io.quarkus.quarkus-datasource/reset")
.then()
.statusCode(303);
RestAssured.when().get("/my-entity/count").then().body(is("2"));
Expand Down

0 comments on commit db5eab6

Please sign in to comment.