hasgeek / funnel

Website for hasgeek.com
https://hasgeek.com/
GNU Affero General Public License v3.0
46 stars 52 forks source link

Fix organization crew notifications #1640

Open djamg opened 1 year ago

djamg commented 1 year ago

Havelock Vetinari is the owner of Ankh-Morpork organization and Mustrum Ridcully is a user. Vetinari decides to make Ridcully an admin of the organization.

This action by Vetinari triggers a notification to the other admins of the organization in this format: <actor> made <subject> <role> of <organization> which is specified in the feature file and implemented in this file

The notification template looks like this:

image

The image of the subject appears because they are the user of interest (Ridcully) next to the actor(Vetinari)'s name.

There are 3 conflicts here:

  1. The notification was triggered by something Vetinari did, so technically Vetinari is the actor (in the data model).
  2. For membership notifications, we made an explicit choice that the subject is the user of interest (here, Ridcully), and so the notification view changes the actor.
  3. However, the notification string was written to use active voice instead of passive voice, so once again it refers to Vetinari doing something.
djamg commented 1 year ago

An example to write the strings to make it sound less passive: Mustrum Ridcully is now an admin of Ankh-Morpork (appointed by Havelock Vetinari)

These changes have to go in the feature file

zainabbawa commented 1 year ago

Subject first, followed by action and then actor. For example, "Sreelakshmi made admin of xyz project by Zainab Bawa."

jace commented 1 year ago

The updated strings with matching tests are part of #1423.