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

knowledgepixels / nanodash / 19769156996

28 Nov 2025 04:22PM UTC coverage: 14.051% (+0.2%) from 13.867%
19769156996

push

github

tkuhn
refactor(ButtonList): Generalize from Space to ProfiledResource

526 of 4892 branches covered (10.75%)

Branch coverage included in aggregate %.

1419 of 8950 relevant lines covered (15.85%)

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

3
import java.util.ArrayList;
4
import java.util.List;
5

6
import org.apache.wicket.markup.html.basic.Label;
7
import org.apache.wicket.markup.html.link.AbstractLink;
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

13
import com.knowledgepixels.nanodash.ProfiledResource;
14
import com.knowledgepixels.nanodash.Space;
15
import com.knowledgepixels.nanodash.SpaceMemberRole;
16

17
public class ButtonList extends Panel {
18

19
    public ButtonList(String markupId, ProfiledResource profiledResource, List<AbstractLink> buttons, List<AbstractLink> memberButtons, List<AbstractLink> adminButtons) {
20
        super(markupId);
×
21
        setOutputMarkupId(true);
×
22

23
        List<AbstractLink> allButtons = new ArrayList<>();
×
24
        if (buttons != null) {
×
25
            allButtons.addAll(buttons);
×
26
        }
27
        if (profiledResource instanceof Space space) {
×
28
            if (SpaceMemberRole.isCurrentUserMember(space) && memberButtons != null) {
×
29
                allButtons.addAll(memberButtons);
×
30
            }
31
            if (SpaceMemberRole.isCurrentUserAdmin(space) && adminButtons != null) {
×
32
                allButtons.addAll(adminButtons);
×
33
            }
34
        }
35
        if (allButtons.isEmpty()) {
×
36
            add(new Label("buttons").setVisible(false));
×
37
        } else {
38
            add(new DataView<AbstractLink>("buttons", new ListDataProvider<AbstractLink>(allButtons)) {
×
39

40
                @Override
41
                protected void populateItem(Item<AbstractLink> item) {
42
                    item.add(item.getModelObject());
×
43
                }
×
44
                
45
            });
46
        }
47
    }
×
48

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