Commit graph

188 commits

Author SHA1 Message Date
Ben Halpern
d447d0cadf
[deploy] Update design and functionality of internal/articles (#7517)
* Update design and functionality of internal/articles

* Fix spec

* Update specs

* Fiddle with test

* Fix request spec
2020-04-26 18:27:09 -04:00
Guilherme Vinicius Moreira
31c0b388e5
Refactor internal users index (#7457)
* Refactor internal users index

* Add table-hover to users table

* Add users query spec
2020-04-24 17:27:07 -04:00
Michael Kohl
f791e84f2d
Filter classified listings by published status for mods (#7432)
* Filter classified listings by published status for mods

* Change checkbox label, invert logic, respect checked status
2020-04-24 10:31:29 -04:00
Mac Siri
57ae315c31
[deploy] Generalize Onboarding's task-card image (#7452)
* Generalize Onboarding's task-card image

* Rename SiteConfig's onboarding_taskcard_sticker

* Add & reorganize #config_params

* Update Internal::Config's view

* Add spec
2020-04-24 10:24:50 -04:00
Ridhwana
17fdc556ee
Generalization: Replace static dev emails with configurable ones. (#7438)
* feat: update the email addresses in the site config

* chore: update the default email address everywhere

* feat: update the template for the config

* chore: remove default_site_mail as an allowed parameter

* feat: change biz@dev.to to teh business email address and with a subject

* feat: update partners@dev.to to use SiteConfig.email_addresses[:business]

* feta: update to business email address

* feat: update members@dev.to to use the site config

* feat: update privacy email

* chore: Anna's suggestion to loop through object instead of keys
2020-04-23 11:26:58 +02:00
Michael Kohl
9df68f3920
Use new classified listing categories (#7250)
* Add ClassifiedListingCategoryModel

* Add data update script for classified listing categories

* Refactor and fix specs

* Resolve conflict

* Incorporate PR feedback
2020-04-23 10:06:58 +07:00
Ridhwana
a2f1a0049f
Removal of morrrre hardcoded dev.to links (#7390)
* feat: remove 90% of hardcoded dev.to links now

* chore: update tests

* chore: implement suggested changes

* chore: update url

* chore: update to use URL helper
2020-04-21 11:50:18 +02:00
Andy Zhao
f5ec83653c
[deploy] Finalize and add response templates feature (#7068) 2020-04-16 15:53:29 -04:00
Jitendra Rajpurohit
7656d10e2b
Generalized shop url by creating SiteConfig field for it (#7262)
* added shop_url to SiteConfig

* fixed issue in show config erb file

* add spec for shop_url SideConfig

* added spec

* handles blank shop_url case

* code review changes
2020-04-15 16:28:34 -04:00
rhymes
34848a4209
Upgrade Rubocop to 0.81 (#7219)
* Upgrade rubocop to 0.81.0

* Reordered rubocop file and updated it

* Regenerate todo

* Correct some things

* Fix specs
2020-04-11 10:10:04 +02:00
Ridhwana
e626cfa933
[deploy] Split out social media options (Important: post deployment task to be run) (#7173)
* feat: define the different social media handles

* feat: dynamically render all the social media fields

* feat: ensure that the social media handles are permitter and dealt in a separate path from the rest

* test: update  social_networks_handle to social_media_handles

* feat: update the sidebar to use different social media

* feat: update the twitter:site meta handle to be  SiteConfig.social_media_handles["twitter"]

* feat: update the a links to tweets

* feat: make the links dynamic and only show those that there is a value for

* refactor: make @ThePracticalDev dynamic

* refactor: make @ThePracticalDev dynamic

* feat: add dynamic social media handles

* chore: rename values

* chore: remove extra social handles

* chore: some spacing

* chore: remove lines

* rafector: user rails-settings-cached type: :hash to set the type and the defaults

* feat: use nil and blank instead of "" and empty

* chore: move the social media handles into the right box

* refactor: rearrange model placement based on the UI

* chore: code climate

* refactor: comments from PR

* chore: rename the ff

* chore: amended twitter username

* chore: add a temporary rake task

* feat: update names

* chore: why am i using the old syntax :(

* chore: revert dynamic erb variable in offline.html
2020-04-09 19:51:11 +02:00
Arit Amana
9ab1979ef0
Async Vomit Confirmations & Invalidations in Internal (#7082)
* Work in Progress

* Time for Refactoring

* WIP Implementation, still lacking tests

* Incorporate PR feedback from team

* Working now

* Add specs specific to JSON being returned by "update" action

* Refactors and Bug-Fixes from PR review
2020-04-08 10:33:41 -04:00
Vaidehi Joshi
b72fc4c9f8
Remove variants from backend portion of onboarding (#7118) [deploy]
* Remove variants from backend portion of onboarding

Since we're no longer using variants in onboarding, we don't need this code anymore!

* Ignore unused column on user, onboarding_variant_version
2020-04-06 16:30:11 -07:00
Jibran Kalia
17037761a8
Add community_member_description, tagline and mascot_image_url to SiteConfig. Enable Cloudinary for primary_sticker_image (#7056) [deploy]
* Add community_member_description, tagline and mascot_image_url to SiteConfig

* extra space

* Add mascot_image_description field to SiteConfig

* Fix test
2020-04-06 18:09:45 +02:00
Guilherme Vinicius Moreira
806075dbe7
Refactor internal mods page (#7002)
* Refactor internal mods page

* Refactor code style suggestions
2020-04-03 10:41:09 -04: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
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