Skip to content

Commit

Permalink
Avoid confusion between entity instances and entity types in the HSea…
Browse files Browse the repository at this point in the history
…rch devcard

Signed-off-by: Yoann Rodière <[email protected]>
  • Loading branch information
yrodiere authored and gsmet committed Mar 1, 2021
1 parent f265630 commit 9d0e7ca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public class DevConsoleProcessor {

@BuildStep(onlyIf = IsDevelopment.class)
public DevConsoleRuntimeTemplateInfoBuildItem collectBeanInfo() {
return new DevConsoleRuntimeTemplateInfoBuildItem("entities", new HibernateSearchSupplier());
return new DevConsoleRuntimeTemplateInfoBuildItem("entityTypes", new HibernateSearchSupplier());
}

@BuildStep
@Record(value = STATIC_INIT, optional = true)
DevConsoleRouteBuildItem invokeEndpoint(HibernateSearchDevConsoleRecorder recorder) {
return new DevConsoleRouteBuildItem("entities", "POST", recorder.indexEntity());
return new DevConsoleRouteBuildItem("entity-types", "POST", recorder.indexEntity());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a href="{urlbase}/entities" class="badge badge-light">
<a href="{urlbase}/entity-types" class="badge badge-light">
<i class="fa fa-search fa-fw"></i>
Indexed entities <span class="badge badge-light">{info:entities.size()}</span></a>
Indexed entity types <span class="badge badge-light">{info:entityTypes.size()}</span></a>
<br>
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
<input type="checkbox" class="form-check-input" id="check-all">
</div>
</th>
<th scope="col">Entity</th>
<th scope="col">Entity type</th>
</tr>
</thead>
<tbody>
{#for entity in info:entities}
{#for entityType in info:entityTypes}
<tr>
<td>
<div class="custom-control">
<input type="checkbox" class="form-check-input checkbox" name="{entity}" id="{entity}">
<input type="checkbox" class="form-check-input checkbox" name="{entityType}" id="{entityType}">
</div>
</td>
<td>{entity}</td>
<td>{entityType}</td>
</tr>
{/for}
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected void handlePostAsync(RoutingContext event, MultiMap form) throws Excep
}
SearchMapping mapping = HibernateSearchSupplier.searchMapping();
if (mapping == null) {
flashMessage(event, "There aren't any indexed entities!", FlashScopeUtil.FlashMessageStatus.ERROR);
flashMessage(event, "There aren't any indexed entity types!", FlashScopeUtil.FlashMessageStatus.ERROR);
return;
}
mapping.scope(Object.class,
Expand Down

0 comments on commit 9d0e7ca

Please sign in to comment.