* Removing :apple_auth feature flag and debugging
* Fix tests failing due to nil in Devise initializer
* Remove db/schema.rb changes
* Devise config tweak
* cleaning up
* Fix spec + delete debug logs
* Removes temporary beta_access_providers spec + remove feature flag DUS
* Add test to avoid connecting an existing user with SIWA
* Fix merge conflict mistake + more feature flag cleanups
* Add additional test cases to the DUS
And then handle them.
* rubocop changes
Keep let blocks together
prefer blank? to ! + present?
* Test copied script as well
Since the file was fixed, then copied - we want to test the copy that
will actually run (these _should_ be idempotent and running both back
to back will cause no harm).
* 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
* update with main
* update with origin
* Add "section" enum to navlink model
* create migration for section column
* create migration and data-update script
* update related rake tasks
* add scopes for default_links and other_links
* update E2E seeds
* ran migration; correct enum reference
* fix requests and model specs
* write DUS spec; fix factory and DUS
* yarn install
* address PR review comments
* fix migration; add null: false
* Remove yarn.lock from commit
* remove yarn.lock changes from commit
* sync yarn.lock with main
* newline
* 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>
* Removes :runtime_banner feature flag + repositioning
* Switch to https://udl.forem.com + fix spec
* Fix URL specs
* Adds data_update_script to remove feature flag
* Fix banner overlay on reactions for small screens + iPad max width
* Append -only to Runtime Filter CSS
* Add import to fix assets:precompile
* Implement design update
* Apply suggestions from code review
Co-authored-by: Lisa Sy <lisasyis@gmail.com>
* Add ;
* Trigger Travis
Co-authored-by: Lisa Sy <lisasyis@gmail.com>
* 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
* Move static profile fields to profiles columns
In order to remove some ambiguity around the availability of certain
profile fields, we can designate certain fields as "static." These
fields are intended to exist on every Forem regardless of configuration;
they contain basic personal info that most Forem's will likely use.
Because these fields already exist on some Forems it is necessary to
migrate the data from existing profile's data column to their respective
columns.
This change should behave as expected irrespective of the existence of
the static fields having associated ProfileFields, however, the UI that
is rendered in a user's settings still depends on the presence of the
ProfileFields. We can address that in a future change when we are
prepared to delete those ProfileFields entirely. We should make sure the
migration occurs without issue before moving to that step, in my
opinion.
* Apply suggestions from code review
Co-authored-by: Michael Kohl <me@citizen428.net>
* Add clarifying comments
Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: Michael Kohl <me@citizen428.net>
* Run user setting DUS per-user via Sidekiq
Doing it as a single query trips the query timeout beyond a certain
quantity of users.
* Run DataUpdateScripts::MigrateRelevantFieldsFromUsersToUsersNotificationSettings asynchronously
* 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!)
* add missing attribute "email_membership_newsletter"
Co-authored-by: Arit Amana <msarit@gmail.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'
* Rename comment-mentioned-user class added by Html::Parser
* Add DataUpdateScripts for resaving articles, comments, and messages
* Swap order of messages and articles DUS
* Use trigger and tsvector column to speed up reading list search
* Add organization destroy spec and todo note
* Fix failing data update script due to not null constraint
* Remove the leading anchor in the trigger regexp
* Fix reading list specs
* Address feedback
* Rename banned and comment_banned roles
* Add data update script to rename roles containing 'ban'
* Add named error for Suspended users
* Update unidiomatic method names
* Rename misc banned to suspended
* Apply suggestions from code review
Co-authored-by: Michael Kohl <me@citizen428.net>
* Add unit tests for suspended methods
This commit also adds TODO comments for removing banned and
comment_banned from the codebase after data update scripts have
successfully run on all of our Forems.
Co-authored-by: Michael Kohl <me@citizen428.net>
* Added credits_awarded to badges
* Data update script for updating credits_awarded
* Data update script for updating credits_awarded
* Added null: false to badges.credits_awarded
* feat: add a feature flag for data update scripts
* feat: write some tests for it
* chore: oops
* stub the data update scripts out wherever the profile admin is
* chore: remove some unneeded ones
* refactor: use call_original
* feat: add a feature flag to all the Forems (but not enable it as yet)
* Fix erroring data update script
* Add spec to ensure that script doesn't impact any other user if tech_admin users don't exist
* Comment out erroring script, delete its associated spec
* Add replacement AddSingleResourceRoleToTechAdmins data update script