This PR implements the async vomit-reaction functionality using StimulusJS. Prior to this, the JS lived in `_abuse-reports.html.erb`.
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
* Remove unused CSS rules
* Use bootstrap utility class over custom css
* Fix grapical bug with buffer tags
* Fix internal UI highlighting and misc fixes
This commit is a little bit too big.
It fixes a bug with the internal UI that was breaking the highlighting
feature (indicates status of articles and when an AJAX request has been
made).
It also does some reformatting in the internal listings UI. This should
make it a bit easier on anyone writing buffer updates in the listings
UI. I was able to reapply some stimulus I wrote previously for this,
super easy!
There are also a couple of CSS classes I renamed to match Bootstrap's
naming conventions.
* Remove <br> tag
* Update article_controller Stimulus test
* Add StimulusJS 1.1.1
Because:
- Internal will likely need more interactivity going forward
- Vanilla JS and jQuery are great, but aren't quite as organized as we
might like
- Stimulus fits our model of what internal should be (imo)
- Adopting Preact or something with templating would require rewriting a
bunch of erb (that is currently working just fine)
Stimulus is a JavaScript framework that directly compliments turbolinks
and the approach vanilla Rails takes to JavaScript. I've set it up to
specifically be used in the internal views where we are currently using
jQuery and vanilla JS. I think we should chip away at the vanilla JS
currently in place with this, which appears to be both scalable and
pragmatic exactly the sort of tool we want for building our internal
tools.
* Replace crufty article JS with Stimulus
I'm swapping out some of the stuff going on in article_script.erb with
some StimulusJS, it seems like a good test case for Stimulus.
This lets us organize the code a little more intentionally and hopefully
fixes a small performance complaint that Michael had.
* Rename uncommunicative methods
* Add unit tests for Stimulus classes
* Move Stimulus code to javascript/internal