Commit graph

7618 commits

Author SHA1 Message Date
Michael Kohl
de119f59c1
Remove unused index_notifications_on_json_data (#11725)
Co-authored-by: rhymes <rhymes@hey.com>
2020-12-04 15:31:16 -05:00
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
Ben Halpern
4b2b9ebd47
Fix wikipedia tag z-index (#11737) 2020-12-04 09:42:05 -05:00
Marcy Sutton
b04b5bcb57
Headings and alt text roundup (#11721)
* Adjust heading order

No skipping levels, adding an h1 for the homepage

* Add missing image alt text

* Update after PR review

* Update test snapshot

Co-authored-by: rhymes <rhymes@hey.com>
2020-12-04 09:41:45 -05:00
Ben Halpern
a1b9336505
Return from method if env called in boot up not available (#11736) 2020-12-03 16:27:13 -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
Molly Struve
8d3a13bc7d
Temp Feature: Award Hacktoberfest Badges Rake Task (#11464)
* Feature:Award Hacktoberfest Badges Rake Task

* Update to use subscriptions to hand out badges

* some script tweaks to detect successful completes and handle failures
2020-12-03 14:19:11 -06:00
Jacob Herrington
1e761ca99a
Remove confusing line from readme (#11712) 2020-12-03 11:30:31 -06:00
Josh Puetz
eabff9cfc8
Add first time admin login to FAQs (#11733) 2020-12-03 11:07:07 -06:00
rhymes
347f7376f1
Change profile header cache key to purge headers (#11732) 2020-12-03 17:41:16 +01:00
Julianna Tetreault
28f3dbb13b
Bug Fix: First Published Post Not Showing Properly in the Feed (#11710) [deploy]
* Adds a ternary operator to determine where to splice in Feed.jsx

* Add comments to Feed.jsx to explain featuredStory and deleteCount
2020-12-03 08:59:29 -07: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
Eevis Panula
d569a253cd
Bugfix: Remove focus from avatars in notifications for better keyboard navigation (#11650)
* Add tabindex=-1 to hide links from keyboard users

* Add aria-hidden to hide the links from accessibility tree

* When multiple followers, remove the first one from tab order as they are in the following text
2020-12-03 08:11:20 -05:00
Fernando Valverde
0b75faa346
Adds a present? check to the DEV specific fields [Profile Generalization] (#11730)
* Adds an empty check to the DEV specific fields

* Use present? && not empty?

* .present? seems to be enough
2020-12-03 06:52:04 -06: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
Lisa Sy
ea00c808bd
Storybook: Add DocsPage and test out static content (#11397)
* Update naming of guidelines section and improve Introduction page

* Add Docs

* Add docs

* Install Docs add-on

- Rename top-level folders and sort manually
- Add MDX static pages

* Updated all Storybook addons to 6.1.3 except for notes as it's currently 5.3.21

* Fixed naming of section for the select component.

* Updated yarn.lock file.

* Added missing dependency @storybook/addon-docs

Co-authored-by: Nick Taylor <nick@dev.to>
2020-12-02 09:56:38 -08: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
c5a29826e8
Move app/labor/error_message_cleaner.rb to service (#11679) 2020-12-02 11:05:36 +07: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
dependabot-preview[bot]
78fc5f5982
Bump redoc-cli from 0.9.13 to 0.10.1 (#11670)
Bumps [redoc-cli](https://github.com/Redocly/redoc) from 0.9.13 to 0.10.1.
- [Release notes](https://github.com/Redocly/redoc/releases)
- [Changelog](https://github.com/Redocly/redoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Redocly/redoc/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-01 11:43:28 -05:00
Vaidehi Joshi
036a6c50b8
Improve error message of User Subscriptions (#11689) 2020-12-01 08:41:49 -08:00
dependabot-preview[bot]
7f066dd203
Bump @storybook/addon-knobs from 6.1.5 to 6.1.9 (#11672)
Bumps [@storybook/addon-knobs](https://github.com/storybookjs/storybook/tree/HEAD/addons/knobs) from 6.1.5 to 6.1.9.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.1.9/addons/knobs)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-01 09:55:51 -05:00
Ridhwana
57b13ffa72
Move the color picker to its own initializer file (#11693)
* refactor: move the color picker to its own initializer file

* fix:wrap in the initializecolorpicker function with use strict
2020-12-01 15:34:44 +02:00
Nick Taylor
3785274199
Cleaned up tests I wrote for #11525. (#11685) 2020-12-01 06:14:13 -05: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
Kushal Niroula
ab045700e1
Fix: action overlapping with header (#11649)
* Fix: action overlapping with header

* Fix: use z-elevate
2020-11-30 11:28:17 -06: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
ludwiczakpawel
d43ff0d46c
Series overflow fix (#11683)
* tooltips 1.0.1

* tooltips 1.0.1

* series selector
2020-11-30 17:12:10 +01:00
rhymes
3f47e8e695
Redirect old settings routes to new ones (#11681) 2020-11-30 16:54:31 +01:00
Ben Halpern
652f8112d2
Small optimization: Don't include --active variation on button for non-logged-in (#11676) 2020-11-30 10:03:06 -05:00
Ben Halpern
a6537dde95
Remove unused html (#11677) 2020-11-30 10:03:02 -05:00
Michael Kohl
a59e94c8f3
Add tag smart variable to Blazer config (#11640) 2020-11-30 21:50:28 +07:00
rhymes
a4b73373e7
rubocop -a (#11674) 2020-11-30 14:50:13 +01:00
dependabot-preview[bot]
651f822c20
Bump listen from 3.3.1 to 3.3.3 (#11680)
* Bump listen from 3.3.1 to 3.3.3

Bumps [listen](https://github.com/guard/listen) from 3.3.1 to 3.3.3.
- [Release notes](https://github.com/guard/listen/releases)
- [Commits](https://github.com/guard/listen/compare/v3.3.1...v3.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump listen from 3.3.1 to 3.3.3 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-30 14:50:05 +01:00
Molly Struve
fd97007364
Bug Fix:Remove nil cached_tag_lists when Collecting Tags (#11648) 2020-11-30 07:18:19 -06:00
Nick Taylor
df31a94f2e
Prep work to sync mobile search in #10424 (#11525)
* Prep work to sync mobile search in #10424

* Added a comment about the custom search event.

* Refactor to fix already defined error caused by const and InstantClick.

* Moved <SearchFormSync /> out of the pack file.

* Fixed broken tests.

* Renamed getInitialSearchTerm utility function to getSearchTermFromUrl

* Added some API docs to getSearchTermFromUrl

* Fixed a typo.

* Added some more API docs.

* Switched to a custom event so a custom payload can be passed.

* Added some API docs.

* Fixed bad destructuring statement.

* wip for some more tests.

* Refactored getSearchTermFromUrl to use URLSearchParams

* lazy loaded state for search term initial value.

* test broken still. Need to think on it.

* filterXSS is now set up in testSetup.js

* Fixed tests.

* Added the @utilities alias to Storybooks webpack config.

* Almost 100% coverage with two useful tests.

* Added some comments explaining document.body usage in the tests.

* Fixed issue where search attemps to get results on first load.

* Small refactor for setting the window.location in tests.

* Clarified an explanation in a comment.
2020-11-30 06:13:06 -05:00
dependabot-preview[bot]
f912f27f34
Bump listen from 3.3.1 to 3.3.2 (#11653)
* Bump listen from 3.3.1 to 3.3.2

Bumps [listen](https://github.com/guard/listen) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/guard/listen/releases)
- [Commits](https://github.com/guard/listen/compare/v3.3.1...v3.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump listen from 3.3.1 to 3.3.2 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-30 09:08:30 +01:00
dependabot-preview[bot]
59f34c5efb
Bump knapsack_pro from 2.9.0 to 2.10.1 (#11652)
* Bump knapsack_pro from 2.9.0 to 2.10.1

Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 2.9.0 to 2.10.1.
- [Release notes](https://github.com/KnapsackPro/knapsack_pro-ruby/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v2.9.0...v2.10.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump knapsack_pro from 2.9.0 to 2.10.1 (Update vendor/cache)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-30 09:07:55 +01:00