* Refactoring to add helper method
Prior to this commit, we made view level calls to service modules. This
refactor provides convenience methods on the model.
Furthermore, it addresses a few Rubocop violations that "come along for
the ride."
* Ensuring cached entity squaks like User
* Fixing broken spec
* Fixing typo
* 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>
* Validate website_url profile field is a url
related to issue #14300
May need a data update script to (fixup? remove?) invalid profiles
since not being able to save existing profiles will cause problems.
* Check that URI is a valid url
Require the scheme to be one of https or http, not something like
mailto:// or telnet:// (nobody would do that, but don't try and link
to it if they did).
* Rubocop fixup for validation rule
URI::regexp is obsolete and should not be used. Instead, use URI::DEFAULT_PARSER.make_regexp
Prefer %w[] literals for arrays of words
Prefer the new style validations `validates :column, format: value` to validates_format_of
* Permit empty website_url fields
The previous validation was rejecting nil, which was the default. This
caused a lot of user factory calls to fail (since users didn't need
website urls in the profiles during testing unless the test was about
the website url link).
* Use :url validation as suggested
* Update validation error message
The validate_url gem gives a more complete error message to the
user. Update the spec to expect this.
* Use url_field rather than text_field in profile form
https://apidock.com/rails/v6.1.3.1/ActionView/Helpers/FormHelper/url_field
* Add data update to either fixup or clear invalid website urls
Checking blazer there are about 2600 profiles with "invalid" website
urls, typically a hostname, sometimes a hostname + path component,
which should be fixed up.
Naively add https:// to the front of the url, check that a valid
scheme and host are present on the resulting url, and save.
If an invalid url is generated (specifically, if host or scheme are
nil), just set the website url (with the invalid link) to an empty
string.
It's possible we'd want to notify users affected by this, that was not
included in this pass.
* Skip validations for intentionally invalid test cases
* Remove unused profile fields
* Clean up CSV
* Account for user settings in Profiles::Update
* Move brand color validation to Users::Setting
* Fix specs
* 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>
* 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'
* Remove references to social link profile fields
* Add some dummy data
* Remove special display social links
* Remove unnecessary tests
* Add tests for profile social icons
* PR feedback
* Remove nil check from erb
* Move view method into helper
* Don't render links in user settings
* Allow image upload even if no existing image
Allow profile image upload even if there's no profile image attached.
* Add specs to ensure profile image field is there
Specs to ensure that the profile image upload field is always
available wether the user has a profile picture or not.
* 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>
* 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>
* 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>
* Make profile settings save button sticky when modified
* Replace querySelector with class selector, add newlines to end of files
* Make profile settings save button sticky when modified
* Replace querySelector with class selector, add newlines to end of files
* Add rspec test for sticky footer
* Move visit method to before block
* flare tag line height
* .
* init styling
* social buttons
* no need for inverted
* other places
* more
* Fix specs
Co-authored-by: rhymes <rhymesete@gmail.com>