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

knowledgepixels / nanodash / 19772182304

28 Nov 2025 07:14PM UTC coverage: 13.901% (-0.2%) from 14.051%
19772182304

push

github

tkuhn
feat(UserPage): Add support for view displays

525 of 4894 branches covered (10.73%)

Branch coverage included in aggregate %.

1398 of 8940 relevant lines covered (15.64%)

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/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.IndividualAgent;
14
import com.knowledgepixels.nanodash.ProfiledResource;
15
import com.knowledgepixels.nanodash.Space;
16
import com.knowledgepixels.nanodash.SpaceMemberRole;
17

18
public class ButtonList extends Panel {
19

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

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

45
                @Override
46
                protected void populateItem(Item<AbstractLink> item) {
47
                    item.add(item.getModelObject());
×
48
                }
×
49
                
50
            });
51
        }
52
    }
×
53

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