Commit graph

141 commits

Author SHA1 Message Date
Philip How
b0086c9171
Add mark as spam button on user profile for admins (#20794) 2024-03-25 10:30:16 -04:00
Philip How
6b8c363487
Prioritize spam label over suspended, add to async profile check (#20790)
* Prioritize spam label over suspended, add to async profile check

* fix jest
2024-03-25 10:15:35 -04:00
Joshua Wehner
c91a652245
Allow trusted users to see whether a user is suspended (#20061)
* Async append user suspended status pill

* Rubocop

* Relocate JS tests, for build & coverage

* Better error-handling for this controller

* Refactor HTML to render pill outside h1

* Continuing to tweak design

* JS class prepended
2023-09-15 08:44:31 -04:00
Rajat Talesra
67ff8d4efb
Add Edit Profile Image option to Onboarding (#19589)
* Basic implementation

* Nit fix

* Using existing profile update api

* API call working

* Basic full implementation

* Nit fixes in design

* UI changes

* Image upload limit set

* Removed drag & drop

* Image size issue fix

* Minor naming fixes

* Removed native mobile code

* Nit fix

* Added few tests

* Added test

* Added test

* Added image upload error

* Added validateFileInput test failure case

* Updated code to test fix

* Revert db changes

* Minor design fixes

* Minor updated test

* Added validateFileInputs test temporarily

* Added processImageUpload test temporarily

* Aded files count test

* Minor warning fixes

* Updated placeholder text

* Added tests for TextInput and TextArea

* Removed un-required test file

* Removed un-required code

* Minor code cleaning
2023-06-23 16:08:27 +05:30
Joshua Wehner
c2a131e43d
Add organizations to onboarding follow suggestions (#19564)
* Prepare: relocate user suggestions

* Prepare: relocate users suggestion service -> query

* Organization query for orgs with above-average scores

* Rubocop

* Limit to last 3 weeks

* Tweak recent scope, limit to 5 orgs

* Onboarding routes are also always JSON

* Divide by zero makes NaN means

* Add Orgs suggester into suggestions

* Rubocop

* select distinct orgs

* Fix for weird edge-case with bad local data

* Include type_identifier in JSON payload

* Update follows API to allow org_ids as input

* Update onboarding front-end to distinguish users/orgs

* Fix: i18n issues

* Fix: type_identifier in json output

* Fix: distinct is weird

* Fix: JS linter

* Continue tweaking front-end

* Audit import order

* Cleanup @todo note

* Try renaming controller action

* Move Article average calculation to postgres and fix math

* Refactor decorated type_identifier

* Refactor SuggestProminent, return more orgs, fix spec math

* Use FeatureFlag for organization suggestions

* This might fix the jest
2023-06-09 10:32:03 +02:00
Joshua Wehner
00a9db232b
Remove manual user follow suggestions (#19457)
* Remove manually user follow suggestions

* I honestly don't understand what this is doing here

* Remove suggested_users from config spec
2023-05-16 15:01:03 +02: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
Joshua Wehner
5dee4a11c1
Allow trusted user to access response templates (#17978)
* Allow trusted user to access response templates

* Add request specs for trusted user templates

* WIP: was just investigating...

* Move permission check to authorizer

* Revert "WIP: was just investigating..."

This reverts commit c38c60f7ab19ce43c174729c2542a9041e9322e2.

* Improved accessibility

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-12 11:37:59 +02:00
Mac Siri
441a76972b
Refactor: Move onboarding routes out of UsersController (#17189) 2022-04-13 14:20:16 -04:00
Ridhwana
5e93d3a25e
Add a contact email address to the /admin/customization/config (#16497)
* feat: remove the default email and cobine the periodic digest and the contact email under the Email section

* refactor: rename  the email_link to contact link and use the contact_email as a default and fallback to the ForemInstance.email

* chore: alignment

* feat: use the contact_email helper

* feat: move the contact_email to the ForemInstance model

* feat: use ForemInstance.contact_email instead of the application helper method

* removed the application Helper

* feat: set the dafault on the contact_email

* fix: cypress tests

* Update app/lib/constants/settings/general.rb

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

Co-authored-by: Michael Kohl <me@citizen428.net>
2022-02-15 17:37:08 +02:00
Jamie Gaskins
a9cdb2bae2
A suspended user returns 403 instead of 500 (#16408) 2022-02-04 09:42:23 -05:00
yheuhtozr
c4778d832e
app/controllers & decorators i18n (#16126)
* app/controllers (& decorators) i18n etc

* tidy key names

* update keys

* delete ja.yml

* delete an involved ja.yml

* fix for PR review

* fix for spec

* delete ja.yml
2022-02-03 13:35:56 -05:00
Daniel Uber
085c566a7b
Onboarding "improvements" (#16210)
* Don't set saw_onboarding automatically

This should be set by the onboarding checkbox update (user accepted
terms of service and code of conduct).

The issue is a PATCH request to track the last seen page is sent on
the first page, _before_ the user consents to the terms via the
checkboxes.

This issue is masked by a 422 unprocessable entity response when we
don't get a username in the patch request (next commit).

* Only validate username on the username page

Every other "last page seen" dialog was returning a 422 because the
username is only submitted in the 3rd dialog "build your profile".

Only validate the username field when it's submitted, process other
onboarding updates normally.

* Remove failing test

Since the onboarding_update action no longer sets saw
onboarding (since we send the patch before they've accepted the code
of conduct), don't test that we do.

There's a parallel test for the onboarding checkbox update later in
this file that covers the checkboxes have been accepted.

* overwrite instead of merging user_params

We now initialize it empty, no need to merge params here.
2022-01-21 10:58:05 -06:00
Jeremy Friesen
5534a8fa18
Addressing rubocop violations (#16156)
```shell
❯ bundle exec rubocop -A
Inspecting 1856 files

Offenses:

app/controllers/admin/settings/mandatory_settings_controller.rb:17:57: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
            settings_model.public_send("#{key}=", value.reject(&:blank?)) if value.present?
                                                        ^^^^^^^^^^^^^^^^
app/controllers/users_controller.rb:66:58: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
      Honeycomb.add_field("error", @user.errors.messages.reject { |_, v| v.empty? })
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/users_controller.rb:280:58: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
      Honeycomb.add_field("error", @user.errors.messages.reject { |_, v| v.empty? })
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/settings/base.rb:111:54: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
          value.split(separator || SEPARATOR_REGEXP).reject(&:empty?).map(&:strip)
                                                     ^^^^^^^^^^^^^^^^
app/services/articles/feeds/weighted_query_strategy.rb:269:121: C: Layout/LineLength: Line is too long. [126/120] (https://rubystyle.guide#max-line-length)
      def initialize(user: nil, number_of_articles: 50, page: 1, tag: nil, strategy: AbExperiment::ORIGINAL_VARIANT, **config)
                                                                                                                        ^^^^^^
app/services/images/optimizer.rb:27:50: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
      options = DEFAULT_CL_OPTIONS.merge(kwargs).reject { |_, v| v.blank? }
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/services/images/optimizer.rb:46:68: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
      options = DEFAULT_IMGPROXY_OPTIONS.merge(translated_options).reject { |_, v| v.blank? }
                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
app/services/settings/upsert.rb:30:55: C: [Corrected] Rails/CompactBlank: Use compact_blank instead.
          settings_class.public_send("#{key}=", value.reject(&:blank?))
                                                      ^^^^^^^^^^^^^^^^

1856 files inspected, 8 offenses detected, 7 offenses corrected
```

After this commit:

```shell
❯ bundle exec rubocop
Inspecting 1856 files

1856 files inspected, no offenses detected
```

1856 files inspected, no offenses detected
2022-01-17 17:21:06 -05:00
yheuhtozr
a1e8f29fe6
user settings i18n (#15098)
Co-authored-by: Nick Taylor <nick@dev.to>
2021-12-02 11:35:08 -05:00
Monica Mateiu
bd0b4f1117
Tokenize settings menu and add French translations (#14905)
* tokenize settings menu and add French translations

* add quotes around tokens

* add tokens in alphabetical order

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2021-10-06 17:53:58 +02:00
Michael Kohl
a32b50d46c
Make Rubocop happy again (#14729) 2021-09-14 09:15:01 -05:00
Michael Kohl
1b87cc7626
Profile generalization cleanup phase 2 (#14555)
* Remove ignored profile columns

* Update test.rb

* Remove dev profile fields CSV

* Fix first round of specs

* Add additional .includes

* More spec fixes

* Preload user in more locations

* Fix typo

* Spec/preloading fixes

* Specy McSpecFace

* Update e2e seeds

* Update e2e sees with correct display area

* Remove unused eager loading

* Update test.rb

* Add another entry to Bullet.safe_list

* Fix e2e seeds
2021-08-27 09:17:26 +07:00
Michael Kohl
08d82e7256
Profile generalization: cleanup (#12947)
* Remove hardcoded instances of education field

* WIP Access display_email_on_profile via User Settings

* Remove unused profile column

* WIP Fix reference to bg_color_hex and text_color_hex

* WIP fix issues revealed by systems specs

* WIP fix issues revealed by services specs

* WIP Fix failing tests

* WIP Fix spec failures

* wip

* Move two attributes from controller to decorator

* Update comment

* Match user settings changes

* More consistently use user.tag_line

Even before the profile changes we sometimes used the user.summary
attribute directly but used the user.tag_line method in other places.

* Remove delegation, rename inline concern

* Drop profile columns from users table

* Remove duplicated work display from header

* Update work profile field handling

* Update DUS + spec

* Delegate more carefully

* Update delegation guard

* Adapt for removed delegation

* Undo accidental schema changes

* Fix seeds

* Remove accidentaly change

* Fix User#processed_website_url

* Update guard clause

* Update profile card content

* Add Organization#profile

* Be more conservative with profile fields

* Spec fixes round 1

* Fix typo

* Update spec

* Limit number of header fields and update card content

* Decorate correct model

* Update factory

* Update schema.rb

* Fix validation

* How bad could this possibly be?

* Pretty bad, nevermind

* Remove obsolete code

* Reset profile fields during test runs

* Move profile fields back to before(:suite)

* Spec fixes

* Remove accidentally re-added files

* More spec fixes

* Specs

* Change User#tag_keywords_for_search

* More spec fixes

* Add comment

* Undo accidental schema changes

* Attempt spec fix

* Remove fix attempt

* Fix e2e test

* Update spec

* Remove guard clause

* Remove hardcoded instances of education field

* WIP Access display_email_on_profile via User Settings

* Remove unused profile column

* WIP fix issues revealed by systems specs

* WIP fix issues revealed by services specs

* WIP Fix failing tests

* WIP Fix spec failures

* wip

* Move two attributes from controller to decorator

* Update comment

* More consistently use user.tag_line

Even before the profile changes we sometimes used the user.summary
attribute directly but used the user.tag_line method in other places.

* Remove education

* Add comment

* WIP

* Clean up mostly_work_with

* WIP

* Update work profile field handling

* More work-related changes

* Remove settings_only from display_area enum

* Remove quickfix from _metadata partial

* Remove special attributes

* Remove leftover spec

* Retrieve location from profile, not user

* Profile.special_attributes no longer exists

* Update specs

* More spec fixes

* Update UsersController

* Update UsersController and spec

* Fix e2e seeds

* Minor cleanup

* More e2e seed fixes

* Fix profile field CSV

* Fix e2e seeds

* Move one more attribute in e2e seeds

* Remove duplicate line

* Clear inputs before typing in them

* Fix formatting issues

* Profiles::Update -> Users::Update

* Remove RegistrationsController#resolve_profile_field_issues

* Fix schema.rb

* More cleanup

* Fix specs

* Fix remaining spec

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
2021-08-20 16:36:02 +02:00
Michael Kohl
1ebec4b67f
Remove hardcoded user profile fields (#14079)
* Remove duplicated work display from header

* Update work profile field handling

* Update DUS + spec

* Delegate more carefully

* Update delegation guard

* Adapt for removed delegation

* Undo accidental schema changes

* Fix seeds

* Remove accidentaly change

* Fix User#processed_website_url

* Update guard clause

* Update profile card content

* Add Organization#profile

* Be more conservative with profile fields

* Spec fixes round 1

* Fix typo

* Update spec

* Limit number of header fields and update card content

* Decorate correct model

* Update factory

* Update schema.rb

* Fix validation

* How bad could this possibly be?

* Pretty bad, nevermind

* Remove obsolete code

* Reset profile fields during test runs

* Move profile fields back to before(:suite)

* Spec fixes

* Remove accidentally re-added files

* More spec fixes

* Specs

* Change User#tag_keywords_for_search

* More spec fixes

* Add comment

* Undo accidental schema changes

* Attempt spec fix

* Remove fix attempt

* Fix e2e test

* Update spec

* Remove guard clause

* Remove hardcoded instances of education field

* WIP Access display_email_on_profile via User Settings

* Remove unused profile column

* WIP fix issues revealed by systems specs

* WIP fix issues revealed by services specs

* WIP Fix failing tests

* WIP Fix spec failures

* wip

* Move two attributes from controller to decorator

* Update comment

* More consistently use user.tag_line

Even before the profile changes we sometimes used the user.summary
attribute directly but used the user.tag_line method in other places.

* Remove education

* Add comment

* WIP

* Clean up mostly_work_with

* WIP

* Update work profile field handling

* More work-related changes

* Remove settings_only from display_area enum

* Remove quickfix from _metadata partial

* Remove special attributes

* Remove leftover spec

* Retrieve location from profile, not user

* Profile.special_attributes no longer exists

* Update specs

* More spec fixes

* Update UsersController

* Update UsersController and spec

* Fix e2e seeds

* Minor cleanup

* More e2e seed fixes

* Fix profile field CSV

* Fix e2e seeds

* Move one more attribute in e2e seeds

* Remove duplicate line

* Clear inputs before typing in them

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
2021-08-18 11:44:53 +07:00
Molly Struve
e87dead7ad
Use new UserSetting and UserNotificationSettings and Ignore Related User Table Fields (#14121)
* schema file undelete description

* feat: v1 of the script

* Flesh out remaining enums under their categories

* complete UsersSettings data update script

* complete DUS for relevant attributes in users and profiles tables

* complete DUS for users_notification_settings

* alphabetize user_settings sql file

* safeguard against null values for "null: false" settings

* Set up actual UsersSettings DUS and specs files

* fix broken DUS script

* complete specs for UsersSetting DUS

* Address QA of specs

* complete specs for users_notification_settings DUS

* fix the typos (thanks Julianna!)

* begin implementation

* still building

* add missing attribute "email_membership_newsletter"

* complete sync code (except race condition for user profile)

* complete implementation, remains tests

* Address PR review and fix Travis fails

* remove superfluous Profile.new

* fix travis fails

* feat: update the users_notification_setting attributes from the user model

* feat: use the config fonts enums to display the fonts

* feat: loop through the keys

* fix profile = nil blowing up; add specs for notification_setting model

* remove unneeded spec

* remove feed validation until after sync code removed; fixes feed_import spec failures

* remove spec associated with feed_url validation in user_setting model

* fix failing spec 😅

* add TODO

* feat: set the user settings in the user controller  and use it in the customization form

* feat: move some update logic to the users settings controller thats being used from customization

* feat: show the updated values form the users_settingd and not the user instance

* Generalize redirect back to current tab

* still trying to reflect changed theme upon refresh

* customizations take effect on refresh

* remove 'with_feed' scope from user model

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* start with takeover for fields previously in profiles table

* Takeover code for `publishing_from_rss` section in Settings (#13914)

* implement takeover code part 1

* implement takeover code

* fix feed fetch

* need rhymes help

* complete implementation; specs pending

* fix STUPID omission that caused so many headaches 😫

* implement profile fields pointing to users_settings 🎉

* run migrations

* implement inbox type & guidelines takeover code; specs pending (#13911)

* Point changes in notification settings to `users_notification_settings` table (#13910)

* implement takeover code; remains specs

* address PR feedback; remove related sync code

* address PR review feedback

* need help with routing and specs

* address pr review

* addressing pr review

* Treat implementation edge cases and omissions 😅

* fix uncommented comment

* fixing implementation cases

* address more PR review feedback

* fixing notifications use-cases

* refactor settings controller

* more pr review changes

* solving bugs

* fix broken onboarding

* handle eperience_level calls

* more fixes

* remove unneeded mappings

* add To-dos for quety updates

* remove done TODO

* purge done TODOs

* update notification_settings-related queries

* start fixing specs

* fixing specs

* fix notification and lrg_forem specs

* fixing broken specs

* still fixing

* fix line dif and remove reloads from user.rb

* run specs

* silence bullet and other fixes

* remove setting migration scripts and specs, fix more settings for specs

* handle missing user for article builder and fix notification specs

* fix some final controller specs and re-add incorrectly removed specs

* remove deprecated data update scripts and related workers, put travis back

* refactor admin tags mods controller, write/move specs for users notifications settings controller

* schema cleanup and other small refactors for consistency

* set field we can invalidate in spec via active record instead of at the db level

* remove I think an uneccessary hook call from subscribe_to_mailchimp_newsletter

* use bnefore_create to setup settings, please dont blow up the test suite

* mailchimp bot fix

* remove decorator in favor of single model method

Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
Co-authored-by: Jamie Gaskins <jamie@forem.com>
2021-07-08 09:31:34 -05:00
Michael Kohl
8f42828028
Change signature of Feeds::ImportArticlesWorker (#13971) 2021-06-17 14:28:23 -04:00
Anna Buianova
26592a3a9c
Removing Settings::General.email_addresses (#13958)
* Replaced Settings::General.email_addresses with Forem.email

* Removed Settings::General.email_addresses remainders

* Fixed schema.rb

* Remove Settings::General.email_addresses record

* Fixed label for default email
2021-06-11 12:34:34 +03:00
Anna Buianova
1862eb5cde
Replacing granular admin email settings with one default email (#13853)
* Replaced granular emails with the default one

* Set reply to header in emails

* Extract shared_examples from NotifyMailer

* Removed unused code

* Replaced SiteConfig with Settings::General

* Fixes related to replacing SiteConfig with Settings

* Removed duplicate line from specs
2021-05-28 12:17:08 +03:00
Michael Kohl
6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00
Michael Kohl
867d9a1a2f
Move services from Suggester::Users (#13699) 2021-05-11 12:57:12 -04:00
Jacob Herrington
dd3121e91c
Add username to onboarding (#12697)
* Add username to onboarding

* Add margin to profile form error alert

* Update user controller for onboarding

Co-authored-by: Michael Kohl <me@citizen428.net>
2021-02-24 10:48:31 -06:00
Alex
3f02045458
Redirect user to sign up path after deletion (#12696) 2021-02-16 12:15:36 -05:00
Michael Kohl
e258e36c92
Remove language settings (#12502)
* Remove language settings

* Remove more language related code

* Remove leftover spec

* Remove language from ES mapping
2021-02-04 08:35:00 +07:00
Julianna Tetreault
2ebe55fc22
Log Relevant Data from Self-Deletion Flow to Honeycomb (#12369) [deploy]
* Log params[:token] and destroy_token to Honeycomb when token mismatch

* Refactor #confirm_destroy and add Honeycomb fields for error logging

* Add tests around Honeycomb error logging in #confirm_destroy to spec

* Remove logging of user to Honeycomb in #confirm_destroy and in spec
2021-01-21 17:00:10 -07:00
Michael Kohl
71ea85be6e
Verify current password on password change (#12174)
* Verify current password on password change

* Address PR comments

* Allow password reset for logged in users

* Make password change message more explicit

* Reformat message

* Fix specs
2021-01-21 12:40:54 +07:00
Julianna Tetreault
d06ee645f8
Improve Error Messaging for Self-Deletion Confirmation Flow (#12266) [deploy]
* Adds guard clauses and better error messages to UsersController #confirm_destroy

* Adds tests around guard clauses in UsersController #confirm_destroy

* Adds a custom error for invalid tokens in UsersController#confirm_destroy

* Refactor user_destroy_token.rb initialize method to be more succinct

* Removes unnecessary code from user_self_destroy_spec.rb and fixes failing InvalidToken spec

* Reworks code in #confirm_destroy to be consistent with other #destroy methods

* Adjust token mismatch test to use mismatched tokens

* Refactors #confirm_destroy and adds a before_action to Users::Controller
 - Reworks the logic within #confirm_destroy and removes excess code
 - Adds set_or_sign_in_user before_action for #confirm_destroy
 - Removes custom InvalidToken error message

* Cleans up spec and adds an additional test around logged out user edge case

* Fixes failing tests due to changes in #confirm_delete flow

* Adjusts test logic in user_self_destroy_spec.rb

* Refactors code by removing custom before_action and rewriting conditionals
2021-01-15 11:51:06 -07:00
Molly Struve
636f4b0ae1
Bug Fix:Increase Default Rate Limit for User Updates to 15 (#12281)
* Bug Fix:Increase Default Rate Limit for User Updates to 15

* spec fix
2021-01-14 12:51:08 -06:00
Molly Struve
5a3ea304ca
Log User Save Error Messages When it Fails (#12267) 2021-01-13 16:14:48 -06:00
Molly Struve
0f2c0c70b1
Log onboarding_checkbox_update Params (#12252) 2021-01-13 12:39:25 -06:00
rhymes
e7f9735354
Remove RssReader (#12169)
* Add script to remove feature flag

* Remove :feeds_import feature flag and RssReader and related classes

* Change Feeds::ImportArticlesWorker signature to support Sidekiq Cron serialization

* Replace RssReader::Assembler with Feeds::AssembleArticleMarkdown

* Removing Assembler
2021-01-08 11:45:15 -05:00
rhymes
4aaeb3e955
Feeds::Import: only import feeds that haven't been recently updated (#12126)
* Add earlier_than to Feeds::Import

* Ignore feeds that have been imported in the last 4 hours

* Make earlier_than mandatory in Feeds::ImportArticlesWorker
2021-01-06 16:58:42 +01:00
rhymes
1c8b44f326
Remove GitHub repositories when GitHub identity is removed (#11951)
* Remove GitHub repositories when user deletes their own GitHub identity

* Remove GitHub repos also from the admin remove identity

* Add a notice in Settings/Extension

* Add data update script to cleanup orphan GitHub repos
2020-12-20 15:15:40 +01:00
Ridhwana
7a9629172d
Profile generalization for the onboarding workflow (#11629)
* feat: v1 of the profile form

* feat: fix inputs and create a handleChange event

* feat: update the submit values to represent values from the form

* feat: ensure that errors and success is handled on send

* refactor: remove unused code

* feat: replace the old profile form with a new one

* fix: use the renames file

* refactor: safety net for groups

* chore: fix code climate issue

* tests: amend + add tests

* test: fix broken spec

* feat: update the setup for the test

* tests: refactored them to move the fake response into the before all

* feat: clunky way to quickly cater for color field since it was a quick and easy implementation

* feat: add a field.description to the color field

* refactor: pull some duplicate code into a new function

* chore: cater for a textarea field

* overflow issue

* refactor: use FormField instead of manual divs

* Update spec/requests/users_onboarding_spec.rb

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

* Update spec/requests/users_onboarding_spec.rb

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

* refactor: move out of method and into a constant

* refactor: user_onboarding_update to be more readable

* refactor: use current.save instead of declaring a new variable

* refactor: remove explicit check for bookean

* refactor: use request from '@utilities/http' instead :)

* refactor: no need for if with destructured groups

* refactor: move color field to its own component

* chore: remove colorfield now thats its a component

* fix: forgot about field

* feat: a text area component

* chore: remove textField function in favor of component

* refactor: checkbox refactor

* refactor: add a switch statement

* chore: move into a more organized folder

* fix: move the handler to props and off from field

* fix: add a conditional so we dont hit an error undefined method `success?' for nil:NilClass

* refactor: change from component to function

* feat: add a key attribute

* refactor: add role for readers

* refactor: remove unnecessary guard clauses

* refactor: use function instead of an arrow

* chore: document components

* test

* padding

* fixes

* test: fix the tests by using more general matchers

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-12-08 19:53:00 +02: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
rhymes
369d6e2206
Fix Settings/Customization page (#11615) 2020-11-25 16:47:38 +01: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
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
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
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
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
Michael Kohl
9377eee4f5
[deploy] /profile/settings page rendering (Ridhwana/Michael) (#10733)
* chore: update the profile to be more dynamic. Maps out the group + field name   + value for field

* feat: add the correct input type to the form tying it to the correct method to update

* feat: update the value and the label

* feat: update the profile with a submit

* refactor: ensure we dont show empty groups on the settings/profile

* fix: this shoudl be dribbble

* fix: use attributes! to refresh the cache to ensure that we font run into the case where Profile.attributes is []

* feat: show group description only when it exists

* chore: add some classes

* feat: use the profile update service to update the relevant user information

* chore: rename variable

* chore: use a scope to not return empty groups

* fix: only update user if the profile sync is update is successful. Also capture errors

* feat: style the crayons field checkbox

* refactor: rename the attribute to user instead of profile

* refactor: service object

* Fix CodeClimate warning and rearrange code

* Fix service object, add missing attribute

* Fix flash and add redirect

* Fix service object + spec

* Fix user edits profile spec

* Disable spec

* Fix more specs

* Undo vim fail

* Add data update scripts

* Update where clause in data update script

* Rename method

* Make sync_to_user conditional

* Add after update actions and Honeycomb

* feat: handle checkbox allow chcekbox to check

* Don't set experience cookie in ProfilesController

* Clean up Profiles::Update object

* Fix spec

* Remove Twitch integration (#10732)

* Remove Twitch integration

* Ignore columns

* Change admin password in docs (#10735)

Update default admin password in documentation

* 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

* Generalizes Connect welcome message and settings nav tab and refactors tests (#10741) [deploy]

* [deploy] fix: Clear chat input after Enter key submit (#10487)

* fix: Clear chat input after Enter key submit

* fix: Rename Composer component

* test: Add integration tests for input value

* After pressing Enter
* After clicking Send
* After clicking Save edit
* After clicking Close edit

* Remove tabindex of -1 on upload image input in the write a post editor (#10543)

* Remove tabindex of -1 on upload image input in the write a post editor

* Remove negative tabindex on image uploader's outer button

* Give tabindex of -1 to outer button on image uploader

* Update buttons.scss

* [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>

* Add Section for Series/Collections (#10719)

* Add Section for Series/Collections

I added a small section in this area of the docs to share some information about collections/ series. 

There is not much information in the documentation about collections or series and I felt like this would be beneficial to others looking to help with the Series feature of the website.

* Updated wording of collections section.

* 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)

* Move Imgproxy endpoint config to Images::Optimizer (#10742)

* 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

* Add forem meta tags (#10747)

* Add forem meta tags

* Add docs

* Update docs/technical-overview/compatibility.md

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

* Update docs/technical-overview/compatibility.md

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

* Update docs/technical-overview/compatibility.md

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

* Update docs/technical-overview/compatibility.md

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

* Remove Twitch-related columns from users table (#10750)

* [deploy] Long text goes outside cards (#10740)

* Add word-break to crayons-card

Add word-break to crayons-card this will allow words to be broken if the word is too long but will wrap normally otherwise.

* Use overflow-wrap: anywhere;

`break-word` is deprecated though `anywhere` does not work in IE

* Removes superfluous sign_in from users_onboarding_spec.rb (#10757) [deploy]

* [deploy] Allow glitch id starting with ~ (#10544)

* [deploy] crayons prep (#10737)

* Add DEV special case for following hiring tag

* Move image validation to Profiles::Update object

* spec: move over the tests for validating images

* Move follow_hiring_tag into the service object

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
Co-authored-by: Andrew Bone <AndrewB05@gmail.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Robin Gagnon <me@reobin.dev>
Co-authored-by: Manaswini <58681405+Manaswini1832@users.noreply.github.com>
Co-authored-by: Andy Zhao <17884966+Zhao-Andy@users.noreply.github.com>
Co-authored-by: Christopher Wray <53663762+cwray-tech@users.noreply.github.com>
Co-authored-by: Rafal Trojanowski <rt.trojanowski@gmail.com>
Co-authored-by: Mac Siri <mac@dev.to>
Co-authored-by: Josh Puetz <josh@dev.to>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
Co-authored-by: irmela <irmela@berlin-coding.de>
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
2020-10-20 09:18:13 -04:00
Michael Kohl
1a44d717fc
[deploy] Move settings tabs to constant (#10859) 2020-10-16 08:30:58 +07:00
Michael Kohl
a2b55f889c
Remove Twitch integration (#10732)
* Remove Twitch integration

* Ignore columns
2020-10-08 12:44:10 +00:00
Andy Zhao
0b849341e0
Remove ghostify from app (#10139)
* Remove ghostify from app

* Remove unused ghostify specs
2020-09-01 13:39:39 -04:00