• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

knowledgepixels / nanodash / 19237538372

10 Nov 2025 03:52PM UTC coverage: 13.839% (+0.03%) from 13.813%
19237538372

Pull #283

github

web-flow
Merge acc25ba44 into 4241085bb
Pull Request #283: Fix the HTML rendering in `QueryResultList`

514 of 4680 branches covered (10.98%)

Branch coverage included in aggregate %.

1334 of 8674 relevant lines covered (15.38%)

0.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
src/main/java/com/knowledgepixels/nanodash/component/QueryResultList.java
1
package com.knowledgepixels.nanodash.component;
2

3
import com.knowledgepixels.nanodash.GrlcQuery;
4
import com.knowledgepixels.nanodash.Utils;
5
import com.knowledgepixels.nanodash.ViewDisplay;
6
import org.apache.wicket.behavior.AttributeAppender;
7
import org.apache.wicket.markup.html.basic.Label;
8
import org.apache.wicket.markup.html.panel.Panel;
9
import org.apache.wicket.markup.repeater.RepeatingView;
10
import org.nanopub.extra.services.ApiResponse;
11
import org.nanopub.extra.services.ApiResponseEntry;
12

13
import java.util.Arrays;
14
import java.util.stream.Collectors;
15

16
public class QueryResultList extends Panel {
17

18
    QueryResultList(String markupId, GrlcQuery grlcQuery, ApiResponse response, ViewDisplay viewDisplay) {
19
        super(markupId);
×
20

21
        add(new AttributeAppender("class", " col-" + viewDisplay.getDisplayWidth()));
×
22

23
        String label = grlcQuery.getLabel();
×
24
        if (viewDisplay.getView().getTitle() != null) {
×
25
            label = viewDisplay.getView().getTitle();
×
26
        }
27
        add(new Label("label", label));
×
28
        RepeatingView listItems = new RepeatingView("listItems");
×
29
        for (ApiResponseEntry entry : response.getData()) {
×
30
            String labelText = buildInlineLabel(entry, response);
×
31
            listItems.add(new Label(listItems.newChildId(), labelText).setEscapeModelStrings(false));
×
32
        }
×
33
        add(listItems);
×
34
    }
×
35

36
    private String buildInlineLabel(ApiResponseEntry entry, ApiResponse response) {
37
        return Arrays.stream(response.getHeader())
×
38
                .map(entry::get)
×
39
                .filter(entryValue -> entryValue != null && !entryValue.isBlank())
×
40
                .map(entryValue -> Utils.looksLikeHtml(entryValue) ? Utils.sanitizeHtml(entryValue) : entryValue)
×
41
                .collect(Collectors.joining(", "));
×
42
    }
43

44
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc