Commit graph

2112 commits

Author SHA1 Message Date
Diogo Osório
2b72a35d3d
[deploy] Introduce /api/profile_images/:username endpoint (#10547)
* Documents the new /profile-images/:username API endpoint

* Introduces the /api/profile_images/:username endpoint

This endpoint receives either an user or organization username as input
via the URL path and returns the profile image information for that
user/orgnization.

* Updates the /api/profile_images/:username response

Adapts the response according to the review comments:

1. Removes the cache directives
1. Tweaks how the user query is being done
1. Adds a `image_of` property to the response

* Bump API version

Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-10-14 14:24:25 -05:00
Jean-Francis Bastien
9ff7f82664
[deploy] API - New endpoint to retrieve the articles in the reading list of the authenticated user (#10540) 2020-10-14 13:20:03 -05:00
Ben Halpern
b5f20c0a46
Make allow email password login default true (#10838)
* Make allow email password login default true

* Change test
2020-10-14 13:34:01 -04:00
Mac Siri
30fa3b79a3
Default to Imgproxy on Forem-cloud (#10819) 2020-10-14 12:54:59 -04:00
Lisa Sy
36e271e1cb
Deprecate old button stylings with Crayons buttons (#10694) [deploy]
* Deprecate old buttons.scss file

* Replace outdated button styles with Crayons button styling

* Update additional views after removing old button styling

* Update tests

* Update test

* Update test

* Fix button placements
2020-10-14 07:28:41 -07:00
Ivan
4f79da26c3
add fullscreen to code blocks (#10784)
* add fullscreen to code blocks

* add review fixes

* remove extra import

* fix approved tests

* code review - paddings

* fix padding to make highlight code scrollable
within  padded area

* add fullscreen to existing webpack entrypoint

* fixed aria: true generated extra ids

* fix tests
2020-10-14 12:01:35 +02:00
Molly Struve
1d8c87715f
Add Specs for Basic Feed Class (#10833) 2020-10-13 17:52:50 -05:00
Lisa Sy
3377b5b69e
Update [authentication] in /admin/config (#10748)
* Write up new accordion view in markup

* Add inline SVG and edit padding of form

* Fix padding

* Remove extraneous buttons for current draft
2020-10-13 16:43:29 -04:00
Akshay Mahajan
f6c1fe0ade
Fix missing category in delete draft listing URL (#10809)
* added category in DASHBOARD_JSON_OPTIONS in listing_controller.rb

* added test to make sure that draft listings contain category
2020-10-13 14:04:07 -04:00
Molly Struve
73cb7f0d42
Comment out Flaky Basic Feed Spec (#10831) 2020-10-13 13:01:48 -05:00
Ben Halpern
bc248f17e7
Skip edge caching for private forems (#10817)
* Skip edge caching for private forems

* Add test

* Update spec/requests/stories_index_spec.rb

* Adjust comment

* Also check other cache-related headers
2020-10-13 13:36:20 -04:00
Molly Struve
7ce3b8abd2
[deploy] Feature:Add Video States Encoder Key to SiteConfig (#10818) 2020-10-13 12:14:07 -05:00
Julianna Tetreault
cb93197d43
Fixes "Invite Flow" 404s for Unregistered Users (#10743) [deploy]
* Add conditional to display "<username> is not registered" or Admin User profile in /admin/show.html.erb
  -Displays a "<username> is not registered" message for unregistered users
  -Displays all linked usernames and Admin User info for registered users

* Adds tests around unregistered users Admin User profiles

* Use predicate method in all conditionals in /admin/users/show.html.erb

* Adjusts message alerting admins that a user has not accepted the invite yet
  - Makes the message displayed on the Admin User prof more explicit
  - Makes GETS singular instead of plural in invitations_spec.rb
  - Updates users_spec.rb to test against updated message
2020-10-13 07:53:29 -06:00
Ridhwana
66b14fc0bf
[deploy] Dynamic frontend for the sidebar navigation Items (#10754)
* feat: configure the frontend for sidebar nav links

* chore: add a comment

* changes to the admin interface

* feat: move the temporary task to be in the rake tasks and use it in the dev seeds

* feat: use the task in the rake seeds

* refactor: reuse the form across two modals

* refactor: use the form partial

* feat: change the modal to be large

* fix: naming

* Update db/seeds.rb

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

* chore: make the file readable

* chore: removed the if else as the rake task was run on all forems + i sent out a message to new communities

* oops

* refactor: add a scope

* chore: oops removed this

* feat: add navigation links specs

* spec: fix two failing ones

Co-authored-by: Michael Kohl <me@citizen428.net>
2020-10-12 16:05:47 -04:00
Jacob Herrington
221f134d83
Remove code setting SiteConfig values in specs (#10811) 2020-10-12 12:06:10 -05:00
Arit Amana
f4bd1df21c
[Email/Password Authentication] Allow Admins to enable email/password login (#10745)
* Implement Admins ability to allow email login

* Write specs for admin allow email login

* Fix specs causing builds to fail

* Fix spec causing builds to fail

* Use dummyimage.com for spec images

Co-authored-by: Josh Puetz <joshpuetz@gmail.com>

* Use dummyimage.com

* refactor setting of SiteConfig attributes

* Address PR review comments

* fix indentation

* Use "allow to receive and return" approach for other specs

Co-authored-by: Josh Puetz <joshpuetz@gmail.com>
2020-10-12 12:54:35 -04:00
Molly Struve
e42b6d6b46
Flaky Spec Fix:Clear Article Content Before Filling In (#10810) 2020-10-12 10:46:25 -05:00
Jacob Herrington
c37b283865
Allow Forem admins to enable an invite only mode. (#10758)
* Add invite only mode field to SiteConfig

* Add UI elements for invite only mode
2020-10-12 11:27:22 -04:00
rhymes
a1e8634b90
[deploy] Disable flakey Runkit test (#10806) 2020-10-12 15:48:29 +02:00
Michael Kohl
f95acef2bc
Profile generalization tidbits (#10631)
* Load all profile fields on app start

This time without breaking bin/setup (hopefully)

* A SiteConfig.dev_to? for special case logic

* Update BanishUser#remove_profile_info

* Continue clearing data from users table for now

* Add specs for SiteConfig#dev.to?

* Use correct attribute list

* Update spec/models/site_config_spec.rb

Co-authored-by: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com>

Co-authored-by: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com>
2020-10-12 10:01:27 +07:00
irmela
ee989a0d47
[deploy] Allow glitch id starting with ~ (#10544) 2020-10-09 17:17:53 -04:00
Julianna Tetreault
749dd55d41
Removes superfluous sign_in from users_onboarding_spec.rb (#10757) [deploy] 2020-10-09 14:24:27 -06:00
Josh Puetz
37b40c9b04
Link Email Account creation UI to existing Create Account UI (#10746) [deploy]
* Conditional button to link to email accout creation

* Rename email signup state param

* Test for email account creation button scenarios
2020-10-09 10:29:09 -05:00
Rafal Trojanowski
2a488a19f8
Articles API: filtering by tags (#3654) (#10614)
* Articles API: filtering by tags (#3654)

* Address CR comments (#3654)

* Add test case
* Move tests
* Update docs

* Use _any_ option for querying by tags (#3654)
2020-10-09 12:49:34 +02:00
Andy Zhao
6c20a70aef
[deploy] Add recaptcha keys to as site-configurable keys (#10736)
* Add recaptcha keys to as site-configurable keys

* Add recaptcha to site config view

* Use site config key

* Make ReCAPTCHA tag optional if keys are blank

* Use proper capitalization of recaptcha

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

* Refactor logic for readability

* Use proper capitalization of recaptcha

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

* Use proper capitalization of recaptcha

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

* Use proper capitalization of recaptcha

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

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2020-10-08 17:16:00 -04:00
Vaidehi Joshi
c4efee10bf
Do not require meta_keywords to be set (#10721)
* Remove extra character from meta_keywords in /listings/index.html.erb

* Remove meta_keywords from MANDATORY_CONFIGS

* Add and use meta_keywords_tag helper

* Use modern tag syntax instead of deprecated syntax

* Add and use meta_keywords_default helper

* Add and use meta_keywords_article helper

* Remove * from meta_keywords_field.label

* Update meta_keyword specs to account for no keywords being set
2020-10-08 10:51:25 -04:00
Michael Kohl
a2b55f889c
Remove Twitch integration (#10732)
* Remove Twitch integration

* Ignore columns
2020-10-08 12:44:10 +00:00
Ben Halpern
36b1edb3e2
[deploy] Ensure podcast episodes are created with processed_html (#10715) 2020-10-07 12:09:36 -04:00
Ben Halpern
0ed408a409
Fix feed order for basic (#10717)
* Fix feed order for basic

* Fix spec
2020-10-07 11:26:32 -04:00
Jacob Herrington
c53522a8a8
Remove random onboarding background images (#10683)
* Fix misleading alt tags

* Make random fallback images optional
2020-10-07 10:19:18 -04:00
Julianna Tetreault
0a5babc10e
Add Recent Reactions to the Admin Users' Page (#10680)
* Adds Recent Reations back to the Admin Users page...UGH rebasing :(
  - Render negative_reactions partial in admin/edit.html.erb
  - Add #set_related_reactions back to Admin::UsersController
  - Refacotors JS to target #reports-row in _reports.html.erb

* Alphabetizes reports and reactions partials in edit.html.erb

* Adds tests around Recent Reports and Recent Reactions sections to users_spec.rb
2020-10-07 14:21:10 +07:00
Brunno Souza
120bd7940f
Move method #approved_liquid_tags to user service (#10663) 2020-10-07 12:04:08 +07:00
Vaidehi Joshi
52fd043c33
[deploy] Limit articles created by newer users (#10686)
* Limit articles created by newer users

* Fix typo in test
2020-10-06 21:02:05 -04:00
Ben Halpern
6cb68f134e
[deploy] Allow pattern match for spam terms (#10684) 2020-10-06 19:18:29 -04:00
Ben Halpern
c77a13c0d0
[deploy] Auto-suspend multiple-spammers (#10679)
* Auto-ban multiple-spammers

* Fix xit
2020-10-06 18:07:48 -04:00
Ben Halpern
f87e9eace1
[deploy] Add feed_strategy config (#10245)
* Add feed_strategy config

* Add configs spec

* Fix specs

* Fix field test scenario

* Linting

* A couple small changes

* Rename Optimized and objects

* Add proper namespace

* Fix codeclimate

* Add docs

* Update docs/technical-overview/readme.md
2020-10-06 17:36:27 -04:00
Vaidehi Joshi
f83062a9dd
Remove community_action from SiteConfig (#10678) 2020-10-06 15:46:04 -04:00
Vaidehi Joshi
3d169b5e6f
Do not require SiteConfig.tagline (#10623) [deploy]
* Fix incorrect formatting in admin/configs/show.html.erb

* Only render SiteConfig.tagline if it exists

* Fix typo in _signup_modal.html.erb

* Remove tagline from VerifySetupCompleted::MANDATORY_CONFIGS

* Improve signup_modal tagline specs

* Tiny fixes to address @citizen428's comments
2020-10-06 10:34:34 -07:00
Ben Halpern
eefbe25bd3
[deploy] Add ability for admin to add anti-spam terms (#10615)
* Add ability for admin to add anti-spam terms

* Fix specs

* Fix tests

* Fix typo

* Fix test
2020-10-06 10:10:30 -04:00
Ben Halpern
c60566b8a5
[deploy] Modify code to deal with flaky tests (#10616)
* Modify code to deal with flaky tests

* Remove uneeded x
2020-10-05 14:54:11 -04:00
Rachael Wright-Munn
348aa3df15
[deploy] Add twitch liquid tags (#10577)
* Add a Liquid Tag specifically for Twitch clips.

These will embed Twitch Clips in articles and comments.

* Update documentation to incorporate Twitch clip liquid tags.

* Include Twitch Clips in video embed logic

* Making a small change to rebuild
2020-10-05 11:55:27 -04:00
Michael Kohl
640f124033
Don't use "not_to raise_error" with specific class (#10602) 2020-10-05 17:29:01 +02:00
ludwiczakpawel
1375e8a4df
[deploy] Redesigned Comment Form (#10355)
* init

* .

* .

* better

* last bits

* specs

* merge

* fix response templates for replies

* copy

* active inactive buttons + cleanup

* labels

* specs

* specs

* response templates fix

* ....

* wtf

* .
2020-10-05 12:01:48 +02:00
Brunno Souza
e5973ebf9c
Refactoring user_controller separating some classes to service (#10384)
* Refactoring user_controller separating some classes to service

* Replace service Credit::Manager and improve yours specs

* improve method with memoize
2020-10-05 10:41:59 +02:00
ludwiczakpawel
9d384e1a93
CSS Cleanups, part 2 (#10527)
* padding-top on body

* padding-top on body

* move cheese around

* .

* :(

* rename
2020-10-03 06:57:57 +02:00
Molly Struve
cf443c3ae7
Refactor:Remove Screenshot Monkey Patch (#10520) 2020-10-02 16:53:26 -05:00
rhymes
c0c1b0fd71
Rename misspelled spec file (#10537) 2020-10-02 17:25:22 +02:00
Ridhwana
21389ab05d
Admin Panel for Configurable Navigational Links (#9444) 2020-10-02 11:11:21 -04:00
Julianna Tetreault
c87974b7ac
[deploy] Add co_author_ids to Articles (#10339)
* Replaces second_user_id and third_user_id with co_author_ids on the Articles table

* Adjusts migration that adds co_author_ids to also add array: true

* Replaces second_user_id and third_user_id with co_author_ids in all applicable files
  - Use co_author_ids in _individual_article view
  - Use co_author_ids in articles and stories controllers
  - Use co_author_ids in article and podcast_episode models
  - Use co_author_ids in article_dashboard
  - Use co_author_ids in comments_helper
  - Use co_author_ids in articles_spec

* Replaces second_user_id and third_user_id with co_author_ids in article.rb model

* Remove unused #assign_co_authors method from the Stories::Controller

* Add #co_authors and #co_author_name_and_path to article_decorator.rb

* Adds a descriptive form field for co_author_ids for Admins in /admin/articles

* Adds a conditional in article/show.html.erb to render co_author names on an Article in a human-readable way

* Replaces get_co_author_name_and_path with proper method name, co_author_name_and_path in show.html.erb

* Adds latest schema to (hopefully) resolve Travis conflicts

* Adds the safe operator to show.html.erb

* Adjusts articles_spec.rb to use an array in the first test

* Replaces unless &.empty? with if ./present? in articles/show.html.erb

* Replaces second_user_id with co_author_ids in stories_show_spec.rb test

* Replaces elsif with else in articles/show.html.erb

* Cleans up show.html.erb by removing conditional in favor of decorator method

* Refactors splitting of params in Articles::Controller and optimizes query in #co_authors

* Reverts removal of second_user_id and third_user_id and migration file

* Adds a data_update script to update co_author_ids with existing second and third user_ids

* Adds validations to co_authors and flash_messages to indicate whether an update was successful or not
  - Adds to methods to article.rb to validate the IDs of co_authors and authors
  - Adds flash messages to the Admin::Articles::Controller and a redirect to the show page
  - Removes the JS highlighting upon submit when updating an Article in Admin
  - Refactors #update action in Admin::Articles::Controller

* Adds tests to article_spec.rb around co_author_id validations in article.rb

* Adjusts #validate_co_authors_must_not_be_the_same to use .include? instead

* Uses Field::Select.with_options in article_dashboard.rb to properly display co_author_ids

* Reverts removal of assigning co_author_ids in the Stories::Controller

* Adjusts error message and adjusts return logic in article.rb (thanks, Fernando!)

* Fixes failing article_spec.rb test that checks for co_author_ids uniqueness

* Adds a default array to co_author_ids and checks if they are .blank?

* Refactor data_update script to use a single SQL statement (thank you, Michael)

* Preserve array order of co_author_ids in article_decorator.rb

* Add db file for default: []

* Add validation to fix bug related to text inputs and invalid users when adding co_authors

* Adds tests to ensure that co_author_ids are both an integer and an integer > 0

* Updates admin/articles_spec.rb to default [] instead of nil

* Adjusts validations in article.rb to be DRY-er and more consistent

* Consolidates validations further

* Refactors validations in article.rb to use procs

* Refactors data_update script to remove nil values from array
2020-10-02 11:06:11 -04:00
Rafi
4a9f27163e
[deploy] Manage listing categories in dashboard (#10506)
* Displaying all listing

* Edit listing form

* Editing listing

* Searching listing categories

* Creating new listing category

* Deleting listing category

* Fixing error message and roles

* Tests

* Fixing aria label

* Fixing link class

* Fixing error message of destroy

* Changing placeholder text
2020-10-02 11:05:09 -04:00