Commit graph

398 commits

Author SHA1 Message Date
Anna Buianova
4cab190285
Hiding comments: an option to hide or keep children (#15178)
* Optional hiding child comments (start)

* Changed confirm button in comments hide form

* Hide children comments if hide_children was passed

* Added a spec for hidden child comment notifications

* Hide only explicitly hidden comments

* Hide comment modal on article page

* Prevent default behaviour for hide comment link

* Improved hide comments modal looks

* Improved hide comments modal looks

* Removed unused code

* Send hide comment form via fetch

* Hide comment descendants when hide_children was passed

* Don't hide hidden comments descendants on permalink

* Removed unnecesary span

* Improved hide comments modal styling

* Removed unused styles and js, improved styling

* Clickable label

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

* Fixed showing hidden comments spoiler for article author

* Fixed hideArticleComments.spec.js

* Fixed displaying hidden comments text for artice author, added specs

* Target hide comments modal inside the modal when adding a listener

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Replaced hide comment link with a button

* Refactored adding hide_children url param

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Fixed cypress hide comments test

* Removed aria-label for submit on the hide comments modal

* Fixed formatting

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-11-18 11:57:40 +03:00
Daniel Uber
dc35f8ed24
Remove optional chaining syntax from comments page initializer (#15277)
* Remove questionable syntax from comments initializer

Not sure what ?. is, changing to . to placate the asset precompiler

* Restore conditional access

Rather than changing the ?. to ., wrap the chained access in a guard
clause.

* Fix error in logic

First pass had wrapped this in an "if currentUser" which caused the
else block only to hide comments when no user was logged in, however
the actual behavior should have been to hide comments unless current
user was an article author.
2021-11-03 12:04:28 -05:00
Suzanne Aitchison
89faac306a
treat cmd and ctrl key shortcuts separately on macOS (#15265)
* treat cmd and ctrl key shortcuts differently on macOS

* consolidate shortcut key string into Runtime helper
2021-11-03 11:54:15 +00:00
Akash Srivastava
4cb48768f9
Added collapsed hidden comments to author's article/podcast episode view (#14018)
* Handling hiding/collapsing hidden comments client side

* Updated comment quality text

* Added placeholder for comments against podcast episodes

* Added logic for encompassing co-author-ids in articles

* Removed rspecs validating non-presence of hidden comments in dom

* Fixed hiding flow on comments page for a commentable

* Fixed e2e specs

* Addressed feedback on e2e tests
2021-11-03 11:08:04 +07:00
Julianna Tetreault
4a9f442354
Creator Onboarding: Creator Setup View (#14728)
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Yhëhtozr <conlang2012@outlook.com>
Co-authored-by: yheuhtozr <84892012+yheuhtozr@users.noreply.github.com>
Co-authored-by: Nick Taylor <nick@dev.to>
2021-11-01 15:50:08 -04:00
ludwiczakpawel
ca108aa9c8
Videos UI update (#15177)
* videos ui updates

* move cheese around

* .

* .

* thumbnail yolo

* thumbnail yolo

* object fit

* aspect ratio yolo

* .

* loading videos

* Make Travis and asset pipeline happy with .mp4 extension

* Use Cloudinary video url, testing for Travis

* Try weird things

* Try a real image url

* Use a real image instead of 'video' string

* Update views.scss

Co-authored-by: Andy Z <17884966+Zhao-Andy@users.noreply.github.com>
2021-10-28 09:34:44 +02:00
rhymes
0dd11b3da5
Replace spread syntax with Object.assign in untranspiled JS file (#15148) 2021-10-21 14:01:05 +02:00
Ben Halpern
09fa66a03f
Fix and clean up podcast pages (#15004)
* Fix and clean up podcast pages

* Adjust tests

* Fix a test

* Fix missing i18n

* Fix tests

* Fix tests

* Fiddle with test

* Sure up css and tests

* Add featured as allowed param

* Fix a couple tests

* xit out test

* Update app/views/podcast_episodes/index.html.erb

* Update app/views/podcast_episodes/index.html.erb

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

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
2021-10-15 17:38:57 -04:00
ludwiczakpawel
096cf18b10
Article layout (#14753)
* style updates

* author and tools

* overflow hidden for avatars because geeeez

* font smoothing

* reverting little change

* specs

* preview

* css fix

* avatar fix'

* No longer eager load user profile when showing articles.

articles show view no longer needs user profile, as it no longer
renders the user profile preview.

* tags

* tags

* tags reverts

* typo

* dropping initializer for user cards previews on article page

* spec

* remove spec

* revert

* Update app/decorators/article_decorator.rb

Co-authored-by: Michael Kohl <me@citizen428.net>

* Update spec/requests/stories_show_spec.rb

Co-authored-by: Michael Kohl <me@citizen428.net>

* yoloing outline change on buttons because i couldn't see any visual difference

Co-authored-by: Dan Uber <dan@forem.com>
Co-authored-by: Michael Kohl <me@citizen428.net>
2021-09-30 19:08:06 +02:00
Ben Halpern
647573dcad
[Tiny fix] Fix a couple small bugs from DisplayAd clean up (#14846)
* Clean up and fix DisplayAd click JS

* Fix double use of variable
2021-09-28 15:51:30 -04:00
Ben Halpern
036d75aa6e
Admin-configurable display locale (#14620)
* Admin-configurable display locale

* Add i18n-js and namespacing

* Basic tests and clean up

* A few test adjustments

* Update vendor cache

* Fix a few tests

* Fix a few tests

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

Co-authored-by: Michael Kohl <citizen428@dev.to>

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

Co-authored-by: Michael Kohl <citizen428@dev.to>

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

Co-authored-by: Michael Kohl <citizen428@dev.to>

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

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/views/comments/_comment_header.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/views/layouts/_sidebar_tags.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/views/listings/index.html.erb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update spec/system/homepage/user_visits_homepage_articles_spec.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update spec/system/user/view_user_index_spec.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Alphabetical locale page

* Add activerecord custom validation error translations

* Add i18n to webpacker

* Fix a few tests

* Adjust error messages

* Add i18n-tasks

* Adjust JS to get working with jest

* Adjust the way translations are pulled in

* Adjust jest tests

* Remove time localization

* Remove superfluous public js

* Add basic tests for i18n application controller

* Remove unnecessary content

Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-09-28 11:04:35 -04:00
Ben Halpern
a5e8ed66ee
Fix inconsistencies with DisplayAd (#14789)
* Fix inconsistencies with DisplayAd

* Remove console log

* Fix tests

* Fix width/height being backwards

* Stub FastImage

* Update app/services/html/parser.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Update spec/factories/display_ads.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Fix display language

* Add check for img

* Change name of rotatingDisplayUnits

* Update app/helpers/display_ad_helper.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-09-28 09:22:07 -04:00
Angel Barros
bb8b32bdf2
Zappat0n/add rate limit model everywhere 11500 (#14609)
* Create showModalAfterError function

* Show modal when comments rate limit is reached

* Show modal when article reaction rate limit is reached

* Show modal when follow user rate limit is reached

* Show form error when listing creation rate limit is reached

* Show form error when feedback messages rate limit is reached

* Rename functions for listings rate limit checks

* Show modal when notifications reaction rate limit is reached

* Show modal when picture upload rate limit reached

* Show modal for reactable objects when rate limit reached

* Add and modify tests

* empty commit

* Match modal messages to tests

* Fix error updating Modals

Co-authored-by: Dan Uber <dan@forem.com>
2021-09-23 10:49:19 +01:00
Andy Zhao
e1606bcb0c
Move pin post to admin ✂️ (#14739)
* Update pin post button to be an admin articles button instead

* Rename file since we don't pin posts on show page

* Don't use instant click for admin link

* Update tests to visit the article from the start
2021-09-17 14:25:39 -04:00
Aayush Gupta
4280434aed
Make podcast-playback to be controllable via keyboard (#14139)
* Make podcast-playback to be controllable via keyboard

* Add improved state handling for the play/pause controller

* Fix business logic + Improve HTML semantics

* Remove manual tabIndex addition (not required now)

* Refactor redudant event-listener

* Keep aria-pressed label in sync in all cases

* Code refactor

* Add seed data to create a test podcast

* Add a static file and use that as example podcast episode (#1)

Rather than relying at test time on external media, and requiring the
podcast episode import flow to run during e2e testing, just insert a
canned episode that shows.

Confirmed in cypress this does show after visit('/pod') in the
togglePodcastPlayback.spec.js

* Add cypress test

* Move cypress tests

* Update cypress/integration/seededFlows/podcastFlows/togglePodcastPlayback.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* fix button name in test

Co-authored-by: Daniel Uber <djuber@gmail.com>
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-08-20 12:45:53 +02:00
Jamie Gaskins
4b640077e7
Fix readline key bindings for comments on macOS (#14423)
* Fix readline key bindings for comments on macOS

* Extract OS-specific modifier key check to Runtime

* Add the *actual* OS-specific modifier check

* Only operate on the event if it's a KeyboardEvent

It's the only type of event we care about here.

This commit also changes the `!= -1` to `>= 0` to be more clear about
intent. The `index != -1` is a double negative - it means the substring
"is not not found". Instead, the `>= 0` means "is found".
2021-08-10 12:42:27 -04:00
Keshav Biswa
b58fdd013b
Comment reaction button accessibility (#14256)
* added aria-pressed to comment buttons

* Added accessibility title

* updated set attribute and text content of aria-title

* removed 'x likes' from svg titles

* Added e2e tests to test behaviour of like toggle button

* changed reaction button's description to save instead of Saved

* Fixed cypress test
2021-08-10 10:20:14 +01:00
Suzanne Aitchison
75b6c8ed96
Use a single listener for all follow buttons on a page (#14246)
* create new pack, handle user follow buttons, use pack on article page, remove initializeUserFollowButts

* init all follow button types, add pack to tag index and podcast episode pages

* add pack to all relevant pages, listen for newly inserted follow buttons

* change to searchParams to remove follow button initializer calls

* fix bug with tag page, add pack to notifications page

* fix issue with follow back inner text

* update cypress specs

* run the followbuttons code on sponsors page

* remove extra foreach

* add test for follow from article sidebar

* add test for follow and unfollow tag

* add test for the tag index page

* add spec for organisation profile follow

* add tests for follow buttons in search results

* add tests for notification follows

* commit missed file - woops

* show login modal if user is logged out when they click

* add cypress tests for logged out state

* change tag button initialization

* remove data-button-initialized

* init follow buttons from base pack

* handle the case where multiple follow buttons exist on a page for the same user

* account for instantclick and userdata not being defined, lower coverage for jest

* use getInstantClick

* fix issue with set initialisation

* only listen for mutations in areas we know follow buttons may be added dynamically

* small refactors
2021-07-27 10:45:50 +01:00
Suzanne Aitchison
ca5de50308
[15 min fix] Update flaky test in loggedOutFlows (#14271)
* fix flake in save click test

* rename data attr
2021-07-19 15:25:41 +02:00
zeotuan
9900d40521
Add error handling and UI feedback when submitting comment resulting in a 503 error (#14233)
* add catch to response.json promise to handle 503 service unavailable error

* fix typo in error message

* make error message more generic

* add test for comment when server response with 503
2021-07-15 10:24:32 +01:00
Fernando Valverde
8095fdb891
Runtime Banner v2 (#14119)
* Banner v2 - first working version

* Move pack_with_chunks_tag up + removing comments

* Trying to fix unlrelated tests

* Revert experiment

* Defer initialization until page is ready

* Test refactor + trying out UDL Server refactor

* Revert experiment - to be handled in separate PR

* refactor to use function component

* Cleanup unused lines in cypress test

* Update app/javascript/runtimeBanner/RuntimeBanner.jsx

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

* Apply review feedback

* Update app/javascript/runtimeBanner/RuntimeBanner.jsx

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

* Add import clause + extract functions outside of component

Co-authored-by: Nick Taylor <nick@forem.com>
2021-07-14 14:44:07 -06:00
Suzanne Aitchison
9150e3d4ba
Only attach a click listener to a follow button once (#14217)
* only attach a click listener to a follow button once

* unskip test

* Trigger Travis CI
2021-07-14 15:32:49 +01:00
Keshav Biswa
9e320afe78
Keep aria-label values static for post reaction buttons (#14211) 2021-07-12 15:46:43 -04:00
Keshav Biswa
8e2e25fbb9
added aria-pressed values to reaction buttons (#14192) 2021-07-12 12:54:29 +02:00
Suzanne Aitchison
6a93ad914a
fetch preview card follow buttons in one network call (#14085)
* fetch preview card follow buttons in one network call

* when new comment is submitted, only fetch new comment status

* make sure individual button follow requests continue to init

* Add follow-user class to all follow user buttons via the application helper

Co-authored-by: mstruve <mollylbs@gmail.com>
2021-07-09 09:24:57 +01:00
Suzanne Aitchison
16cec7d93d
[15 min fix] Add aria-current attribute to current dashboard link (#14128)
* add aria-current attribute to current dashboard link

* Update app/views/dashboards/_actions.html.erb

Co-authored-by: rhymes <github@rhymes.dev>

* Update app/views/dashboards/_actions.html.erb

Co-authored-by: rhymes <github@rhymes.dev>

* Update app/views/dashboards/_actions.html.erb

Co-authored-by: rhymes <github@rhymes.dev>

* Update app/views/dashboards/_actions.html.erb

Co-authored-by: rhymes <github@rhymes.dev>

* Update app/views/dashboards/_actions.html.erb

Co-authored-by: rhymes <github@rhymes.dev>

* Update app/views/dashboards/_actions.html.erb

Co-authored-by: rhymes <github@rhymes.dev>

* stub network request

* fix typo in stub

* always guard against lack of entries

Co-authored-by: rhymes <github@rhymes.dev>
2021-07-07 09:41:35 +01:00
Suzanne Aitchison
6146fcd56b
15 min fix - only initialise article buttons once (#14007) 2021-06-17 14:59:45 +02:00
Suzanne Aitchison
f607cf8722
Optimise dropdowns for accessibility - Profile page (#13916)
* use initializedropdown in profileDropdown

* improve aria in html

* add cypress tests, stop buttons and dropdown initializing twice or more

* make sure dropdown shows when logged out
2021-06-14 12:31:23 +01:00
Suzanne Aitchison
be15f31122
Optimise dropdowns for accessibility: Dashboard and Manage pages (#13909)
* use dropdownutils in dashboard and manage pages

* add tests for the toggle menu on dashboard

* add test for archiving from manage post view

* small tweak to avoid unhandled errors

* small tweaks to form methods
2021-06-04 10:19:56 +01:00
rhymes
99ddd31058
Pin posts to feed (#13807)
* Add SiteConfig.feed_pinned_article and validation

* Display pinned article at the top of feed

* Add (basic) functionality to pin/unpin post

* Admins can pin other users posts as well

* Hide the button if looking at the non pinned post

* Add pinned/unpinned snackbar message

* Rename SiteConfig usage to Settings::General

* Add pinned article to the Admin articles index

* Show the pin post button when there's no pinned article

* Move pinning to a separate controller

* Fix SiteConfig reference

* Hide PinController actions to unauthorized users

* PinnedArticlesController#show action and refactor some of the code

* Add Modal interaction

* Fix modal-pinned checkbox interaction

* Fixed pin/unpin post

* Add ArticleDecorator#pinned? specs

* Add PinnedArticlePolicy and PinnedArticlesController specs

* Add ability to actually pin an article from the admin after submit

* Add partial Cypress pin/unpin spec

* Fix pinned article and add basic Cypress interaction tests

* Add Crayons styling to modal

* Only render the pinned article on the default Feed page

* Use persisted?

* Add some comments

* Update app/javascript/articles/Article.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/javascript/packs/homePageFeed.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Fix Cypress tests

* Update app/javascript/admin/controllers/article_controller.js

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Fix pinning in article show page

* Used PinnedArticle domain model

* Fix spec

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/adminFlows/articles/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/articleFlows/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/articleFlows/pinArticle.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/articles/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Fix merge woes

* Add missing article pin post flows

* Add missing admin article flows

* Add Unpin to Admin as well

* Add Audit::Log entries for pin/unpin actions

* Update app/controllers/stories/feeds_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Do not rate limit in E2E tests

* Use .find instead of .filter

* Rename ArticleIdValidator to ExistingArticleIdValidator

* Treat draft and deleted articles the same

* Make sure posts can be pinned after the pinned article is unpublished or deleted

* Use .get directly

* Fix spec and fix PinnedArticlesController#show

* Strengthen pinArticle Cypress tests

* Add Cypress test heading guard

* Add another Cypress test heading guard

* Remove duplicate validator

* Try using the Tools: header instead of the article title

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-06-04 10:54:53 +02:00
Suzanne Aitchison
7e322e4f7b
Optimise dropdowns for accessibility - Post comments and share (#13868)
* WIP - basic init of comment dropdowns with open and close on click

* WIP - initialize the share dropdown

* initialize all post dropdowns within packs, init copy to clipboard announcer

* refactor and add JSDocs to helper

* undo changes to base jsx

* update accessible name of post actions button in cypress test

* make sure dropdowns pack loaded on comment index page

* undo prettier changes in base jsx

* undo prettier changes in base jsx

* initialize comment dropdowns in podcasts

* add test for the post actions

* add article comment tests

* add cypress tests for comment dropdowns
2021-06-03 09:13:17 +01:00
Suzanne Aitchison
7a17cdf0f3
[15 min fix] Remove flake in "follow user" spec (#13897)
* always wait until button initialized

* fix flake in follow user spec
2021-06-02 13:32:39 +02:00
Fernando Valverde
7845423bb9
Remove :runtime_banner feature flag (#13662)
* Removes :runtime_banner feature flag + repositioning

* Switch to https://udl.forem.com + fix spec

* Fix URL specs

* Adds data_update_script to remove feature flag

* Fix banner overlay on reactions for small screens + iPad max width

* Append -only to Runtime Filter CSS

* Add import to fix assets:precompile

* Implement design update

* Apply suggestions from code review

Co-authored-by: Lisa Sy <lisasyis@gmail.com>

* Add ;

* Trigger Travis

Co-authored-by: Lisa Sy <lisasyis@gmail.com>
2021-05-28 15:10:15 -06:00
Fernando Valverde
5832d146de
Add error handling to clipboard promise - post editor (#13798)
* Adds error handling to clipboard promise - post editor

* Adds a reload when rendering the Editor to get missing navigator.clipboard

* Remove reload logic from Post Editor

* Adds Honeybadger notify on error handling
2021-05-20 09:46:37 -06:00
Olawale Oyeyipo
5107844251
Make comment box shrink on submit (#13686)
* Make comment box shrink on submit

* Add missing semicolon

* Reset height on both comment textboxes
2021-05-10 09:06:49 +01:00
Rafi
8ef1313e71
Fixing preview button text in comment section (#13627) 2021-05-07 10:48:33 -05:00
Nick Taylor
c48e31731d
[15 min fix] Fixed broken share button on article page. (#13688) 2021-05-07 06:33:30 -04:00
Andrew Bone
2a05955092
🐛 Fix new comment dropdown issue (#13661) 2021-05-06 09:06:30 -04:00
Nick Taylor
058c70e9c3
[15 min fix] Fixed app code that was causing flaky E2E test (#13674)
* Fixed app code that was causing flaky E2E test.

* Added a comment about adding the click to the comments container.
2021-05-06 11:30:26 +01:00
dependabot[bot]
1a48b3151a
Bump cypress from 6.9.1 to 7.2.0 (#13528)
* Bump cypress from 6.9.1 to 7.2.0

Bumps [cypress](https://github.com/cypress-io/cypress) from 6.9.1 to 7.2.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/commits/v7.2.0)

Signed-off-by: dependabot[bot] <support@github.com>

* fix intercept and exception issues causing commentOnArticle specs to fail

* fix a typo while we're here

* stub the minimum search text

* update intercepts on post mention user

* Bump cypress from 6.9.1 to 7.2.0

Bumps [cypress](https://github.com/cypress-io/cypress) from 6.9.1 to 7.2.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/commits/v7.2.0)

Signed-off-by: dependabot[bot] <support@github.com>

* fix unhandled exceptions in initScrolling causing tests to abort

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-28 10:09:43 +01:00
Fernando Valverde
affc704c9b
Runtime Banner for Mobile Deep Linking (#13190)
* First version using custom schemes for iOS

* Starting to take shape with /r/mobile redirect page

* Wording and aasa

* Adds e2e tests

* Trigger CI

* Tweaks to AASA

* Uses external pivot domain to trigger Universal Links

* Add missing external domain deep link

* Fix test by enabling runtime_banner only in E2E tests

* Fix URL encoding mismatch in Cypress test

* banner sttyling

* Cleanup unrelated changes

* Add AASA tests + remove lingering Gemfile.lock changes

* Fix cypress test

* Remove unnecessary window global assignment

* Trigger Travis

* Replace querySelectorAll with querySelector

* Apply suggestions from code review

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Refactor inline comments, extract URL.deep_link logic and other review feedback

* Small tweaks

* Remove untrusted user-provided redirect (CodeQL suggestion)

* Fix failing tests

* Whoops - another test fix

* Use Forem's UDL server

* Extract timeoutDelay and add comment clarifying

* Add target='_blank' to deep link

* Add TODO comment for replacing hardcoded identifiers

* Apply suggestions from code review

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Add a11y attributes

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-23 15:45:34 -06:00
Suzanne Aitchison
ee66e4cf7d
[15 min fix] Fix following tags input a11y errors (#13425)
* fix following tags input a11y errors

* give hidden inputs unique ids

* update html element code in initScrolling, update test with new ids

* refactor

* trigger travis

* target the textfield inside the div in the test
2021-04-23 14:40:02 +01:00
Andrew Bone
c9e4227c59
crayons-notice accessibility improvements (#13273)
* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

* Add roles to crayons-notice

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/badge_achievements/award.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/broadcasts/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/configs/_apple_auth_provider_settings.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/configs/_form_submission.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/pages/sponsors.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/shared/authentication/_email_registration_form.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/users/_account.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/shared/authentication/_initial_account_wizard.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/users/edit.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/configs/show.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/configs/show.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/feedback_messages/_feedback_message.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/html_variants/show.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/pages/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/pages/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/liquids/_user_subscription.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/profile_fields/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/tags/edit.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/users/gdpr_delete_requests/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/comments/_comment_quality_marker.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/comments/deleted_commentable_comment.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/users/_notes.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/dashboards/following_tags.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/devise/invitations/edit.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/events/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/listings/_form.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/listings/edit.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/pages/_editor_frontmatter_help.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-14 13:32:57 +01:00
Julien Maury
cb3d6f6d22
Remove HTML errors (PR n°2 - fixed) (#13350)
* delete alt attribute on span

* delete role checkbox on button - add type button

* delete wrong aria label

* sidebar-nav as class not ID

* delete duplicate attr class on single story

* delete duplicate attr class sidebar nav

* Revert "delete role checkbox on button - add type button"

This reverts commit 456fa676ff4457ffa724e9a07a3f123149dc5f39.

* delete role checkbox and modidy spec login modal js

* no need for name in cypress test showloginmodal anymore

* add attr data-test-id

* replace attr defer with DOMContentLoaded event

* delete useless class

* better a11y approach for button and cypress tests

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* better a11y approach for button and cypress tests

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* discussion_r612278777 : change initialize article reactions js

* revert replacing `const` with `let`

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* revert replacing `const` with `let`

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* apply `aria-hidden` on all reaction svg

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* keep original text `Saved` for bookmark button

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* fix missing aria-label on load - reaction button

* Revert "replace attr defer with DOMContentLoaded event"

This reverts commit db6a7eec051c443c18c17e23cf331132b222011f.

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-14 14:06:44 +02:00
Michael Kohl
5406b0576e
Split Settings::Authentication from SiteConfig (#13095)
* Split Settings::Authentication from SiteConfig

* Move specs

* Sort fields

* Update settings usages

* Update recaptcha usages

* Add data update script

* Update spec

* Rename SiteConfigParams concern

* Fixes, new route, new controller

* Controller and service refactoring

* More controller and service updates

* Spec updates

* More spec fixes

* Move file

* Fix FeedbackMessagesController

* Update admin/configs_spec

* Fix remaining specs in admin/configs_spec

* Fix configs API

* Formatting

* Clean up old service object

* Various fixes

* Update DUS

* Add model argument to admin_config_label

* Fix key name

* Fix specs

* Add distinct request caches for settings classes

* Fix e2e tests

* Fix remaining system spec

* Make DUS idempotent

* Move routes block

* Cleanup

* Switch to ActiveSupport::CurrentAttributes

* Pinned rails-settings-cached

* Update e2e test

* Update lib/data_update_scripts/20210316091354_move_authentication_settings.rb

Co-authored-by: rhymes <rhymes@hey.com>

* Add guard to DUS

* Temporarily re-add two SiteConfig fields

* Fix config show view

Co-authored-by: rhymes <rhymes@hey.com>
2021-04-12 09:41:09 +02:00
Vaidehi Joshi
95055b2a89
Remove pro role + expose analytics to all users via dashboard (#13156)
* Remove pro role on user, expose pro dashboard to all users as analytics

* Remove pro from Elasticsearch mappings

* Update user role docs to use :trusted over :pro

* Remove pro from Role model spec

* Remove more references to pro, as noted by @rhymes
2021-03-30 15:02:18 -07:00
Nick Taylor
871650053c
[15 minute fix] Fixed bug with templates not being inserted for comments. (#13149)
* Fixed bug with templates not being inserted for comments.

* Removed some trailing white space from a heading.

* Added custom Cypress command to create an article.

* Added E2E tests for creating comments on an article.

* Fixed adding a comment issue caused by mention auto-complete.

* Fixed a selector for the E2E tests.

* Removed some unnecessary white space and also making code climate happy.

* Updated E2E test.

* Added a bit more to the E2E tests.

* Now validation for comment doesn't need to loop through textareas.

* Merge remote-tracking branch 'origin/master' into nickytonline/fix-comment-template-insertion-bug

* Removed a similar spec file and added tests to the other file.

* wip

* Fixed bug where a response template could not be submitted.

* Added/updated E2E tests.

* Reverted a small change to condition for showing the combobox popover.

* Undoing some white space changes as not related to PR.

* Trigger Build

* Put back article seed data as it's used in tests outside of comment tests.
2021-03-30 13:02:54 +02:00
Suzanne Aitchison
45a291047d
Re-add mention autocomplete to comments, fixing bugs (#13126)
* Revert "Revert "Add (updated) mention autocomplete to post comments (#13061)" (#13116)"

This reverts commit e28bde043c.

* Fix issues with editing comments and arrow key navigation, update tests

* Update app/javascript/crayons/MentionAutocompleteTextArea/MentionAutocompleteTextArea.jsx

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

* refactor adding of attributes

* destructure

Co-authored-by: Nick Taylor <nick@forem.com>
2021-03-26 13:43:05 +00:00
Suzanne Aitchison
1f8f348d5d
add skip link functionality to videos (#13113) 2021-03-26 10:23:45 +01:00
Fernando Valverde
f0b8754d4f
Feature: Runtime Content Filter (#13007)
* Working version of Runtime Filter with banner behind Feature Flag

* First attempt to add a cypress test

* Adds simplified test

* Cleanup global references

* Add multi-platform e2e test

* Use --runtime-display var with fallback to block

* Update app/assets/javascripts/initializers/runtime.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Add FeatureFlag stub to fix unrelated specs

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-03-25 12:04:45 -06:00