Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ <h4 wicket:id="label">Query</h4>
<ul wicket:id="items" class="inline-list">
<li wicket:id="listItem"></li>
</ul>
<p wicket:id="no-records" class="no-records-note">Nothing found.</p>
<div class="navigation" wicket:id="navigation">
<div class="navigatorLabel" wicket:id="navigatorLabel"></div>
<div class="navigator" wicket:id="navigator"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,18 @@ protected void populateItem(Item<ApiResponseEntry> item) {
navigation.setVisible(dataView.getPageCount() > 1);
navigation.add(pagingNavigator);

Label noRecordsLabel = new Label("no-records", "Nothing found.") {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(filteredDataProvider.size() == 0);
}
};

itemsContainer = new WebMarkupContainer("items-container");
itemsContainer.setOutputMarkupId(true);
itemsContainer.add(dataView);
itemsContainer.add(noRecordsLabel);
itemsContainer.add(navigation);
add(itemsContainer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ <h4 wicket:id="title">[View Title]</h4>
</div>
<div wicket:id="nanopubs-container">
<div class="flex-container" wicket:id="nanopubs"></div>
<p wicket:id="no-records" class="no-records-note">Nothing found.</p>
</div>
</wicket:panel>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ protected void populateComponent() {
nanopubsContainer = new WebMarkupContainer("nanopubs-container");
nanopubsContainer.setOutputMarkupId(true);
nanopubsContainer.add(buildNanopubResults());
Label noRecordsLabel = new Label("no-records", "Nothing found.") {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(filteredDataProvider.size() == 0);
}
};
nanopubsContainer.add(noRecordsLabel);
add(nanopubsContainer);

if (viewDisplay.getNanopubId() != null) {
Expand All @@ -110,6 +118,10 @@ protected void populateComponent() {
private NanopubResults buildNanopubResults() {
NanopubResults nanopubResults = NanopubResults.fromApiResponse("nanopubs", filteredDataProvider.getFilteredData(), itemsPerPage);
nanopubResults.add(AttributeAppender.append("class", NanodashSession.get().getNanopubResultsViewMode().getValue()));
// Hide the (empty) results container when there is nothing to show, so the
// "Nothing found." note sits directly below the header instead of being pushed
// down by the flex-container's padding.
nanopubResults.setVisible(!filteredDataProvider.getFilteredData().isEmpty());
return nanopubResults;
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 4 additions & 7 deletions src/main/java/com/knowledgepixels/nanodash/page/ExplorePage.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ <h2><span wicket:id="termname"></span></h2>
</div>

<div wicket:id="info-section" class="row-section">
<div class="col-12">
<div wicket:id="classes-panel"></div>
<div wicket:id="definitions-panel"></div>
<div wicket:id="instances-panel"></div>
<div wicket:id="templates-panel"></div>
<div wicket:id="parts-panel"></div>
</div>
<div wicket:id="classes-panel"></div>
<div wicket:id="definitions-panel"></div>
<div wicket:id="instances-panel"></div>
<div wicket:id="templates-panel"></div>
</div>

<div wicket:id="nanopub-section" class="row-section">
Expand Down
25 changes: 19 additions & 6 deletions src/main/java/com/knowledgepixels/nanodash/page/ExplorePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public class ExplorePage extends NanodashPage {
*/
public static final String MOUNT_PATH = "/explore";

private static final String DESCRIBED_IN_VIEW = "https://w3id.org/np/RAMH_7qMY-jmgXr2jqqk5F_XW7t2k2n3NCB6LtoKEXDzY/described-in-view";
private static final String CLASSES_VIEW = "https://w3id.org/np/RAHPtR1VriEW09tcvZhrM8Dr3vE1JnMWWi9-ajKJWNOJs/classes-view";
private static final String INSTANCES_VIEW = "https://w3id.org/np/RABXfsNoT_RYlk8LpDmKfJ2poSlvIGk3jgq4DkR4YLAps/instances-view";
private static final String TEMPLATES_VIEW = "https://w3id.org/np/RAP0-S9PUUVF1rQiqo8vq8z6XWsXkeGBUo60DJf8JsXsc/templates-view";

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -300,18 +305,26 @@ private void initPage() {
if (publishedNanopub != null) {
infoSection.add(new Label("classes-panel").setVisible(false));
} else {
infoSection.add(ThingListPanel.createComponent("classes-panel", ThingListPanel.Mode.CLASSES, ref, "<em>Searching for classes...</em>"));
View classesView = View.get(CLASSES_VIEW);
QueryRef classesQueryRef = new QueryRef(classesView.getQuery().getQueryId(), "thing", ref);
infoSection.add(QueryResultListBuilder.create("classes-panel", classesQueryRef, new ViewDisplay(classesView)).build());
}
if (isNanopubId) {
infoSection.add(new Label("definitions-panel").setVisible(false));
infoSection.add(new Label("instances-panel").setVisible(false));
infoSection.add(new Label("parts-panel").setVisible(false));
infoSection.add(new Label("templates-panel").setVisible(false));
} else {
infoSection.add(ThingListPanel.createComponent("definitions-panel", ThingListPanel.Mode.DESCRIPTIONS, ref, "<em>Searching for term descriptions...</em>"));
infoSection.add(ThingListPanel.createComponent("instances-panel", ThingListPanel.Mode.INSTANCES, ref, "<em>Searching for instances...</em>"));
infoSection.add(ThingListPanel.createComponent("parts-panel", ThingListPanel.Mode.PARTS, ref, "<em>Searching for parts...</em>"));
infoSection.add(ThingListPanel.createComponent("templates-panel", ThingListPanel.Mode.TEMPLATES, ref, "<em>Searching for templates...</em>"));
View describedInView = View.get(DESCRIBED_IN_VIEW);
QueryRef describedInQueryRef = new QueryRef(describedInView.getQuery().getQueryId(), "term", ref);
infoSection.add(QueryResultNanopubSetBuilder.create("definitions-panel", describedInQueryRef, new ViewDisplay(describedInView)).build());

View instancesView = View.get(INSTANCES_VIEW);
QueryRef instancesQueryRef = new QueryRef(instancesView.getQuery().getQueryId(), "class", ref);
infoSection.add(QueryResultListBuilder.create("instances-panel", instancesQueryRef, new ViewDisplay(instancesView)).build());

View templatesView = View.get(TEMPLATES_VIEW);
QueryRef templatesQueryRef = new QueryRef(templatesView.getQuery().getQueryId(), "thing", ref);
infoSection.add(QueryResultListBuilder.create("templates-panel", templatesQueryRef, new ViewDisplay(templatesView)).build());
}
add(infoSection);
}
Expand Down
Loading