Challenge Overview
Topcoder Connect is our primary customer facing platform. Messaging is an important part of the application, and it supports two modes of messaging: Status updates and Discussions.
In this challenge we’ll do two things
-
Improve the message editing interface
-
Add options for message editing and deleting
Message editing improvements
When posting a new status update or starting a new discussion thread, a formatting bar is available in the post editor, but when replying to posts there is just a textarea.
We want to add the same editor when responding to posts. The change here should be quite straightforward, as you only need to make the updates in AddComment component (replace the textarea element with the post editor)
Edit & Delete Messages
Adding edit/delete features will require both backend and frontend changes. Backend currently only supports creating a topic and adding comments, and we’ll need to add endpoints for editing/deleting messages.
Frontend changes
After a post (or a comment) is created, it will have a small menu in the top right with options to edit or delete the post. The menu should be shown only if the current user is the post author. Option to delete a post should be shown only if it has no comments attached to it.
Clicking the edit icon will enter edit mode - the user can change content in the post and then save (repost). The user should also be able to cancel changes. When editing, there should be two buttons at the bottom of the composer (instead of “Post”):
-
Update post
-
Cancel
Clicking the Update button should send a POST to api/v4/topics/TOPIC_ID/edit in case the message being edited is the first post, or a POST to api/v4/topic/TOPIC_ID/posts/POST_ID/edit in case it is a comment or a reply in a discussion thread.
Clicking the delete icon will show the message confirmation dialog. Actual delete should send DELETE to api/v4/topics/TOPIC_ID/ tin case it’s a first post, or DELETE to api/v4/topic/TOPIC_ID/posts/POST_ID in case it’s a comment.
Backend changes
The connect app will use tc-message-service for all messaging related features. The service should be easy to set up locally for development, docs are in the local directory.
You should add edit and delete routes in app/routes/topics and in app/routes/posts as well as edit/delete post/topic methods in app/services/discourse.js. All the routes should validate input parameters and make sure the permissions are correct (ie only the author can edit/delete a post).
Design assets are available at https://drive.google.com/drive/folders/0B1LbmKnex41fNG84R1ZtLTUzVVk?usp=sharing
All frontend changes should be made in the connect-app repository, feature/messageEditDelete branch.
All backend changes should be made in the tc-message-service repository, dev branch.
Final Submission Guidelines
Submit a git patch containing your changes to the base code.Submit a verification document with screenshots.