Commit graph

2296 commits

Author SHA1 Message Date
Chien-Wei Huang (Michael)
f7a9f0d2b4
validate payment pointer (#11702)
* Add validation for payment_pointer and clean its space before save

* Add test for payment_pointer

* fix payment pointer regexp

* fix test

* Remove space with strip

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>

* Remove redundant test

* Refactor clean_payment_pointer to strip_payment_pointer
- Move callback from before_save to before_validation

* Refactor PAYMENT_POINTER_REGEXP

* style: remove last comment in regexp

* fix typo

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
2020-12-04 12:00:25 -05:00
Vaidehi Joshi
d9011f4b59
Improve user subscription UX flow when latency is high (#11735)
* Improve user subscription UX flow when latency is high

* Extract subscribeBtn into const, add margin-bottom to logged-in-text
2020-12-03 12:25:32 -08:00
rhymes
41fbe24235
Fix schema.db whitespace (#11729)
* Fix schema.db whitespace

* Disable flaky spec
2020-12-03 15:35:29 +01:00
Ben Halpern
12efe40e63
Add a/b test for implicit follow points (#11675)
* Add a/b test for implicit follow points

* Add field test specs

* Add a/b testing docs

* Fix tests

* Fix tests

* Update docs/technical-overview/ab_testing.md

Co-authored-by: Molly Struve <mollylbs@gmail.com>

* Add comment

* Update docs/technical-overview/ab_testing.md

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>

* Update config/field_test.yml

* Update docs/technical-overview/ab_testing.md

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update docs/technical-overview/ab_testing.md

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

Co-authored-by: Molly Struve <mollylbs@gmail.com>
Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2020-12-03 08:39:04 -05:00
Fernando Valverde
e3176ad00f
Fixes a rubocop failure that slipped through in a previous PR (#11715) 2020-12-03 10:00:50 +01:00
ludwiczakpawel
69f7f4ba08
Logo on /new (#11701)
* tooltips 1.0.1

* tooltips 1.0.1

* logo on /new

* comment

* spec: Adds a test to ensure that the logo or Community name shows on /new

Co-authored-by: Julianna Tetreault <juliannatetreault@gmail.com>
2020-12-03 08:55:40 +01:00
Michael Kohl
8f5cfa2c0f
Drop profile columns from user (#10707)
* Prepare to drop profile columns from user

* Update code and factory

* Also remove unused constant

* Move validation from user to profile

* Remove Profiles::ExtractData service object

* Add more comments

* Simplify sameAs attribute generation

* Obey me machine, I am your master

* Fix condition order in guard clause

* Temporarily disable callback

* Fix specs

* Reduce usage of Profile#refresh_attributes!

* Remove leftover comment

* Handle social media links differently

* More spec fixes

* Fix specs for admin profile fields controller

* Fix specs after merge

* Fix remaining specs

* Update user show request spec

* Add comment for follow_hiring_tag

* Only save profile when user is valid

* Fix seeds.rb for profile fields

* Switch from before_save to after_save

* Undo unrelated formattin change

* Update spec/fixtures/files/profile_fields.csv

Co-authored-by: Molly Struve <mollylbs@gmail.com>

* Remove data update script and spec

* Fix spec

* Fix typo in comment

* Fix typo in comment

* Move article resave logic to service object

* Move profile field creation to before(:suite)

* Refactor error handling in Profiles::Update

* Fix Profiles::Update specs and refactor

* Temporarily disable spec

* Add ProfileValidator

* Clean up

* Move DB ready check into app/lib

* Refresh attributes after importing from CSV

* Fix specs

* Remove unused file

* A girl has no name. A profile neither.

* Fix specs

* Add responds_to? check

* Spec fix

* Add name to user fields in profile settings page

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-12-03 08:14:38 +07:00
Fernando Valverde
b02262c563
Split ReCaptcha service and use verbs instead of pronouns (#11706)
* Split ReCaptcha service and use verbs instead of pronouns

* Inline comment rewrite for clarify

* after? > >

* Use explicit role check for the user instead of .auditable?
2020-12-02 16:50:42 -06:00
Arit Amana
42e10e7b42
[EOY2020 Issue] Default new forems to Email Authentication only (#11696)
* Set default Auth Providers to empty array

* complete implementation; tests remain

* tests

* fix failing specs authenticator_spec.rb

* Fix failing specs

* fix more failing specs

* fix more failing specs 2

* update failing spec

* Update app/views/admin/configs/_auth_provider_settings.html.erb

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Update app/assets/stylesheets/admin.scss

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-12-02 16:49:07 -05:00
Alex
7ee8523ba3
Refactor EdgeCache (#11684)
* Refactor EdgeCache

* Update specs

* Add bust comment spec

* Fix more specs

* Use const_get

* Make methods private

* Add .discussion? decorator to Article

* Change variable name to article for clarity
2020-12-02 14:20:22 -05:00
Vaidehi Joshi
a658406b5c
Ensure first user of a Forem has a trusted role (#11700) 2020-12-02 08:44:35 -08:00
Fernando Valverde
494af84e83
Refactor reCaptcha code and bypass in report abuse for trustworthy users only (#10502)
* Bypass recaptcha for authenticated users abuse reports

* Moves bypass_recaptcha? to helper method to have one definition of the criteria for this

* User must be 1 month old at least in order to bypass_recaptcha?

* Fixes test

* Better spec message

* Bypasses auditable users

* Adds better test coverage over recaptcha bypass cases

* include Helper removed from FeedbackMessagesController

* Adds some inline comments for clarity and banned check
2020-12-02 08:55:47 -06:00
rhymes
5e9be0c32d
Disable ActionController auto params wrapping (#11692)
* Disable ActionController auto params wrapping

Rails by default accepts wrapped and unwrapped parameters in JSON requests (with or without a root object), regardless of the fact that the contract with the client requests wrapped parameters or not. This results in unforeseeable bugs when the client sends unwrapped parameters in lieu of wrapped ones.

As undeterministic bugs are a PITA and this is the classic grey area in Rails apps and as the customer facing API is fully documented and the internal can be manually adjusted, we disable this and be done with this odd feature.

https://github.com/forem/forem/issues/11645
https://github.com/forem/forem/pull/11638

* Remove accidentally committed file
2020-12-02 15:17:43 +01:00
Fernando Valverde
c740b4e6dd
Adds ability for admins to create new tags via /admin/tags (#11240)
* Adds ability for admins to create new tags via /admin/tags

* Merge branch 'master' of github.com:forem/forem into fdoxyz/admin-new-tags-11026

* Fix rubocop pre-hook

* UI Tweaks

* replaces show with edit action & other minor changes

* Reverse unrelated changes

* Removed more unrelated edits

* Fix specs

* Fix moderator link
2020-12-02 08:12:57 -06:00
rhymes
201492c95b
Fix invalid feed error display in settings (#11695) 2020-12-02 12:13:49 +01:00
Michael Kohl
195e228307
Move GeneratedImage to Images::GenerateSocialmage (#11691) 2020-12-02 11:03:14 +07:00
Ben Halpern
54937fa5a7
Add configs/show api for admins (#11358)
* Add configs/show api for admins

* Add initial test

* Add test

* Update docs/api_v0.yml

Co-authored-by: rhymes <rhymes@hey.com>

* Change to single resource

* Change authentication approach

* Change to status code spec

* Fix spec path

* Final touches

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

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Proper stubbing

Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-12-01 12:22:07 -05:00
Vaidehi Joshi
036a6c50b8
Improve error message of User Subscriptions (#11689) 2020-12-01 08:41:49 -08:00
Michael Kohl
2939813168
Move app/labor/reaction_image.rb to helper (#11678) 2020-12-01 14:15:30 +07:00
Michael Kohl
5185de4c91
Move app/labor/follow_checker.rb to service (#11613)
* Move app/labor/follow_checker.rb to service

* Move to Follows:: namespace
2020-12-01 14:14:36 +07:00
Nenad Pantelić
ad04158b90
Add podcast_appearances joined table (forem#82) (#11354)
* Add podcast_appearances joined table (forem#82)

* Add podcast appearances keys unique constraint and creator property (forem#82)

* Add podcast_appearance role validation forem(#82)

* Add spec test for podcast_appearances model (forem#82)

* Small refactoring - place podcast appearance association by alphabetical order

* Adapt m2m association to pass rspec test (forem#82)

* Rename podcast appearance model to podcast episode appearance and remove fk indexing

* Rename podcast appearance model to podcast episode appearance and remove fk indexing

* Rename podcast episode appearance models and spec models. Update podcast episode and user spec tests (forem#82)

* Rename podcast episode appearances composite index to follow Rails naming pattern (forem#82)

* Remove ddl_transaction disabling and conurrent index adding from appearance migration

* Add role validation in model spec (forem#82)
2020-11-30 17:12:52 +01:00
rhymes
3f47e8e695
Redirect old settings routes to new ones (#11681) 2020-11-30 16:54:31 +01:00
rhymes
a4b73373e7
rubocop -a (#11674) 2020-11-30 14:50:13 +01:00
Michael Kohl
06fd95f93f
Move LogWorkerQueueStats from labor to services (#11642) 2020-11-30 09:31:15 +07:00
Akash Srivastava
ebd7712829
fix: Parsing of preamble with escaped content in runkit tags (#11466) 2020-11-27 16:56:52 -05:00
rhymes
68b320a1de
Add contact email to SiteConfig and replace default where appropriate (#11630)
* Add a new contact email to use in place of default

* Replace :default with :contact email in all non transactional emails

* Add missing expectation
2020-11-27 16:39:38 +01:00
Michael Kohl
1ce8a762b7
Move HtmlCleaner from app/labor into service (#11609)
* Move HtmlCleaner from app/labor into service

* Move to Feeds:: namespace
2020-11-27 08:21:57 +07:00
Ben Halpern
d759ac4627
Add implicit points to follows to improve feed relevancy (in all algorithms) (#11513)
* Fix menu dropdown disable issue

* Initial base work

* Add real algorithm

* Add working object and test

* Fix schema

* Fix schema

* Fix schema

* Finalize

* Add update script and explict_points

* Proper implicit/explicit points

* Fix tests

* Add docs

* Fix tests

* Fix data update script test

* Fix data update script test

* Fix typo

* Improve efficiency and add more logic

* Changed to find_each

* Change to bulk insert

* Update tests and refactor logic

* Various improvements

* Fix typo

* Fix tests

* Remove extra line

* Fix tests

* Fix test typo

* Cache site-wide tag names
2020-11-25 16:09:51 -05:00
Thomas Bnt
3d8049697a
Edited URLs settings/ux to settings/customization (#11618) 2020-11-25 12:29:12 -05:00
Ben Halpern
a229cfa174
Preserve internal navigation indicator on redirect (#11476)
* Preserve internal navigation indicator on redirect

* Fix test

* Refactor for cleaner reusability

* Add docs
2020-11-25 11:04:19 -05:00
rhymes
369d6e2206
Fix Settings/Customization page (#11615) 2020-11-25 16:47:38 +01:00
Michael Kohl
82108ea8b5
Remove app/labor/random_gif.rb (#11611) 2020-11-25 14:58:32 +00:00
Arit Amana
845e00797b
[EOY 2020] Replace "ban" with "suspend" in Admin (#11581)
* Implement changes

* display "Suspended" if user role.name is banned

* Correct equality symbol

Co-authored-by: Michael Kohl <me@citizen428.net>

Co-authored-by: Michael Kohl <me@citizen428.net>
2020-11-25 09:15:07 -05:00
Spencer
de3d62bc40
API: Endpoint to get an organization's users (#11514)
* add tests

* add route

* add users action to organizations controller

* add jbuilder file

* update api docs

* add recource routes

* make updates to organizations controller

* remove org_users from api docs

* update spec

* add users show jbuilder

* bug fix for user show
2020-11-25 12:50:57 +01:00
Molly Struve
dc7d9d5843
Refactor/Optimization:Use more_comments_minimal_weight_randomized_at_end for Signed In Feed (#11604) 2020-11-24 15:36:55 -06:00
Lisa Sy
fc4f6e3b1c
Improve information architecture of Settings (#11347)
* WIP Rename categories and make consistency card titles

* Add rest of sections to Extensions page

* icons

* Reshuffle Integrations and remove unnecessary Integrations tab in controller

* Update rspec tests

* Fix specs

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-11-24 12:26:06 -08:00
Molly Struve
c3b0103eb1
Bug Fix:Remove Score Filter From Tag Mod Index (#11599) 2020-11-24 14:18:14 -06:00
rhymes
1741e52e83
Add missing features to new feed importer (#11501)
* Add explanatory comment to how RssReaderFetchUserWorker works

* Add Feeds::ImportWorker worker

* Enable Feeds::Import for single user feed fetching behind a feature flag

* Add Feeds::ValidateUrl service

* Add feature flag to user's validate feed URL feature

* Remove todo notices

* Add feature flag to fetch_all_rss task

* Add feature flag to RssReaderWorker

* Bring back short-circuit for Articles::RssReaderWorker
2020-11-24 18:11:13 +01:00
rhymes
d49c00aa84
Fix email messages link in admin's user page (#11595) 2020-11-24 16:35:14 +01:00
Mac Siri
c4fdeeb944
Make Images::Optimizer nil-safe (#11584) 2020-11-24 09:39:34 -05:00
Molly Struve
abbc29dafe
Bug Fix:User >= when filtering by SiteConfig.home_feed_minimum_score (#11567) 2020-11-23 09:13:03 -06:00
Michael Kohl
894b1b94c7
Remove UnreadNotificationsEmailer (#11561) 2020-11-23 14:15:07 +00:00
Molly Struve
e454772128
Update trusted role email Subject (#11519) 2020-11-20 09:54:21 -06:00
Andy Zhao
827c9aa77c
Fix Facebook Login profile image download failure (#11478)
* Send a new request and use link in response for profile img

* Use fallback option and make method private

* Refactor and use constant template string

* Stub image_url method for tests

* Fix tests and mock response object properly

* Fix tests and mock response object properly

* Stub response for tests

* Refactor a bit and move into helper method

* Undo everything I did. today I will watch facebook burn.

* Use more foolproof string to gsub
2020-11-19 16:18:09 -05:00
Ben Halpern
c837834d6a
Remove under-used growth tab (#11495) 2020-11-19 10:53:36 -05:00
Manasa
b015690f4f
Podcast ownership join table (MLH Fellowship #81) (#11410)
* added podcast_ownership route

* added podcast_ownership table

* added podcast_ownership controller and pundit policy

* fixed codeclimate

* removed controller and pundit policy

* codeclimate

* codeclimate

* schema.rb

* schema.rb

* schema.rb

* user.rb

* made the suggested changes

* added validations

* fixed build error

* changed name to owned_podcasts

* added validation and tests

* added tests

* added tests

* changed spec

* added factory

* added factory

* merge conflict

* factory

* factory

* factory

* modified spec file

* modified spec file

* fix build error

* added class_name

* adjusted m2m relations

* made suggested changes

* fixed build error

* added subject

* schema

* ran migration

* removed index:true from singular fields

* changed schema file

* set index: false
2020-11-19 12:41:17 +01:00
rhymes
7c5794dcda
Remove boolean checks for validate_inclusion_of in specs (#11474) 2020-11-19 12:19:36 +01:00
ludwiczakpawel
70706d0a62
Comments UI update (#11283)
* tooltips 1.0.1

* tooltips 1.0.1

* init

* .

* drop not needed files

* .

* init

* init

* .

* comments

* border

* missing bits

* build comment JS

* .

* .

* specs

* sloan avatar fix

* bunch of fixes

* specs and fixes

* specs

* .

* swap order of links

* contrast

* js for dropdown

* icons

* op-author

* three dots icon

* reverts

* test: capybara- make sure that we click the dropdown before clicking on edit

* permalink --> link

* tiny fixes

* aria-label on form

* proper alt on user's avatar

* aria has popup

* use UL > LI instead of DIV

* add aria-labels to dropdown items

* another aria-label

* better links: nav

* contrast

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-11-18 18:21:19 -05:00
Molly Struve
fd8f83dc7d
Feature:Backend Username Search Endpoint for Mention Completion (#11479)
* Feature:Backend Username Search Endpoint for Mention Completion

* ensure user is authenticated to use usernames endpoint

* update spec with authaa
2020-11-18 16:43:59 -06:00
Akash Srivastava
2ee5ea69bd
Added published date as editable in admin articles list/show (#11124)
* Added published date as editable in admin articles list/show

* Added requests spec for articles published date update
2020-11-18 10:40:13 -06:00