Commit graph

1339 commits

Author SHA1 Message Date
Ben Halpern
c837834d6a
Remove under-used growth tab (#11495) 2020-11-19 10:53:36 -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
Vaidehi Joshi
59ea42a372
Add community_emoji to SiteConfig (#11450)
* Add optional community_emoji to SiteConfig

* Remove hardcoded emojis, favor community_emoji instead

* Remove remaining hardcoded emojis

* Validate community_emoji field when updated
2020-11-17 14:02:04 -08:00
Ben Halpern
f3a69bbd84
Allow Forems to specify which domains are allowed for registration (#11442)
* Allow authors to restrict which emails can sign up

* Add form and tests

* Check for email presence in allowed email flow

* Fix test domains

* Fix codeclimate issue
2020-11-17 08:43:46 -05:00
Molly Struve
cf619caf70
Refactor: Remove more_tag_weight_more_random_experiment (#11447) 2020-11-16 15:48:45 -06:00
Ben Halpern
992dc54b0f
Simplify admin config permissions and add links to help pages (#11362)
* Simplify admin and add links to help pages

* Add line

* Add line

* Update app/views/layouts/admin.html.erb

* Update app/controllers/admin/configs_controller.rb

* Move svg to own file
2020-11-13 09:56:13 -05:00
Alex
99c3fb276d
Auto generate mascot accounts (#11380)
* Auto generate mascot accounts

* Refactor to remove extra query

* Update registration specs

* Fix search query spec

* Fix reaction specs

* Create with bang and raise error
2020-11-12 16:33:16 -05:00
Julianna Tetreault
0ee74d1e26
Validate Image URLs in SiteConfig (#11299) [deploy]
* Adds image URL validation to image URLs in configs_controller.rb

* Adds additional image URLs to #valid_image_url in configs_controller.rb

* Adds tests around valid image URLs to configs_spec.rb

* WIP: sets strict conditions for before_action

* WIP: comments out unused code for draft PR

* WIP: cleans up configs_controller.rb for draft PR review

* Renames constant to more explicit IMAGE_FIELDS in configs_controller.rb

* Removes unnecessary comments from admin/configs_spec.rb

* Checks for matching keys in params and IMAGE_FIELDS in configs_controller

* Refactors #valid_image_urls and #valid_image_url in ConfigsController (THANK U, ANDY)

* Refactors image-related code and error messages in Admin::ConfigsController

* Renames expected_image_url to invalid_image_url and removes useless test

* Fix: update the tests to contain valid image urls so that they pass the validation.

* Adjusts tests & VALID_URL regex to validate images rather than image-specific URL

* Replaces $ with \z per Rhymes suggestion and feedback

* Adds accidentally removed code

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-11-12 12:02:07 -07:00
Ben Halpern
badefcabeb
Developer experience/security: Make dev/test blow up if current_user is used erroneously (#11237)
* Let dev/test blow up if current_user is used erroneously

* Fix logic

* Fix click-to-edit permissions

* Change test to check for new behavior

* linting

* Edit tests

* Change test

* Clean up implementation

* Update comment

* Fix instance vars

* Update app/controllers/concerns/caching_headers.rb

* Merge origin and add request_store gem
2020-11-12 11:54:23 -05:00
Josh Puetz
2223e5468b
Email login always on (#11307)
* Starting out

* Building away...

* Hooking buttons up

* Hook Auth Provider buttons to Array Field

* trying to fix NoNameError

* Remains InviteOnlyMode disable and tests

* Smashing remaining tasks

* Last of tasks

* add tests

* Complete specs and tests 😅

* Fix bug

* Additional guard

* pass event to functions

* Position Email Auth first

* Fix bug in Email Auth Modal

* Fix spacing issue

* Update docs for adminModal.js

* Show/hide Enabled Indicator with Enable/Undo buttons

* Complete Auth Providers functionality

* Only update `allow_email_password_registration` from admin

* Remove duplicated methods

* Some refactoring around fact that Email Login is now always on (#11382)

* Fix merge (again!)

Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
2020-11-12 09:32:58 -06:00
ludwiczakpawel
ab34b37c49
Badges area on profile (#11384)
* tooltips 1.0.1

* tooltips 1.0.1

* badges size

* badges size

* .

* button style

* pawel messing with controllers

* math is stupid

* good boys write docs

* typos
2020-11-12 15:53:14 +01:00
Ben Halpern
dfc3d96286
Update shell version when admin action taken (#11343)
* Update shell version when admin action taken

* Update app/controllers/admin/application_controller.rb

Co-authored-by: Alex <alexandersmith223@gmail.com>

Co-authored-by: Alex <alexandersmith223@gmail.com>
2020-11-09 15:31:54 -05:00
Molly Struve
a0c174fcb7
Refactor:Remove more_experience_level_weight_experiment From Feed Tests (#11340) 2020-11-09 13:59:59 -06:00
Krzysztof Rybka
d6956180ad
Return video_source_url in API V0 Videos index (#11040) 2020-11-09 06:27:28 +01:00
Arit Amana
08796b5cee
[Team Email Login] Refactor Authentication Provider Enable/Disable (#11185)
* Starting out

* Building away...

* Hooking buttons up

* Hook Auth Provider buttons to Array Field

* trying to fix NoNameError

* Remains InviteOnlyMode disable and tests

* Smashing remaining tasks

* Last of tasks

* add tests

* Complete specs and tests 😅

* Fix bug

* Additional guard

* pass event to functions

* Position Email Auth first

* Fix bug in Email Auth Modal

* Fix spacing issue

* Update docs for adminModal.js

* Show/hide Enabled Indicator with Enable/Undo buttons

* Complete Auth Providers functionality

* Update app/javascript/admin/controllers/config_controller.js

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

* Update app/javascript/admin/controllers/config_controller.js

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

* Update app/controllers/admin/configs_controller.rb

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

* Update helper names

* better implementation of EnabledIndicator show/hide

* Small copy changes

* Update spec/helpers/authentication_helper_spec.rb

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

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

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

* Update app/helpers/authentication_helper.rb

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

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-11-06 18:19:34 -05:00
Krzysztof Rybka
397a1c2389
Update page views counters a little bit more often (#11286) 2020-11-06 13:09:11 -05:00
Rafi
47be7ea322
Fixing missing category in listing modal (#11301) 2020-11-06 12:29:20 -05:00
Andy Zhao
a8c3ff8c5a
Add trusted role to new tag moderators (#11242)
* Don't add to mailchimp for N/A circumstance

* Use class << self over self. methods

* Refactor and make add/remove tag mod idempotent

* Add missing param wiki_body_markdown

* Add errors_as_sentence b/c Tag not inheriting from AppRecord

* Refactor and Crayonsify tag page

* Use proper for attr to make label checkable

* Crayonsify moderator section

* Make placeholder white

* Remove remote: false for sync form submit

* Fix more merge conflicts

* Minor styling adjustments

* Fix color field value

* Don't add to Mailchimp community mod list if not enabled

* Add tests for new tag mod routes

* Add missing line oops

* Use self.method over class << self for new Rubyists

* Use more efficient query for getting tag mods

* Use parentheses to follow convention

* Use cleaner way of routing and controller

* Update tests to match new configuration
2020-11-05 10:36:26 -05:00
Rafi
01725d9344
Fixing date in listing modal (#11260)
* Fixing date in listing modal

* Adding test

* Fixing test message
2020-11-05 08:09:43 +01:00
Christopher Wray
9e439fcf6e
Fix Bug: Series index page showing series with 0 articles -#9658 (#11227)
* added join to index collections controller

* + collections test to not show empty series
2020-11-03 09:10:46 +01:00
Molly Struve
1852ff55bf
Refactor:Show Same Number of Articles for all Envs (#11197) 2020-11-02 10:39:38 -06:00
Wouter van Marrum
9946ac221a
Added form fields for the admin podcasts dashboard. (#10517)
* Added form fields for the admin podcasts dashboard.

* Updated podcasts_controller.rb; Added parameters to the allowed params.
Updated edit.html.erb; Removed duplicated field.
Updated podcasts_spec.rb; Updated test.

* Fixed a typo.

* Refactored test which hopefully fixes the build

* Added missing comma.

* Added file fixture uploads.

* Fixed a typo.

* Update spec/requests/admin/podcasts_spec.rb

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>

* Again fixed another typo.

* And again fixed another typo.

* Fixed merge conflicts.

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-11-02 17:19:39 +01:00
Molly Struve
6007cadad9
Refactor:Always Load Last 24 Hour Podcasts (#11198) 2020-11-02 08:33:16 -06:00
Michael Kohl
7b6c5b60c1
Add feature flag for profile admin section (#11149)
* Add feature flag for profile admin section

* Fix spec description

* Also remove profile admin link from sidebar

* Disable profile admin routes based on feature flag

* Minor fixes

* Remove unnecessary object from spec

* Refactor AdminHelper

* Fix specs

* Fix remaining specs
2020-11-02 08:48:18 +07:00
Molly Struve
9cf92d1a9e
Refactor:Remove Unused BufferedArticles Controller (#11193) 2020-10-30 15:24:02 -05:00
Spencer
c0168df2a8
API: Endpoint to get an organization's details (#10931)
* add organizations api request spec

* add organizations api controller

* add organizations api show route

* add show jbuilder file

* fix merge conflict on routes

* add organization show to api docs

* update created_at to iso format

* api docs add format field/cleanup
2020-10-30 16:22:30 -04:00
Molly Struve
ca3452f044
Refactor:Remove Production Conditional for Page View Updates (#11164) 2020-10-30 13:32:54 -05:00
Alex
cb6781740f
[deploy] Update site config defaults (#11172)
* Update site config defaultss with specs

* Add missing .freeze

* Fix specs
2020-10-30 13:40:09 -04:00
Julianna Tetreault
038385e4f8
[deploy] Mark Posts as Published in Admin Articles (#11142)
* Refactors #update in Admin::ArticlesController and articles_spec.rb
  - Adds article.update to #update in the controller
  - Shifts the update of co_author_ids further down in #update
  - Adds additional tests to articles_spec.rb
  - Refactors existing tests in articles_spec.rb

* Adds a gaurd clause to Admin::ArticlesController and refactors specs

* Removes ! from article creation in articles_spec.rb
2020-10-30 10:39:31 -04:00
Molly Struve
3c6b8adc3c
[deploy] Refactor:Remove Rails Env Prod Check when Setting Shell Version (#11162) 2020-10-29 12:44:01 -05:00
Julianna Tetreault
6f4e600a4e
Refactor Admin Events Index (#11103) [deploy]
* Adds new and edit views for events and removes them from the index view

* Fixes formatting issues in /admin/pages/index.html.erb

* Refactors /admin/events partial, new, and edit forms

* Updates admin_events routes to include all routes except destroy

* Refactors Admin::EventsController and adds #new and #edit actions

* specs: Adjusts admin_creates_new_event_spec to work with /admin/event changes

* Refactors the Admin::EventsController, routes, and events index even further
  - Adds back placeholder text in Events form
  - Removes unnecessary code from controller
  - Reverts changes to routes
  - Adjusts event_cover_image size on index.html.erb

* specs: Adds tests around creating and updating events to events_spec

* Adds pagination to Admin::EventsController #index to cap events at 20 per page

* Removes .all from Admin::EventsController and adds a line to index.html.erb

* Uses crayons classes for _event_form.html.erb
2020-10-29 10:11:15 -06:00
Alex
94cd9e246f
[deploy] Add default for main_social_image (#11126)
* Add default for main_social_image

* Fix image URL and add spec

* Fix spec

* Move image_url helper into image module

* Fix typo in comment

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

* Change URL helper logic

* Try something else

* Use ApplicationConfig

* Refactor

* Try again

* Try again with another approach

* Add specs for URL.local_image

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-10-29 10:07:14 -04:00
Molly Struve
f97c822570
[deploy] Refactor: Run Display Ad Events Controller in all Envs (#11144) 2020-10-28 17:15:43 -05:00
WenYu
0067a2124c
Refactor UsersController (#11143)
* Refactor UsersController

Removed unused method #less_than_one_day_old? and refactor a few lines of code

* Undo reduce
2020-10-28 13:41:33 -06:00
Jacob Herrington
8f5954aeb8
[deploy] Improve error messages and validation for admin pages (#11141)
* Improve error messages and validation for pages

This could probably be cleaner, but I wanted to avoid changing behavior,
so there is a bit of redundancy.

In this commit, I also had to convert an if statement to a case
statement for Rubocop.

* Add system spec for editing pages

* Use errors_as_sentence
2020-10-28 13:54:38 -05:00
Arit Amana
1912ffdc46
[Team Email Login] Refactor the Email Authentication flow (#11090)
* Hooked "Enable" button to hidden checkbox

* Hooked "Close" button to close email settings and show "Enable/Edit" button

* Additional hookups

* Start building generalized Modal blocks

* Everything hooked up except styling and a few Qs

* last of the hookups; ensure logic flow

* clean up

* specs to cover email auth refactor

* Fix bug surfaced by Vaidehi

* Incorporate PR feedback

* prevent email auth disable if invite-only-mode

* adjust emailAuthModal body text

* Sundry improvements

* Last-mile tweaks

* Trying to get 3rd party auth deselect to work

* delete unnecssary function

* remove superfluous comment

* Move inline styling into CSS file

* Incorporate PR feedback

* Incorporate more PR feedback

* Make Confirm btn intent clearer

* Add TODO comment
2020-10-28 13:37:11 -04:00
y yam
fc22e2c4ae
Add admin config to always show manually selected users on "Suggested people to follow" list (#10917) [deploy]
* Fix missing spaces in description of suggested_users

* Add config to use suggested_users instead of auto-generated suggestions

* Improve determine_follow_suggestions method

* Update app/lib/constants/site_config.rb

Improve the wording of the description of prefer_manual_suggested_users

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

* Apply new style to prefer_manual_suggested_users checkbox

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-10-28 10:36:49 -07:00
Molly Struve
ea156a201d
[deploy] Optimization:Remove more_tag_weight_experiment From Feed Tests (#11089) 2020-10-27 16:36:53 -05:00
WenYu
b0ee1c3905
Refactor articles_controller (#11122)
Refactor unless statement and remove unused variables from controller
2020-10-27 17:34:52 -04:00
Jacob Herrington
c91c07920f
Add config option for Forem collective noun (#11107)
Not everyone will want to use "Community" to describe their Forem, so
now they have some flexibility there.
2020-10-27 12:45:52 -04:00
Andy Zhao
b80dae1436
Update data exporter to handle admin send (#10274)
* Update data exporter to handle admin send

* Match button with everything else

* Use proper redirect path

* Stub SiteConfig definition instead of setting it

Co-authored-by: Mac Siri <krairit.siri@gmail.com>

* Removed if statement by accident oops

* Remove non-functional boolean param and pass email directly

* Use refinement to conv to boolean instead of JSON.parse

* Rename to StringToBoolean

* Use 'using' in proper scope (not in method)

* Rename to_bool to to_boolean

* Refactor if statement, thanks rhymes!

* Fix small bugs in tests

* Remove tracking for export_email b/c no @user

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2020-10-26 18:00:56 -04:00
Jacob Herrington
ff177b0c09
[deploy] Only show user count for large userbases (#11021)
This is a request from one of our early adopter Forems. We should only
render the user count that appears on most of our sign up CTAs when a
Forem has a large userbase (initially, I'm setting that to 1000 users).

The change also removes a lot of duplicated markup by using some
partials to render the copy in the various auth CTAs.

Hopefully, this is written in such a way that changing opening up more
fine-grained control of these partials is trivial.
2020-10-23 09:00:59 -05:00
Ben Halpern
2d75d6d5ea
Fix missing registration data change (#11008)
* Fix missing registration acknowledgment

* Add backfill script and seeds adjustment

* Update lib/data_update_scripts/20201022161311_backfill_user_registrations_in_registrations_controller_path.rb

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

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-10-22 19:21:03 -04:00
Julianna Tetreault
1733c88a07
Ability to Mark Podcasts as Published in Admin Podcasts (#11024) [deploy]
* Adds ability to publish/unpublish Podcasts via /admin/podacasts/id/edit
  - Moves ability to Admin to remove reliability of resource_admin
  - Adds published to podcast_params in Admin::PodcastsController

* Adds a test to check the successful publishing of a podcast in podcasts_spec.rb

* Reverts change to podcast.reload in podcasts_spec.rb
2020-10-22 14:35:58 -06:00
Molly Struve
f54549cca3
[deploy] Optimization:Remove 2 Feed Experiments (#11007) 2020-10-22 11:22:00 -05:00
Ben Halpern
5457f0c0b7
[deploy] Bust caches when navigation links are changed (#10865)
* Bust caches when navigation links are changed

* Remove extra line

* Add admin_action_taken_at to SiteConfig to reference later

* Format timestamp with rfc3339 and fix Specs

Co-authored-by: mstruve <mollylbs@gmail.com>
2020-10-21 21:30:31 -04:00
Jacob Herrington
380d8ebcd5
Add campaign call to action to SiteConfig (#10997)
* Ignore LineLength cop for SiteConfig constants

* Add campaign call to action to SiteConfig
2020-10-21 21:27:53 -04:00
Ben Halpern
a6923d530b
[deploy] Add interface for feed number config (#10969)
* Add interface for feed number config

* Fix tests

* Allow list values

* Fix lint
2020-10-21 09:01:00 -04:00
Andy Zhao
5d9d1525d2
[deploy] Fix Basic Feed Issues (#10958)
* Add configurable field for tag minimum feed score

* Use basic feed algorithm for Forems w/ basic

* Don't use cached value for Forems w/ basic feeds

* Revert "Use basic feed algorithm for Forems w/ basic"

This reverts commit f07853c2d5b28592aeae57f9f0313cba5aa6526e.

* Use a configurable hotness score

* Add a discussion comment

* Adjust tag feed min score default to 0

* Revert change to use original 7 score

* Use home feed minimum score

* Update app/controllers/stories_controller.rb

* Update app/controllers/stories_controller.rb

* Update app/controllers/stories_controller.rb

* Update app/controllers/stories_controller.rb

* Update app/controllers/stories_controller.rb

* Update app/controllers/stories_controller.rb

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-10-20 17:42:28 -04:00