Also we have in Community App various Topcoder sub-communities; some of them are public and any visitor can self-join them (e.g. Blockchain Community). Note that Join Now button behaves different when a vistor is logged in, and when he is not. In the first case, it just joins him to the community (by adding that user to the corresponding user group in the TC backend); in the second case, the button redirects user to the accounts-app, using a special return URL: after successful login that return URL takes the vistor back to the Blockchain community and automatically joins him to the community.
We want to add an option to protect this Join a Community flow by user terms agreements. The idea is:
- We add an optional terms param to the community config (e.g. https://github.com/topcoder-platform/community-app/blob/develop/src/server/tc-communities/blockchain/metadata.json). If present, terms parameter will hold an array of term IDs that user must agree with before joining the community;
- When user clicks Join community (in case he is not authenticated, then right after he got redirected back from accounts-app), we check whether he has agreed to all necessary terms in past. If yes, we join him; otherwise we take him through the same terms agreement process, as in the case of challenge details page, and register him only once successfully completed.
Technically, we want this to be implemented out of the latest commit in the develop branch of Community App (a013f9eb260d9a460aeba8bb7de89274e6e8eca5 at the moment of writing); following our coding standards. We expect you to re-use (and appropriately refactor, where necessary) the components and other functionality that implements challenge terms flow. In other words, our goal to get a generic solution for the terms agreement flow, that can be easlity reused to protect any other action in the app as well. Be sure to more related code to the appropriate paths (e.g. /src/shared/components/challenge-details/ChallengeTerms sure should become /src/shared/components/Terms).
In the case of any further questions / doubts do not hesitate to ask in the challenge forum!