Commit graph

437 commits

Author SHA1 Message Date
Mac Siri
74be076907
Add Algoliasearch-rails gem (#20866)
* Add Algoliasearch-rails gem

* Remove comment

* Add specs

* Add cache gem
2024-04-16 13:45:54 +00:00
Ben Halpern
c6a3e001fa
(Hopefully) final ahoy email tweak (#20835) 2024-04-03 15:02:13 -04:00
Ben Halpern
35848e4582
Digest config (#20834) 2024-04-03 13:22:54 -04:00
Ben Halpern
b6fa936e36
Customize ahoy email to track clicks async without redirect (#20809)
* Initial controller creation

* Ahoy custom clicks initial WIP

* Add test for success and failure

* Adjust some tests

* Adjust test

* Adjust tests and some code

* Update app/views/mailers/digest_mailer/digest_email.html.erb

* Remove s/t/u from safe params

* Add simple test

* Update app/controllers/ahoy/custom_email_clicks_controller.rb

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

* Change to just email clicks

* Email clicks controller test

---------

Co-authored-by: Mac Siri <mac@forem.com>
2024-04-01 15:05:04 -04:00
Meredith
fe0d9437e2
Remove redundant sidekiq configuration (#20807) 2024-03-29 11:47:40 -04:00
Meredith
2c0c4460e7
Resolve sidekiq warning (#20805) 2024-03-28 10:19:56 -04:00
Ben Halpern
eb8006a841
Make ahoy_email default_options[:click] an env var (#20757)
* Make ahoy_email default_options[:click] an env var

* Also noted a typo here

* Manually mount AhoyEmail::Engine

* Disable by default

---------

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2024-03-11 15:43:55 -04:00
Ben Halpern
0d4f7c7e19
Add new simple a/b test for Digest subject and adjust config and design details (#20754)
* Adjust Digest Email design and configuration

* Adjust some tests

* Update tests

* More adjustments to markup and tests

* More adjustments to markup and tests

* Digest email feature flag

* Test title variants
2024-03-11 13:02:19 -04:00
Mac Siri
61602db7a4
Remove yarn's install-state (#20639) 2024-02-16 10:14:33 -05:00
Mac Siri
afa73e06e3
Replace Webpacker with Esbuild (#20470)
* Migrate to esbuild WIP

* Add exclude

* Remove redundant file

* Move file

* Move to javascript_include_tag

* Lint fix

* WIP

* WIP

* Add watch mode to esbuild WIP

* Get jest working

* Remove babel

* Revert "Remove babel"

This reverts commit 6da35260aa19d6f97f586deb66c0ecaf48433b73.

* More WIP

* Got image to load

* WIP

* Resolve audit

* Lint fix

* WIP

* Fix jest spec

* [CI] Remove asset-restore for test build stage

* Production compliant

* Temp disable sourcemap

* Update glob

* Add esbuild helper to stimulus

* Import fragment

* Temp disable coverage to see failing tests

* Fix broken spec

* Address lint

* Set proper es6 target

* Use esbuild for everything

* wait what

* Revert "Set proper es6 target"

This reverts commit 98f5278093421baa8ffe2ca580845b01c1a1eadf.

* Revert "Use esbuild for everything"

This reverts commit 0ac46738f07ffcb6af095ccb1ffa5e439b7fefa3.

* Replace uglifier with terser

* New compiled assets version

* Remvoe honeybadger-io/webpack

* Remove cypress coverage checks for now

* Update jsconfig.json

* Update docker-compose

* Remove public/packs-test from ci cache
2024-01-25 20:29:21 +00:00
Anna Buianova
ca16a87a47
Upgrade ahoy_matey (#20404)
* Added index to ahoy_visits

* Upgrade ahoy_matey
2023-12-01 14:27:11 +00:00
Ben Halpern
bc89cf3e38
Store browser accept language header on users (#20212)
* Store browser accept language header on users

* Change to tracking via user context

* Remove async info code

* First draft of spec

* Work out tests

* Delete dependents
2023-10-16 11:59:30 -04:00
Mac Siri
5dc7e889b9
Support devcontainers and GitHub codespace (#20126)
Co-authored-by: Josh Klar <jklar@forem.com>
2023-09-21 18:16:09 -04:00
Juanito Fatas
e1c91d2a64
Fix typo of configuring redis at datadog initializer (#20016) 2023-09-11 10:40:04 -04:00
PJ
7be865b295
Feature-flagged support for filtering billboards by location (#19834)
* add migrations

* add countries gem?

* first pass at location model

* specs 

* add location to filtered ads query

* feature flag and nicer errors

* cosmetic fixes

* more tweaks (remove unnecessary index, add initializer)
2023-07-27 18:13:26 +01:00
Mac Siri
cd9d5df963
Set hash_digest_class to SHA256 (#18364) 2023-07-06 17:38:56 -04:00
Mac Siri
d183f8c670
Disable DD's log_injection in development (#19660) 2023-06-30 10:11:52 -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
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
Mac Siri
140f85695b
Add forgot_password_throttle (#19175) 2023-02-27 09:25:29 -05: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
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
Joshua Wehner
3f26694976
Refactor reaction categories as abstract class collection (#18540)
* Try a ReactionCategory abstract 'model'

* Use ReactionCategory

* Lookup category, pre-reaction

* Lookup category > constant

* Category can sometimes be nil?

* Try something friendlier for code reloading

* Refactor: extract point calculation out of Reaction

* Reaction Category can have color

* Rename reaction points service to follow convention

* method signature changed as well, calculate -> call

* Fix typo, leading comment, and rename data structures for clarity
2022-11-01 10:50:37 +01:00
Fernando Valverde
2517a4dac9
Remove rack attack throttle for admin users in API requests (#18612)
* remove rack attack throttle for admin users

* Add tests

* Optimize cache admin secrets for 24h with invalidation when needed

* Make ApiSecret callback only execute on create
2022-10-25 09:26:38 -06:00
Fernando Valverde
9ab6edb0b8
Opt in settings for Ahoy Tracking (#18575)
* Opt in settings for Ahoy Tracking

* Typo tweak
2022-10-17 10:11:27 -06:00
Mac Siri
0e43c915d9
Silence parser warnings (#18429) 2022-09-09 11:28:43 -04:00
Mac Siri
2413ece281
Use remote_ip in Rack::Attack (2nd attempt) (#18409) 2022-09-06 10:06:29 -04:00
Mac Siri
0ea60867d4
Revert all Rack::Attack changes (#18407) 2022-08-31 18:11:56 -04:00
Mac Siri
05f0e72c24
Simplify Rack::Attack (#18403) 2022-08-31 16:58:34 -04:00
Mac Siri
560bff9403
Move rack_attack.rb (#18402) 2022-08-31 14:28:26 -04:00
Mac Siri
9c0fc6b918
Use remote_ip in Rack::Attack (#18397) 2022-08-31 10:50:26 -04:00
Fernando Valverde
f77b5f83a9
Include audit log for API admin endpoints (#18167)
* First commit for audit log - specs need fixing

* Fix notification subscription issues + specs

* Use single line in notification subscribe initializer

* Remove conditional in unpublish endpoint
2022-07-22 11:35:30 -06:00
Fernando Valverde
aa130cc456
Fix Honeybadger typo in Rpush reflection callback (#18071) 2022-07-13 09:13:40 -06:00
Mac Siri
9599d3349f
Enable framework 7's cache_format_version (#18064) 2022-07-12 15:44:23 -04:00
Mac Siri
5579f3360c
Add DD service name for active_support and active_record (#18060) 2022-07-11 10:14:42 -04:00
Mac Siri
390cf0a6a0
Enable Rails 7 framework's default_headers (#18042) 2022-07-07 09:01:59 -04:00
Mac Siri
294fcba1e0
Add service_name scope to Datadog (#17996)
* Add service_name scope to datadog

* Fix typo

* Update config/initializers/datadog.rb
2022-07-01 11:32:45 -04:00
Mac Siri
9dd52c24e1
Enable Rails 7's framework wrap_parameters_by_default & cookies_serializer (#17984) 2022-06-27 09:33:37 -04:00
Fernando Valverde
8c836430ca
API V1 transition (#17835)
* API Articles v0-v1 restructure

* Remove unused helper

* Bulk move API controllers into concerns + add V1 controllers

* Extract API routes + some fixes

* Fix v1 api_controller authenticate! + add more article_controller specs

* Completed spec/requests/api/v1/articles_spec.rb

* specs up to listings

* All v1 specs except for 9 skips

* mime_types cleanup + authenticate! relocation

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2022-06-23 14:26:00 -06:00
Mac Siri
2f029fe896
Enable Rails framework 7.0's isolation_level, partial_inserts, & raise_on_open_redirects (#17970) 2022-06-23 10:30:58 -04:00
Mac Siri
130b47e8b8
Enable Rails framework 7.0's TimeWithZone & scope-inversing (#17958) 2022-06-22 09:33:38 -04:00
Mac Siri
eed1946e8c
Enable Rails framework 7.0's ActionView & tests (#17948)
* Enable Rails framework 7.0's tests configs

* Enable action_view configs
2022-06-16 17:18:21 -04:00
Mac Siri
80d9b969bd
Enable Rails framework 7.0's ActiveStorage & ActionMailer (#17931) 2022-06-16 10:49:56 -04:00
Mac Siri
dc55db5708
Change Rails load_defaults to 6.1 (#17877) 2022-06-13 10:40:53 -04:00
Mac Siri
686be06009
Enable cookies_same_site_protection :lax (#17875) 2022-06-09 16:04:39 -04:00
Mac Siri
a87f70048c
Enable some Rails 6.1 framework default part2 (#17855)
* Enable form_with_generates_remote_forms and deliver_later_queue_name

* Change form_with_generates_remote_forms to true

* Move config to application.rb

* Enable urlsafe_csrf_tokens

* Update comment
2022-06-08 10:56:10 -04:00
Mac Siri
678dda8cf4
Routine Rubopcop lint fixes (#17844)
* Routine Rubopcop lint fixes

* Undo app_secrets_spec changes

* Fix broken spec
2022-06-07 10:17:16 -04:00
Mac Siri
fc9bfda0ce
Enable/remove some Rails 6.1 framework default (#17831)
* Default Rails 6.1's active_record & active_storage config

* Remove active_storage and action_mailbox from 6.1 default
2022-06-07 08:42:10 -04:00
Fernando Valverde
21103696c3
Add missing explicit scopes to Omniauth adapters (#17761)
* Add missing scopes to Omniauth adapters - explicit > implicit

* Trigger CI
2022-05-25 09:56:13 -06:00