Previewing a main image on an article was broken in v2 of the editor :(
We had some tests for this (which I wrote), but the setup for the tests weren't quite right!
This commit fixes the bug, and also refactors and cleans up our tests quite a bit.
Also adds some snapshots for both v1 and v2 editors in a "no image" preview state.
* 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
* Feature 🚀 : Ability to delete messages in chat channels
- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime
* Minor Bug 🐞: Show message action only for current user
- User can delete or edit their own messages
* Test cases added
* Bug 🐞: Update message id for receiver
Message id was not sent to receiver by pusher
* Refactoring🛠: Message controller refactoring
* Test Cases📝 : Specs for Delete message added
* Feature 🚀 : Ability to edit messages
* Test Cases📝 : Specs for Edit message added
* Feature 🚀 : Ability to mention member in Group [Frontend]
* Test Cases📝 : Test Cases added
* Feature 🚀 : Ability to mention member in Group [Backend]
* Bug Fix 🐞: Making messages realtime for open channels
* Feature 🚀 and Bug Fix 🐞: Ability to get notification if mentioned in open messages and increasing message number count
* Feature 🚀 : Ability to remove message count on channel open
* Bug Fix 🐞: Making Notification more reliable by checking if the new message is notified to user or not
* Feature 🚀 : Ability to metion @all and notify them
* Bug Fix 🐞: Minor fixes
* Fews tweaks in code
* Bug Fix 🐞: Feature was not present for Invite only Section
* Bug Fix 🐞: In open channels one can't mention all
* Bug Fix 🐞: Markdown conversion for all only in case of invite only
* Specs added
* Delete schema.rb
* Schema file updated
* Code refactoring
* Further Code refactoring backend
* Further Code refactoring backend
* Bug Fix 🐞: Mention List error problem in switching tabs
* Test Snapshots added
* Feature 🚀 : Ability to mention member in Group [Frontend]
* Test Cases📝 : Test Cases added
* Feature 🚀 : Ability to mention member in Group [Backend]
* Bug Fix 🐞: Making messages realtime for open channels
* Feature 🚀 and Bug Fix 🐞: Ability to get notification if mentioned in open messages and increasing message number count
* Feature 🚀 : Ability to remove message count on channel open
* Bug Fix 🐞: Making Notification more reliable by checking if the new message is notified to user or not
* Feature 🚀 : Ability to metion @all and notify them
* Bug Fix 🐞: Minor fixes
* Fews tweaks in code
* Bug Fix 🐞: Feature was not present for Invite only Section
* Bug Fix 🐞: In open channels one can't mention all
* Bug Fix 🐞: Markdown conversion for all only in case of invite only
* Specs added
* Code refactoring
* Further Code refactoring backend
* Further Code refactoring backend
* Bug Fix 🐞: Mention List error problem in switching tabs
* Test Snapshots added
* Feature 🚀: Ability to navigate through user list with keyboard only
* Bug Fix 🐞: Changing color of group avatars in dark themes
* Bug Fix 🐞: Setup pusher channel for open channels also
* Feature 🚀 : Ability to delete messages in chat channels
- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime
* Minor Bug 🐞: Show message action only for current user
- User can delete or edit their own messages
* Test cases added
* Bug 🐞: Update message id for receiver
Message id was not sent to receiver by pusher
* Refactoring🛠: Message controller refactoring
* Test Cases📝 : Specs for Delete message added
* Feature 🚀 : Ability to edit messages
* Test Cases📝 : Specs for Edit message added
* Bug Fix 🐞: Fixing missing edit and delete option
* Feature 🚀 : Ability to delete messages in chat channels
- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime
* Minor Bug 🐞: Show message action only for current user
- User can delete or edit their own messages
* Test cases added
* Bug 🐞: Update message id for receiver
Message id was not sent to receiver by pusher
* Refactoring🛠: Message controller refactoring
* Test Cases📝 : Specs for Delete message added
* Feature 🚀 : Ability to edit messages
* Test Cases📝 : Specs for Edit message added
* Refactoring🔩: Refactoring for edit messages
* Refactoring🔩: Refactoring:2 for edit messages
* Refactoring🔩: Refactoring:2 for edit messages
* Test Cases📝 : Test Cases for edit message added
* Minor Bug 🐞: Show message action only for current user
- User can delete or edit their own messages
* Test cases added
* Bug 🐞: Update message id for receiver
Message id was not sent to receiver by pusher
* Feature 🚀 : Ability to edit messages
* Test Cases📝 : Specs for Edit message added
* Refactoring🔩: Refactoring for edit messages
* Refactoring🔩: Refactoring:2 for edit messages
* Refactoring🔩: Refactoring:2 for edit messages
* Bug Fix 🐞: Added space between edited and timestamp
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
* Initial work for streaming app shell way of using serviceworkers
* Close in on serviceworker adjustment finalization
* Add docs and loading indicator
* Remove useless code
* Don't run on API
* Update app/javascript/contentDisplayPolicy/hideBlockedContent.js
* Fix small details
* Don't run serviceworker.js code in test env
* Fix JS in serviceworker
* Move private keyword to proper place in async controller
* Change shell_version to HEROKU_SLUG_COMMIT
* Update caching config
* Add test for async_info/shell_version
* Feature 🚀 : Ability to delete messages in chat channels
- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime
* Minor Bug 🐞: Show message action only for current user
- User can delete or edit their own messages
* Test cases added
* Bug 🐞: Update message id for receiver
Message id was not sent to receiver by pusher
* Refactoring🛠: Message controller refactoring
* Test Cases📝 : Specs for Delete message added
* Remove edit button and modify css
* Feature 🚀 : Ability to delete messages in chat channels
- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime
* Minor Bug 🐞: Show message action only for current user
- User can delete or edit their own messages
* Test cases added
* Bug 🐞: Update message id for receiver
Message id was not sent to receiver by pusher
* Refactoring🛠: Message controller refactoring
* Test Cases📝 : Specs for Delete message added
* Feature🚀: Ability to see chat history by scrolling up
* Test samples updated
* Feature Enhancement 🛠 : Jump back to recent messages
If you scroll far away just click this button to go back

* Test case added
* Bug Fix 🐞: Scrolling problem with large screen and re-rendering issue
* Remove Report Button from user's own profile sidebar
* Update UserDetails test file to include window
* Uncomment code and Add tests
* Resolve issue with display property change persisting
* Update snapshot
* Uncomment line of code
* Reduce code duplication in onboarding tests
* Update variable names for consistency
* Improve test descriptions and format
* Refactor a useless test
This test was fairly pointless, but hopefully with this refactor it
could detect a regression? Although, I think it's really just testing
the that the Preact framework's state mechanism is working the way we
expect it to, but it might be worth leaving this test in.
* Add jext-axe package and introduce a11y testing
Automated a11y testing is NOT comprehensive. We cannot expect this to
even scratch the surface of potential a11y issues.
However, we can expect to find a percentage of issues that are currently
flying under the radar. Adopting some automation around a11y testing
also allows us to use CI to find a11y regressions -- which should be
really handy.
I've never really used Jest before, and Preact seems to make it a little
more complicated, but as far as I can tell, this is a decent way to add
at least some minor automated a11y testing.
* Add doc about automated a11y tests
* Fix some eslint complaints
* Fix some basic a11y issues in onboarding
- Missing a main element
- TODO to enable zooming
- Rename a duplicate ID attribute
I may need some context on the zooming thing, why did we decided to
disable that in the first place? It is a pretty bad a11y issue, we will
need to fix whatever that is a workaround for instead of making it
difficult for some people to use our onboarding.
* Update screenshots
* Hide blocked users' content appropriately
* Use RESTful create route
* Update functionality to block the user
* Fix specs for new route
* Use const instead of var
* Add noopener and noreferrer
* Remove caching for blocked user ids
* Add new rule for lack of noopener noreferrer
* Update snapshot