Commit graph

1313 commits

Author SHA1 Message Date
Anna Buianova
0457fa4e9d
Removed unused scholarships code (#7023) 2020-04-02 08:15:00 -04:00
Vaidehi Joshi
9cebaa53e7
Avoid clobbering user attributes with empty params during onboarding (#7016) [deploy] 2020-04-01 16:56:10 -07:00
Molly Struve
a396660986
Remove Comment and Article docs From Elasticsearch During User Delete (#7008)
* remove comment and article docs when they are deleted

* fix banish user spec to handle ES deletes

* remove comments from elasticsearch when deleted via delete comments service
2020-04-01 16:01:16 -04:00
Vaidehi Joshi
e23e69d4b2
Prompt users to ask a question/start a discussion (#7007) [deploy]
* Add a discuss/ask notification(s) to seeds + factories

* Add a start discussion/ask question welcome notification

* Add a scope for finding articles published by a user + with a certain tag.

* Some clean up/refactoring in the generator

* Reorganize welcome notification sending, add specs for discuss/ask notification
2020-04-01 11:57:50 -07:00
Molly Struve
ef358c0213
[deploy] update articles when touched by reactions (#7001) 2020-04-01 13:26:56 -05:00
jituraj98
e2edf960dc
[deploy] Connect: move settings to sidecar iframe, improve invitations and remove experimental features (#6903)
* 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

* Move channel settings to sidecar

* added spec for chat_channels_memberships_controller.rb (#6539)

* added spec for chat_channels_memberships_controller.rb

* simplified record not found error for membership

* error message formatting updated

* added error key in flash message

Co-authored-by: jitendra <jitendrarajpurohit@skynox.tech>

* Refining "Move sidecar to iframe" branch (#6634)

* added spec for chat_channels_memberships_controller.rb

* simplified record not found error for membership

* error message formatting updated

* added error key in flash message

* 🐞 Bug Fix: Open sidecar of clicking @all

* 🐞 Bug Fix: adding space after selecting the username from suggestion box

* added remove channel member functionality for moderators

* 🔩 Small Tweaks: Hover issue fixed

* 🐞 Bug Fix: Remove sidecar toggle on @all tag (for now)

* updated manually constructed urls with rails path helpers

* mod users cannot remove members of other channel

Co-authored-by: jitendra <jitendrarajpurohit@skynox.tech>

* 🚀 Finalising the connect group/channel feature.  (#6829)

* added spec for chat_channels_memberships_controller.rb

* simplified record not found error for membership

* error message formatting updated

* added error key in flash message

* 🐞 Bug Fix: Open sidecar of clicking @all

* 🐞 Bug Fix: adding space after selecting the username from suggestion box

* added remove channel member functionality for moderators

* 🔩 Small Tweaks: Hover issue fixed

* 🐞 Bug Fix: Remove sidecar toggle on @all tag (for now)

* updated manually constructed urls with rails path helpers

* mod users cannot remove members of other channel

* mod members can now invite user who have left the channel

* 🐞 Bug Fix: Ability to open sidecar on mention all properly

* Eslint Changes

* send email notification on inviting user feature added

* 🛠  Email design enhancements for channel invitation

* send invitation to mod user added from internal

* 🛠  Gif changes for Mod

* spec fixed

* inviter name issue fixed

* 🚀 Open sidecar when automatically if you use link from email

Co-authored-by: jitendra <jitendrarajpurohit@skynox.tech>

* review changes

* added spec for channel_invite_email

* Bug🐞: Design problem with sidecar after merge

* Bug🐞: Design problem with invitation alert box

* replaced instance variables with local variable

* Bug🐞: Wrong css classes fixed

* Bug🐞: Edit option bug

* yarn.lock file updated

* code review changes

* updated manually constructed urls with rails path helpers in spec

* user name url issue fix in invite email

* user url corrected

Co-authored-by: Sarthak Sharma <7lovesharma7@gmail.com>
Co-authored-by: benhalpern <bendhalpern@gmail.com>
2020-04-01 12:13:26 -04:00
Molly Struve
05b6220e2d
[deploy] reindex articles to Elasticsearch in places where relations are updated or update_column is used (#7003) 2020-04-01 10:59:30 -05:00
Mac Siri
95f18b4592
Create alias for User's welcome_notification (#6991) 2020-03-31 20:22:55 -04:00
Mac Siri
fc728af0cd
Prompt new users to customize their feed (#6979) 2020-03-31 17:32:11 -04:00
Molly Struve
ed90ddad10
Index Reading List Reactions (#6953)
* Index reactions when they are created and updated, remove when destroyed

* update reading list reactions when related article fields are updated

* create indexable method and use for indexing to elasticsearch
2020-03-31 12:23:43 -04:00
Mac Siri
1cb51780cb
Update feed_spec's use of NON_DEFAULT_EXPERIMENTS (#6975) 2020-03-31 11:43:34 -04:00
Ridhwana
e74890680a
Generalize meta content and copyright year (#6887)
* chore: remove the description

* feat: change the meta og:site_name property from The Practical DEV to The <COMMUNITY_NAME> Community consistently

* refactor: change the canonical link to be more dynamic using the <%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %>

* refactor: update the path to be dynamic

* refactor: change some other meta properties to be dynamic

* refactor: update the index

* refactor: update the sitename to just read <%= ApplicationConfig["COMMUNITY_NAME"] %> Community

* feat: copyright year should be dynamic

* feat: change the meta og:url content to be dynamic by using <%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %> for the former part of the url

* feat: space

* refactor: move the copyright notice to a helper

* refactor: use the community_qualified_name helper!

* refactor: start year is already a string

* refactor: use app url helper instead of <%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %> everywhere

* chore:oops

* refactor: Change  <meta name="twitter:image:src" content="http://i.imgur.com/B4JNl1w.png"> to `<meta name="twitter:image:src" content="<%= SiteConfig.main_social_image %>">` consistently.

* refactor: Replace  `<meta property="og:image" content="http://i.imgur.com/B4JNl1w.png" />` with `  <meta property="og:image" content="<%= SiteConfig.main_social_image %>" />`

* chore: update some other meta's

* feat: replace 'The Practical DEV' with 'DEV Community' and

* test: remove The :)

* test: copyright_notice

* fix: syntax error

* feat: name of community

* refactor: use app url

* fix: template strings

* fix: tag

* feat: update the app url parameters

* feat: add a community_name helper so we don't have to refer to an environment variable in the templates

* feat: take into account the case when the start year is a blank string

* feat: single quotes to double quotes

* test: add a test for the #community_name

* chore: update or codeclimate

* chore: amend the community helper

* refactor: use the community_name helper in here

* feat: update ApplicationConfig["COMMUNITY_NAME"]  with community_name

* fix: Time.current.year needs to be a string :(

* chore: extra space

* chore: change to use community_qualified_name
2020-03-31 16:15:57 +02:00
Michael Kohl
1ae9cfbdc6
Remove POST /api/reactions endpoint (#6968) [deploy] 2020-03-31 16:12:30 +02:00
rhymes
a58596f25f
Correctly save Tweet reply ids (#6951) 2020-03-31 11:09:19 +02:00
Vaidehi Joshi
28956d90a5
[deploy] Prompt new users to customize their experience (#6959)
* Rename find_broadcast to find_auth_broadcast

* Fix broken div rendering on /notifications tab

* Allow customize notification to be enqueued

* Add specs for customize welcome notification

Also clean up existing specs to match!

* Rename customization notification method for clarity

* Remove some redundant assertions in generator spec
2020-03-30 19:17:52 -04:00
Andy Zhao
ec371b4624
Fix response templates edit and delete buttons (#6952)
* Fix delete button with correct form_with options

* Use correct path for edit button

* Add test for edit and delete response templates

* Use old pattern to accept alert

* Check for text instead b/c weird timing issue with backend
2020-03-30 15:43:01 -04:00
rhymes
66515d1258
Ignore unused organizations columns (#6933) [deploy] 2020-03-30 19:00:31 +02:00
Molly Struve
55fe5a40a8
Add Rack::Attack Gem to Throttle Requests, Only Search to start (#6841) [deploy]
* throttle requests made to search endpoints

* stub elasticsearch requests in rack attack specs and disable for running specs unless tagged

* use original client IP from fastly to throttle requests to search endpoints
2020-03-30 12:09:40 -04:00
rhymes
4baa9d3165
Remove job_opportunities table (#6932) 2020-03-30 12:08:10 -04:00
Alex
efc08d9b74
[deploy] Add valiation for file name length to file uploads (#6918) 2020-03-27 18:54:27 -04:00
Molly Struve
72f04e4a13
Create Reactions Index in Elasticsearch and Serializer (#6899)
* create index for reactions and their reactables, set up serializer

* use respond_to instead of checking type

* remove rubocop change

* add last_indexed_at to reactions index
2020-03-27 18:44:54 -04:00
Molly Struve
974ba032da
Add last_indexed_at Timestamp to all Elasticsearch indexes (#6913)
* add last_indexed_at to all Elasticsearch indexes

* use Time.zone.parse
2020-03-27 18:43:46 -04:00
Mac Siri
2c5e12268f
Implement authentication welcome notification (#6846) 2020-03-27 15:21:40 -04:00
Ben Halpern
e35d55c422
Add pagination to tag pages for better SEO crawling (#6771) [deploy]
* Add pagination to tag pages for better SEO crawling

* Modify system specs

* Add some tests

* Finalize tests

* Fix things up

* Add url helpers
2020-03-27 10:34:42 -04:00
rhymes
d03c751c65
Rubocop fixes (#6904)
* Run rubocop -a

* Regenerate rubocop todo

* Fix Lint/UselessAssignment

* Fix RSpec/RepeatedDescription

* Fix Style/GuardClause

* Fix Style/NumericPredicate

* Regenerate rubocop todo
2020-03-27 15:30:59 +01:00
rhymes
336c195228
Remove redundant Puma silencing in system specs (#6905) 2020-03-27 09:51:35 -04:00
Andy Zhao
7255a7d9af
[deploy] Use constraints and different params for settings (#6898) 2020-03-26 18:39:27 -04:00
Jacob Herrington
38d56542eb
[deploy] Moderator and admin actions log (#6797)
* Add audit logging for negative reactions

This change saves requests that create negative reactions to the audit
log. We need to be monitoring admin and moderator actions throughout the
app to increase visiblity on how our tools are being used and identify
abuse.

Additionally, this will help east concerns about giving elevated users
more powerful tools.

* Add a basic UI for moderator audit logs

* Log experience level ratings

* Log tag adjustments

* UI tweaks for moderator actions log

* Add logging to internal reactions controller

* Add logging for admin actions on users and articles

* Add searching to the moderator actions table

* Move audit instrumentation out of concern

We are able to use a PORO here instead of using a Rails concern. Moving
this also makes syntax to audit something quite a bit more explicit and
obvious to future developers

* Change moderator logs pagination page length

* Move auditing to after action filters

* Add moderator actions to the internal navbar

* Add request spec for internal moderator actions

* Use request params to populate AuditLog slug
2020-03-26 16:59:24 -05:00
Andy Zhao
1a989bef07
[deploy] Add response templates to user settings (#6823)
* Add response templates controller, routes, and view

* Add response templates settings page

* Remove dead code

* Use proper variable oops

* Use proper indentation

* Use before action for checking current_user

* Remove index action temporarily

* Use url helpers for redirects

* Use form_with over form_tag and form_for

* Persist previous content if edit fails

* Use exists for performance

* Remove index spec and add CRUD specs

* Memoize @response_template

* Use workaround for sad paths b/c render doesn't work

* Refactor and extract permitted_attributes into var

* Use present over exists to preload into memory

* Use last over first

* Lint for codeclimate

* Use two redirects for happy and sad create path

* Remove proper index route oops

* Codeclimate comma sigh
2020-03-26 14:48:00 -04:00
Vaidehi Joshi
c12cea9b02
Allow users to opt-out of welcome notifications (#6852) [deploy]
* Update some test descriptions in notifications_spec

The descriptions of these tests didn't actually match the test's assertions!

* Add welcome_notifications column to users table

Also ensures that welcome_notifications cannot be set to `nil`.

* Show an opt-out message for Welcome broadcast notifications

* Add opt-out link to notifications + welcome notification box to settings

* Allow welcome notification subscription to be updated

* Add tests for unsubscribed to welcome notification users

Also refactor generator specs a bit.

* Fix up paths, copy, tests

Use rails path helpers instead of hardcoding paths. Improve copy in a few locations.
2020-03-26 11:26:19 -07:00
Molly Struve
d20a50aa2b
sync feed content documents in Elasticsearch (#6888) [deploy] 2020-03-26 13:11:09 -05:00
Molly Struve
84a14aed0a
handle missing displayed_classified_listing for moderate views (#6881) [deploy] 2020-03-26 12:24:26 -05:00
rhymes
353af9fcff
Fix flaky response_template test (#6889) [deploy] 2020-03-26 11:13:25 -05:00
rhymes
f1167be64c
Ignore unused articles columns (#6781)
* Ignore unused article columns

* Remove usage of ignored columns
2020-03-25 17:48:42 -04:00
Alex
129cd3ba83
Log Elasticsearch index counts to Datadog (#6845) [deploy] 2020-03-25 15:52:54 -05:00
rhymes
cfb64a1c68
Add URL module and article_url, user_url helpers (#6833)
* Add AppURL with .article and .user

* Use URL.url and URL.user

* Add article_url and user_url helpers
2020-03-25 13:54:45 -04:00
Molly Struve
94c7bd3a95
return default aspect ratio of 1 if gif id is not present and refactor (#6837) [deploy] 2020-03-25 11:21:47 -05:00
Molly Struve
3f33d6c376
Allow user, feed, and classified listing searches even when users are not logged in (#6819) 2020-03-25 11:20:13 -05:00
Mac Siri
84e84af8d7
Create Article#admin_published_with scope (#6794) 2020-03-24 18:15:43 -04:00
rhymes
22822d448d
Add App.url and use it with Slack messengers (#6818)
* Add App.url

* Use App.url with Slack messengers
2020-03-24 17:22:09 -04:00
Jacob Herrington
c673b2bb6d
Internal: Add a table for negative reactions (#6751) [deploy]
* Add a table for moderator reactions

This is a simplified version of a feature that should be fleshed out
in the near future.

Despite the fact that this project is taking a new direction, I think
this table could be useful in the meantime.

* Add specs for internal mod actions view

* Rename mod actions to negative reactions
2020-03-24 16:08:24 -04:00
rhymes
e9e4059ad3
Add Slack messengers: part 1 (#6748)
* Add Slack::Announcer and SlackClient

* Add Slack::Messengers::Feedback class

* Use Slack::Messengers::Feedback and refactor test

* Should not raise an error if params are nil, let the job fail

* Add Slack::Messengers::Sponsorship

* Rename spec

* Use Slack::Messengers::Sponsorship

* Add Slack::Messengers::PotentialSpammer

* Use Slack::Messengers::PotentialSpammer

* Add Slack::Messengers::RateLimit and use it

* Refactor a bit and improve tests

* Add Slack::Messengers::Note and use it

* Use Slack::Announcer and fix spec

* Fix specs

* Update app/services/slack/announcer.rb

Co-Authored-By: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Implement review suggestions

* Empty commit to trigger Travis

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-03-24 18:45:40 +01:00
rhymes
118762ca9b
Some RSpec fixes (#6757)
* Fix spec/uploaders/profile_image_uploader_spec.rb

* Additional ordering based fixes

* Fix spec/requests/comments_spec.rb

* Fix spec
2020-03-24 13:16:19 -04:00
Molly Struve
2f5a8f532b
ensure article published dates are far enough apart to ensure they are sorted properly (#6811) 2020-03-24 10:10:22 -05:00
Molly Struve
3087d3d4d8
Index comments into FeedContent index (#6791) [deploy] 2020-03-24 09:24:20 -05:00
ludwiczakpawel
61b913e5e8
Replacing theme variables (#6682)
* add tons of colors

* add tons of colors

* moving cheese around and prepping for new theming system

* documenting

* .

* moving theme code to own files

* replacing some variables

* whitespaces

* replacing another batch of variables

* get rid of another variable

* replace loading animation variable with one-fits-all-sizes

* get rid of theme-anchor-color

* remove code colors variables

* another batch of variables replaced

* mostly bringing in variables for haxor theme

* remove invert-image variable for chat

* remove another inver-image variable

* forgot to remove reaction-background variable

* remove border variable

* series

* .

* remove another variable

* remove another variable..

* another batch of variables

* and more...

* drop comments

* Update approval file for tweet

Co-authored-by: rhymes <rhymesete@gmail.com>
Co-authored-by: benhalpern <bendhalpern@gmail.com>
2020-03-24 15:05:35 +01:00
Molly Struve
eab6c02f33
More Backend Feed Search Updates (#6784) [deploy] 2020-03-24 08:15:02 -05:00
Andy Zhao
57d9d72c10
Update call to action box text styling (#6795)
* Use constant for type_of_user

* Add comment for clarity

* Remove legacy inline styles

* Move comment above the render
2020-03-24 10:49:37 +01:00
Alex
bc8c126497
Validate file uploads client-side (#6737)
* JavaScript MVP

- First round of linting
- Use for testing

* Add some default UI error handling

* Add file validation to updating profile image

* Add type validation and fix size bug

* Refactor and add file validation to article cover

* Add file validation to body images

* Add accept field to profile image form

* Add parseInt to maxFileSizeMb

* Add accept and max-file-size-mb to article images

* Change parseInt to Number

* Add file validations to podcast form

* Add accept image to podcasts

* Add file validation and accept field to org form

* Use appendChild for error message

* Add file validation to comment form

* Add JS Docs comments

* Remove redundant format check

* Add documentation to override default values

* Update documention (spelling, formatting, etc.)

* Update max-file-size-mb to 25

* Bump default max file size for images to 25

* Change appendChild to append

* Refactor remove error message

* Refactor JS, remove console logs, update error msg

* Remove video from permitted file types

* Update error messaging

* Update docs for funciton params...oops 🙈

* Fix file size check logic

- Allow for 0 maxFileSizeMb
- Use JSON.parse() for permittedFileTypes to get an Array

* Add specs

* Change blackbox to black box

* Remove wait_for_javascript

* Remove comments from spec
2020-03-24 09:21:49 +01:00
Ben Halpern
da8dbd2180
Add feed variants with shuffle post-ranking (#6766) [deploy]
* Add feed variants with shuffle post-ranking

* Refactor tests and fix erroneous shuffle
2020-03-23 18:09:30 -04:00