client icon indicating copy to clipboard operation
client copied to clipboard

Show only bioTome's groups on bioTome demo site

Open seanh opened this issue 8 months ago • 1 comments

Problem

bioRxiv want only their own groups to be shown in the embedded client on biorxiv.org.

Specifically: they'll have an open group that should always be shown, and they'll have a private group for their moderators that should be shown if the authenticated user is a member of the private group. No other groups should be shown in the client's dropdown menu.

In addition, bioRxiv want the + Create new group button to be removed from the client's groups menu.

The embedded client on our demo site https://biotome.hypothes.is/ is currently configured to show only a demo open group and demo private group using pre-existing client settings, like so:

<script type="application/json" class="js-hypothesis-config">
  {
    ...,
    "services": [{
      "apiUrl": "${HYPOTHESIS_API_URL}",
      "authority": "${HYPOTHESIS_AUTHORITY}",
      "groups": [${HYPOTHESIS_GROUPS}]
    }]
  }
</script>

However, there are several issues with this configuration:

  • If the user is not a member of the ReviewR Moderators private group they see an error message when the client first appears: Unable to fetch groups: Network request failed (404): Either the resource you requested doesn't exist, or you are not currently authorized to see it. Users who aren't members of the private group should not see the private group in the groups menu. But they shouldn't see an error message either.

  • The configuration causes the sign up, log in and log out buttons in the client to stop working. These should work normally.

  • The + Create new group button is still shown. We'd like this to be removed.

  • The groups menu has the text CURRENTLY VIEWING at the top. This is weird. We'd like to remove this.

    Image
  • The ReviewR Moderators group has an h. logo next to it. This shouldn't be there.

Solution

We'll add new client configuration settings for restricting the groups shown in the client's groups menu to certain, specific groups and for hiding the + Create new group button.

We'll use our demo site https://biotome.hypothes.is/ to test and demo this configuration.

Done when

  • [ ] Only the ReviewR open group and ReviewR Moderators private group are shown in the client's groups menu on https://biotome.hypothes.is/.
  • [ ] Users who aren't a member of the private group don't see the private group in the groups menu
  • [ ] Users who aren't a member of the private group don't see an error message
  • [ ] The + Create private group button isn't shown in the client's groups menu on https://biotome.hypothes.is/.
  • [ ] CURRENTLY VIEWING isn't shown in the client's groups menu on https://biotome.hypothes.is/.
  • [ ] The log in, sign up and log out links work as normal
  • [ ] No h. logo is shown next to the ReviewR Moderators group in the client's groups menu on https://biotome.hypothes.is/. (This may require implementing creating private groups in organizations other than the default organization. I don't think this is possible currently.)

seanh avatar May 14 '25 17:05 seanh

FYI if you run make devdata in h, then run make dev in https://github.com/hypothesis/biotome, you'll find (to your delight, I'm sure) that h's make devdata now creates an open and a private group for bioTome, and bioTome's make dev configures the client to show only those groups, using the same configuration in dev as https://biotome.hypothes.is/ has in production. You're welcome 😛

seanh avatar May 14 '25 17:05 seanh

The embedded client on our demo site https://biotome.hypothes.is/ is currently configured to show only a demo open group and demo private group using pre-existing client settings, like so:

Note for anyone else reading this. The configuration has changed since this issue was opened. See https://github.com/hypothesis/biotome/pull/8. The current configuration on that page is just:

<script type="application/json" class="js-hypothesis-config">
    {
      "enableExperimentalNewNoteButton": true,
      "externalContainerSelector": "#hypothesis"
    }
  </script>

robertknight avatar Sep 29 '25 11:09 robertknight

It is now possible to do this via the new groupsAllowlist configuration option. https://github.com/hypothesis/client/pull/7410

acelaya avatar Oct 31 '25 13:10 acelaya