Improve the error message when changing resources to complementary items in an application with multiple members
- Dominant language
- Clojure
- Stars
- 66
- Forks
- 28
- Avg merge
- 7d 4h
- Merged PRs (30d)
- 2
Description
Continuing from https://github.com/CSCfi/rems/issues/3475
and regarding https://github.com/CSCfi/rems/pull/3476#issuecomment-5602798260
The error message could be improved somewhat. The id alone does work as a search term when changing resources, but there's not much reassurance being offered to the applicant that this is the right one to add, as the id is not displayed anywhere.
The error message is reused for a member joining the application, when they don't have prior entitlement. The main applicant, when being relayed this message, could work it out as mentioned, but the message for an invitee who's unfamiliar with REMS is admittedly rather cryptic.
Also, in an application with multiple members, it's not clear which member is the one who is missing the entitlement. This is easy to add to the error message[^1] but it would initially seem like a bit of a grey area concerning the applicants' privacy.
When changing the resource, Reagent goes on to fetch the catalogue, so the ids in the error message can be matched to catalogue item titles. The error message is rendered using an effect, where subscriptions aren't available, but effects do get the app db as a parameter. Weirdly though, `::catalogue` didn't seem to be stored in the app db even though it's clearly used in the dropdown, but it wasn't immediately obvious why.
Perhaps there's also a way to prevent inviting someone without the necessary entitlements or an account yet, or simply display a flash message to alert the applicant that they should either consider whether everyone has the required entitlements, or add them to the application. We should evaluate which option makes the most sense to handlers and REMS operators.
See also:
[^1]: https://github.com/CSCfi/rems/issues/3487
Contributor guide
Research direction
Read issues 3475 and 3487 and the discussion on pull request 3476 first. Trace the Reagent error-message effect, its app-db parameter, and how ::catalogue is populated during resource changes. Done means an agreed handler/operator approach that gives applicants useful entitlement and member context without exposing inappropriate information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- authorization, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100