davidskalinder / mpeds-coder

MPEDS Annotation Interface
MIT License
0 stars 0 forks source link

Clean up GET and POST usage in article-level AJAX requests #105

Closed davidskalinder closed 4 years ago

davidskalinder commented 4 years ago

See #101. This issue is just for the article-level AJAX so that it can be PR'd separately.

From #101:

Strategy:

  1. grep for GET
  2. Start at first JS file
  3. Search for first GET and change it
  4. Search for other calls to same URI and change those too
  5. Search for URI in controller
  6. Add , methods=['POST'] to @app.route() params for URI
  7. Change all request.args.get('ting')s to request.form['ting']
  8. grep for URI to confirm that it doesn't occur anywhere else important
  9. Commit

Repeat until no more non-idempotent GETs are left.

Afterward, review commits to see what needs testing. If testers are up for it, might want to open a new issue for each URI (though that might be too much).

See https://github.com/davidskalinder/mpeds-coder/issues/101#issuecomment-658461660 for template of changes that will need testing.

davidskalinder commented 4 years ago

b4bd0ac8a72f merges the changes from #101 into an otherwise minimal article-enabled branch. That might be all I'll get to for a while, but the comments above are a nice list of next steps...

davidskalinder commented 4 years ago

Detailed list of changes:

_add_article_code

Sent from:

Description: Adds a new line to coder-article-annotation table, based on article, variable, input value, and text (for text capture, probably unused)

_del_article_code

Sent from:

Description: Deletes a line from coder-article-annotation table, based on article, variable, and input value

_change_article_code

Sent from:

Description: Changes (deletes and then adds) a line from the coder-article-annotation table, based on article, variable, and input value

davidskalinder commented 4 years ago

Merged change_article_gets_to_posts into testing: 7e71728574250

davidskalinder commented 4 years ago

No apparent problems with this after a week of testing with training articles.