Commit graph

248 commits

Author SHA1 Message Date
Molly Struve
04fea52893
[deploy] Update Users, Follows, Identities, and Reaction Pks to Bigints (#9615) 2020-08-06 18:27:08 -05:00
Michael Kohl
c2d23cfc4d
[deploy] Seed profile fields (#9605)
* 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>
2020-08-05 10:11:30 -04:00
Michael Kohl
e9bbcbb789
[deploy] Add ProfileField model (#9580)
* Add ProfileField model

* Fix schema.rb

* Fix schema.rb again

* Fix validation
2020-08-03 16:16:50 -04:00
Michael Kohl
6edb476acd
[deploy] Remove UserOptionalField (#9579)
* Remove UserOptionalField

* Remove optional fields from user and users factory

* Remove optional fields from user spec
2020-07-31 09:59:48 -04:00
Michael Kohl
1a6c6acd45
[deploy] Activate Devise::Lockable (#9535) 2020-07-30 10:28:51 -04:00
Molly Struve
7460893159
[deploy] Optimization:Change Comment, Ad Events, and Github ID Code Ints to Bigints (#9543) 2020-07-28 14:35:03 -05:00
Molly Struve
97882ce31c
[deploy] Optimization:Change Tag Related IDs to Bigints (#9533) 2020-07-27 10:51:56 -05:00
Molly Struve
4f20555221
[deploy] Optimization:Change Multiple Small Table Column IDs to Bigints (#9513) 2020-07-26 16:16:13 -05:00
Molly Struve
21b1afb076
[deploy] Optimization:Change Mentions, Notes, Podcasts, Roles Related Ids To Bigints (#9477) 2020-07-25 16:11:26 -05:00
Molly Struve
06fb3cff6b
[deploy] Optimization:Recreate Comments Index with Digest Hash (#9474) 2020-07-25 14:32:00 -05:00
Molly Struve
b6cc3ebb9a
[deploy] Optimization:Change Podcast and Episode PKs to Bigints (#9423) 2020-07-22 09:15:10 -05:00
Molly Struve
d79a2133f7
[deploy] Optimization:Change Tweet Primary Key to Bigint (#9409) 2020-07-21 08:08:52 -05:00
Molly Struve
c99cd29eb2
[deploy] Optimization:Change Role PKs from Int to Bigint (#9403) 2020-07-20 12:26:55 -05:00
Molly Struve
d9beec9419
[deploy] Optimization:Change Primary Keys on Mentions and Notes to Bigint (#9393) 2020-07-20 09:04:18 -05:00
Molly Struve
914e8b80a8
[deploy] Optimization:Change Broadcast and GithubIssue PKs to Bigint (#9372) 2020-07-19 17:41:37 -05:00
Molly Struve
129b60772c
[deploy] Refactor:Drop Blocks Table (#9373) 2020-07-17 16:29:05 -05:00
Alex
204fb51f14
[deploy] Remove path redirects (#9350)
* Remove path_redirect menu item

* Remove path_redirects_controller

* Remove path_redirect routes

* Remove PathRedirect model

* Remove internal views

* Remove path_redirects from seed file

* Remove PathRedirect factory

* Remove specs

* Migration to drop table and update schema
2020-07-16 09:35:42 -04:00
Ben Halpern
da6a6739e5
[deploy] Invite users to join and create password (#9294)
* Initial invitation work

* Add more invitation code

* Add proper registration page

* Fix up tests

* Fix failings

* Fix spec

* Add self-serve auth config

* Add registered condition

* Change profile image call and registered_at test

* Change comment

* Fix copy test

* Stub emojipedia

* Linting

* Add registered at to factory

* Ensure registered for user tag

* Update app/views/internal/invitations/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/controllers/internal/invitations_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Slight changes

* Update recover password flow

* Update app/views/internal/invitations/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/controllers/internal/invitations_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update db/schema.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-07-15 11:37:19 -04:00
Julianna Tetreault
5f143c4308
Add Polymorphism to Broadcasts (Part 1) (#9231) [deploy]
* 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
2020-07-13 09:36:19 -06:00
Alex
9f9236164c
[deploy] Add subscriptions to the dashboard (#9161)
* Add /dashboard/subscriptions route

* Dashboard controller updates

* Update ArticlePolicy with subscriptions?

* Update article row view in dashboard

* Add subscriptions view

* Add specs

* Add comment for pagination limit

* Use cached user_subscriptions count

* Add spec for cache counter

* Add path helper
2020-07-08 08:31:03 -04:00
rhymes
8afc9bb0c3
[deploy] Add unique indexes to follows - part 7 (#8215) 2020-07-06 11:15:56 -05:00
Alex
8714a36d27
[deploy] User subscriptions API and backend updates (#8779)
* 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
2020-06-23 13:43:32 -04:00
Vaidehi Joshi
904f0dac78
Add ahoy + welcome notification tracking (#8758) [deploy]
* 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
2020-06-18 13:40:14 -07:00
Alex
1890f393a2
[deploy] Add subscriber_email to user_subscriptions & more backend updates (#8723)
* 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
2020-06-18 14:40:08 -04:00
Molly Struve
76a0a96495
[deploy] Optimization: Add Index to Article Public Reaction Counts for Sorting (#8716) 2020-06-16 18:00:25 -04:00
Julianna Tetreault
58f9c303aa
Add active_status_updated_at to the Broadcasts Table (#8451) [deploy]
* 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
2020-06-16 13:04:14 -06:00
Molly Struve
e47037087d
[deploy] Optimization: Remove unused indexes from Postgres (#8693) 2020-06-16 11:13:38 -05:00
rhymes
380adc30ed
[deploy] Remove user_counters table (#8445) 2020-06-15 11:46:02 -04:00
Alex
6af063eebf
[deploy] Email signups liquid tag backend (#8375)
* 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
2020-06-15 09:33:34 -04:00
Josh Puetz
d33322f8e4
Add json template to Pages (#8357)
* Add json template to pages

* Add jsonb field, tweak form
2020-06-10 09:42:15 -05:00
Ben Halpern
c1dca335c7
[deploy] Allow users to set a payment pointer for their content (#8304)
* Initial user payment pointer work

* Finalize functionality and tests

* Fix schema

* Update app/views/shared/_payment_pointer.html.erb

* Add function to list
2020-06-09 16:28:16 -04:00
Julianna Tetreault
b4b10a0cd7
Allow Users to Opt-out of Announcements (#8343) [deploy]
* 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
2020-06-09 13:44:10 -06:00
Vaidehi Joshi
defab11a4d
Provide default crayon styles when creating banners (#8361) [deploy]
* 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.
2020-06-09 11:26:14 -07:00
Alex
f7430ccd16
[deploy] Add path_redirects table and internal view (#8161)
* 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
2020-06-05 10:28:33 -04:00
rhymes
753bdc5dc8
Add missing unique indexes to notifications (#8273) 2020-06-05 09:19:22 +02:00
Julianna Tetreault
8fb0641118
[deploy] Commit migration file (#8272) 2020-06-04 10:11:56 -04:00
Molly Struve
dc48886b7d
[deploy] Add If Statements to Skip Migrations If Index Exists (#8236) 2020-06-02 11:43:50 -05:00
rhymes
948e984ef3
Add unique index to comments - part 6 (#8214) 2020-06-02 11:30:43 +02:00
rhymes
70dc2429bc
Add timestamps to broadcasts (#8181)
* Add timestamps to broadcasts

* Update schema version
2020-06-01 18:11:38 +02:00
rhymes
acb35afe03
Add unique indexes - part 4 (#8059)
* Rubocop unique index cop needs a static list of columns

* Add unique index on organizations secret

* Add unique index on chat_channel_memberships chat_channel_id

* Add unique index to chat_channel slug

* Add unique index to badge_achievements badge_id
2020-05-27 09:29:20 +02:00
Josh Puetz
1a1b5b544e
Add Feature Flags support to DEV (#7996)
* Create tables for Flipper gem

* Enable Flipper gem

* Remove concurrent ruby from Gemfile

* Add Flipper UI

* Codeland landing page

* Remove codeland controller and sample page

* Remove oops

* Rename Flipper-UI endpoint

* Wrap Flipper in a FeatureFlag module

* [deploy] Lock node to 12.16 (#8057)

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2020-05-26 15:26:33 -05:00
rhymes
7db40b2117
[deploy] Add unique indexes - part 3 (#8050) 2020-05-26 08:34:53 -05:00
Molly Struve
b8d72a36d8
[deploy] Remove ProMembership Table and Factory (#8020) 2020-05-22 13:13:20 -05:00
rhymes
174dd9359d
[deploy] Add missing unique indexes - part 2 (#8002) 2020-05-21 14:15:49 -05:00
rhymes
264e8baa14
Add missing unique indexes - part 1 (#7977) 2020-05-21 12:09:06 +02:00
Andy Zhao
45ae42f611
[deploy] Add public reactions count columns (#7919) 2020-05-18 11:34:30 -04:00
Anna Buianova
35e3733314
[deploy] Removed articles.live_now column (#7879) 2020-05-15 11:37:28 -04:00
Ben Halpern
a288acf88f
[deploy] Add query-friendly article additions (Initial step) (#7794)
* Add query-friendly article additions

* Fiddle with font size

* Change from query_friendly_ to search_optimized_
2020-05-13 16:59:41 -04:00
Sarthak Sharma
90d60bf73f
[deploy] 🚀 Feature: Ability to search discoverable channels and send request to join (#7385)
* Feature 🚀 : Ability to delete messages in chat channels

- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime

* Minor Bug 🐞: Show message action only for current user

- User can delete or edit their own messages

* Test cases added

* Bug 🐞: Update message id for receiver

Message id was not sent to receiver by pusher

* Refactoring🛠: Message controller refactoring

* Test Cases📝 : Specs for Delete message added

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* added new column discoverable for public channel and changes in elasticsearch

* fix corrections

* changes in serializer file, added channel_discoverable

* added checkbox with discoverable policy

* changes in code for discoverable channels

* accept and reject member invitation by mod

* add joining request to closed groups

* fixed merge error

* changes in joining member to closed groups

* join to closed group

* changes in message action of joining

* changes in chat upopened json

* 🚀Feature : Ability to search Global Channels

* touch updated_at in after commit update

* 🚀Feature : Ability to send request to discoverable channel

* 🚀Feature : Ability to send request to discoverable channel

* created new route for joining closed channel

* 🚀 Success handle on joining request sent

* removed redundant code

* join_channel improvement, removed authorization for join channel

* list of joining requests

* added joining_request status channels on search list

* changes in mailer and query builder optimized

* 🛠 Adding filter for new Query

* added rspec for add membership method in controller

* rspec for sending join channel request

* invite join request channel list rspec

* test case for query builder discoverable

* viewable and discoverable channel list

* refactored logic for search channels

* 🚀 Check if Request already sent

* 🛠 Optimizing code and making channelButton Component

* 🛠 Optimizing codefor SVG problem

* 🛠 Optimized action.js

* changes in search controller query

* hot fix

* removed unwanted code

* 🛠  Fix the Channel Name problem

* 🛠  Optimizing code further for CodeClimate

* added new column discoverable for public channel and changes in elasticsearch

* fix corrections

* changes in serializer file, added channel_discoverable

* added checkbox with discoverable policy

* changes in code for discoverable channels

* accept and reject member invitation by mod

* add joining request to closed groups

* fixed merge error

* changes in joining member to closed groups

* join to closed group

* changes in message action of joining

* changes in chat upopened json

* touch updated_at in after commit update

* 🚀Feature : Ability to search Global Channels

* 🚀Feature : Ability to send request to discoverable channel

* 🚀Feature : Ability to send request to discoverable channel

* created new route for joining closed channel

* 🚀 Success handle on joining request sent

* removed redundant code

* join_channel improvement, removed authorization for join channel

* list of joining requests

* added joining_request status channels on search list

* changes in mailer and query builder optimized

* added rspec for add membership method in controller

* rspec for sending join channel request

* invite join request channel list rspec

* 🛠 Adding filter for new Query

* test case for query builder discoverable

* viewable and discoverable channel list

* refactored logic for search channels

* 🚀 Check if Request already sent

* 🛠 Optimizing code and making channelButton Component

* 🛠 Optimizing codefor SVG problem

* 🛠 Optimized action.js

* changes in search controller query

* hot fix

* 🛠  Fix the Channel Name problem

* 🛠  Fixing merge problem

* 🛠  Optimizing code further for CodeClimate

* updated UI for membership edit

* fixed test casses and fixed UI for chat_channel_edit

* 🛠napshots added

* test cases fixed

* 🛠 Test cases added for new component

* channel settings accesible only by mod

* 🛠 More Test cases added

* 🛠 Svg code optimized

* 🛠 Svg code optimized in videocontent

* optimized code for search query

* fix test case for query builder

* changes in joining closed channel logic

* refactored join channel

* redirect to edit channel after joining request

* changes in test case for redirect

* optimized code

* 🛠 Eslint bugs fixed

* test case fixed

* optimization

* olving channel repetition problem

* optimization of code for query builder

* changes in query builder

* test cases fixed

* 🛠 Handling reduntant data on frontend

* 🛠  Don't show data if no filter query

* 🛠 Optimized code for fixing bugs and code coverage

* 🛠  Optimizing code further for CodeClimate

Co-authored-by: Parasgr-code <paras.gaur@skynox.tech>
2020-05-11 09:29:15 -04:00
Michael Kohl
7e6c2b3977
Refactor classified listing social previews (#7679)
* Refactor classified listing social previews

* Rename decorator method

* Fix overeager renaming
2020-05-06 14:00:09 -04:00