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

knowledgepixels / nanodash / 17837235071

18 Sep 2025 05:58PM UTC coverage: 13.87%. Remained the same
17837235071

push

github

tkuhn
chore: Remove serialVersionUIDs

443 of 4022 branches covered (11.01%)

Branch coverage included in aggregate %.

1133 of 7341 relevant lines covered (15.43%)

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

3
import com.knowledgepixels.nanodash.NanodashPreferences;
4
import com.knowledgepixels.nanodash.NanodashSession;
5
import com.knowledgepixels.nanodash.User;
6
import com.knowledgepixels.nanodash.page.*;
7
import org.apache.wicket.markup.html.basic.Label;
8
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
9
import org.apache.wicket.markup.html.link.ExternalLink;
10
import org.apache.wicket.markup.html.panel.Panel;
11
import org.apache.wicket.request.mapper.parameter.PageParameters;
12
import org.eclipse.rdf4j.model.IRI;
13

14
/**
15
 * A panel that displays a link to the user's profile.
16
 */
17
public class ProfileItem extends Panel {
18

19
    /**
20
     * Constructor for the ProfileItem panel.
21
     *
22
     * @param id   the component id
23
     * @param page a {@link com.knowledgepixels.nanodash.page.NanodashPage} object
24
     */
25
    public ProfileItem(String id, NanodashPage page) {
26
        super(id);
×
27
        NanodashSession session = NanodashSession.get();
×
28
        NanodashPreferences prefs = NanodashPreferences.get();
×
29
        IRI userId = session.getUserIri();
×
30
        if (prefs.isOrcidLoginMode() && userId == null) {
×
31
            String redirectMountPath = ProfilePage.MOUNT_PATH;
×
32
            PageParameters redirectPageParams = new PageParameters();
×
33
            if (page != null) {
×
34
                redirectMountPath = ((NanodashPage) page).getMountPath();
×
35
                redirectPageParams = ((NanodashPage) page).getPageParameters();
×
36
            }
37
            ExternalLink l = new ExternalLink("profilelink", OrcidLoginPage.getOrcidLoginUrl(redirectMountPath, redirectPageParams));
×
38
            l.add(new Label("profiletext", "Login with ORCID"));
×
39
            add(l);
×
40
        } else if (prefs.isReadOnlyMode()) {
×
41
            BookmarkablePageLink<HomePage> l = new BookmarkablePageLink<>("profilelink", HomePage.class);
×
42
            l.add(new Label("profiletext", ""));
×
43
            add(l);
×
44
        } else {
×
45
            if (userId != null) {
×
46
                BookmarkablePageLink<ProfilePage> l = new BookmarkablePageLink<ProfilePage>("profilelink", UserPage.class, new PageParameters().add("id", userId.stringValue()));
×
47
                l.add(new Label("profiletext", User.getShortDisplayName(userId)));
×
48
                add(l);
×
49
            } else {
×
50
                BookmarkablePageLink<ProfilePage> l = new BookmarkablePageLink<ProfilePage>("profilelink", ProfilePage.class);
×
51
                l.add(new Label("profiletext", "incomplete profile"));
×
52
                add(l);
×
53
            }
54
        }
55
    }
×
56

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