Commit graph

2142 commits

Author SHA1 Message Date
Omar Bahareth
dca66bd6a8 Rate limit daily user follows to 500 (#4647) [deploy]
* 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
2019-11-06 16:24:43 -05:00
rianadon
47ca9b5139 Wrap <figcaption> elements and content inside <figure> elements (#4645) 2019-11-06 15:05:45 -05:00
Ben Halpern
1b5f702c96 Add noopener to sponsor links (#4733) [deploy] 2019-11-06 14:21:40 -05:00
Sam Rae
732aea764f Fix CSS on onboarding page (#4512) 2019-11-06 14:19:24 -05:00
rhymes
64adc3114c Enable viewport scaling for a11y (#2150) 2019-11-06 13:45:55 -05:00
Jacob Herrington
afc9351399 Onboarding a11y fixes (#4728) [deploy]
* 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
2019-11-06 12:51:13 -05:00
Mike Rogers
39a774dc98 Listings Page: Adding spacing around the word must (#4732) 2019-11-06 10:26:15 -05:00
Andreas Müller
f0fa221a47 improve editor guide: typos and formatting issues (#4726) [deploy]
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)
2019-11-05 17:05:03 -05:00
Colby Melvin
4531679c23 fix tag input swallowing numeric keycodes [deploy] (#4283)
* fix tag input swallowing numeric keycodes

* add AR validation for Tags class

* allow whitespace in Tag.name

* fix specs

* whitespace

* reformat
2019-11-05 16:20:34 -05:00
Mike Rogers
cf475779d0 Setting width & height attributes to SVGs on articles#show page (#4705)
* 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
2019-11-05 13:13:44 -05:00
aRtoo
b421ad908b Add JSitor liquid tag (#4657) [deploy]
* 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
2019-11-05 09:43:52 -05:00
jeffin sam
2569a0ac3d Move cached_followed_tags to redis (#4714) 2019-11-05 09:34:58 -05:00
jeffin sam
71b144da8d move cached_follow_check to redis (#4715) 2019-11-05 09:34:42 -05:00
Ibrahim Khan
961bef0173 Moved classic-article-for-tag to Redis (#4706) 2019-11-04 17:06:15 -05:00
Ibrahim Khan
9c0bb311bf Moved user-github-token to Redis (#4710) 2019-11-04 17:05:24 -05:00
Ibrahim Khan
73de48e370 Moved following_users_ids to Redis (#4708) 2019-11-04 17:04:46 -05:00
Tamas Fodor
76e099599b Fix eslint lints in chat's jsx files (#4302) [deploy] 2019-11-04 15:51:30 -05:00
Andy Zhao
85d8f52789 Hide a blocked user's content [deploy] (#4678)
* 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
2019-11-04 14:47:26 -05:00
rhymes
027dbb027b Return 401 instead of 500 when a channel is blocked (#4721) 2019-11-04 10:39:18 -05:00
Ibrahim Khan
f988cba9d8 Moved reading_list_ids_of_articles to Redis (#4711) 2019-11-04 10:15:06 -05:00
Ibrahim Khan
d4347bf3e3 Move article_flare_tag to Redis (#4709) 2019-11-04 10:13:38 -05:00
tariq-abughofa
40fddab7e2 Move cached_user_reactions-* keys to Redis (#4696) 2019-11-04 10:12:12 -05:00
tariq-abughofa
33a1330033 Move count_for_reactable-* keys to redis (#4695) 2019-11-04 10:11:47 -05:00
tariq-abughofa
267ec36460 Move users' has_trusted_role keys to redis (#4697) [deploy] 2019-11-04 13:12:19 +00:00
tariq-abughofa
5135804a60 Move ga daily_random_key to Redis (#4694) 2019-11-02 09:07:27 -04:00
Aurelio
c7e0ce0275 move has-pro-membership cache to redis (#4691) 2019-11-02 08:59:15 -04:00
Molly Struve
78f1eb2b11 Move moderator_for_tags Cache Key to Redis (#4690)
* Move moderator_for_tags cache key to Redis

* move delete commands for tag moderator list to Redis as well
2019-11-02 08:57:28 -04:00
Morgan Adams
c986e02044 fix 'Contact via Connect' checkbox to be checkable (#4617) 2019-11-01 16:50:23 -04:00
Molly Struve
fd11d17973 Remove cacheing for preferred_languages_array (#4689) 2019-11-01 16:15:59 -04:00
Ben Halpern
5ab15f6861
Add guard for block button presence and add theming of profile dropdown (#4688) 2019-11-01 16:12:25 -04:00
Molly Struve
ee99b2e613 Move cached_following_organizations_ids to Redis (#4685) 2019-11-01 14:31:28 -04:00
Molly Struve
760bae49c5 Move cached_following_podcasts_ids to Redis (#4684) 2019-11-01 13:45:00 -04:00
Mohab Abd El-Dayem
2c80e9da42 Make The Default Email An Enviroment Variable. (#4677)
* Make the default email an enviroment variable

* Added spaces in Envfile for readability
2019-11-01 09:03:06 -04:00
Emilia Muresan
f2ce926653 #4663: Adds border styling for homepage search-bar on focus (#4668) 2019-10-31 17:32:11 -04:00
Nadiya Karachevska
06d2fa24f5 Add ability to set favicon through environment variable (#4665) 2019-10-31 15:34:28 -04:00
Dhananjay
81b171efa8 Fix Lints in initializeBaseUserData (#4612) [ci skip] 2019-10-31 14:44:34 -04:00
Huynh Tan
b6a731276e Fix answers from other stackexchange sites have the wrong link (#4615) [ci skip] 2019-10-30 15:01:29 -04:00
garethx
fba9446e17 Update _codesandbox.html.erb (#4575) [ci skip]
* 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>
2019-10-30 14:44:59 -04:00
Ahmad Mahmoud
d3dfc70f5a Fix lint errors in pulltorefresh.js (#4594) [ci skip] 2019-10-30 14:21:09 -04:00
Jenna Pederson
77270290da Use named function so duplicate event handlers are discarded (#4655) [ci skip] 2019-10-30 13:26:14 -04:00
rhymes
75f1d142fe Add focus styling to SAVE button (#4664) [ci skip] 2019-10-30 13:14:45 -04:00
Brad Pauly
b59aba415d ArticlesController#feed refactor (#4498)
* Move query details into model.
Reorganize filtering initial results by params.

* Fixups from feedback.
2019-10-30 12:35:53 -04:00
WenYu
b162e8b848 Refactor app/services/notifications/new_comment#send (#4642) 2019-10-30 12:21:56 -04:00
Omar Bahareth
41463a7264 Deduplicate giphy_img? function and add tests (#4590)
* 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.
2019-10-30 11:40:17 -04:00
rhymes
36d1df7f49 Routine rubocop lint fixes (#4638) [ci skip] 2019-10-30 10:46:57 -04:00
Molly Struve
fd3d87c759 Select path when loading buffered article urls (#4651) [ci skip] 2019-10-30 10:37:22 -04:00
Ben Halpern
ec6d66018f
Add some html to internal articles and new internal view (#4636)
* Add some html to internal articles and new internal view

* Add check for article existence for buffer updates

* Change arrays to unions
2019-10-28 19:09:24 -04:00
Mehdi Vasigh
42771beb5d add heading and clear all btn to tag filters (#4620) 2019-10-28 09:39:47 -04:00
WenYu
6665c2cdc1 Remove ChartDecorator (#4622)
Removing it as it is no longer used in the codebase. There is no specs
related to ChartDecorator
2019-10-28 08:26:12 -04:00
Yash Dave
3fde5b810f [deploy] Fix Image Overflow in Comment Preview - #4382 (#4466)
* 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.
2019-10-26 13:34:16 -04:00