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

knowledgepixels / nanodash / 27831881428

19 Jun 2026 02:34PM UTC coverage: 26.652% (+0.07%) from 26.583%
27831881428

push

github

web-flow
Merge pull request #489 from knowledgepixels/feat/per-type-preset-templates

feat: per-type "add preset" templates (type-filtered preset choice)

1553 of 6847 branches covered (22.68%)

Branch coverage included in aggregate %.

3421 of 11816 relevant lines covered (28.95%)

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

3
import com.knowledgepixels.nanodash.QueryApiAccess;
4
import com.knowledgepixels.nanodash.View;
5
import com.knowledgepixels.nanodash.ViewDisplay;
6
import com.knowledgepixels.nanodash.domain.IndividualAgent;
7
import org.apache.wicket.markup.html.panel.Panel;
8
import org.nanopub.extra.services.QueryRef;
9

10
/**
11
 * The "About" tab body for a user: their introduction nanopublications, a public
12
 * read-only view of their profile (default license, profile picture), assigned
13
 * presets, and the listing of their configured view displays (issue #302).
14
 */
15
public class AboutUserPanel extends Panel {
16

17
    /**
18
     * View that lists a user's introduction nanopublications. Its per-row
19
     * retract/derive actions are driven by the viewer's session-bound magic query
20
     * params (LOCALPUBKEY/SITEURL), so the owner gets the editable actions and
21
     * everyone else gets the read-only table — no custom companion needed.
22
     */
23
    public static final String INTRODUCTIONS_VIEW = "https://w3id.org/np/RAmdDJAKs1gKPPdo23t6lMUXC6mlzLjRZyjDCcNEMx7Tw/introductions-view";
24

25
    /**
26
     * View showing a user's basic profile properties (default license and
27
     * profile picture), one per row.
28
     */
29
    public static final String PROFILE_VIEW = "https://w3id.org/np/RAtTP_qhEqsz2V8YoR6MfZ_j7gwcJ9SE2WvzjXLiagb9Q/profile-view";
30

31
    /**
32
     * View listing a user's configured view displays. Mirrors the space view-displays
33
     * view but its "add view display" action links the user-specific creation template.
34
     */
35
    public static final String USER_VIEW_DISPLAYS_VIEW = "https://w3id.org/np/RA1d1qBF8Fk-ZWKtNB-wZd56HrV0wdtJkw0wp58sHxM0E/view-displays-view";
36

37
    /**
38
     * View listing the presets assigned to a user. Mirrors the space preset-assignments view
39
     * but its "add preset" action links the user-specific template (offering only presets that
40
     * apply to users).
41
     */
42
    public static final String USER_PRESET_ASSIGNMENTS_VIEW = "https://w3id.org/np/RAd0UM_ll5a7Ewpg2VT5azZ7lh3S-K2ASCOIk2AgKfAJY/preset-assignments-view";
43

44
    /**
45
     * @param id            the Wicket markup id
46
     * @param userIriString the user IRI
47
     */
48
    public AboutUserPanel(String id, String userIriString) {
49
        super(id);
×
50

51
        // The owner's account/identity controls (logout, local-mode ORCID form,
52
        // signing key) AND the recommended actions now live in the page header
53
        // stripe's "This is you" box (ProfileAccountPanel), not here.
54

55
        // Introductions: a proper view for everyone. The owner's session-bound magic
56
        // params drive the per-row retract/derive action buttons; non-owners get the
57
        // read-only table. (Formerly the ProfileIntroItem companion for the owner.)
58
        View introView = View.get(INTRODUCTIONS_VIEW);
×
59
        add(QueryResultTableBuilder.create("introductions", new QueryRef(introView.getQuery().getQueryId(), "user", userIriString), new ViewDisplay(introView))
×
60
                .resourceWithProfile(IndividualAgent.get(userIriString))
×
61
                .id(userIriString)
×
62
                .contextId(userIriString)
×
63
                .build());
×
64

65
        // Profile view with result actions to update the profile image/license;
66
        // needs the resourceWithProfile/id/contextId for the action links.
67
        View profileView = View.get(PROFILE_VIEW);
×
68
        add(QueryResultTableBuilder.create("profile", new QueryRef(profileView.getQuery().getQueryId(), "user", userIriString), new ViewDisplay(profileView))
×
69
                .resourceWithProfile(IndividualAgent.get(userIriString))
×
70
                .id(userIriString)
×
71
                .contextId(userIriString)
×
72
                .build());
×
73

74
        View presetsView = View.get(USER_PRESET_ASSIGNMENTS_VIEW);
×
75
        add(QueryResultTableBuilder.create("presets", new QueryRef(presetsView.getQuery().getQueryId(), "resource", userIriString), new ViewDisplay(presetsView)).resourceWithProfile(IndividualAgent.get(userIriString)).id(userIriString).contextId(userIriString).build());
×
76

77
        View vdView = View.get(USER_VIEW_DISPLAYS_VIEW);
×
78
        add(QueryResultTableBuilder.create("viewdisplays", new QueryRef(QueryApiAccess.LIST_VIEW_DISPLAYS, "resource", userIriString), new ViewDisplay(vdView)).resourceWithProfile(IndividualAgent.get(userIriString)).id(userIriString).contextId(userIriString).build());
×
79
    }
×
80

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