Commit graph

350 commits

Author SHA1 Message Date
Nick Taylor
5e677daac1
Homepage feed components (#6052)
* wip - <PodcastArticle /> component.

* Added filler user avatar for other article types.

* Added <LoadingArticle /> component.

* wip

* wip on <Article /> component.

* Added <Article /> component to barrel file.

* Deleted assets from dummy storybook assets folder.

* Updated podcast article story avatar.

* More work on <Article /> component.

* Refactoring Storybook stories.

* Refactored so main component is just the <Article /> component.

* Added a missing video article property.

* Some refactoring of <Article /> component.

* Added Storybook knobs addon.

* Now <Article /> component supports an isBookmarked prop.

* Fixed podcast Storybook story.

* Made the knobs Storybook addon the first tab

* Added more <Article /> Storybook stories.

* More <Article /> component tweaks.

* Added publish time to <Article /> component stories.

* Made the timeAgo function compatible with Preact.

* Added loading="lazy" attribute to <img /> in <Article /> component.

* Added <Article /> Storybook story for past published date.

* Fixed publish date for <Article /> story data.

* Scrapped random avatars.

* Added snapshots for <Article /> component.

* Added snapshots for <LoadingArticle /> component.

* Now test article entities are shared.

* Fixed some wording of Storybook stories.

* Breaking up Article.jsx to make codeclimate happy.

* Now <Article /> component receives icon props.

* Added knobs for <Article /> icon props.

* Added *.stories.jsx to codeclimate exclusion list.

* Added **/*.stories.jsx to codeclimate exclusion list.

* Alright now we have the good glob for excluding Storybook from codeclimate 😆

* Added org headline changes from low hanging fruit PR.

* Updated <Article /> snapshot for org headline.
2020-02-19 11:39:13 -06: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
Zachary Dixon
cf2af6c2dc
Add dropdown menu to listings (#4184) [deploy]
* Resolves 2826, add dropdown menu to listings

* Fixed dropdown position

* Refactored single listing

* Revert schema.rb to master

* Fixed tests
2020-02-18 18:08:39 -05:00
Molly Struve
98f25e2b9d
Remove UserHistory Feature and PageViews from Algolia (#6127) [deploy] 2020-02-18 10:06:30 -05:00
Nick Taylor
a7dc893f50
Updates to Storybook for home page makeover. (#6130) 2020-02-18 08:42:37 -06:00
Nick Taylor
bd24cf2a05
Updates/adds to prop-types for homepage feed makeover. (#6128) 2020-02-18 08:09:50 -06:00
Nick Taylor
9696e63034
[deploy] Made changes to timeAgo function for Preact component usage. (#6083) 2020-02-17 10:04:38 -05:00
Molly Struve
7ff79f77b8
Search Tags in Elasticsearch from Classified Listing and Post Creation (#6024) [deploy] 2020-02-17 08:16:45 -05:00
Jacob Herrington
bc9fc6ee3b
[deploy] Autosize textareas for suggested tweets (#6056) 2020-02-13 11:42:44 -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
Frederico Hasegawa
7436e70158
Onboarding JS: refactor function out of repetitive blocks (#5564) [deploy] 2020-02-06 16:00:57 -05:00
Nick Taylor
f2b79a94dd
Removed isRequired for whole user entity (#5902)
This is already done in components that consume these PropTypes
2020-02-05 17:52:53 -05:00
Nick Taylor
261a4f9efa
Add common tag PropTypes (#5882) 2020-02-05 17:38:43 -05:00
Vaidehi Joshi
b09a0c60f3
Add comment to highlight difference between previewing in v1 and v2 editors (#5894)
A follow-up to https://github.com/thepracticaldev/dev.to/pull/5873.
2020-02-04 08:32:06 -08:00
Nick Taylor
59f5cd7e07
Cleanup proptypes exports (#5874) 2020-02-03 17:52:23 -05:00
Vaidehi Joshi
db3e6128ac
Render main image in article preview for v2 editor (#5873) [deploy]
Previewing a main image on an article was broken in v2 of the editor :(
We had some tests for this (which I wrote), but the setup for the tests weren't quite right!
This commit fixes the bug, and also refactors and cleans up our tests quite a bit.
Also adds some snapshots for both v1 and v2 editors in a "no image" preview state.
2020-02-03 16:58:11 -05:00
Sun-Li Beatteay
a86ccff096 fix firefox tags 'View Rules' bug (#5732) [deploy] 2020-01-27 12:53:11 -05:00
Jacob Herrington
3e99fb527f Add StimulusJS and Refactor Internal article_script (#5539) deploy]
* Add StimulusJS 1.1.1

Because:
- Internal will likely need more interactivity going forward
- Vanilla JS and jQuery are great, but aren't quite as organized as we
might like
- Stimulus fits our model of what internal should be (imo)
- Adopting Preact or something with templating would require rewriting a
bunch of erb (that is currently working just fine)

Stimulus is a JavaScript framework that directly compliments turbolinks
and the approach vanilla Rails takes to JavaScript. I've set it up to
specifically be used in the internal views where we are currently using
jQuery and vanilla JS. I think we should chip away at the vanilla JS
currently in place with this, which appears to be both scalable and
pragmatic exactly the sort of tool we want for building our internal
tools.

* Replace crufty article JS with Stimulus

I'm swapping out some of the stuff going on in article_script.erb with
some StimulusJS, it seems like a good test case for Stimulus.

This lets us organize the code a little more intentionally and hopefully
fixes a small performance complaint that Michael had.

* Rename uncommunicative methods

* Add unit tests for Stimulus classes

* Move Stimulus code to javascript/internal
2020-01-24 16:00:24 -05:00
Ben Halpern
8ed94c8fb1
Add conditional to prevent superfluous rerenders in chat compose (#5705) [deploy] 2020-01-24 11:23:48 -05:00
Sarthak Sharma
75608e3e55 Feature🚀: Ability to mention anyone in open chats and notify them (#5460) [deploy]
* 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

* Feature 🚀 : Ability to mention member in Group [Frontend]

* Test Cases📝 : Test Cases added

* Feature 🚀 : Ability to mention member in Group [Backend]

* Bug Fix 🐞: Making messages realtime for open channels

* Feature 🚀 and Bug Fix 🐞: Ability to get notification if mentioned in open messages and increasing message number count

* Feature 🚀 : Ability to remove message count on channel open

* Bug Fix 🐞: Making Notification more reliable by checking if the new message is notified to user or not

* Feature 🚀 : Ability to metion @all and notify them

* Bug Fix 🐞: Minor fixes

* Fews tweaks in code

* Bug Fix 🐞: Feature was not present for Invite only Section

* Bug Fix 🐞: In open channels one can't mention all

* Bug Fix 🐞: Markdown conversion for all only in case of invite only

* Specs added

* Delete schema.rb

* Schema file updated

* Code refactoring

* Further Code refactoring backend

* Further Code refactoring backend

* Bug Fix 🐞: Mention List error problem in switching tabs

* Test Snapshots added

* Feature 🚀 : Ability to mention member in Group [Frontend]

* Test Cases📝 : Test Cases added

* Feature 🚀 : Ability to mention member in Group [Backend]

* Bug Fix 🐞: Making messages realtime for open channels

* Feature 🚀 and Bug Fix 🐞: Ability to get notification if mentioned in open messages and increasing message number count

* Feature 🚀 : Ability to remove message count on channel open

* Bug Fix 🐞: Making Notification more reliable by checking if the new message is notified to user or not

* Feature 🚀 : Ability to metion @all and notify them

* Bug Fix 🐞: Minor fixes

* Fews tweaks in code

* Bug Fix 🐞: Feature was not present for Invite only Section

* Bug Fix 🐞: In open channels one can't mention all

* Bug Fix 🐞: Markdown conversion for all only in case of invite only

* Specs added

* Code refactoring

* Further Code refactoring backend

* Further Code refactoring backend

* Bug Fix 🐞: Mention List error problem in switching tabs

* Test Snapshots added

* Feature 🚀: Ability to navigate through user list with keyboard only

* Bug Fix 🐞: Changing color of group avatars in dark themes

* Bug Fix 🐞: Setup pusher channel for open channels also
2020-01-23 18:06:35 -05:00
Vaidehi Joshi
9fb8875085 Use the correct cover image in article form preview (#5660) [deploy]
Fixes #5630, wherein the cover image from the article data was appearing in the preview.
2020-01-23 17:06:06 -05:00
Mac Siri
5f020860af Allow for proper deselect of email_newsletter (#5675) 2020-01-23 16:59:17 -05:00
Ben Halpern
24246015bc
Move Chart.js to dynamic import (#5576) [deploy] 2020-01-18 20:46:35 -05:00
Ben Halpern
b3c3f5ab1f
Add onboarding sanetization (#5575) [deploy] 2020-01-18 19:16:23 -05:00
José Chaves Neto
eff7bac9d8 refact: refactor userDetails (#5467) 2020-01-16 14:02:49 -05:00
Mehdi Vasigh
29a734b698 fix totalCount getting an array instead of a number (#5359) 2020-01-09 09:47:55 -05:00
rhymes
040b36bceb Fix event propagation for click on tag rules in editor (#5280) [deploy] 2020-01-02 13:04:16 -05:00
dependabot-preview[bot]
b5db5b19a9 Bump jest-fetch-mock from 2.1.2 to 3.0.0 (#5207) 2019-12-26 15:29:06 -05:00
Ben Halpern
737310f8ef
Add ability to open /new in connect sidecar (#5220) [deploy] 2019-12-23 09:11:02 -05:00
Sarthak Sharma
bb570a2d55 Bug Fix 🐞: Fixing missing edit and delete option (#5200)
* 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

* Bug Fix 🐞:  Fixing missing edit and delete option
2019-12-23 08:20:15 -05:00
Ben Halpern
5812ecc383
Open /connect sidecar links in iframe (#5203) [deploy]
* Use iframe for connect sidecar

* Modify css of lefthand sidebar

* Add proper sidecar markup

* Update tests
2019-12-21 15:46:36 -05:00
Ben Halpern
cb3a0c462c
Separate chat channel unopened status from Algolia (#5198) [deploy] 2019-12-21 13:05:16 -05:00
Sarthak Sharma
b602b7b91f 🚀Feature/ability to edit messages (#5139) [deploy]
* 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

* Refactoring🔩: Refactoring for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Test Cases📝 : Test Cases for edit message added

* 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

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* Refactoring🔩: Refactoring for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Bug Fix 🐞: Added space between edited and timestamp

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2019-12-20 10:19:00 -05:00
Ben Halpern
4349843c05
Frontend bug fixes (#5158) [deploy]
* Frontend bug fixes

* One line fix
2019-12-17 10:56:51 -05:00
Dan Ingenthron
12dae72b72 Refactor/lint onboarding slides (#4240) 2019-12-16 17:22:59 -05:00
Ben Halpern
630c1b7425
Migrate to streaming app shell via serviceworkers (#5020) [deploy]
* Initial work for streaming app shell way of using serviceworkers

* Close in on serviceworker adjustment finalization

* Add docs and loading indicator

* Remove useless code

* Don't run on API

* Update app/javascript/contentDisplayPolicy/hideBlockedContent.js

* Fix small details

* Don't run serviceworker.js code in test env

* Fix JS in serviceworker

* Move private keyword to proper place in async controller

* Change shell_version to HEROKU_SLUG_COMMIT

* Update caching config

* Add test for async_info/shell_version
2019-12-16 12:21:33 -05:00
James George
f03867f77d refactor: use Array.includes instead of indexOf (#5117) 2019-12-16 08:10:44 -05:00
Andy Zhao
71157c993e Hide comment feature (#4944)
* Add MVP of hide comment feature

* Slight copy adjustments

* Remove unused file oops

* Fix strange styling issues

* Add hide/unhide comment specs

* Authenticate user for hide/unhide

* Add tests for hide/unhide functionality

* Remove opacity CSS for hidden comments

* Fix hidden comment explanation logic

* Fix some styling issues

* Fix hiding top level comment logic

* Show only hidden comments in permalink and not thread

* Hide subtree properly if hidden comment

* Fix weird CSS issue

* Properly hide comments for permalink view

* Show children comments in permalink view

* Add tests for comment hiding visibility

* Remove superfluous code and adjust copy

* Remove some more logical duplication

* Add dedicated article column for any comments hidden

* Add reload in test
2019-12-10 15:09:47 -05:00
Ben Halpern
c746da3a5e
Remove unused "Edit" button as follow-on to #5056 (#5071) [deploy]
* 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

* Remove edit button and modify css
2019-12-10 14:15:56 -05:00
Sarthak Sharma
4db5399ee8 Feature🚀: Ability to Delete Messages realtime (#5056)
* 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
2019-12-10 13:58:34 -05:00
Ben Halpern
c7ed970c02
Change copy on jump back button in /connect (#5001) [deploy] 2019-12-03 16:07:17 -05:00
Sarthak Sharma
147b0936df Feature🚀: Ability to see chat history by scrolling up (#4903)
* Feature🚀: Ability to see chat history by scrolling up

* Test samples updated

* Feature Enhancement 🛠 :  Jump back to recent messages

If you scroll far away just click this button to go back

![img](https://i.imgur.com/HlhB8Up.gif)

* Test case added

* Bug Fix 🐞: Scrolling problem with large screen and re-rendering issue
2019-12-03 15:19:04 -05:00
Bolarinwa Balogun
54d8762af2 Chat: Remove Report Button from user's own profile sidebar (#4604) [deploy]
* Remove Report Button from user's own profile sidebar

* Update UserDetails test file to include window

* Uncomment code and Add tests

* Resolve issue with display property change persisting

* Update snapshot

* Uncomment line of code
2019-12-02 16:35:47 -05:00
Bolarinwa Balogun
5fc0a12f26 Resolve TypeError when clearing new changes in articleform (#4963) [deploy]
* Resolve TypeError when clearing new changes in articleform

* Revert cursor change
2019-11-29 14:40:19 -05:00
Jacob Herrington
e79ad764bd Onboarding test love (#4878)
* Reduce code duplication in onboarding tests

* Update variable names for consistency

* Improve test descriptions and format

* Refactor a useless test

This test was fairly pointless, but hopefully with this refactor it
could detect a regression? Although, I think it's really just testing
the that the Preact framework's state mechanism is working the way we
expect it to, but it might be worth leaving this test in.
2019-11-22 14:23:57 -05:00
Molly Struve
61753715f1
Remove Service Worker Desktop Notification Code (#4881) [deploy] 2019-11-22 12:47:14 -06:00
Ben Halpern
c817ac0192
Fix missing series in article edit form (v2) (#4867) [deploy] 2019-11-22 08:33:55 -05:00
Jacob Herrington
c6c5421163 Javascript automated testing and a11y doc (#4873)
* Add jext-axe package and introduce a11y testing

Automated a11y testing is NOT comprehensive. We cannot expect this to
even scratch the surface of potential a11y issues.

However, we can expect to find a percentage of issues that are currently
flying under the radar. Adopting some automation around a11y testing
also allows us to use CI to find a11y regressions -- which should be
really handy.

I've never really used Jest before, and Preact seems to make it a little
more complicated, but as far as I can tell, this is a decent way to add
at least some minor automated a11y testing.

* Add doc about automated a11y tests
2019-11-22 08:32:01 -05:00
Bolarinwa Balogun
4536d35716 Fix broken layout from "additional config/settings" overlap (#4858) [deploy]
* Fix broken layout from "additional config/settings" overlap

* Resolve bugs by adding important state fields
2019-11-20 14:34:30 -05:00
Mac Siri
d2373b5678
Add Clipboard polyfill (#4824) [deploy] 2019-11-20 11:32:30 -05:00