Commit graph

173 commits

Author SHA1 Message Date
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
Guilherme Vinicius Moreira
52f8e8512a
Refactor internal user page (#6940)
* Refactor internal user page

* Refactor forms and conditions
2020-03-31 13:43:07 -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
Jacob Herrington
7d30463464
Increase the number of negative reactions per page (#6840)
After looking at this UI in production, I realized that showing only
five negative reactions per page was way too few! Bumping this up to 25
which I feel is more reasonable.
2020-03-25 14:18:24 -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
Jibran Kalia
a91cb9f8f4
Create primary_sticker_image_url in SiteConfig (#6746) [deploy]
* Create primary_sticker_image_url in SiteConfig

* Adding test for updating primary_sticker_image_url

* typo

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-03-23 14:55:18 -04:00
Ben Halpern
030e491cf4
Add logo_png SiteConfig for manifest etc. use (#6760) [deploy]
* Add logo_png SiteConfig for manifest etc. use

* Touch ups
2020-03-23 14:31:41 +01:00
Andy Zhao
494ad153ab
Add response templates for internal usage (#6676)
* Add internal response template controller

* Add response template policy and spec

* Add response template views for internal

* Add missing html oops, and some padding

* Use arrays instead of %w because spaces

* Link to user in index list

* Add actual HTML oops

* Allow success flash to be displayed

* Add tag moderator trait

* Remove unnecessary .all

* Use constant to avoid duplication

* Use URL helpers over manual string URLs

* Use appropriate renders and URLs

* Follow conventional CRUD and use form_with

* Add internal request spec for response_templates

* Add missing view file oops

* Use table view for index and bootstrap styles

* Redirect to index after create

* Use clearer messaging for labels

* Validate email types to use only plain text and html
2020-03-20 11:32:55 -04:00
Ben Halpern
325389467e
[deploy] Move banishing spam users to async job (#6745)
* Move banish_user to async

* Fix up specs

* Fix up format
2020-03-20 11:21:49 -04:00
Ben Halpern
379aa4d1ec
Allow communities to dictate authentication providers (#6639) [deploy]
* Allow communities to dictate authentication providers

* Include proper file

* Reset siteconfig value

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-03-18 16:41:39 -04:00
Jacob Herrington
243e9b5524
Add a form to email users from internal (#6668)
Co-authored-by: MichaelaHunter <michaela1234@gmail.com>

Co-authored-by: MichaelaHunter <michaela1234@gmail.com>
2020-03-17 11:19:42 -04:00
Ben Halpern
de27e7ed34
Allow community admins to alter site description (#6662) [deploy]
* Allow community admins to alter site description

* Fix typo
2020-03-16 15:34:49 -04:00
Ben Halpern
58e524acdc
Allow admins to define core sidebar tags in config (#6641) [deploy] 2020-03-16 08:54:32 -04:00
Anna Buianova
f05e5254bb
Fetch podcast's episodes from /internal (#6593) [deploy]
* Formalized and improved Podcasts::GetEpisodesWorker documentation

* Basic functionality for fetching podcasts episodes from /internal

* Improved notice on fetching

* Reorganized /internal/podcasts edit page
2020-03-11 17:25:12 -04:00
Michael Kohl
02f86fedd7
Allow admins to delete users without emails (#6530) [deploy]
* Allow admins to delete users without emails

* Guard against blank email addresses
2020-03-10 22:20:36 +01:00
Anna Buianova
99cabcbf6b
Removed unused campaign settings (#6532) [deploy] 2020-03-09 12:59:54 -04:00
Jacob Herrington
7ebde59b62
Convert internal listing table view to bootstrap (#6486)
* Convert internal listings index table to bootstrap

* Add some eager loading to internal listings

This should cheer bullet up some!
2020-03-06 20:03:24 +01:00
Michael Kohl
8df0a72ce7
Move onboarding tags from public to internal API (#6329)
* Move onboarding tags from public to internal API

* Fix typo

* Undo wrong chang
2020-03-06 19:34:31 +01:00
Vaidehi Joshi
10cee2ec5c
Add a mascot_user_id to SiteConfig (#6483) [deploy]
* Add a mascot_user_id to SiteConfig

Also allow it to be updated from /internal/config pages.

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Add spec for updating mascot_user_id

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2020-03-05 12:44:59 -08:00
Ben Halpern
3c8422c8d5
Add social image to internal/pages form (#6401) [deploy] 2020-03-02 11:38:01 -05:00
Anna Buianova
b36d2e72ff
Started moving sponsorships to /internal (#6355) [deploy]
* Started moving sponsorships to /internal

* Moving sponsorships to /internal

* Improved /internal/sponsorships

* Added destroying sponsorships to /internal

* Rename sponsorships creator in internal
2020-03-01 12:48:47 -05:00
Anna Buianova
df93e8d41e
Custom social preview template for tags (#6290) [deploy]
* Custom social preview template for tags

* Added index on tags social_preview_template + small refactoring

* Add checks if index exists to tags migration
2020-02-27 17:56:21 -05:00
Vaidehi Joshi
3bc0f49861
Only send notifications that belong to an active broadcast (#6319) [deploy]
* Use active in place of sent on internal broadcast routes

* Add and use active scope on broadcasts

* Update seeds + specs to use active broadcasts

* Add note about active broadcasts to /internal/broadcasts page
2020-02-27 08:02:45 -08:00
Jacob Herrington
4b47611764
Remove existing mods from potential mod list (#6235) [deploy]
This is a request from Peter, and it should make searching for potential
admins a bit less tedious.
2020-02-26 12:14:28 -05:00
Anna Buianova
e2cb359b2d
Change sidebar campaign view (#6228) [deploy]
* Changed sidebar campaign view

* feat: update the hml of the campaign sidebar config (do not show broken image if the link has not been set)

* feat: update the html and css to make it look like Figma

* chore: revert the classname change as we use write elsewhere

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-02-26 10:36:18 -05:00
Jacob Herrington
42042d9a9e
Vomit on users from /mod (#6182) [deploy]
* Add UI to vomit on a user from /mod

Co-authored-by: MichaelaHunter <michaela1234@gmail.com>

* Add backend tweaks for vomitting on users

Co-authored-by: Andy Zhao <17884966+Zhao-Andy@users.noreply.github.com>

* Validate that users can't moderate articles

* Add system spec for article mod page

* Satisfy rubocop after rebase

* Fix typo and formatting

* Use reactable_id instead of user_id

Co-authored-by: Michaela Hunter  <60361569+MichaelaHunter@users.noreply.github.com>
Co-authored-by: Andy Zhao <17884966+Zhao-Andy@users.noreply.github.com>
2020-02-20 14:11:53 -05:00
Anna Buianova
1dfa3d6183
Fix podcasts internal page (#6205)
* Fix podcasts internal page

* Add a test to check what is displayed in /internal/podcasts
2020-02-20 11:51:37 -05:00
Ridhwana
39007b4dab
Campaign settings (#6141) [deploy]
* feat: port over changes (+ suggestions) from https://github.com/thepracticaldev/dev.to/pull/5892/files

* chore: add query over multiple lines

* refactor: move the sql logic into the controller instead of in the template

* chore: appease code climate
2020-02-18 11:02:09 -06:00
Andy Zhao
acd3b92b32
Add sink user service and specs for mass vomits (#6006)
* Add sink user service and specs for mass vomits

* Use new score calculation

* Lower articles' scores instead and make async

* Add lower score functionality to controllers

* Remove unused variable

* Use correct var and add missing arg

* Remove unused status

* Add composite index for reactable_type and ID

* Use alias instead of additional boolean

* Use medium priority for sink worker

* Log to honeybadger and not logs

* Log the error and not a string
2020-02-17 10:29:50 -05:00
Jacob Herrington
40bc7ecedd
Remove unnecessary eager loading (#6063)
Bullet doesn't seem to like this, and it makes sense because we don't
want to load ALL reactions, just some of them.

Co-authored-by: nspinazz89 <nspinazz89@gmail.com>

Co-authored-by: Nick S <nspinazz89@gmail.com>
2020-02-17 09:39:30 -05:00
Ben Halpern
8837531195
Add additional safeguards for config write access (#6064) [deploy]
* Add additional safeguards for config write access

* Change spec name and confirmation step
2020-02-13 18:39:55 -05:00
Ben Halpern
2add3ae300
Replace dev.to with ApplicationConfig in a few locations (#6008) [deploy]
* Replace dev.to with ApplicationConfig in a few locations

* Update app/labor/badge_rewarder.rb
2020-02-11 14:48:27 -05:00
Vaidehi Joshi
c33d6936b5
Do not allow staff_user_id to be mutated (#6009) [deploy]
Allowing ids to be mutated by admins from the /internal/config pages is dangerous.
This could cause issues if an admin tries to update the SiteConfig.staff_user_id to an id that is another user's id, or to an id that isn't valid.
2020-02-10 16:35:18 -08:00
rhymes
6cd46ae2f9
Enable bullet during tests to catch N+1 early (and some cleanups) (#5930) [deploy]
* Remove unused methods

* Small refactorings

* Enable bullet in testing mode

* Remove unused eager loading for notes

* Skip bullet on rolify method

* Use .present?

* Fix method name
2020-02-07 09:02:22 -05:00
Michael Kohl
7270d5ab4c
Move user deletion by moderator to worker (#5887) [deploy] 2020-02-05 08:27:07 -05:00
Vaidehi Joshi
e84dec1db6
Allow broadcasts to be created from internal/broadcast (#5908) [deploy]
Also raise errors when necessary in all broadcast endpoints.
Clean up tests and add specs for POST /internal/broadcast
2020-02-04 15:57:17 -08:00
Vaidehi Joshi
267e08f6f0
Improve dropdown UX for internal/badges (#5880) [deploy]
* Improve dropdown UX for internal/badges

Add a "blank" option to the dropdown to list of badges on internal/badges route.
Also add some checks to handle if an admin accidentally tries to award a "blank" badge.

* Ensure error is surfaced as flash message
2020-02-04 09:02:14 -08:00
Michael Kohl
d82bbb874e Add rate limits to admin interface (#5642) 2020-01-22 15:29:27 -05:00
Michael Kohl
5b35370db8 Introduce BanishedUser table (#5589) [deploy] 2020-01-21 17:15:58 -05:00
Jacob Herrington
07bd2e90b5 Add eager loading based on Bullet (#5552) [deploy] 2020-01-18 19:07:41 -05:00
Jacob Herrington
8db4808d2e Internal Reports: Searching and sorting with Ransack (#5447) [deploy]
* Add gem Ransack 2.3.0

* Add sorting and search to internal/reports

The UI here should probably be revisited sooner or later, I feel like
the vomit reactions might even need to be moved to their own view.

* Add system spec for internal reports search

* Remove filter for report_type
2020-01-16 15:02:09 -05:00
Ben Halpern
f78b89e763
Add suggested tags to SiteConfig (#5426) [deploy]
* Initial base work

* Add suggested tags config

* Downcase suggested tag input
2020-01-10 12:33:37 -05:00
Jacob Herrington
9652ecc456 Refactor/internal ui update (#5339) [deploy]
* Move internal styles out of layout

* Upgrade to Bootstrap 4.4 and redo nav

* Redesign /internal/users/index

* Refactor /internal/tags/show

* Refactor /internal/broadcasts/index

* Refactor /internal/broadcasts/index

* Refactor /internal/pages/index

* Refactor /internal/mods/index

* Fix internal nav highlighting

* Refactor internal/organizations/index

* Refactor internal/growth

* Refactor internal/badges

* Refactor /internal/podcasts/

* Refactor internal listings filter

* Refactor /internal/endpoints/

* Refactor /internal/tools/

* Refactor /internal/chat_channels/

* Refactor /internal/config/

* Refactor /internal/feedback_messages

This is the one that worries me the most. I made a strong effort not to
touch any IDs and the JavaScript appears to be working after manual
testing.

This view probably needs some systems specs covering it.

* Remove unused CSS

* Refactor feedback_messages/show

* Refactor internal/comments

* Refactor internal/podcasts/edit

* Refactor internal/users/show

* Refactor internal/users/edit

* Refactor internal/organizations/show

* Refactor internal/permissions

* Refactor internal/tags/show

* Refactor internal/pages/form

* Add events to navbar

* Refactor internal/events

* Refactor internal/brodcasts

* Refactor internal/articles

* Refactor internal/listings

* Remove unused CSS

* Load jquery earlier
2020-01-06 07:58:03 -05:00
Jacob Herrington
00dd84f9e1 Add a default message to badge award action (#5160)
* Add a default message to badge award action

Because:
 - The only badges routinely awarded manually use the same message
 - Right now, unfriendly/unsafe UI can result in an error notification

The only badges that are currently awarded manually (afaik) have the
message "Congrats!!!" so for the time being, if a message is not
supplied to the UI, it will simply use the "Congrats!!!" message as a
default.

That being said, I'm not totally convinced this message won't work for
the long term. Generally, if we are awarding badges by hand, I'd imagine
we'd want a specific message explaining why we are doing that, or just
be okay with "Congrats!"

After talking with Peter about it, the longer term goal should be to
move badge messages into the database so they can be modified in the app
and not hardcoded. That also make sense regarding the effort to
genericize the app eventually.

* Test Badge notifications
2019-12-19 10:38:57 -05:00
Jacob Herrington
d98f8237bd Add view for managing organizations (#5149) [deploy]
* Add view for managing organizations

This adds only an index and show action for the internal/organizations
page. Eventually we'll flesh this out with features to automate the more
mechanical org management tasks.

* Use instance variable for search query

* Convert multiple expects into one

* Add pagination to organizations

* Add search spec for organizations

* Use size over count
2019-12-17 12:07:11 -05:00
Jacob Herrington
35ede32be7 Internal bulk badge awarder (#5110) [deploy]
* Move admin specs

These tests should probably be grouped together, so I moved them into a
directory called "internal"

This also encourages some additional internal tests.

* Add an internal badges controller

* Add internal view for running BadgeRewarder task

Because:
  - Peter is currently running this rake task from Heroku and this is
  going to make his workflow easier
  - It's a step towards having a decent tool under internal for managing
  badges (though I'd hesitate to call this decent)

This change adds a view and controller action to award badges in
batches, it's an improvment over the current workflow that Peter is
using, but it's still very rough around the edges.

We could definitely improve this with some error handling around the way
the BadgeRewarder works, but for now this is a net gain over how Peter
has been doing this task. I think it's worth merging as is and future
work to improve the experience and reliability of this tool can be
prioritized against other tasks.
2019-12-16 11:31:37 -05:00
Jacob Herrington
b34ae9b7d9 Remove dead code (#5090) [deploy] 2019-12-12 12:19:55 -06:00
Jacob Herrington
145db47a3a Add single resource admin concept (#5069) [deploy]
* Add a trait for single_resource_admins to users factory

* Add single_resource_admin authrization for Growth view

* Expand GrowthController test coverage

* Add single resource admin workaround to models

* Add single resource admin to additional views
2019-12-11 13:17:55 -05:00
rhymes
b0eec90b24 Add additional keys to site configuration (#4861) [deploy]
* Add rate_limit_follow_count_daily to SiteConfig

* Add favicon_url to SiteConfig

* Add logo_svg to SiteConfig

* Add staff_user_id to SiteConfig

* Add default_site_email to SiteConfig

* Add social_networks_handle to SiteConfig

* Add ga_view_id and ga_fetch_rate to SiteConfig

* Add mailchimp newsletters IDs to SiteConfig

* Add periodic_email_digest_max, periodic_email_digest_min to SiteConfig
2019-11-20 10:58:10 -05:00