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

knowledgepixels / nanodash / 17837235071

18 Sep 2025 05:58PM UTC coverage: 13.87%. Remained the same
17837235071

push

github

tkuhn
chore: Remove serialVersionUIDs

443 of 4022 branches covered (11.01%)

Branch coverage included in aggregate %.

1133 of 7341 relevant lines covered (15.43%)

0.68 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/ReactionList.java
1
package com.knowledgepixels.nanodash.component;
2

3
import com.knowledgepixels.nanodash.User;
4
import com.knowledgepixels.nanodash.Utils;
5
import com.knowledgepixels.nanodash.page.ExplorePage;
6
import org.apache.wicket.markup.html.basic.Label;
7
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
8
import org.apache.wicket.markup.html.panel.Panel;
9
import org.apache.wicket.markup.repeater.Item;
10
import org.apache.wicket.markup.repeater.data.DataView;
11
import org.apache.wicket.markup.repeater.data.ListDataProvider;
12
import org.apache.wicket.request.mapper.parameter.PageParameters;
13
import org.nanopub.Nanopub;
14
import org.nanopub.extra.services.ApiResponse;
15
import org.nanopub.extra.services.ApiResponseEntry;
16

17
/**
18
 * A panel that displays a list of reactions to a nanopublication.
19
 */
20
public class ReactionList extends Panel {
21

22
    /**
23
     * Constructs a ReactionList panel.
24
     *
25
     * @param id   the component id
26
     * @param resp the API response containing reaction data
27
     * @param np   the nanopublication to which reactions are related
28
     */
29
    public ReactionList(String id, ApiResponse resp, Nanopub np) {
30
        super(id);
×
31

32
        add(new DataView<ApiResponseEntry>("reactions", new ListDataProvider<ApiResponseEntry>(resp.getData())) {
×
33

34
            @Override
35
            protected void populateItem(Item<ApiResponseEntry> item) {
36
                ApiResponseEntry e = item.getModelObject();
×
37
                PageParameters params = new PageParameters();
×
38
                if (e.get("pub").equals(np.getUri().stringValue())) {
×
39
                    item.add(new Label("reactionnote"));
×
40
                } else {
41
                    item.add(new Label("reactionnote", "On earlier version:"));
×
42
                }
43
                item.add(new Label("reactiontext", "\"" + e.get("text") + "\" (" + e.get("reltext") + " the nanopublication above)"));
×
44
                params.add("id", e.get("np"));
×
45
                BookmarkablePageLink<Void> l = new BookmarkablePageLink<Void>("reactionlink", ExplorePage.class, params);
×
46
                String pubkeyhash = Utils.createSha256HexHash(e.get("pubkey"));
×
47
                String username = User.getShortDisplayNameForPubkeyhash(null, pubkeyhash);
×
48
                l.add(new Label("reactionlinktext", "by " + username + " on " + e.get("date").substring(0, 10)));
×
49
                item.add(l);
×
50
            }
×
51

52
        });
53
    }
×
54

55
}
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