Community App - Legal terms in the

Register
Submit a solution
The challenge is finished.

Challenge Overview

As you probably know, some of Topcoder challenges can be protected by various legal terms; when you push Register button, if any of the required terms has not been agreed by you previously, you are taken to Terms agreement flow, and only once successfully completed, you are actually registered to the challenge. This functionality is already implemented for the new challenge details page in Community App, along with the option to run the app with mock challenge terms service, which simplifies related development and testing (there are some functional restrictions though).

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!
 

Final Submission Guidelines

Submit Git patch for the Community App, verification instructions and a brief demo video.

ELIGIBLE EVENTS:

2018 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30059817