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.
This ports the follows app from a4-opin to adhocracy4 core. There are some important things to note:
It is currently only possible to follow projects. In the future it might be a requirement to follow other things, e.g. items. It is not yet clear how this will work exactly. It will probably be implemented as a separate (but related) feature. We think that using generic foreign keys is overkill here.
The react component does not currently support the case where the user is not logged in. For now, the recommended bahvior in this case is not to show the component. See follow count shows zero if logged out a4-opin#629 and click on follow button should lead to login page a4-opin#627 for related issues in a4-opin.
There is some discussion as to whether the API of this feature should be changed. This pull request keeps the current API. The related issue Refactor Follows API a4-opin#510 should be moved to this repository.
The API does not currently check project membership on private projects. The recommended way for this is to check membership when sending notifications. It might be a good idea to check it here though.
The HTML code may need to be adapted in order to be stylable in different projects.