Commit graph

821 commits

Author SHA1 Message Date
Ben Halpern
9b15329110
Adjust digest rate if recent clicks tracked (#20838)
* Adjust digest rate if recent clicks tracked

* Fix issues

* Fix issues

* Fix issues

* Fiddle with tests

* Fix syntax

* Fiddle with tests

* Fiddle with tests

* Fiddle with tests

* Fiddle with tests

* Fiddle with tests

* Fiddle with tests

* Fiddle with tests

* Remove .env.test symlink (#20839)

* Update the mdx vscode extension (#20840)

* Update @cypress/code-coverage to version 3.12.30 (#20803)

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <mac@forem.com>

* Update ruby VSCode extensions for debugging (#20816)

The 'rebornix.Ruby' extension is deprecated. I replaced with the
'Shopify.ruby-lsp' extension since VSCode's Ruby docs pointed
users to ruby-lsp, see https://code.visualstudio.com/docs/languages/ruby.

* Update esbuild to version 0.19.12 (#20841)

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>

* Update eslint to version 8.57.0 (#20853)

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>

* fix: remove listings option from views/dashboards/_actions_mobile.html.erb (#20849)

Co-authored-by: Mac Siri <mac@forem.com>

* Update eslint-import-resolver-webpack to version 0.13.8 (#20854)

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>

* add timestamp to users roles table (#20844)

* Update eslint-plugin-import to version 2.29.1 (#20855)

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>

* Adjust tests to account for clicks

* Adjust tests to account for clicks

---------

Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Meredith <meredith.edwards1771@gmail.com>
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Quaresma <j.quaresmasantos_98@hotmail.com>
Co-authored-by: Philip How <philip.j.how@gmail.com>
2024-04-10 10:39:15 -04:00
Anna Buianova
93c2babb89
Specs for adding tag mods (#20815) 2024-03-29 14:05:28 -04:00
Anna Buianova
51316c747f
Comments count according to display rules in feed (#20753)
* Move calculating comments score from worker to a service

* Display displayed comments count in feed

* Recalculating displayed comments counts on article show (if needed)

* Rubocop fixes

* Fixed lambda
2024-03-28 12:12:05 +00:00
Anna Buianova
ed1b4045d3
Auto confirm flag reactions when spam role is assigned (#20797)
* Auto confirm flag reactions when spam role is assigned

* Renamed method according to its point

---------

Co-authored-by: Mac Siri <mac@forem.com>
2024-03-27 13:03:41 +00:00
Anna Buianova
1008f0af7d
Automatically resolve spam reports when the offending user is marked as spam (#20781)
* Start resolving spam reports automatically after assigning spam role

* Specs for resolving spam reports + async resolving
2024-03-21 17:31:43 +00:00
Mac Siri
092ee4a425
Implement PageViewRollup (#20670)
* Refactor

* Create PageViewRollup WIP

* Create PageViewRollupWorker and specs

* Add spec WIP

* Write spec

* Refactor

* Add spec

* Prevent retry

* Update baseline date

* Improve specs

* Update ATTRIBUTES_

* Update spec again
2024-03-18 20:33:12 +00:00
Kim Emmanuel
04fb62a6f5
ignore code blocks when checking markdown for XSS (#20641)
Code blocks are rendered as raw strings and therefore don´t need to be
checked for XSS. Checking them for XSS disallow users to write articles about
XSS in markdown, for example.

Co-authored-by: Mac Siri <mac@forem.com>
2024-03-07 21:03:39 +00:00
Ben Halpern
78f9bec3e7
Allow admin to declare whether to include the badge description in message (#20684)
* Allow admin to declare whether to include the badge description in badge achievement message

* Update spec/services/badges/award_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Add proper acceptance to tests

* Tweak tests

* Switch to kwargs

* Clean up test acceptance

* Change interface

* Update spec/requests/admin/badge_achievements_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/badges/award.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Adjust interface

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-28 11:02:58 -05:00
Mac Siri
248f0f55c0
Allow Slack::Messengers to be disabled (#20609) 2024-02-09 17:20:35 +00:00
Philip How
e2035e0c4a
update first post badge name (#20613) 2024-02-09 12:20:14 -05:00
Ben Halpern
1b083f39a4
Ensure at least 0 score for new badge award (#20605) 2024-02-08 17:00:10 +00:00
Philip How
55f191a5ec
Automated First Post Badge (#20600)
* award first post logic, schedule, and tests

* award first post logic, schedule, and tests
2024-02-08 10:11:40 -05:00
Anna Buianova
b43cb38d40
Remove notifications related to spammer actions (after the role is assigned) (#20593) 2024-02-07 17:36:19 +00:00
Ben Halpern
e26b27c7fa
New a/b test for Feb 5 (and add a variable too a hardcoded value) (#20588)
* Fix AudienceSegmentRefreshAllWorker args issue

* New a/b test for Feb 5 (and add a variable too a hardcoded value)
2024-02-05 15:46:03 +00:00
Ben Halpern
ee29318126
Add a/b test for which comments to show in feed (#20332)
* Add a/b test for which comments to show in feed

* Adjust figure

* Started at

* Move scope placement around

* Add tests for different comments_variants passed

* Fix typo
2024-01-29 12:18:50 -05:00
Ben Halpern
aab0a19011
Allow configuration to conditionally prefer Cloudflare over Cloudinary (#20539)
* Allow configuration to conditionally prefer Cloudflare over Cloudinary

* Update app/services/images/optimizer.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix some lints

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-19 09:45:36 -05:00
Anna Buianova
08d34d5d34
Don't show low scoring articles in timeframe feeds (#20525) 2024-01-15 14:14:32 +00:00
Philip How
7d47ffef78
Remove calls to trigger round robin notifications (#20506)
* remove calls to trigger round robin notifications

* remove tests
2024-01-10 13:44:57 +00:00
Anna Buianova
473594f192
Match spam role with existing suspended actions (#20477)
* Started matching spam and suspended roles

* Match spam and suspended roles in most cases

* Fixed check_suspended for unauthenticated users
2023-12-27 20:12:50 +00:00
Anna Buianova
1eeaa34e98
Added spam role (#20434)
* Added spam role

* Fixed role spec
2023-12-11 14:27:22 +00:00
Anna Buianova
3093e0207a
Refactoring Badges::AwardThumbsUp (#20360)
* Optimized Badges::AwardThumbsUp

* Reorganized Badges::AwardThumbsUp spec
2023-11-16 15:10:21 +00:00
Philip How
779701d5f6
Automatically reward thumbs-up milestone badges (#20338)
* initial work on #20111

* initial work on #20111

* fix cron

* is this a good test

* add in initial check, fix test data

* Update spec

---------

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2023-11-14 16:47:24 +00:00
Ben Halpern
64fd4e7800
Adjust VariantQuery to dynamically account for recent last_comment_at (#20323)
* Adjust VariantQuery to dynamically account for recent last_comment_at

* Adjust test line which was temporarily adjusted
2023-11-07 08:22:22 -05:00
Anna Buianova
41ab84a25d
Remove feature flag and use consistent rendering by default (#20305) 2023-11-03 11:42:12 -04:00
Ben Halpern
587a11d490
Adjust image optimization for billboards (#20309)
* Adjust image optimization for billboards

* Fix test typo

* Adjust default
2023-11-02 16:12:20 -04:00
Gabriel Quaresma
593d95e7a8
Feat Make tag score minimum configurable by admins (#20233)
* feat: add Settings::UserExperience.award_tag_minimum_score

* test: write new specs

* test: write a new test case
2023-11-01 17:48:25 +03:00
Anna Buianova
20e242af0d
Rubocop fixes (#20254)
* Fixed redundant alls for rubocop

* Fixed rubocop violations in spec/requests

* Fixed rubocop violations in spec/models

* Fixed Performance/MapMethodChain

* Fixed rubocop violations in spec/requests

* Revert changes to FastlyConfig::Update spec
2023-10-18 17:24:28 -04:00
Ben Halpern
8268a59ae5
Add feed event for extended page view (#20198) 2023-10-02 10:28:31 +07:00
Ben Halpern
c71b2b182f
Change profile image max size to 8 MB (#20183)
* Change profile image max size to 8 MB

* Stub the const for the sake of the test
2023-09-28 17:05:35 -04:00
Ben Halpern
e998e5bcac
Do not show suspended followers in aggregated siblings for notification (#20174) 2023-09-27 20:23:25 -04:00
Joshua Wehner
2c138d86ef
Add or remove limited role via API (#20136)
* Refactor API user suspend, make room for more roles

* Handle adding limited

* Handle remove limited

* And swagger docs

* Update & refactor roles spec

* Remove old route

* Remove old specs
2023-09-26 09:57:14 -04:00
PJ
47deeefe57
Optionally limit new users based on admin setting (#20149)
* create admin setting for new user status

* limiting on signup working 🎉

* update registration specs

* sort out OAuth registrations
2023-09-26 10:46:36 +01:00
PJ
da73343540
Skip round robin mod notifications for limited users (#20128)
* return early if user is limited

* fix worker specs
2023-09-19 15:03:20 +01:00
Ben Halpern
cadebde66f
Add feed_success_score and other count tallies (#20106)
* Add initial feed events score

* Add feed events score

* Clean up code styles

* Adjust how tests are run

* Fix conflicts

* Update app/javascript/articles/Feed.jsx

* Add additional feed events tabulation queries for more reliable eventual consistency

* Add additional feed events tabulation queries for more reliable eventual consistency

* Fix test logic

* Updates from feedback
2023-09-15 12:02:26 -04:00
PJ
95ca9d37c5
Record feed events for public reactions (#20079)
* create feed event on feed reaction

* move feed event creation to feed event model

* tiny whoops

* fix failing specs

* slightly less flaky e2e spec (maybe)

* tiny fixes (couldn't resist)
2023-09-12 08:36:10 -04:00
Anna Buianova
aa5cb535fa
Add languages to User model (#20059) 2023-09-11 11:44:19 -04:00
PJ
3f7d1fbc1a
Create feed impression and click events (#20043)
* getting started: model setup

* basic controller action & spec

* somewhat working click events

* pick up on impressions

* there was an attempt at batching without duplicates

* (better) bulk upsert service

* fix specs?

* touch up feed events JS

* end-to-end specs??

* workers wip

* fix failing user delete spec
2023-09-11 13:32:36 +01:00
Ben Halpern
ed853f7e1e
Fix "register" bugs in invitations (#20071)
* Fix registered bugs in invitations

* Update spec/requests/api/v0/admin/users_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Move to v1 spec

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-09-08 17:00:37 -04:00
Ben Halpern
02db638d9d
Remove cache headers from sidebars controller (#20002)
* Remove cache headers from sidebars controller

* Remove cache bust logic for sidebar
2023-08-29 13:42:10 -04:00
Joshua Wehner
d227e1d285
Suppressing articles negative-follow tags from appearing in the "relevant" feed (#19948)
* Try suppressing all negative-follow tags

* userData isn't always available

* Bolster test coverage for tag filter scenarios

* Antitags for the non-basic 'strategy'

* Rename antitags -> hidden_tags

* Rename 'anti_tags' -> 'hidden_tags' as well

* Use userData.followed_tags to derive hidden_tags
2023-08-28 10:11:20 -04:00
Rajat Talesra
5ef0f43636
Added limited role (#19969)
* Added limited role

* Nit fix

* Updated tetss

* Added spec tests

* Attempt at 100% code coverage

* Rollback DB migration

* Revert timestamp
2023-08-25 14:41:17 +05:30
Ben Halpern
98c92bcde2
Fix never_imagga for imgproxy (#19997) 2023-08-24 19:00:23 -04:00
Anna Buianova
fc034e41cd
Renamed display ads to billboards in tests descriptions (#19973) 2023-08-24 23:42:13 +03:00
Ben Halpern
1463d8c98a
Do not crop with imagga if never_imagga is passed (#19975)
* Do not crop with imagga if never_imagga is passed

* Clean up code styles
2023-08-22 11:52:02 -04:00
Ben Halpern
ec7adf56fe
Allow admins to set cover image height configs (#19936)
* Initial basic work

* Bulk of related work, including find/replace on the inputs

* Adjust some tests

* Adjust some specs

* Fix a few more tests

* Clean up tests

* Adjust tests

* Test fiddle

* Adjust crop back to be a param

* Update tests

* Set proper defaults

* Fix some styling

* Adjust enrichment logic and tests

* Adjust form JS

* Update test snapshot

* Clean up formatting

* Fix spec name

* Adjust some css and defaults

* Adjust translation for image provider options

* Switch from fill to fill-down

* Proper fallback image

* Fix tests

* Update app/services/images/optimizer.rb

Co-authored-by: Mac Siri <mac@forem.com>

---------

Co-authored-by: Mac Siri <mac@forem.com>
2023-08-21 13:25:16 -04:00
Joshua Wehner
c5731ac91a
FeatureFlag.enabled_for_user(_id) (#19929)
* FeatureFlag can work with user_id

* Use the new methods

* No thank you, rubocop

* Some tests would be nice

* Try to appease codecov

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2023-08-15 12:02:44 -04:00
Ben Halpern
33b11f1eac
Use direct relative path to access assets in minimagick (#19933)
* Use direct relative path to access assets in minimagick

* Skip Hairtrigger spec

* Add a test to get more coverage
2023-08-15 09:36:16 -04:00
Anna Buianova
9c9663a5b5
Renamed display_ads to billboards: variables and descriptions in tests (#19920)
* Renamed display ad variables and descriptions in tests

* Renamed api docs display_ads => billboards

* Updated billboard cypress seeds

* Fixed api billboards specs

* Update db/schema.rb

Co-authored-by: Duke Greene <dukegreene@gmail.com>

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
Co-authored-by: Duke Greene <dukegreene@gmail.com>
2023-08-11 15:00:07 -04:00
Ben Halpern
c9af090af0
Prefer Minimagick for social image generation (#19826)
* Prefer Minimagick for social image generation

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Reformat main file

* Fix user tests

* Finish up tests

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Change asset path syntax

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Refactor magickally file

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix style issues

* Remove pure black

* Test color swap

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Add more test coverage to service

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix doubled spec name

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Add upload spec

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update spec/services/images/generate_social_image_magickally_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Swap out magickally in social image worker

* Add test stub and rescue

* Update spec/rails_helper.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix regex

* Add cache busting and error logging

* Update app/services/images/generate_social_image_magickally.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix style issues

* Add more test coverage

* Add feature flag

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-11 08:22:06 -04:00
Mac Siri
1c351bf22c
BanishUser also destroy organization (#19911) 2023-08-10 08:26:45 -04:00