Topcoder Connect - Avoid unnecessary requests

Register
Submit a solution
The challenge is finished.

Challenge Overview

Avoid unnecessary server requests after updating objects in the metadata editors.

Project Background

Topcode Connect is a client-facing application of Topcoder. We have the ability to edit various metadata objects for admins. Currently, after editing and saving any object to the server we additionally trigger reloading the data from the server. Which is unnecessary and should be avoided. 

Technology Stack

  • React

  • Redux

Code access

The work for this challenge has to be done in one repository:

- Connect App repo https://github.com/appirio-tech/connect-app dev branch.

- A user for testing is provided on the forum.

Individual requirements

At the moment after making request to update an object in metadata editor we are reloading that object or even all the metadata objects in the next lines. We have to remove the “then” part to stop reloading objects as we already getting the updated data in response from the server in the PATCH request. 

Instead of that, we should properly implement “updateProjectsMetadata” action. So far UPDATE_PROJECTS_METADATA_SUCCESS is not implemented properly, and the line “metadata: action.payload” does nothing and should be removed. Instead of that, we should implement it properly to update the saved object in the Redux state.

Note, that we have two types of objects: with revision (Forms, Plan Configs, Price Configs) and without revision (others). When we update objects which have revision, then server doesn’t actually update the object but returns a new object with the next revision. So such objects should be added to the Redux store, not updated.

If you have any questions or concerns, don’t hesitate to raise a question on the forum.

General requirements

  • Follow React and Redux best practices. In particular, don’t mutate the Redux state.

  • Lint should pass

  • Existent unit tests should pass

Local development

Verification Guide

Basically, the task here is to refactor the code so we keep the same functionality but without additional server calls. So all the functionality should work as it is. Here are essential use cases to check.

- After updating object it should be also updated in the list of objects, see a demo video.
- After updating an object with revision, we should see that an object with latest revision is loaded on the page, and also we should see it in the Revision History, see a demo video.



Final Submission Guidelines

  • Patch to the Connect App.

  • The winner is required to raise a PR to the repository.

Review style

Final Review

Community Review Board

Approval

User Sign-Off

Challenge links

ID: 30104425