* Rate limit daily user follows to 500 per day
Return an error in `POST /follows` JSON response when a user tries to follow more than 500 accounts in a single day.
Other Changes:
- Add a spec for follows#create.
* Turn daily account follow limit into an env var
* Avoid executing today follow count query when possible
user.following_users_count is a counter cache on how many users the person is already following, so if it's less than the limit we don't need to run the query and can just return it instead.
* Simplify today follow count query
Stop needlessly checking into the future, only check from the beginning of the day until now.
* Raise account follow limit error if followable_id count is over limit
Other changes:
- Always return JSON, the `respond_to` block from before was unnecessary since this endpoint always returns JSON.
- Rescue `DailyFollowAccountLimitReached` on the method and remove begin block, since the error can be raised from two places in the same method.
* Index created_at on users table
* Make adding created_at index on users table happen concurrently
* Rename DAILY_ACCOUNT_FOLLOW_LIMIT to RATE_LIMIT_FOLLOW_COUNT_DAILY
* Add RATE_LIMIT_FOLLOW_COUNT_DAILY to Envfile
* Move RATE_LIMIT_FOLLOW_COUNT_DAILY from env var to ApplicationConfig
* 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
I fixed some typos, corrected (maybe due to copy pasting) description mistakes in the "Glitch embed" section and improved formatting of code blocks (to many spaces, wrong indentation, additional blank lines)
* Adding spec around adding width/height to images
* Adding width/height to svgs on article page
* Improving the englishing of the test description
* Re-read final test description, this felt the clearest
* Just checking attriutes are present - not to fussed about much else
* Request change
- Added specific error message
- changed jsitor to JSitor
- changed JSITOR_URL constant to URL_REGEXP
- added space between URL_REGEXP and initialize method
* created jsitor liquid tag
- created a jsitor_tag.rb for jsitor liquid core
- created partial (_jsitor.html.erb) for jsitor liquid tag
* created test for jsitor liquid tag
- created spec for jsitor liquid tag
- generated jsitor_liquid_tag.approved.html
* added suggestion change
- removed regex
- change the full link to embeddable id
- removed dead code(methods) due to change logic
- removed checking of link since embeddable id will be parse as string
- removed parts of the test
- change the guide explanation
* Added lazy loading on iframe
* 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
* Update _codesandbox.html.erb
Adding 'allow-popups' to enable 'open sandbox' and link buttons to work, so folks can open the sandbox in a new tab.
* Update app/views/liquids/_codesandbox.html.erb
Co-Authored-By: Michaël De Boey <info@michaeldeboey.be>
* De-duplicate giphy_img? function in favor of a tested service.
Add a tested `GiphyService` and move `giphy_img?` function to it.
Make `labor/markdown_parser.rb` and `models/html_variant.rb` use the service version of the function.
* Refactor GiphyService into Giphy::Image class
Based on comments from @rhymes, I've changed this into a `Giphy::Image` class sincethe repo is currently being moved away from `XYZService` objects for namespacing and organization purposes.
* Fix typo
Update describe case to mention the current method name.
* Update CSS for img in .comment-preview-div
- Enforces `max-width:100%` on images in .comment-preview-div to prevent them from overflowing their container.
* Implement Recommended Changes
- Enforces `max-width:100%` on images in .comment-preview-div to prevent them from overflowing their container.