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

knowledgepixels / nanodash / 17675472756

12 Sep 2025 01:10PM UTC coverage: 13.79% (+0.05%) from 13.739%
17675472756

push

github

tkuhn
test: Fix GrlcQueryTest

433 of 3980 branches covered (10.88%)

Branch coverage included in aggregate %.

1112 of 7224 relevant lines covered (15.39%)

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

3
import java.io.Serializable;
4
import java.util.ArrayList;
5
import java.util.Collections;
6
import java.util.List;
7

8
import org.apache.commons.lang3.tuple.Pair;
9
import org.apache.wicket.markup.html.WebMarkupContainer;
10
import org.apache.wicket.markup.html.panel.Panel;
11
import org.apache.wicket.markup.repeater.Item;
12
import org.apache.wicket.markup.repeater.data.DataView;
13
import org.apache.wicket.markup.repeater.data.ListDataProvider;
14
import org.apache.wicket.request.mapper.parameter.PageParameters;
15

16
import com.knowledgepixels.nanodash.GrlcQuery;
17
import com.knowledgepixels.nanodash.Space;
18
import com.knowledgepixels.nanodash.template.Template;
19

20
public class PinGroupList extends Panel {
21

22
    public PinGroupList(String markupId, Space space) {
23
        super(markupId);
×
24

25
        final PageParameters params = new PageParameters();
×
26
        if (space.getDefaultProvenance() != null) {
×
27
            params.add("prtemplate", space.getDefaultProvenance().stringValue());
×
28
        }
29

30
        List<Pair<String, List<Serializable>>> pinnedResourcesList = new ArrayList<>();
×
31
        List<String> pinGroupTags = new ArrayList<>(space.getPinGroupTags());
×
32
        Collections.sort(pinGroupTags);
×
33
        List<Serializable> pinnedResources = new ArrayList<>(space.getPinnedResources());
×
34
        for (String tag : pinGroupTags) {
×
35
            for (Object pinned : space.getPinnedResourceMap().get(tag)) {
×
36
                if (pinnedResources.contains(pinned)) pinnedResources.remove(pinned);
×
37
            }
×
38
            pinnedResourcesList.add(Pair.of(tag, space.getPinnedResourceMap().get(tag)));
×
39
        }
×
40
        if (!pinnedResources.isEmpty()) {
×
41
            String l = pinnedResourcesList.isEmpty() ? "Resources" : "Other Resources";
×
42
            pinnedResourcesList.add(Pair.of(l, pinnedResources));
×
43
        }
44

45
        add(new DataView<Pair<String, List<Serializable>>>("pin-groups", new ListDataProvider<>(pinnedResourcesList)) {
×
46
            @Override
47
            protected void populateItem(Item<Pair<String, List<Serializable>>> item) {
48
               item.add(new ItemListPanel<Serializable>(
×
49
                        "pin-group",
50
                        item.getModelObject().getLeft(),
×
51
                        item.getModelObject().getRight(),
×
52
                        (o) -> {
53
                            if (o instanceof Template t) return new TemplateItem("item", t, params);
×
54
                            if (o instanceof GrlcQuery q) return new QueryItem("item", q);
×
55
                            return null;
×
56
                        }));
57
            }
×
58
        });
59

60
        add(new WebMarkupContainer("emptynotice").setVisible(pinnedResourcesList.isEmpty()));
×
61
    }
×
62

63

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