Skip to content

Fixes #3295 - Fetch and render existing issue comments as HTML#3308

Merged
karlcow merged 14 commits intomasterfrom
issues/3295/1
May 20, 2020
Merged

Fixes #3295 - Fetch and render existing issue comments as HTML#3308
karlcow merged 14 commits intomasterfrom
issues/3295/1

Conversation

@miketaylr
Copy link
Copy Markdown
Member

@miketaylr miketaylr commented May 15, 2020

TODO:

  • write some tests for the modified behavior of get_response_headers
  • remove the entire client-side part of adding a new comment, and handle the XHR bits related to that
  • add more tests
  • fix the tests i broke
  • fix the NSFW handling stuff that's broken now
  • fix busted unit tests
  • add some kind of ajax spinner when submitting a comment
  • remove client-side markdown stuff

Comment thread webcompat/static/js/lib/issues.js Outdated
@miketaylr miketaylr force-pushed the issues/3295/1 branch 3 times, most recently from cf63e11 to e9533e3 Compare May 16, 2020 01:35
@miketaylr
Copy link
Copy Markdown
Member Author

So I decided to just do away with the CommentsView and Collection and Model, etc. Instead we'll go old-school, and after doing an XHR post for new comments, we just append the HTML the server sends back to us.

The cool thing about this is it means we no longer need the Markdown client stuff, so we can delete a ton of code here.

Comment thread webcompat/static/js/lib/issues.js
Comment thread webcompat/templates/issue/issue-comment-list.html Outdated
Comment thread webcompat/api/helpers.py Outdated
@miketaylr miketaylr force-pushed the issues/3295/1 branch 2 times, most recently from c482f91 to ced813d Compare May 18, 2020 22:29
@miketaylr miketaylr marked this pull request as ready for review May 18, 2020 23:02
@miketaylr
Copy link
Copy Markdown
Member Author

OK, I think this is ready for review now.

r? @karlcow
r? @ksy36

@miketaylr miketaylr requested review from karlcow and ksy36 May 18, 2020 23:03
@miketaylr
Copy link
Copy Markdown
Member Author

🥳 Screen Shot 2020-05-18 at 6 03 36 PM

Comment thread webcompat/api/endpoints.py
Comment thread webcompat/templates/issue/issue-comment-list.html
Comment thread webcompat/static/js/lib/issues.js Outdated
Comment thread tests/functional/comments-auth.js
@miketaylr miketaylr force-pushed the issues/3295/1 branch 3 times, most recently from 9b7f9dc to 55535e2 Compare May 19, 2020 20:12
Copy link
Copy Markdown
Member

@karlcow karlcow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yoohoo. Wunderbar. Thanks @miketaylr for working on this. we are approaching a better system.

Comment thread tests/unit/test_api_helpers.py Outdated
Comment thread tests/unit/test_api_helpers.py Outdated
Comment thread webcompat/api/helpers.py Outdated
Comment thread webcompat/api/helpers.py Outdated
Comment thread webcompat/api/helpers.py Outdated
Comment thread webcompat/api/endpoints.py
Comment thread webcompat/api/endpoints.py Outdated
Comment thread webcompat/api/endpoints.py
Comment thread webcompat/api/endpoints.py
Comment thread webcompat/helpers.py
Mike Taylor added 8 commits May 20, 2020 15:31
This file will be returned when POSTing a new comment in test mode,
so our existing functional tests can pass. When doing a GET, it will
serve /tests/fixtures/api/issues/100/comments.38e6a9ddcea3ef150105b48bcd1c18f3.json
because it has a ?per_page=100 param.
Now we rely on everything coming back from GitHub before rendering,
so there's no more need for this.
@miketaylr miketaylr force-pushed the issues/3295/1 branch 2 times, most recently from f4fccb0 to c9c81eb Compare May 20, 2020 20:38
Co-authored-by: Karl Dubost <kdubost+github@mozilla.com>
@miketaylr
Copy link
Copy Markdown
Member Author

miketaylr commented May 20, 2020

OK @karlcow, I believe I addressed everything!

Thanks to you and @ksy36 for the review -- this is in better shape as a result.

r? @karlcow

Copy link
Copy Markdown
Member

@karlcow karlcow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @miketaylr 🦞 Let's 🎈

@karlcow karlcow merged commit 3df0c39 into master May 20, 2020
@karlcow karlcow deleted the issues/3295/1 branch May 20, 2020 21:44
@miketaylr
Copy link
Copy Markdown
Member Author

yay!

@ksy36 ok, you can rebase your form-v2 branch, promise i won't touch build configs for a while ^__^

@ksy36
Copy link
Copy Markdown
Contributor

ksy36 commented May 21, 2020

sounds good, thanks!

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

Successfully merging this pull request may close these issues.

3 participants