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

knowledgepixels / nanodash / 21595973435

02 Feb 2026 03:23PM UTC coverage: 14.461% (+0.2%) from 14.286%
21595973435

Pull #349

github

web-flow
Merge 196b1534b into 35ff7f048
Pull Request #349: Domain model refactor to avoid confusion around different meanings

577 of 5258 branches covered (10.97%)

Branch coverage included in aggregate %.

1570 of 9589 relevant lines covered (16.37%)

2.13 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 com.knowledgepixels.nanodash.IndividualAgent;
4
import com.knowledgepixels.nanodash.ResourceWithProfile;
5
import com.knowledgepixels.nanodash.Space;
6
import com.knowledgepixels.nanodash.SpaceMemberRole;
7
import org.apache.wicket.markup.html.basic.Label;
8
import org.apache.wicket.markup.html.link.AbstractLink;
9
import org.apache.wicket.markup.html.panel.Panel;
10
import org.apache.wicket.markup.repeater.Item;
11
import org.apache.wicket.markup.repeater.data.DataView;
12
import org.apache.wicket.markup.repeater.data.ListDataProvider;
13

14
import java.util.ArrayList;
15
import java.util.List;
16

17
public class ButtonList extends Panel {
18

19
    public ButtonList(String markupId, ResourceWithProfile resourceWithProfile, 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 (resourceWithProfile 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
        } else if (resourceWithProfile instanceof IndividualAgent ia) {
×
35
            if (ia.isCurrentUser() && adminButtons != null) {
×
36
                allButtons.addAll(adminButtons);
×
37
            }
38
        }
39
        if (allButtons.isEmpty()) {
×
40
            add(new Label("buttons").setVisible(false));
×
41
        } else {
42
            add(new DataView<AbstractLink>("buttons", new ListDataProvider<AbstractLink>(allButtons)) {
×
43

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

49
            });
50
        }
51
    }
×
52

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