• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Build has been canceled!

knowledgepixels / nanodash / 18221639883

03 Oct 2025 12:01PM UTC coverage: 13.723% (-0.01%) from 13.734%
18221639883

push

github

tkuhn
feat(Spaces): Automatically set SPACE template param from Space page

446 of 4108 branches covered (10.86%)

Branch coverage included in aggregate %.

1154 of 7551 relevant lines covered (15.28%)

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
        params.add("param_SPACE", space.getId());
×
27
        if (space.getDefaultProvenance() != null) {
×
28
            params.add("prtemplate", space.getDefaultProvenance().stringValue());
×
29
        }
30

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

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

64
        add(new WebMarkupContainer("emptynotice").setVisible(pinnedResourcesList.isEmpty()));
×
65
    }
×
66

67

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