* Add migration, update badgeachievements model and admin view to set flag on badges
* Show multiple badges on profile
* update factory
* badge model validation
* safe navigation to badge?
* add null: false to migratrion
* Extracting container for allowed tags & attrs
Prior to this commit, we had several different locations in which we
specified ALLOWED_TAGS and ALLOWED_ATTRIBUTES for HTML rendering and
sanitization.
Curious to see how these either intersected or didn't, I opted to
create a container module that allows for us to more readily normalize
these allowed tags and attributes. It's possible that we won't do any
normalization, but this work helps make that easier.
Ideally, I'd love us to contextualize "why did we choose the
tags/attributes we chose?" But for now, I think consolidating these
tags and attributes will help make adding a `details` and `summary` tag
easier.
This relates to forem/rfcs#296
See [Google Sheet][1] for analysis of what tags/attributes are used, the
intersection and union.
[1]:https://docs.google.com/spreadsheets/d/1yj-a1qus1o0o4cj-_gOMP5yteeg-_f3s5z7kvK0Y7RM/edit#gid=0
* Fixing misnamed constant
* Fixing misnamed constant
* Extracting additional HtmlRendering use cases
* Adding comparative documentation for HTML tags
* Fixing broken parameter signature
* Moving constants into MarkdownProcessor
* Favoring delete_all on user relationships
Prior to this commit, several of the user's "has_many" were marked as
`depenedent: :destroy`.
In the case of :destroy, ActiveRecord instantiates each object and then
runs destroy. Whereas in the case of :delete, ActiveRecord issues a SQL
command to delete the related files.
It is often "safer" to use :destroy, as it guarantees that you'll
instantiate the record and run it's callbacks. But sometimes you have
to go with the speed of SQL.
And while not directly related to #15424 it is representative of our
callback ecosystem creating some unexpected computational loads.
Related to #15442 and #15424
* Noting models that user no longer cascade destroys
* 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>
* Added credits_awarded to /admin/badges forms
* Award credits only if badge has them
* Removed information about credits and listings in the new badge email when not needed
* Specs for number of credits awarded for badges
* Added missing newline
* Fix typo
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* Improve new_badge_email.text.erb
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* Fixed number of credits in notification
* Added specs for number of credits in notifications
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* Resourcify badge achievements
* Add test for single resource admin badge achievements
* Add badge and badge achievement roles
* Alphabetize (mostly) and cleanup syntax for easier writing
* Use quotes instead of %w and not outsmart myself :(
* alpha oops
* Enable new Rails/* cops and use autocorrect on them
* Fixed Rails/PluckInWhere leftovers
* Fix Rails/DefaultScope
* Enable and fix Rails/PluckId
* Fix manual mistake with forcing autocorrection on Rails/PluckId
* Apply PR feedback to remove Rails/PluckId inline disables
* Apply PR feedback to get rid of Rails/PluckInWhere inline
* Validate for trailing slash instead of strict validation
* Remove unused sign_in_count field
* Add profile URLs to edit view
* Add profile URLs to admin controller params
* Add profile URLs to edit view
* Clean up index and search views for user
* Move around user fields to make more sense
* Display more informative label
* Remove name_of_user field in favor of new display label
* Fix typo
* Remove duplication for website, employer, and Mastodon URLs
* Add score to comment params
* Remove unused name_of_user field views
* Fix typo for medium url
* Remove stream and add new notification views
* Actually remove Stream
* Move followers query to async method
* Remove unused tests and fix query
* Try using without delay instead
* Add without delay and escape HTML
* Make all tests pending for now
* Add new columns to notifications table
* Remove stream from notifications and add new methods
* Turn off moderation comment notifications
* Add notifiable_type index to migration
* Stop creation of Stream-based notification model instances
* Add notification model create hooks
* Add badge achievement notification creation hook
* Fix some specs
* Add missing @ symbol
* Fix for tests and rename a few things
* forgot to uncomment code sigh
* Use timezone aware datetime methods
* Use timezone aware date parse for GitHub issue tag
* Introduce a bit of chaos programming using Zonebie
Zonebie uses a random timezone to run tests, it's a really good way to see if the code is timezone dependent or not.
* Convert GitHub issue date as UTC
* Fix adding quotes and dashes in codeblocks
* Use find_by for all remove_from_feed methods (#558)
* Destroy memberships when chat channel is destroyed
* Make org proof a required field
* Fix color picker and other minor org adjustments
* Add MVP of org add'l sidebar
* Add proof to org factory
* Fix org create action and fix tests
* Add new org fields to admin panel & lint
* Add proof to org edit for backward compatibility
* Add org info to edit preview
* Move preview edit notice to inside article div
* MVP of badge "final" steps
* Add info to user sidebar and clean up badge commit
* Modify sidebar for data
* Add organization decorator
* Add conditional so only users have new swipe nav, not orgs
* Add cloudinary prefix to badges
* Disallow duplicate badges