Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate challenge editor page with the API #61

Closed
ThomasKranitsas opened this issue Jun 8, 2019 · 0 comments
Closed

Integrate challenge editor page with the API #61

ThomasKranitsas opened this issue Jun 8, 2019 · 0 comments

Comments

@ThomasKranitsas
Copy link
Collaborator

ThomasKranitsas commented Jun 8, 2019

Swagger: https://github.com/topcoder-platform/challenge-api/tree/develop/docs

1. Run the API locally

Follow the instructions from https://github.com/topcoder-platform/challenge-api to set up and run the API locally.


2. Challenge types

Call the /challengeTypes to fetch the available challenge types that will populate the following section:

Screenshot 2019-06-08 at 13 09 49


3. Groups

Call the api.topcoder-dev.com/v3/groups endpoint to fetch the available groups that will be used to render the following section:
Screenshot 2019-06-08 at 13 26 53


4. Timeline

  1. Call the /challengePhases endpoint to fetch the available phases.
  2. Call the /timelineTemplates endpoint to fetch the available timeline templates.
  3. Dates should be based on the user's local timezone. Use a 3rd party lib to identify the user's local timezone and show it on the right corner.
  4. Phase dates should also be shown when the section is collapsed similar to how it's currently showing up when you click Edit from the listings page.

Important: Dates should be passed to the API as UTC and not based on the user's local timezone.

Use the response from 2 to populate the dropdown from the screenshot below.
Based on the selected timeline template, populate the phases list with the data from the response of 1.

Screenshot 2019-06-08 at 13 31 09


5. Markdown editor

Use the following 3rd part tool as the Markdown editor:
https://github.com/sparksuite/simplemde-markdown-editor


6. Submit a challenge

Clicking Save as Draft will set the status to Draft while Launch will set it to Active.

Clicking Save as Draft will save the challenge immediately while Launch will show the confirmation popup first.

To save/launch the challenge, POST the challenge to the /challenges endpoint.

After saving/launching the challenge, take the user to the challenge edit page.


7. Attachments

  • Use the /challenges/:challengeId/attachments endpoint to upload an attachment.
  • Use the /challenges/:challengeId/attachments/:attachmentId endpoint to download an attachment.
  • To delete an attachment, you need to remove it from the challenge object. Then, once we save the updated challenge object (see below), the backend will delete it.

8. Edit a challenge

  • To fetch an existing challenge, use the GET /challenges/:challengeId endpoint.
  • To update/edit a challenge, make a PUT request to the /challenges/:challengeId endpoint.
@ThomasKranitsas ThomasKranitsas changed the title Integrate challenge creation page with the API Integrate challenge editor page with the API Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant