* Fix schema.rb
* Add service objects for base and link fields
* Add link fields to seeds
* Make placeholder a keyword argument
* Add work fields
* Add explanation column to profile fields
* Add coding fields
* Switch from inheritance to mixin
* Add email checkbox to base fields
* Add branding fields
* Add spec for ProfileFields::FieldDefinition
* Move migration back into correct location
* Rename column from explanation to description
* Rename attribute in mixin
* chore: rename from explanation to description
* Add ProfileFields::ImportFromCsv
* Simplify ProfileFields::ImportFromCsv
* Add comment about disabled cop to spec
* Add TODO comment to Rake task
* Document mixin
* Add groups to profile fields
Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
* 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
* Add polymorphism to Broadcasts table
- Adds a broadcastable_id column to Broadcasts
- Adds a broadcastable_type column to Broadcasts
* Create Announcements and Welcome Notifications tables
- Adds an Announcements table
- Adds a Welcome Notifications table
- Adds timestamps to both tables
- Adds banner_style column to Announcements table
* Adds Announcement and Welcome Notification models
- Adds an Announcement model in prep for polymorphism
- Adds a WelcomeNotification model in prep for polymorphism
* Add data_update script to backfill type_of column for Broadcasts
* Add unique index on broadcastable_type and broadcastable_id on the Broadcasts table
* Add update! to the data_update script to backfill broadcastable_type
* Create "blank" EmailSubscriptionTag
* Refactor liquid_tags_used with spec
* Create /user_subscriptions#create
- Update liquid tag name to UserSubscriptionTag
* Add rate limiting and specs
* Add counter_culture for user_subscriptions
* Update /async_info/base_data
- Alphabetize user_data
- Add email
- Add subscription_source_article_ids
- Cache subscription_source_article_ids on User model
* Add stale email check and specs
* Change user_email to subscriber_email for clarity
* Restrict UserSubscriptionTag
* Rename RESTRICTED_TAGS to RESTRICTED_LIQUID_TAGS
* Make TODO comment more clear
* Refactor error responses and update specs
* Update type to source_type in error message
* Use constantize over safe_constantize
* Add check for active source
* Refactor checking of current_user's subscriptions
- Remove data from async_info
- Create a new service to fetch/cache a user's existing subscriptions
* Restrict email in base_data to admin roles
* Oops! Rename liquid tag file
* Change error back to result...oops!
* It's not goodbye, it's see you later. RIP email :/
* Add current_email to /user_subscriptions/base_data
* Revert adding current_email
* Undo async_info_controller changes/fix conflict
* Move params to constant
* Refactor SubscriptionCacheChecker
* Remove duplicate status code in JSON response
* Remove duplicate status code for #subscribed
* Use response.parsed_body
* Remove user guard in SubscriptionCacheChecker
* Set up ahoy gem, add ahoy-js
* Import ahoy.js into base.js.erb
* Add trackNotification function to notifications/index.html.erb
* Add sanitized_broadcast_id helper
* Use sanitized_broadcast_id in broadcast partial
* Add specs around tracking welcome notifications
* Remove optional fields from Ahoy::Visit migration + table
* Fiddle with trait to see if it helps with CI failures
* Disable geocode tracking in ahoy
* Stub out SiteConfig in notifications page spec
* Add migrations for subscriber_email column
* Add new schema
* Update relationships, specs, and factory
* Use unless index_exists? over if !index_exists?
* Fix typo in last fix for migration
* Rename authored_user_subscriptions
- to source_authored_user_subcriptions
* Add factory methods and specs
- UserSubscription.make
- UserSubscription.make_new
- Article.new_user_subscription
- Article.create_user_subscription
* Remove self and &
* Change make_new to build
* new_user_subscription --> build_user_subscription
* Come on, Travis
* We don't want to do devel seeding in production mode when using db:prepare. This
PR fixes that. We can also use seeds.rb to do production seeding for new Forems
in the future.
* Just return if in production instead of wrapping the entire file in an if statement.
* Add last_active_at datetime to Broadcasts table
* Add last_active_at to Broadcast index view
* Add callback to Broadcast.rb to update last_active_at
* Add a data_update script to backfill the last_active_at column on the Broadcasts table
* Add a spec for updating the last_active_at timestamp in models/broadcast_spec.rb
* Format last_active_at timestamp via strftime in index.html.erb
* Remove data_update_script: backfill_last_active_at_for_broadcasts
* Remove ActiveRecord::Dirty method from broadcast.rb
* Adjust callback in broadcast.rb and last_active_at timestamp format in index.html.erb
* Adjust time in #update_last_active_at and add the safe navigation operator to index.html.erb
* Accounts for nil last_active_at values in the view
* Uses Time.current in place of Time.zone.now
* Remove last_active_at param from Broadcasts::Controller
* Add spec to broadcasts_spec.rb to test the updated attribute via a request
* Adjust current_time in broadcasts_spec.rb
* Adjust Timecop.freeze in broadcasts_spec.rb to resolve Travis faliure (fingers crossed)
* Adjust expectation to compare against last_active_at timestamp rather than current time
* Adds Timecop back and stores last_active_at timestamp to test against
* Rename last_active_at to active_status_updated_at on Broadcasts table
- Renames last_active_at to active_status_updated_at in specs
- Renames last_active_at to active_status_updated_at in model
- Renames last_active_at to active_status_updated_at in view
- Adjusts spelling in spec descriptions
- Rewords active_status_updated_at in view to Last Active On
* Backend MVP
- Migration
- Model
- Associations
* Add factory, spec, and validations
- Add unqiue index for validations
* Fix specs
* Add author to email_subscriptions
* Add user association to set_author_id
* Add clarifying comment to set_author_id
* Writing is hard sometimes
* Rename email_subscriptions to subscription_sources
* UserSubscription and user_subscription_sourceable
* subscribers --> sourced_subscribers
* Add comment to explain UserSubscription model
* Initial user payment pointer work
* Finalize functionality and tests
* Fix schema
* Update app/views/shared/_payment_pointer.html.erb
* Add function to list
* Add display_announcements boolean to Users table
* Adds a boolean with a default of true to Users
* Add display_announcements to #user_data and user_policy.rb
* Adds display_announcements to #user_data in AsyncInfoController
* Adds display_announcements to PERMITTED_ATTRIBUTES
* Add display_announcements to _misc.html.erb
* Adjust submit data request button and adjust Announcements heading
* Adjusts submit data request button to follow button capitalization
* Adjusts announcements heading to read Announcements not Sponsors
* Add copy to _misc.html.erb to add context around Announcement toggle
* Add request and system specs around Announcements
* Adds a test for announcements to user_settings_spec.rb
* Adds a system spec for updating announcements
* Add user_updates_announcements_spec file and remove old spec from users_settings_spec
* Fix spec weirdness
* Add tests around misc tab and Announcement toggle to user_settings_spec.rb
* Tests that misc tab renders properly
* Tests that display_announcements toggle updates a users settings properly
* Removes user_updates_announcements_spec.rb
* Adjusts Export Content capitalization in _misc.html.erb
* Resolve DB conflicts
* Provide default crayon styles when creating banners
* Import crayons styles into /internal pages.
* Allow admins to use crayons banner styles when creating broadcasts.
* Preview banner styles with crayons.
* Use constant and helper for broadcast banner styles
* Add VALID_BANNER_STYLES frozen constant to Broadcast class.
* Add banner_style helper for determining banner style class.
* Use pick instead of pluck first
* Use touch_all instead of update_all
* Use destroy_by instead of where.destroy_all
* Use scopes
* Fix db:seed:replant
* Remove ActiveSupport::Cache::RedisCacheStore expires_in cache
* db
* Add an iframe to host mod actions menu
This iframe is probably the fastest way to get a working mod actions
menu without rewriting existing code. We may eventually re-write this,
but based on Ben's recommendation we are going to go with an iframe
because it gets us a working feature quickly and it seems to be serving
us well in other parts of the application.
* Add the mod actions menu button to articles
When the user is "trusted" they will see a small badge on the lower
right-hand side of the screen. Clicking the icon reveals the mod actions
menu.
* Add header to actions panel (#7395)
* Update iframe border
* Add 'Moderate Post' header and button
* Use inline SVG over <img src='svg'>
* Use Crayons variables for units
* Use flexbox to center chevron
* Add accidentally deleted positioning
* Add chevron-right.svg
* Use a partial for actions panel and revert /mod page
* Load actions panel in iframe and not /mod
* Style UpVote, DownVote and Vomit buttons (#7421)
* Add a iframe to host mod actions menu
* Up and Downvote Icons
* Starting with vomit button
* Completed UI; interactions pending
* Incorporated Andy changes; making mod action-panel
* space reactions away from header
* UI tweaks and corrections 1
* Fixing styles to match crayons
* choose pure white color css variable
* Add thumbs-up emoji; address Lisa comments
* Trying to fix reactions interactions
* remove clearThumbReactions function
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
* Add bottom layout for actions panel (#7501)
* WIP for Lisa
* Finalize mod actions bottom section
* Use showing instead of hidden for transition
* Add new optimized SVGs
* Fix weird height issues for actions panel
* Move hover styles below the cascade, yo
* Use margin-top for sticky footer over height: 100%
* Move initialize actions panel button to Webpack (#7506)
* Move actions panel JS code to webpack
* Refactor and use destructuring
Thanks @nickytonline!
Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>
* Rename file
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Configure Experience Level options for Mod Action Panel (#7507)
* Add a iframe to host mod actions menu
* Click interactions (no toggle of dropdowns yet)
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
* Fix the iframe's path (#7509)
* Toggle the 'Set Experience Level' menu on button-click (#7529)
* Add a iframe to host mod actions menu
* Add set-exp dropdown functionality
* WIP: making exp level updates async
* Completes async implementation
* Fix controller for "actions_panel" and "/mod"
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
* Add close button interaction (#7552)
* Rename actions panel pack file
* Add close button toggle to actions panel
* DB update
* Move more code to Webpack and add conditional tag adjustments section (#7652)
* Move JS code to Webpack
* Clean up a few style issues
* Add styling for tag adjustments
* Add active/inactive functionality
* Add conditional rendering for tag adjustments section
* Add missing variable oops (#7673)
* update with upstream
* Add missing subtract svg (#7695)
* Create 'Flag User' modal (#7626)
* Add a iframe to host mod actions menu
* Starting task
* Phase 1
* Fix "Close Modal" icon
* Implement open modal
* Working on all "Close Modal" actions
* Almost-complete implementation
* Remove Abuse Report snackbar
* Delete unneeded JS code
* Remove "How does this work?" links
* Link to Community Moderation page
* Addressing code review corrections
* Update api call to use "request" method
* Make else path clearer in api call
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
* Mod Actions Panel: Prevent nonsensical reaction pairs (#7699)
* Still implementing
* Completed Implementation
* Address code review feednack; refactor "create" method
* Move scss variables to native-css (for ModPanel code only)
* Correct missing native css
* update to native-css again
* More sccs -> native-css fixes
* Adjust ModPanel Button position on mobile (#7744)
* Adjusted ModPanel position on mobile
* Better adjustment
* Fix phantom schema.rb changes
* Fix phantom schema.rb changes
* Finalize tag adjustments (#7740)
* Finalize tag adjustments and flow
* Fix logic for rendering adjust tags options
* Clean up alert response
* Rename user to trusted user
* Use new CSS variables
* Add/remove tag on article's tag section after adjusting
* Fix logic for admin tag input and some other niceties
* Final bug fixes mod panel (#7772)
* Use correct boolean statement
* Clear the value of the textarea not div
* Use the correct attribute
* Use actions panel for /mod page (#7775)
* Fix loading logic with tag adjust button conditional render
* Link to tag moderation for adjust tags section
* Use top over window.parent
Thanks @nickytonline!
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Use Webpack alias to import
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Use place-items shorthand over align-items + justify-content
Thanks @nickytonline!
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Fix typo for utilities
* Add new line to end of file
* Disable linter for use for top function
* Use align-items and justify-content center
* Update SVGs to spec
* Remove unnecessary height and use spacing units for open button
* Remove accidentally added comment
* Error handling when selecting reactions; optimize "reactions.each" loop
* Add comment about clearing innerHTML
* Revert schema back to master
* Use each since there should only be two reactions
* Fix typo oops
* Add missing height oops
* Return if there are no reactions to be destroyed
* Center path with GUI tool shrug
* chose more appropriate name for JS pack; rewrote api calls using async-await
* Rename variables and methods and check categories before clearing
* Use addSnackbarItem instead of hardcoded version
* Place articleModerationTools pack behind user_signed_in
* Correct omission
* Implement dynamic imports for ModPanel tools
* Implemented async/await; added snackbar message for null response use-case
* Fix the "/article/mod" page; make sure all reactions, vomit-user and exp-level working as expected
* Update language to reflect new UI
* Close the modal after the "Confirm Action" button is clicked
* Change text for Spam/Abuse button
* Fix schema to use with master
* Update schema to master again
* Use crayons button for actions panel button
* UI tweak to play nicer with site themes
* Make actions panel work for dev.to/mod
* Add snackbar for reactions
* Update how does this work links
* Add "thumbsup" reactions to logging
* Add thumbsup to categories
* Add external link icon
* Changes to reflect "Privileged" and not "Negative" reactions; spec changes pending
* Updated instance variable
* Starting to update the specs
* Update "thumbsup" points from 10 to 5
* Still working on both requests
* Embracing an easier implemantation (thanks Andy!)
* Add tests for actions panel
* Add some basic tests for actions panel
* Change to flag to admins
* Indicate that 'Reason for Tag adjust' is required
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
* Rename negative_reactions to privileged
* Update rating level to use correct values
* Use a different display value than backend value
* Don't show adjust tags for trusted users
* Add specs for moderation_routes for admin and super_admin
Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
* Create migrations
* Create PageRedirect model
* Refactor migration and add timestamps
* Add routes for internal/page_redirects
* Add index controller action and view
* Change background color of version in /internal
* Add page_redirect factory and index specs
* Fix specs
* Use ransack for search
* Alphabetize internal sidenav
* Rename spec
* Add edit view with destroy button
* Refactor page_redirect form partial
* Update error messages and fix redirect
* Small fixes and hookup new and create
* Specs FTW
* Fix migration, overridden --> source
* Add PageRedirect model specs
- Validate presence of status
* Update routes
* Code climate fixes
* Add old_slug_url and new_slug_url helper methods
* Prevent updating old_slug, refactor _form
* Add URLs to index view for slugs
* Better spec wording
* Change version to badges and add to edit view
* Update destroy response
* slug --> path 🙈
* Add PageRedirects to seed file
* Fix seed file
* ACTUALLY fix the seed file
* slug --> path in PageRedirect factory
* Remove bug fix from seeds file
* Move menu items to controller constant
* Update source type validation in model spec
* Rename page_redirect --> path_redirect
* Add AuditLog for admin create, destroy, and update
* Remove redundant index
* Cleanup old name of page_redirect
* Remove old model
* Update AuditLog to :internal
* Titleize search placeholder task in internal
* Add comment to explain MENU_ITEMS constant
* Add warning text on edit page about many updates
* Remove default and allow null on source
* Fix comment
* Add path_redirect validations and model specs
- Validate old_path != new_path
- Validate new_path isn't an existing redirect
* Add uniqueness validation to broadcast titles in broadcast.rb
* WIP: properly test title uniqueness in broadcast_spec.rb
* Add unique index for title and type_of on Broadcasts
* Adds a unique index to the Broadcasts table
* Adds broadcast.rb to .rubocop_todo.yml
* Resolve merge conflicts
* Add spec around duplicate broadcasts in broadcasts_spec.rb
* Adjust broadcast to be inactive in broadcasts_spec.rb