Repository navigation
Conversation
This was referenced Nov 26, 2026
Closed
A class group's members come from the classes on each student's Profile, and
spring#309 lets only teachers and admins change them through POST and DELETE
/api/groups/{id}/members/{personId}. Members now shows Add and Remove on a class
group only to them (canChangeMembers). Everyone else sees the list, without the
Action column. With the search hidden, createDialog focuses the close button, so
focus stays in the dialog. isClassGroup now trims the name before comparing, as
Spring's ClassGroupMembershipService does.
Allowances.for(me) mirrors Spring's rules for the page. Spring's MentorRules keep an account with ROLE_MENTOR and no teacher or admin role to its team's groups, so that account gets no New chat, no Find or make, and no Remove or add search in Members. Its empty Direct messages list says direct messages are off, the empty thread pane says to pick a group, and Leave says a member can add them back. Allowances also holds those words and shows or hides the buttons. The page passes its answers to the shared modules, which never check the mentor role; a test fails if one does. New chat leaves out people Spring won't let anyone message, since Spring refuses any direct message that includes one of them. A refusal now carries Spring's reason with its status, uploads too. A send, a New chat start or a member change that Spring refuses for a mentor rule says why instead of asking to try again. Members marks the members Spring says are mentors, and a dialog whose fields are all hidden focuses Close.
…keeps its status The page passed createThread two texts objects, and the later one (the commands placeholder) replaced Allowances' words, so a mentor's empty thread pane still offered New chat and Find a group. They're one object now, and a test fails if a second appears. A failed response whose body can't be read now keeps its status, with no reason, instead of rejecting with the read error.
Spring refuses "message the owner" with mentor_no_direct_messages when the page's owner or the visitor is a mentor. The block showed its generic "Couldn't start a message. Try again." for that, so the visitor kept trying. It now says a mentor would be in the message.
… check reads every module "Add at least 2 people who aren't mentors" was wrong for a group that already had one. It now says a group needs at least 2 members who aren't mentors before it can have a mentor. The test that keeps the mentor role out of shared code read 5 of the 42 modules. It now reads every one but allowances.js.
…roup rule Open-Coding-Society#2088 hides Members' Action column on a class group for anyone who isn't a teacher or admin, so the dialog now toggles the column's header, and the tests give it one. A student no longer gets Add in a class group, so the class-group refusal test opens the dialog as a teacher.
svaka2000
force-pushed
the
feat/messages-mentors
branch
from
November 26, 2026 06:06
5dce732 to
4c63abe
Compare
Contributor
Author
|
Combined into #2091 with the same commits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Messages now only offers an account what Spring lets it do. For a mentor, that means no direct messages, no finding or making groups, and no adding or removing members.
Allowancesclass (allowances.js) follows Spring's rules: an account with ROLE_MENTOR and no teacher or admin role only talks in groups it's been added to.How it fits with Darshan's work:
role-view.jsswitches the site sidebar, and nothing here changes that.allowances.jschecks the mentor role. The page gets the answers fromAllowancesand passes them in, and a test reads every file and fails if one does.Other notes:
messages-api.jsnow keeps thereasonSpring gives when it refuses something.node --test _projects/systems/messages/tests/*.test.mjsand the UI Builder tests pass. I tried it against a local Spring with Mentors: no direct messages, and only the groups they're added to spring#303, in Chrome and Safari's engine.How to try it (with Open-Coding-Society/spring#303):