Page MenuHomePhabricator

Setup Ajax post request for sending contribution data to the server
Closed, ResolvedPublic

Description

This means we don't need to reload the page, which is better for UX and allows us to keep the current client side image loaded without extra code to redirect back to the last image they worked on.

Data is posted as a JSON string using new API route ( api/post-contribution). This has been tested locally but the actual route on the server has been left out of this commit to avoid merge conflicts (this will be added in T224968: Setup new API route to receive posted contributions data

  • Add postContribution(editType) method to Participation manager, which sends JSON string to server for depicts or captions
  • Setup cancel and publish buttons for depicts and captions
  • Added new functions to reset to initial state (for cancel buttons)
  • Update stored initial data and button states after contribution is sent
  • Create functions to get current depicts/captions data as shown in the UI (needed now this logic is used in more than one place)

Event Timeline

NavinoEvans renamed this task from Populate hidden fields on Participate page on form submission to Switch to Ajax post request on Participate page instead of form submission.Jun 1 2019, 3:23 PM
NavinoEvans updated the task description. (Show Details)
NavinoEvans renamed this task from Switch to Ajax post request on Participate page instead of form submission to Switch to Ajax post request for sending contribution data instead of form submission.Jun 2 2019, 12:14 PM
NavinoEvans renamed this task from Switch to Ajax post request for sending contribution data instead of form submission to Setup Ajax post request for sending contribution data to the server.Jun 4 2019, 9:14 AM

Change 514256 had a related patch set uploaded (by NavinoEvans; owner: NavinoEvans):
[labs/tools/Isa@master] Setup Ajax post request for sending contribution data to the server

https://gerrit.wikimedia.org/r/514256

Change 514256 merged by jenkins-bot:
[labs/tools/Isa@master] Setup Ajax post request for sending contribution data to the server

https://gerrit.wikimedia.org/r/514256