Commit graph

1172 commits

Author SHA1 Message Date
rhymes
dfbc1b3791
Disable service worker on social previews (#6209) [deploy] 2020-02-20 17:39:17 -05:00
Michael Kohl
4e208dc11c
Add cache_key helper (#6190) [deploy] 2020-02-20 17:36:49 -05:00
ludwiczakpawel
6d2c63026c
Homepage Improvements, round II (#6202) [deploy]
* remove border from ad and fix cut-off

* improving ellipsis for tags

* improving ellipsis for tags

* fixing underline between each tag on hover

* user avatars alignment in left sidebar

* test commit

* reverting test

* test commit

* reverting test

* index unassigned

* user suggestions in right sidebar on tag page, fixes

* improving widgets a little

* line height for category

* Update tests

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-02-20 17:12:56 -05:00
Ben Halpern
a73fc5a6a1
Add base element to open embed links in parent context (#6212) [deploy] 2020-02-20 17:08:11 -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
Jacob Herrington
a24a37c7a6
Add JS confirm to confirmation of user vomits (#6211)
Because confirming a User vomit is a particularly destructive task, we
want to make it a bit more intentional. Ben recommended adding a confirm
dialog for these reports.

This commit also satisfies erblint's complaints regarding the select
element in the ransack search form.
2020-02-20 12:44:03 -06: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
rhymes
0efa486f34
Remove unused code for users-index (#6204) 2020-02-20 10:50:03 -05:00
rhymes
bc385ae6d5
Switch decorators to Rails builtin decorations - take 2 (#6125) [deploy]
* Revert "Revert "[deploy] Switch decorators from Draper to Rails builtin decorations (#6040)" (#6122) [deploy]"

This reverts commit d438349550.

* Enable serialization for decorators

* Refactor and test default home feed serialization

* Improve spec

* Applied @vaidehijoshi suggestions

* Applied @citizen428 suggestions

* Make CodeClimate happy

* Cleanup stories_index_spec.rb

* Refactor UserDecorator#cached_followed_tags to loop less
2020-02-19 15:30:53 -05:00
Jacob Herrington
aee50e9ea0
Remove misleading FAQ file (#6180)
The FAQ page displayed in production is actually generated in internal
and it might be pretty misleading to folks who want to contributing by
improving our FAQ if they find this file in the codebase.

This has the benefit of clearing up any confusing that might arise from
finding this file and also having a placeholder if someone goes the faq
route in the their dev environment.
2020-02-19 14:14:08 -06:00
Josh Puetz
17953a06a5
Remove 'table' from JSON fields for user and organization (#6179) [deploy]
* Change naming of some fields in feed json

* Elimate the 'table' entry to OpenStruct
2020-02-19 14:00:56 -06:00
Josh Puetz
c2261d7ac7
Change naming of some fields in feed json (#6177) 2020-02-19 12:47:16 -06:00
Mohamed ABDELLANI
e351227bb0
Don't Allow Users To React to Unpublished Posts (#5969) 2020-02-19 13:41:35 -05:00
ludwiczakpawel
a77dfefc2a
Homepage UI Improvements (#5890) [deploy]
* de-emphasizing right sidebar: mostly colors & spacing

* adding a bit more love to typography in sidebar

* changing language on LISTINGS widget header

* hiding profile widget from left sidebar

* cards shadow now looks like a bit less random and annoying

* actually doing the same with all shadows! YOLO

* some spacing cleanups around sidebars

* this time some typography love

* im committing but not really sure what exactly

* adding a bit more love to feed card

* looks like i broke some other views.. time to fix em all

* cleaning up typography a bit more

* .

* separating empty search results styling

* created a card styling mixing to reduce some code.. also moved cheese around a bit

* several more cleanups

* improving responsiveness

* i fixed what i broke

* more cleanups

* org badge

* .

* ...

* responsiveness

* .

* some adjustments

* bring back profile card

* tiny logo adjustment

* bunch of further refainments

* typography

* a bit more refainments

* whoops

* bringing back CTAs styling to loggedout sidebar

* fixes to left tags in left sidebar after merge

* buttons fix

* fixing border-color

* Update app/assets/stylesheets/articles.scss

Typo!

Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>

* .

* css cleanup + double border on article page

* removing unnecessary comments

* get rid of loading glitch

* static vs fixed header

* Update system specs

* Update client test snapshots

* Further modify homepage specs

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-02-19 11:24:44 -05:00
Ben Halpern
055c826139
Add heroku slug commit to some cache keys (#6159) [deploy] 2020-02-19 09:07:32 -05:00
Josh Puetz
35c2800c89
Add json support at stories/index endpoint (#6070)
* Add json support at stories/index endpoint

* Tweak tests

* Add main image

* Some light refactoring in StoriesController

* Tiny test refactor

* Split feed generation to it's own controller

* Use Jbuilder for article formatting

* Blank lines thanks Rubocop

* Don't cache this response: we want it generated per use each time

* Whoops!

* PR changes and tweaks to Timeframmer constants

* Remove initializer test since arguments aren't required
2020-02-18 15:15:40 -06:00
Ridhwana
086b6ab202
Filter by 'approved:true' on the tags page (when a tag requires approval) (#6037)
* feat: we add the attribute for faceting

* feat: pass the requires_approval tag through with the dataset

* feat: if the tag requires approval then filter by the approved:true facet that we setup via algolia

* chore: false is redundant

* chore: robocop syntax improvement

* refactor: rename filters to tagFilters

* chore: standard javascript styleguide formatting

* chore: javascript styling

* Update app/assets/javascripts/initializers/initScrolling.js.erb

Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-02-18 12:44:51 -06: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
rhymes
6cbfb01394
Stop using legacy user's organization_id and remove followers unused code (#6079) [deploy] 2020-02-18 11:27:43 -05:00
Molly Struve
98f25e2b9d
Remove UserHistory Feature and PageViews from Algolia (#6127) [deploy] 2020-02-18 10:06:30 -05:00
Andy Zhao
6cb525900f
Add notification_id to honeybadger context (#6124) 2020-02-17 14:08:14 -05:00
Molly Struve
d23afcd7ef
Add safety navigators to handle a missing reply (#6121) [deploy] 2020-02-17 13:50:23 -05:00
Ridhwana
8641f0a93e
Update the number of Published Posts to match the approved articles where necessary. (#6098)
* feat: the number of published posts should show up by approved article.

* chore: Do not use spaces between -> and ( in lambda literals

* refactor: use the existing function in order to spawn the one where we need approval

* refactor: move logic to the controller instead of the view :)

* chore: code climate syntax

* chore: more codeclimate
2020-02-17 12:18:33 -05:00
rhymes
d438349550
Revert "[deploy] Switch decorators from Draper to Rails builtin decorations (#6040)" (#6122) [deploy]
This reverts commit cc53b55a4a.
2020-02-17 11:28:32 -05:00
Andy Zhao
7cf87c14de
[deploy] Delete notifications before comments are deleted and log w/ Honeybadger (#6084)
* Use Honeybadger to log notification errors

* Create a comment first to test if deleted

* Ensure notifications are deleted before comment
2020-02-17 09:51:05 -05:00
rhymes
cc53b55a4a
[deploy] Switch decorators from Draper to Rails builtin decorations (#6040)
* Convert SponsorshipDecorator to Rails decorator

* Remove empty ReactionDecorator

* Rename SponsorshipDecorator#level_color_hex to level_background_color

* Convert CommentDecorator to Rails decorator

* Add specs and fix bugs for NotificationDecorator

* Convert NotificationDecorator to Rails decorator

* Add specs and fix bugs for OrganizationDecorator

* Convert OrganizationDecorator to Rails decorator

* Add specs to PodcastEpisodeDecorator and fix bugs

* Convert PodcastEpisodeDecorator to a Rails decorator

* Add missing specs for ArticleDecorator and fix bugs

* Convert ArticleDecorator to Rails decorator

* Add missing specs to UserDecorator and fix issues

* Convert UserDecorator to Rails decorator

* Add .decorate_collection method

* Add decorator for AR relations and remove Draper

* Rename BaseDecorator back to ApplicationDecorator

* Rename .decorate_ back to .decorate

* Restore decorate_collection (WTH)

* Add decorated?

* Fix bugs and failing specs

* Decoration should always be explicit
2020-02-17 09:32:32 -05:00
Alex
b81c2e8df3
Remove delayed_job (#6071) [deploy]
* Update adapter to sidekiq

* Remove delayed_jobs routes

* Remove delayd_jobs initializer and references

* Remove delayed_job_spec

* Remove bin/delayed_job

* Remove app/jobs/

* Migration to drop delayed_jobs table

* Remove delayed_job_web & delayed_job_active_record

* Update docs

* Remove reference to delayed_job dashboard

* Remove delayed_job settings from initializers

* Add delayed_job_admin back to reserved words list
2020-02-14 10:00:26 -08: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
Michael Kohl
934d0a6cc3
Add placeholder to badge award text area (#6054) 2020-02-13 15:10:38 -05:00
Jacob Herrington
bc9fc6ee3b
[deploy] Autosize textareas for suggested tweets (#6056) 2020-02-13 11:42:44 -05:00
Vaidehi Joshi
f71c8b16e7
Allow dynamic authoring of welcome notifications (#6045) [deploy]
* Add "Welcome" type to Broadcasts, allow dynamic "authoring" of Broadcasts

This adds a new `type_of` to the Broadcast model: "Welcome". As we begin to create a new "welcome notification" workflow, we'll categorize them by making them all of the same type.

This also adds a concept of a "welcoming user", which can be set via an ENV var. The WELCOMING_USER_ID will allow us to explicitly set (and change) which user in the database is the one that "sends" welcoming notification. In production, we plan for this to be dev.to/sloan.

* Allow WelcomeNotificationWorker to accept + send any kind of broadcast

This abstracts out the logic of deciding which broadcast to send from the woker into the calling method. This will help us send many different kinds of welcome notifications using one, resuable worker class.

* Raise if a Notification can't be created

* Add STAFF_USER_ID as an ENV var

This is in preparation for moving away from SiteConfig.staff_user_id, and replacing it with an ENV var. We will need to set this in production first, and then make a separate PR to replace all instances of staff_user_id with the newly-set ENV var.
2020-02-12 13:50:37 -08:00
Michael Kohl
06d78e3676
Fix API documentation link (#6036) 2020-02-12 15:08:46 -05:00
Josh Puetz
38622317b7
Consolidate server side main article feed logic (#5953) [deploy]
* Consolidate `.decorate` calls

* Move Activerecord finders out of main stories feed partial

* Add back in decorates to sticky_articles partial

* Combine top and new articles returned from StoriesController

* Extract feed construction logic to a service

* Some PR tweaks (naming)

* Quick test fix
2020-02-12 08:43:20 -06:00
Andy Zhao
0f9b52f800
Use post instead of get for CSRF (#6026) 2020-02-11 17:56:11 -05:00
Nick Taylor
0119918237
Homepage left side bar tags followed (#5918) [deploy]
* SASS formatting in action.

* Unnested .sidebar-nav-element in SASS

* Created the <TagsFollowed /> component.

* Mini refactor.

* Left side bar uses <TagsFollowed /> component now.

* Accomodating InstantClick

* Small refactor and added some comments.

* The homepage webpacker pack only needs to be loaded once.

* Added tests for the <TagsFollowed /> component.

* Modified the receive InstantClick callback as per their docs.

* Reverted the data-no-instant on he homepage bundle. It seems to cause issues in certain scenarios.

* Just some tweaks to <TagsFollowed /> component.

* Removed CSS for general img tag in context of sidebar as it does not appear to be used.

* Fixed copy paste error from JSX to HTML.

* Fixed <img /> styles for arbitrary sponsorship widget.

* Fixed a regression that a Capybara test caught.

* Fixed user followed tags on home page tests.

* Fixed logic for loading user data on homepage.
2020-02-11 12:09:23 -05:00
Ben Halpern
30e2fd5017
Add /embed to list of disallowed path matches (#6019) [deploy]
In service workers, we should not be adding the shell to these views.
2020-02-11 10:24:33 -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
Anna Buianova
8fb9e4940d
Removed unused special_sidebar (#5929) 2020-02-10 10:24:56 -05:00
rhymes
c41d66e900
Replace ban/banned with suspend/suspended in user facing text (#5816) [deploy] 2020-02-10 10:12:53 -05:00
Anna Buianova
1c94ffb38e
Added template select to the pages admin form (#5952) [deploy] 2020-02-07 14:59:05 -05:00
Ben Halpern
2c07b08514
Add low-value landing pages to robots.txt disallow (#5944) [deploy]
* Add low-value landing pages to robots.txt disallow

* Update app/views/pages/robots.text.erb

* Update app/views/pages/robots.text.erb
2020-02-07 14:04:36 -05:00
ludwiczakpawel
45f2a6b542
removing border-box from shecoded landing page (#5949) 2020-02-07 11:08:46 -05:00
Sebastien
665f5aac0f
Refactor ProfileImage (#5803) 2020-02-07 08:56:16 -05:00
Michael Kohl
4872422373
Remove extra whitespace from text inputs in Buffer share (#5924) [deploy] 2020-02-06 15:18:58 -05:00
Andy Zhao
975a716e5e
Use simpler messaging for ghost account deletion (#5906)
* Use simpler messaging for ghost account deletion

* Add 'have questions' section

* Use same language for confirm destroy page
2020-02-06 14:31:18 -05:00
Deepu K Sasidharan
5194c009ce
Style: update height of speakerdeck tag to be avoid scaling (#5818)
* style: update height of speackerdeck tag to be avoid scaling

* style: remove incorrect padding and margin from speackerdeck tag

* add a comment
2020-02-06 14:29:34 -05:00
rhymes
fd5643bc9d
Improve API controllers efficiency by selecting only columns needed for serialization (#5805) [deploy] 2020-02-06 07:36:56 -05:00
rhymes
a95877e8ff
Use cleverer patterns to fetch/iterate AR objects when checking presence (#5833) [deploy] 2020-02-05 08:21:20 -05:00
Vaidehi Joshi
a396d024de
Remove quotes from broadcast options in internal form (#5904) [deploy] 2020-02-04 12:37:28 -08:00
Michael Kohl
9e6a363cfc
Add readonly ApplicationConfig to /internal/config (#5662) [deploy]
* Add readonly ApplicationConfig to /internal/config

* Incorporate PR feedback

* Remove spurious div
2020-02-04 15:13:34 -05:00