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

knowledgepixels / nanodash / 17611782280

10 Sep 2025 11:06AM UTC coverage: 13.872% (-0.3%) from 14.17%
17611782280

push

github

tkuhn
Add Space and SpacePage, replicating Project and ProjectPage

431 of 3944 branches covered (10.93%)

Branch coverage included in aggregate %.

1111 of 7172 relevant lines covered (15.49%)

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

3
import java.util.Arrays;
4

5
import org.apache.wicket.request.mapper.parameter.PageParameters;
6

7
import com.knowledgepixels.nanodash.Project;
8
import com.knowledgepixels.nanodash.QueryRef;
9
import com.knowledgepixels.nanodash.Space;
10
import com.knowledgepixels.nanodash.component.ItemListElement;
11
import com.knowledgepixels.nanodash.component.ItemListPanel;
12
import com.knowledgepixels.nanodash.component.TitleBar;
13
import com.knowledgepixels.nanodash.connector.ConnectorConfig;
14
import com.knowledgepixels.nanodash.connector.GenOverviewPage;
15

16
/**
17
 * A page that lists all available connectors.
18
 */
19
public class ConnectorListPage extends NanodashPage {
20

21
    /**
22
     * The mount path for this page.
23
     */
24
    public static final String MOUNT_PATH = "/connectorlist";
25

26
    /**
27
     * {@inheritDoc}
28
     */
29
    @Override
30
    public String getMountPath() {
31
        return MOUNT_PATH;
×
32
    }
33

34
    private static final String[] journals = new String[]{"ios/ds", "pensoft/bdj", "pensoft/rio"};
×
35

36
    /**
37
     * Constructor for the ConnectorListPage.
38
     *
39
     * @param parameters the page parameters
40
     */
41
    public ConnectorListPage(final PageParameters parameters) {
42
        super(parameters);
×
43

44
        add(new TitleBar("titlebar", this, "connectors"));
×
45

46
        add(new ItemListPanel<Space>(
×
47
                "spaces",
48
                "Spaces",
49
                new QueryRef("get-spaces"),
50
                (apiResponse) -> { Space.refresh(apiResponse); return Space.getSpaceList(); },
×
51
                (space) -> {
52
                    return new ItemListElement("item", SpacePage.class, new PageParameters().add("id", space.getId()), space.getLabel());
×
53
                }
54
            ));
55

56
        add(new ItemListPanel<Project>(
×
57
                "projects",
58
                "Projects  Project pages are still experimental:",
59
                new QueryRef("get-projects"),
60
                (apiResponse) -> { Project.refresh(apiResponse); return Project.getProjectList(); },
×
61
                (project) -> {
62
                    return new ItemListElement("item", ProjectPage.class, new PageParameters().add("id", project.getId()), project.getLabel());
×
63
                }
64
            ));
65

66
        add(new ItemListPanel<String>(
×
67
                "journals",
68
                "Journals",
69
                Arrays.asList(journals),
×
70
                (journalId) -> {
71
                    String journalName = ConnectorConfig.get(journalId).getJournalName();
×
72
                    return new ItemListElement("item", GenOverviewPage.class, new PageParameters().add("journal", journalId), journalName);
×
73
                }
74
            ));
75
    }
×
76

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