Commit graph

287 commits

Author SHA1 Message Date
Fernando Valverde
154a3629ee
Add Native bridge video support (#9303) 2020-07-20 11:22:32 -04:00
Pavel Tkachenko
9e94b80741
[deploy] Add local_date helper to handle dates with respect of user timezone (#9285)
* Add local_date helper to handle dates with respect of user timezone

* Fix date timezone bug for articles/show

* Fix date_helper to meet system specs requirements
2020-07-16 08:45:44 -06:00
Vaidehi Joshi
2fadc24d28
Fix TypeError: null is not an object in initializeArticleReactions.js (#9297) [deploy]
* Fix TypeError: null is not an object in initializeArticleReactions.js

Should fix https://app.honeybadger.io/fault/67192/6f9b4fdf475e2229c968fa26d785b90f

* Return 0 rather than undefined if reactionEl doesn't exist
2020-07-14 08:12:07 -07:00
Vaidehi Joshi
3391593de1
Fix TypeError: userData is null in initializeOnboardingTaskCard.js (#9298) [deploy]
* Fix TypeError: userData is null in initializeOnboardingTaskCard.js

Should fix https://app.honeybadger.io/fault/67192/65045742fda3390a067960f53a894e87.

* Combine return statements in initializeOnboardingTaskCard
2020-07-14 07:32:57 -07:00
Rembrandt Reyes
14b410cb39
Article page: edit and manage button spacing (#9230) 2020-07-10 11:54:57 -04:00
Michael Kohl
fb27f52ed0
[deploy] Display banner if site hasn't been configured (PRE DEPLOYMENT TASKS) (#8435) 2020-07-07 07:37:04 -05:00
ludwiczakpawel
30c9175f80
Tags index design update (#9072)
* flare tag line height

* .

* dropdown fix + actions bar fix

* actions bar on mob

* .

* .

* js

* little updates

* improve contrast ratio

* Remove unused id and duplicated element id

Co-authored-by: rhymes <rhymes@hey.com>
2020-07-06 11:43:58 +02:00
Yash Dave
5c1222d912
fix lint errors in initializeSwipeGestures (#8972)
Co-authored-by: Nick Taylor <nick@iamdeveloper.com
2020-07-05 14:20:49 -05:00
Nick Taylor
322628c4ef
[deploy] Fixed remaining lint issues in the frontend. (#9093) 2020-07-03 08:00:25 -05:00
Ben Halpern
4a8936a18e
[deploy] Slight fix in dropdown menu code (#9095) 2020-07-03 00:08:22 -04:00
Nick Taylor
dcc882c0c5
[deploy] Fixed the three dot menu on the article page. (#9088) 2020-07-02 21:13:26 -04:00
Ben Halpern
2a31f7b9de
[deploy] Remove report-abuse link from base HTML document into JavaScript (#9059) 2020-07-01 16:29:22 -04:00
Vaidehi Joshi
38ae790183
Do not render active announcements in iframes (#8981) [deploy]
* Do not render active announcements in mod tools

* Add a TODO around refactoring broadcast initialization

* Refactor initializeBroadcast to short-circuit on window.frameElement
2020-06-29 11:15:27 -07:00
Fernando Valverde
a7c56034a2
Fixes archived button in dashboard for PWA (#8930) 2020-06-26 11:26:12 -04:00
ludwiczakpawel
c9c88c7cc1
[deploy] Dashboard updates (#8879)
* flare tag line height

* .

* .

* .

* .

* specs

* spec

* .

* init

* .

* .

* js refactor

* js

* update spec

* Fix infinite scroll

* typo

* move IF

* pro analytics link fix

* Clean up tests

* Refactor adding of html

Co-authored-by: benhalpern <bendhalpern@gmail.com>
2020-06-25 13:10:17 -04:00
rhymes
9cdd03f0dc
Fix typo in dashboard sort element (#8875) 2020-06-24 08:03:27 -04:00
ludwiczakpawel
8c83aa3365
Table component & Dashboard update (#8778)
* flare tag line height

* .

* .

* .

* .

* specs

* spec

* .

* spec
2020-06-22 18:47:17 +02:00
Molly Struve
3d4a079572
[deploy] Refactor: Remove Additional Content Box Code (#8776) 2020-06-22 10:36:23 -05:00
ludwiczakpawel
9c471640b6
Footer redesign (#8684)
* flare tag line height

* .

* init

* moar

* user siteconfig for mascot

* .
2020-06-18 12:52:03 +02:00
ludwiczakpawel
16f4d7d46a
[deploy] Article Design update (#8234)
* flare tag line height

* .

* init

* widgets

* widgets lists

* new tabs on home

* instantclick

* .

* rethinking css

* .

* .

* empty space

* init

* campaign widget

* .

* merge

* .

* update layout

* fix sidebars on home page

* .

* fix onboarding x

* test

* spec

* test

* toolbar fix

* more

* test

* better handling ads

* .

* spec

* card border

* .

* .

* actions bar

* cleanup

* animation

* test

* button width

* .

* better responsiveness and author boxes

* meta info

* padding

* better animation

* optimize videos

* fixes

* spec

* .

* codeblocks in comments

* whoops

* Use .present? correctly as it preloads items

* sticky nav

* Update app/views/articles/_sticky_nav.html.erb

I don't know what I'm doing but @benhalpern says so! e8c0f337a5 (r440248874)

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>

* Update app/views/articles/show.html.erb

I don't know what I'm doing but @benhalpern says so! e8c0f337a5 (r440247802)

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>

* little fixes

* Update app/assets/stylesheets/article-show.scss

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>

* pawel updating ruby code......

* actually better merge

* semantic updates

* .

Co-authored-by: rhymes <rhymesete@gmail.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-06-17 09:57:57 -04:00
Lisa Sy
5e1fc2c4cd
Update connect chat container (part 2) (#8717) [deploy]
* Update chat container of Connect

- Rename certain class names to improve BEM syntax and naming
- Update typography of message cells
- Update header of message area
- Use new 'info' icon to expand sidebar
- Update form fields for both writing and editing a message
- Implement Crayons styling for 'delete' modal

https://github.com/thepracticaldev/dev.to/issues/8437

* Update some tests aand class names

* Update tests

* Update info icon

* Update reference
2020-06-16 15:15:59 -07:00
Ben Halpern
b51647c59a
[deploy] Remove unnecessary comment links and clean up logic (#8686)
* Remove unnecessary comment links and clean up logic

* Fix links
2020-06-15 17:40:21 -04:00
Vaidehi Joshi
38993608cf
Hide active announcements from logged-in users on the editor (#8427) [deploy] 2020-06-11 16:02:54 -07:00
Vaidehi Joshi
a3665406d5
Hide site-wide messaging for opted-out users (#8409) [deploy] 2020-06-11 11:34:04 -07:00
Vaidehi Joshi
e532ccbe42
Allow users to dismiss announcements (#8396) [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.

* Add a "x" close button to announcements, fix styling to accommodate it

* 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.

* Clean up preview CSS, import broadcast styles into preview

* Add close button click handler, clean up initializeBroadcast

* Add close functionality to announcement banner

Also hide announcement if the user has explicitly seen and "X"-ed out of it.

* Add system specs around rendering + dismissing broadcasts

* Add some (truly beautiful) JS documentation

* Add visible class to broadcast when previewed from internal
2020-06-11 08:24:43 -07: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
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
icncsx
d86b9d9ce5
Replace querySelector and getElementsByTagName when selecting for head and body (#8315)
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-06-08 20:08:40 -04:00
Vaidehi Joshi
f04b0a7336
Display site-wide announcements (#8301)
* Serialize broadcast_data within AsyncInfoController::base_data

Adds a `broadcast:` key to our `base_data`, regardless of whether a user is logged in or not.
If a broadcast is not present, passes along a `nil` value.

* Initialize active broadcast (if present) when rendering main page

* Allow admins to preview a broadcast's processed_html when editing

* Add some fixed position styling to active broadcast

* Add system specs around broadcasts on homepage

* Use sanitize in place of html_safe when previewing broadcast

* Do not initialize broadcast if no broadcastData available

* Render default value on broadcast in options_for_select

* JS cleanup

* Unset fixed positioning for static navbar config

Also add some default styling for an active broadcast
2020-06-08 13:52:53 -04:00
Andy Zhao
885e042d31
[deploy] New Feature: Mod Actions Panel (#7777)
* db

* Add an iframe to host mod actions menu

This iframe is probably the fastest way to get a working mod actions
menu without rewriting existing code. We may eventually re-write this,
but based on Ben's recommendation we are going to go with an iframe
because it gets us a working feature quickly and it seems to be serving
us well in other parts of the application.

* Add the mod actions menu button to articles

When the user is "trusted" they will see a small badge on the lower
right-hand side of the screen. Clicking the icon reveals the mod actions
menu.

* Add header to actions panel (#7395)

* Update iframe border

* Add 'Moderate Post' header and button

* Use inline SVG over <img src='svg'>

* Use Crayons variables for units

* Use flexbox to center chevron

* Add accidentally deleted positioning

* Add chevron-right.svg

* Use a partial for actions panel and revert /mod page

* Load actions panel in iframe and not /mod

* Style UpVote, DownVote and Vomit buttons (#7421)

* Add a iframe to host mod actions menu

* Up and Downvote Icons

* Starting with vomit button

* Completed UI; interactions pending

* Incorporated Andy changes; making mod action-panel

* space reactions away from header

* UI tweaks and corrections 1

* Fixing styles to match crayons

* choose pure white color css variable

* Add thumbs-up emoji; address Lisa comments

* Trying to fix reactions interactions

* remove clearThumbReactions function

Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>

* Add bottom layout for actions panel (#7501)

* WIP for Lisa

* Finalize mod actions bottom section

* Use showing instead of hidden for transition

* Add new optimized SVGs

* Fix weird height issues for actions panel

* Move hover styles below the cascade, yo

* Use margin-top for sticky footer over height: 100%

* Move initialize actions panel button to Webpack (#7506)

* Move actions panel JS code to webpack

* Refactor and use destructuring

Thanks @nickytonline!

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

* Rename file

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* Configure Experience Level options for Mod Action Panel (#7507)

* Add a iframe to host mod actions menu

* Click interactions (no toggle of dropdowns yet)

Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>

* Fix the iframe's path (#7509)

* Toggle the 'Set Experience Level' menu on button-click (#7529)

* Add a iframe to host mod actions menu

* Add set-exp dropdown functionality

* WIP: making exp level updates async

* Completes async implementation

* Fix controller for "actions_panel" and "/mod"

Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>

* Add close button interaction (#7552)

* Rename actions panel pack file

* Add close button toggle to actions panel

* DB update

* Move more code to Webpack and add conditional tag adjustments section (#7652)

* Move JS code to Webpack

* Clean up a few style issues

* Add styling for tag adjustments

* Add active/inactive functionality

* Add conditional rendering for tag adjustments section

* Add missing variable oops (#7673)

* update with upstream

* Add missing subtract svg (#7695)

* Create 'Flag User' modal (#7626)

* Add a iframe to host mod actions menu

* Starting task

* Phase 1

* Fix "Close Modal" icon

* Implement open modal

* Working on all "Close Modal" actions

* Almost-complete implementation

* Remove Abuse Report snackbar

* Delete unneeded JS code

* Remove "How does this work?" links

* Link to Community Moderation page

* Addressing code review corrections

* Update api call to use "request" method

* Make else path clearer in api call

Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>

* Mod Actions Panel: Prevent nonsensical reaction pairs (#7699)

* Still implementing

* Completed Implementation

* Address code review feednack; refactor "create" method

* Move scss variables to native-css (for ModPanel code only)

* Correct missing native css

* update to native-css again

* More sccs -> native-css fixes

* Adjust ModPanel Button position on mobile (#7744)

* Adjusted ModPanel position on mobile

* Better adjustment

* Fix phantom schema.rb changes

* Fix phantom schema.rb changes

* Finalize tag adjustments (#7740)

* Finalize tag adjustments and flow

* Fix logic for rendering adjust tags options

* Clean up alert response

* Rename user to trusted user

* Use new CSS variables

* Add/remove tag on article's tag section after adjusting

* Fix logic for admin tag input and some other niceties

* Final bug fixes mod panel (#7772)

* Use correct boolean statement

* Clear the value of the textarea not div

* Use the correct attribute

* Use actions panel for /mod page (#7775)

* Fix loading logic with tag adjust button conditional render

* Link to tag moderation for adjust tags section

* Use top over window.parent

Thanks @nickytonline!

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* Use Webpack alias to import

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* Use place-items shorthand over align-items + justify-content

Thanks @nickytonline!

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* Fix typo for utilities

* Add new line to end of file

* Disable linter for use for top function

* Use align-items and justify-content center

* Update SVGs to spec

* Remove unnecessary height and use spacing units for open button

* Remove accidentally added comment

* Error handling when selecting reactions; optimize "reactions.each" loop

* Add comment about clearing innerHTML

* Revert schema back to master

* Use each since there should only be two reactions

* Fix typo oops

* Add missing height oops

* Return if there are no reactions to be destroyed

* Center path with GUI tool shrug

* chose more appropriate name for JS pack; rewrote api calls using async-await

* Rename variables and methods and check categories before clearing

* Use addSnackbarItem instead of hardcoded version

* Place articleModerationTools pack behind user_signed_in

* Correct omission

* Implement dynamic imports for ModPanel tools

* Implemented async/await; added snackbar message for null response use-case

* Fix the "/article/mod" page; make sure all reactions, vomit-user and exp-level working as expected

* Update language to reflect new UI

* Close the modal after the "Confirm Action" button is clicked

* Change text for Spam/Abuse button

* Fix schema to use with master

* Update schema to master again

* Use crayons button for actions panel button

* UI tweak to play nicer with site themes

* Make actions panel work for dev.to/mod

* Add snackbar for reactions

* Update how does this work links

* Add "thumbsup" reactions to logging

* Add thumbsup to categories

* Add external link icon

* Changes to reflect "Privileged" and not "Negative" reactions; spec changes pending

* Updated instance variable

* Starting to update the specs

* Update "thumbsup" points from 10 to 5

* Still working on both requests

* Embracing an easier implemantation (thanks Andy!)

* Add tests for actions panel

* Add some basic tests for actions panel

* Change to flag to admins

* Indicate that 'Reason for Tag adjust' is required

Co-authored-by: Mac Siri <krairit.siri@gmail.com>

* Rename negative_reactions to privileged

* Update rating level to use correct values

* Use a different display value than backend value

* Don't show adjust tags for trusted users

* Add specs for moderation_routes for admin and super_admin

Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2020-06-08 13:24:18 -04:00
ludwiczakpawel
39295c0bea
Layout updates (#8107)
* flare tag line height

* .

* init

* widgets

* widgets lists

* new tabs on home

* instantclick

* .

* rethinking css

* .

* .

* empty space

* campaign widget

* .

* merge

* .

* update layout

* fix sidebars on home page

* .

* fix onboarding x

* spec

* test

* test

* better handling ads

* .

* spec

* card styling

* .

* i dont know what have i broken
2020-06-04 16:12:17 +02:00
Molly Struve
38634e5316
[deploy] Optimization: Remove Comment Count From Aysnc user_data (#8174) 2020-06-01 10:38:57 -05:00
Fernando Valverde
bf740ac5d8
[deploy] Podcast Player native bridge calls refactor to use message based communication (#8054)
* Podcast native bridge calls now message based

* Resets current time to 0 when initializing
2020-05-27 11:14:31 -04:00
rhymes
ce28c0b5e5
[deploy] Remove ERB pre-processing from pure JS files and cleanup (#8030) 2020-05-27 08:25:39 -05:00
ludwiczakpawel
975ddc61c4
Home Feed Tabs - Crayonsified (#7976)
* flare tag line height

* .

* new tabs on home

* instantclick

* Some JS cleanup for mobile view select event handler.

* eslint cleanup

* select arrow color

* quotes

* quotes

* .

* .

* omg

* .

* finally

* focus visible

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-27 14:48:18 +02:00
Andy Zhao
c42fd3461e
[deploy] Rename positive_reactions_count to public_reactions_count in logic (#7926)
* Rename positive_reactions_count to public_reactions_count

* Add positive reactions count back in so we can remove it

* Use public_category method for reactions

* Add positive_reactions_count in case any old caches rely on it

* Add positive_rxn_count to account for API endpoints

* Remove unused method

* One more spot...

* Add method back in because of caches

* Update specs to match new functionality

* Fix typo

* Remove unused methods
2020-05-26 12:36:28 -04:00
Ben Halpern
cde008c0a9
Add current state to nav bar links properly (#8045) 2020-05-25 12:00:21 -04:00
benhalpern
cca7729198 Add page view tracking to comment permalinks 2020-05-23 14:08:28 -04:00
Molly Struve
1c461f8891
[deploy] Remove Unused Pro Memberships (#7894) 2020-05-20 11:54:30 -05:00
Dmitry Maksyoma
f63c7f9289
Fix Runkit tags not being activated when comment is added (#6767)
* Fix Runkit tags not being activated when comment is added

* Runkit tag activation was ran once, on page load. I've changed it to
  run on on comment preview and submit.
* It was necessary to add a check to skip already activated Runkit
  tags. The code didn't take into account that a tag could be already
  processed, and would just crash.

* Fix Runkit tags and add tests

* Add test for previewing article with Runkit tag

* "Fix CodeClimate not finding waitForRunkitAndActivateTags()

* Refactor a test for readability

* Make Rubocop happy

* Improve test for previewing article with Runkit tag

* Use one method for determining active Runkit tags

* Defer loading of JS from embed.runkit.com

* Add utility function dynamicallyLoadScript(url)

* Switch to dynamic loading of Runkit

* parsed content code block is also hidden now to avoid displaying <code /> block before runkit iframe loads.

* Fix Runkit test

* Remove Runkit script caching in v2 form

* Use <%== instead of .html_safe in v2 form

* Update app/assets/javascripts/utilities/dynamicallyLoadScript.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-15 14:27:46 +02:00
ludwiczakpawel
e17cbd3efb
NOT MERGE Add tabs to Crayons and to the notifications page (#7737)
* tabs

* frontned

* notifications tabs

* ntofiications

* .

* doc

* names instead of slugs

* flare tag line height

* .

* js
2020-05-14 11:38:57 +02:00
Josh Puetz
2abe830377
[deploy] Home Page Feed redesign + top comments (#7579)
* feed cards

* frontend

* preactify

* preactify

* .

* fix

* fixing things and adding dropdown

* whoops.

* whoops 2.

* revert body bg color change

* search snippet

* search snippet

* get rid of featured article

* get rid of featured article...

* cover to its own component

* videos

* videos

* reading time

* small-save-filled asset

* author adjustments

* adjustments

* Author --> Meta

* whoops.

* loader

* logged out state

* .

* dropping what's not needed for now

* better name for cover

* get rid of nav overflow

* bringin comments placeholder back

* bringing comments placeholder back

* publish date

* fix

* date

* .

* save button icon

* ghost button

* lets skip the icon for saving for now

* more buttons

* counting logic

* Display top comments on homepage feed

* Comment list and item components

* Remove 'Top Comments' title

* Remove subscribe button, add reading time

* Update snapshots and tests

* Fix article and follower scrolling

* Added reading time

* (Try) to do flare tags

* Button component from Pawel

* More button styles from Pawel

* Comment count style from Pawel

* Handle empty parens for age on older articles

* Dont show 'more comment' button for more than 2 comments

* cover ratio

* flare tag

* cover fix

* fix buttons

* more button fixes

* tags fix

* responsiveness fix

* reading time  + a bit of responsiveness

* Reading time in more places

* snapshots

* default color for flare tag

* Update CommentsList test snapshot with new styles

* fixing search results

* fixing buttons

* Fix podcast card tests by updating snapshots

* Line clamping for top comments

* Reflect save button state after click before mouseout

* Now the entire feed card is clickable. (#7638)

* Now pointer cursor is only on feed posts. (#7727)

* Revert podcast card styling

* Update test snapshot

* merge

* Fix rspec on feed page

* Reduce complexity of class check for feed card clicking

* PR feedback/fixes

* Fix featured article test and snapshot

* Last minute test tweaks

* clean up crayons

* padding issue + empty div

* Correct merge error

* Fix search results tests

* Test fixes and snapshot updates

* themes

* podcasts colors

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-12 07:57:57 -05:00
Mac Siri
3cdac45deb
Create notification page spec (#7702) 2020-05-11 12:15:07 -04:00
Molly Struve
ea1d38d3b8
[deploy] Bulk Fetch Follow Button Data for Users (#7676) 2020-05-08 13:58:58 -05:00
Mac Siri
82ab9f820b
[deploy] Move first-nav-link from dynamic JS to erb (#7698) 2020-05-07 10:23:30 -04:00
Fernando Valverde
8f567524f7
Adds an extra check for Android Native app for playing podcasts (#7651) 2020-05-01 15:04:26 -04:00
Fernando Valverde
96c27ecdc6
[deploy] Android native audio feature support (#7554)
* First commit Android Bridge for Podcasts

* Working Android Bridge controls

* Adds Android metadata message & cleans up a couple longs functions

* Brings back use strict

* Cleans up a bit the conditional for either ios/android native players
2020-05-01 13:09:05 -04:00
Lisa Sy
9de59c4107
Update sidebar filter menu on Notifications (#7394) 2020-04-27 12:17:20 -04:00
rhymes
d87c3dbb18
[deploy] Improve comment posting error handling (#7519)
* Improve comment posting error handling

* Incorporate PR suggestions
2020-04-27 16:54:59 +02:00
Molly Struve
4ab202ab0a
[deploy] Execute Reading List searches in Elasticsearch (#7440)
* Execute Reading List searches in Elasticsearch

* add additional readinglist front tests
2020-04-24 10:30:17 -04:00