In the group the "Information for members" tool can be enabled/disabled. This allows group coaches to enter a single info message which is displayed in the group menu.
In the course however, we have a much more sophisticated notification course element which can display multiple notification messages and also has the ability to push the messages to the members. The goal of this issue is to refactor this group information feature to use the same info message element as we know it from the course. (in the UI in the course it is called "notification", in the code it is the "info message". In the further spec we use the name "info message" to not confuse it with the notification infrastructure)
Luckily this use case was in our mind when years ago the course info message was designed. The component is already encapsulated and can be reused.
- Remove the old info message input form in group editor that is displayed when the info message is enabled
- Implement a simple coaches or all members toggle to configure who is allowed to create new info message element
- For display configuration, set may days to infinite and max notifications to 10 (not configurable for now)
- Deletion of messages can only be done by group coach, also when the all members setting is active.
- In the run code, remove the controller that displays the old info message
- Replace it with the info message module used also in the course
- Implement the notification handler to subscribe for changes
- Implement an upgrader that converts all existing info messages to the new info messages (create one single info message, dated to the creation date of the original info message if this date is known, otherwise use the creation date of the group)
Things to check
- Check if the old info message can be managed using the REST API. If so, implement is for the new info message. If not, ignore the REST API.
- Check if the old info messages was indexed by full text indexer. If so, index also the new info messages. if not, implement full text indexing for the group info messages
- Make sure the business path are updated and activated properly. When navigating around, make sure browser back always works and the URL in the browser shows the correct path to the messages.
- Make sure that when a user leaves the group the info message notification is deleted. At least check how this is done in the forum/briefcase group tool and handle it accordingly
- Make sure that deleting a group does properly cleanup the info messages on the database. Call the delete message of the manager on group deletion. Check how this is done for the forum group tool