Commit graph

1337 commits

Author SHA1 Message Date
dinozavrix
e9ce70d368
Don't skip indexing for old articles (#19231)
* Don't skip indexing for old articles

* add index_minimum_date to settings

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-05-15 15:35:35 +02:00
Ben Halpern
f853b95ccd
Add feed experiment for 5/11 (#19458)
* Add feed experiment for 5/11

* Change number of articles
2023-05-12 12:17:25 -04:00
Dhanujha R
857dd285d5
Remove Dark and Light Nav Logo Image from Organization (#19309) 2023-05-08 17:01:03 -04:00
Lawrence
2da9b9a0af
Organization Search Filtering (#19430)
* add org fitlering init logic

* further styling of the org block

* add tests and fix sort by error

* serializer spec

* org slug instead of twitter

* add utility CSS
2023-05-08 14:58:25 -05:00
PJ
eadbc94ca5
Round Robin notifications design refresh (#19420)
* update visual design

* add comment user to mod notification

* fix request spec
2023-05-04 18:13:14 +01:00
Ben Halpern
59d6816c47
Add feed experiment for 4/30 (#19406) 2023-05-02 07:05:12 -04:00
Ridhwana
e67454fa53
Preparation of endpoint and files required for ChatGPT Plugin (#19394)
* feat: add the ./wellknown/ai-plugin.json file

* feat: add a logo

* feat: firts attempt at open_api file with endpoint we thought we'd use

* feat: add a search action to teh articles controller that build up teh appropriate json

* feat: add a query param to the article index

* feat: add some chatgpt endpoints and file paths to CORS

* feat: update the openapi yml file to reflect the article search endpoint

* fix: use the correct concept

* feat: replace the logo

* feat: update the ai-json file

* feat: update the openapi file

* feat: update the api and it's params

* feat: update the search query

* fix: ordering

* feat: cors debug

* fix: logic with markdown

* chore: fix test

* spec: article

* spec: article

* spec: article

* Update public/.well-known/ai-plugin.json

* Update public/openapi.yml

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2023-04-27 16:51:24 -04:00
Joshua Wehner
dc1ab81401
Allow DisplayAd to target users via audience segmentation (#19284)
* Trying some models for audience segmentation

* AudienceSegment basics

* Attach AudienceSegment to DisplayAd

* Possibly use a DUS to populate AudienceSegments

* Add to display ad form UI

* Add to display ad API

* Refresh strategy for audience segments

* Add user_id to async ads query

* Maybe :testing -> :manual, for no-refresh segment

* Test & tweak segment refresh

* Testing audience_segment#refresh logic

* Coverage: testing human_readable

* Scope segment refresh to recently active users

* Tweak logic for when to refresh

* Tweak experience levels to match SettingsHelper

* Test for front-end logic

* Fix test, hope this helps coverage?

* Better test names

* One worker for all, many workers for each, perform_bulk

* Fix audience segment UI, needs to use id, not enum

* cron/schedule should RefreshAll

* Singular id in RefreshWorker
2023-04-25 08:41:10 -04:00
Ben Halpern
dda0e1d41d
Add feed experiment for 04/24 (#19388) 2023-04-25 07:49:06 -04:00
Joshua Wehner
efadc31f82
Refactor 'controller:' to 'to:' in routes (#19383) 2023-04-24 14:16:53 +02:00
Lawrence
ec1503a60a
Update Subject Line for Tag Mod Email (#19349)
* update subject line

* change to a
2023-04-18 16:21:06 -05:00
Joshua Wehner
bf7a406e2b
Tell Bullet to ignore unused distinct_reaction_categories (#19332) 2023-04-17 15:15:24 +02:00
Ridhwana
0771a5cd2e
Load post_comments billboard asynchronously (#19285)
* feat: add a route to the async_info for display ads

* feat: load the billboard asyncronously

* feat: move the methods to the display_ads controller

* feat: handle params better

* feat: cache control headers

* feat: test fastly caching headers on display ads

* fix: surrogate key test

* feat: use safe navigation operator to handle cases where there is no article id

* fix: article id present then find the article

* feat: add a response test

* Fragment caching

* feat: update the article decorator

* feat: update cache keys for fragment

* feat: remove an empty line

* feat: add article id

* feat: bust cache

* feat: setup dropdown for billboard

* chore: add chunk to same line

* feat: add to safe params for caching

* Update app/controllers/display_ads_controller.rb

Co-authored-by: Joshua Wehner <joshua@forem.com>

* feat: remove the cache deletion

* feat: update the routes to follow a new scope

* feat: update the cache params

---------

Co-authored-by: Joshua Wehner <joshua@forem.com>
2023-04-12 18:15:15 +02:00
Rajat Talesra
8c3f2c5a36
Fixing eager loading issue in admin/moderation/reports (#19274)
* Removed reports from eager loading

* Fixed the issue in a bit different way
2023-04-12 18:47:04 +05:30
Joshua Wehner
a20cf3e02b
Unique cross-model-slug check is likely misconfigured (#19263)
* Page unique_cross_model_slug seems misconfigured

* Update validator test

* More verbose invalid attribute message

* Try dynamic model/attribute registration

* Rubocop

* Use the cross-model-slug existence check

* Register with the dynamic cross-model-slug checker

* Cleanup

* Add missing keys to fr

* Update format regex

* Adjust validation: always presence, unique if changed

* Tests can create reserved-word pages when they need to

* Slugs can be mixed case?

* Case-sensitive is better, actually

* Refactor to use CrossModel check

* Refactor, rename for clarity

* Refactor, avoid mocking oneself

* Refactor, injectable everything

* Add reservedword check to extracted exists? checker

* Move to concerns

* Without dynamic registration

* extend when needed

* Cleanup comments, remove registration references

---------

Co-authored-by: Goran <gorang.pub@gmail.com>
2023-04-07 17:04:45 +02:00
Lawrence
e4e1f4d96d
report abuse dropdown link (#19247)
* report abuse dropdown link

* Update app/controllers/pages_controller.rb

* Update app/views/shared/_display_ad.html.erb

* remove billboard url check

---------
2023-03-28 14:02:31 -05:00
Mac Siri
1e1064de0b
Undo changes to Sprockets::UglifierWithSourceMapsCompressor (#19261) 2023-03-24 12:48:59 -04:00
Anna Buianova
784afdf41e
Routine rubocop fixes (#19254)
* Rubocop fixes

* Rubocop fixes

* Fixed rubocop violation

* Fixed policies rubocop violations

* More rubocop fixes
2023-03-24 14:37:44 +03:00
Ridhwana
c285cf8f9e
Promotional Flair for external Billboard (#19216)
* Users can only opt-out of external ads

* Move random sampling out of FilteredAdsQuery

* Refactor filtered_ads_query_spec

* Add test for new permit_adjacent setting

* Rubocop

* Use permit_adjacent_sponsors on article sidebar and post-comments

* Remove, unused

* Update copy

* type_matched -> type_of_ads

* Remove non-applicable test

* feat: update the bullet safe list and add eager loading with organizations

* feat: add an indicator round for promoted

* feat: update the css

* feat: add il8n

* fix: styling changes

---------

Co-authored-by: Joshua Wehner <joshua@forem.com>
2023-03-23 18:37:04 +02:00
Thomas Bnt
f9a3baca44
I18n: populate config/locales with French (#17487)
Co-authored-by: Joshua Wehner <joshua.wehner@gmail.com>
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-03-23 10:06:38 -04:00
Joshua Wehner
230e77e5cd
Update FilteredAdsQuery and user settings for opting-out of Billboards (#19208)
* Users can only opt-out of external ads

* Move random sampling out of FilteredAdsQuery

* Refactor filtered_ads_query_spec

* Add test for new permit_adjacent setting

* Rubocop

* Use permit_adjacent_sponsors on article sidebar and post-comments

* Remove, unused

* Update copy

* type_matched -> type_of_ads

* Remove non-applicable test

---------

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2023-03-16 15:23:02 +02:00
Rajat Talesra
1d60c5ff77
Added dropdown to display ads / billboards (#19106)
* Initial setup work with error

* Dropdown working with error fixed

* Removed repition

* Home page billboard dropdowns added

* Created common file for dropdown

* Complete display ad dropdown usage

* Minor indentation fix

* Minor UI updates

* Minor test update

* Dropdown for billboard optimisation

* Added anchor tags

* Display ad unified code

* Design changes

* Design changes

* Changes to display ad click tracking

* Style changes

* Design change to admin display ad

* Nit fix

* Nit fix

* Updated test
2023-02-27 22:57:01 +05:30
Mac Siri
140f85695b
Add forgot_password_throttle (#19175) 2023-02-27 09:25:29 -05:00
yheuhtozr
561ed1858f
Tweak i18n edited date format(#19104) 2023-02-21 18:30:57 -05:00
yheuhtozr
104a013551
[i18n] Remove redundant locale (#19066) 2023-02-20 12:03:30 -05:00
Joshua Wehner
1374ab98e6
Ensure spam doesn't hit logged-out /latest (#19110)
* Ensure spam doesn't hit logged-out /latest

* Restore load-bearing constant

* Narrow selector avoids the new 'latest' banner

* Test scenario for signed-in low-score content

* Remove false-negative test

* Actual test for the logged-in scenario

* Signed-in users get poor quality content

* Feeds (RSS) use an entirely different query

* Pass @stories

* Update tests with new minimum score
2023-02-17 09:29:59 +01:00
Joshua Wehner
a4654f2d2f
Reaction emoji with consistent underscores (#19116) 2023-02-15 08:32:19 +01:00
Lawrence
ca96be13dd
name route and add link (#19109) 2023-02-14 10:15:21 -06:00
Joshua Wehner
ea2154d506
Fixing design issues with multiple reactions (#19020)
* Try disabling text-select (mobile long-tap)

* Try to force button color on mobile safari

* Try making notification decorator more helpful

* More using notification decorator

* Helper so I can see exceptions

* As we toggle feature flag, temporary show 'heart' for unsupported reactions

* Reaction on Comment is a 'reaction'-type notification

* Temporarily add new emojis to i18n

* Render full-color, unique SVGs for multiple_reactions

* Restore card layout

* Aggregate reaction icons also need unique SVGs

* This seems unnecessary?

* Multiple is -more-than-one-

* Display *unique* reaction categories on /notifications

* Comment notification no longer needs to re-render as reaction

* Decorator needs to handle some data gaps

* Fix NotificationHelper

* Try a better name for this

* Tests for the notification decorator

* These partials wound up without an outer layer

* Add a descriptive comment

* index needs force_unique

* Try multiple reactions external img (#19076)

* Try external img SVGs

* Unique SVG might not be necessary if this works

* Can also remove this spec if successful

* Restore flash icon behavior

* Plus external img for #index as well
2023-02-08 11:39:47 +01:00
Joshua Wehner
fd7021b001
Pages API: create, update, and delete (#19009)
* Pages API pt 1 (read/get/index+show)

* Update spec/requests/api/v1/docs/pages_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Update spec/requests/api/v1/docs/pages_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* API Key not required for index & show

* API Feature flag has long since been removed

* Page schema

* Fix spec broken by merge

* Temporary bugfix: slug uniqueness not working for Page

* Pages API endpoints for create, update, and destroy

* Fix swagger error

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-02-02 17:24:11 +01:00
Joshua Wehner
7f41dae631
Pages API: Read (get index+show) (#18970)
* Pages API pt 1 (read/get/index+show)

* Update spec/requests/api/v1/docs/pages_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Update spec/requests/api/v1/docs/pages_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* API Key not required for index & show

* API Feature flag has long since been removed

* Page schema

* Fix spec broken by merge

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-01-25 17:15:27 +01:00
Joshua Wehner
30c0485507
Frontend for multiple reactions (v1) (#18808)
* Remove extraneous comment (see 9361d2 and 5c18f8)

* Flexible, multiple reaction types

* Fix reaction counts

* Re-use svg for active state for now

* Update yml, update spec

* Possible temp fix for failing tests

* Colorize reaction icon svgs

* Reaction engagement above post title

* Index reactions engagements (for logged-out)

* Maybe readinglist is special

* Try using crayons' dropdown as a drawer?

* readinglist isn't really public now

* feat: update the styles for the reaction drawer

* Grey background highlight, turn off border/shadow

* Read our feature flag docs, saw this was recommended

* Missed fifth emoji: party/tada

* Fix JS test errors

* Update test with tada

* Suppress flashing engagements when no public reactions

* Liberate jump-to-comments from unicorn replacement

* 'Add reaction' on tooltip

* Don't show reaction emoji on index unless it's been used

* rubocop

* Update heart+ total count when toggling

* Do not include 'readinglist' in drawer/public counts

* Fix semi-public readinglist so that icon is badged for current user

* Tweak heart-plus svg

* Style tweak: border on active reaction

* Show reacted icon on drawer trigger for 1.5 sec

* Tweak styles for engagements bar

* Style tweaks for multiple engagements (#index)

* Trying to get size working through crayons/inline_svg

* Sparkle hearts

* Restore unicorn

* Make heart-plus-active work when user has an active reaction

* Try 'hoverdown' a dropdown that activates with hover

* Long touch?

* Tap *outside* the drawer to close

* Mobile reaction drawer is also supposed to be columns

* More reaction count cleanup

* Final emoticons maybe?

* Fix reaction bug when feature disabled

* Remove readinglist from public reaction counts

* Update specs for new reaction categories

* Shuffle makes specs flaky

* Order does not matter

* rubocop

* Update to preserve readinglist analytics

* Shuffle makes specs flaky

* Fix flickering images, remove icon highlight for now

* Don't update total for readinglist

* reactions_by_user_id

* Try renaming this observer function

* Try unid ids for SVGs

* Remove local test file

* Simplistic test for the unique svg transform

* Fix javascript for current SVG

* Signifcant string literals in this case, rubocop

* Use the right expected output

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2023-01-23 16:00:50 +01:00
yheuhtozr
ce23832988
I18nize views/pages (#18771) 2023-01-19 17:25:03 -05:00
Ben Halpern
17db5988cd
Feed experiment for 01-11-2023 (#18949)
* Feed experiment for 01-11-2023

* Add winner to yml file
2023-01-11 17:03:29 -05:00
Aramayis
12e37330c7
Integrate Uffizzi (#18792)
Co-authored-by: Aramayis <>
2023-01-09 10:49:39 -05:00
Ridhwana
6cb97eeb01
Async Hamburger Menu Implementation + Caching Optimizations (#18818) 2022-12-20 20:00:08 +02:00
Ben Halpern
38d95857c5
Feed experiment for 12-15-2022 (#18866) 2022-12-16 10:15:01 -05:00
Lawrence
33295ac58c
Update messaging to be Bio (#18798)
* Update messaging to be Bio

* Update app/validators/profile_validator.rb

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

* Update app/validators/profile_validator.rb

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

* Update app/validators/profile_validator.rb

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

* Update app/validators/profile_validator.rb

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

* Update app/validators/profile_validator.rb

Co-authored-by: Joshua Wehner <joshua@forem.com>

* adding rails translation to profile

* implement base for record error

* fix spec

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joshua Wehner <joshua@forem.com>
2022-12-09 13:15:46 -06:00
yheuhtozr
d3bda04051
i18n: Fix several wrong French keys (#18770) 2022-12-05 16:05:32 -05:00
Joshua Wehner
a06ab31416
DisplayAd API: Write endpoints (#18736)
* Try a create endpoint

* Try an update endpoint for display_ads

* Try a delete endpoint for display_ads (unpublish)

* Unpublish

* Permit tags as well

* Update docs for DisplayAd tags via API/swagger
2022-12-05 11:12:24 +01:00
Fernando Valverde
6b920acd2c
Remove Vault Secrets page from admin interface (#18795) 2022-12-02 10:03:39 -06:00
Ben Halpern
a3564a9d67
Feed experiment for 11-22-2022 (#18769)
* Feed experiment for 11-22-2022

* Fix typo

* Update config/field_test.yml

Co-authored-by: Fernando Valverde <fernando@fdo.cr>

Co-authored-by: Fernando Valverde <fernando@fdo.cr>
2022-11-23 14:18:26 -05:00
Rachael Wright-Munn
038c889432
Raise a clearer error message when the user tries to comment on a draft post (#18588)
* Raise a clearer error message when the user tries to comment on a draft post.

* Apply suggestions from code review

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Fernando Valverde <fernando@fdo.cr>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2022-11-23 09:01:30 -06:00
Lawrence
ba4118dcda
Update empty tag state verbiage (#18732)
* Update empty tag state verbiage

* add safe translation for the here link

* forgot the _html
2022-11-22 12:02:20 -06:00
Rajat Talesra
888c6b93bf
Organisation profile page redesign (#18717)
* Partial redesign org page

* Removed div

* Team members design fixed

* Nit fixes

* Nit fixes

* Nit fixes
2022-11-21 21:33:44 +05:30
Joshua Wehner
7c82d128ff
DisplayAd API: Read endpoints (#18726)
* DisplayAd API: Read endpoints

* Updated swagger docs for display_ads read endpoints

* Update swagger with type_of

* Remove extraneous comment

* Restrict authentication to strictly api_key
2022-11-21 09:31:01 +01:00
yheuhtozr
5519fe563c
views/admin/users i18n (#18582) 2022-11-11 15:29:48 +02:00
Joshua Wehner
5dd33c1fe6
Try a simple share -> mastodon via proxy (#18715) 2022-11-10 16:41:49 -06:00
Eevis Panula
09e327b7c2
Add more descriptive accessible names for save/bookmark-buttons (#18583) 2022-11-10 09:48:13 -05:00
Ben Halpern
43c522b58a
Feed experiment for 11-07-2022 (#18702) 2022-11-08 13:06:58 -05:00