Commit graph

366 commits

Author SHA1 Message Date
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
Nick Taylor
e28bde043c
Revert "Add (updated) mention autocomplete to post comments (#13061)" (#13116)
This reverts commit a23caead07.
2021-03-25 10:33:51 -04:00
Jacob Herrington
d667490732
Ensure user data is unset if no user is logged in (#13024)
* Ensure loggd out user data is not in the document

* Use delete operator to remove user property

Another function relies on this value not existing. If this property
exists, but is set to undefined, it will not behave as expected.

* Add tests to verify user data does not persist in the DOM after logout

* Update cypress/integration/loginFlows/userLogout.spec.js

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

* Fixup: Test localStorage for user data

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2021-03-23 07:36:49 -05:00
Suzanne Aitchison
a23caead07
Add (updated) mention autocomplete to post comments (#13061)
* add mention autocomplete functionality to article and notification comments

* add cypress tests

* make sure entry transitions dont replay

* undo change to async useeffect covered in other pr

* move search into dynamic import

* exit search if enter pressed in middle of search term

* refactor button activation code

* add a space after a mention is selected

* tweak cypress test for reply to ensure it awaits combobox

* small refactor
2021-03-22 09:18:13 +00:00
Suzanne Aitchison
5bed8f56d4
improve keyboard accessibility of modals 12427 10610 (#12511)
* adds focusTrap wrapper to preact Modal component

* add view specific code for focus trap in admin add nav link

* add script to return a focustrap toggle, use in add nav link modal partial

* add trap to edit nav link modal

* add handlers for sign up modal

* update modal controller for admin section, update nav link modals to use

* update other admin modals with new data values for trap

* remove unneeded erb script file

* remove unneeded target

* refactor to remove extra unneeded param

* remove duplicate code, store getFocusTrapToggle in window

* trap focus in comment and bookmark showModal instances for not logged in user

* remove need for activator id

* clean up id refs no longer needed

* remove custom code and re-use focsu-trap lib

* update storybook docs

* update default export in focusTrap

* prevent close button click triggering a modal toggle twice

* ensure if user navigates from a modal the trap is deactivated

* add jsdoc comments and add dynamic import

* ensure admin controller modal traps are cleaned up on disconnect

* update sign up modal to use crayons

* update modal controller and admin nav links modals to use preact modal

* update profile fields modals for new controller

* tweak styling of sign up and admin modals to match previous

* update listings modal to use crayons modal, adapt focus trap to work with click outside

* memoize deactivate callback to ensure modal can be presented on first page load

* add missed focustrap changes

* fix focus trap issues in onboarding flow

* refactor onboarding focus trap, remove getFocusTrapToggle

* tweaks for styling and article modal toggle

* add click outside tests to modal

* add cypress tests for the login modal

* update liquid tag tests affected by change

* refactors to address review comments

* fix issue with login modal presented twice on comment add

* change ids to selectors in admin modals

* small pr comment refactors

* add listings e2e tests

* add nav link modal tests

* fix issue with help modal

* tweak to fix ui bug from merge

* remove context from showLoginModal

* rename toggleModal

* rename state property for clarity

Co-authored-by: Nick Taylor <nick@dev.to>
2021-02-24 16:01:10 +00:00
Suzanne Aitchison
5abe88c69b
Add skip links to readinglist, podcasts, and listings (#12769)
* add skip link functionality to readinglist, listings and podcasts

* fix initscrolling reference to podcasts
2021-02-23 08:33:26 +00:00
Suzanne Aitchison
c761c3f9a7
Provide skip links: Tweak skip link style, refactor main area ID (#12694)
* change home page main id to main-ontent, update scroll, refresh and shortcut handlers

* update articles by timeframe test with new main-content id

* tidy up css

* Trigger Travis CI

* undo unneeded changes

* small refactors
2021-02-17 10:15:31 +00:00
Akash Srivastava
8569435b13
Fixed twitter timeline display in comments preview (#12542)
* Fixed twitter timeline display in comments preview

* Removed shared context for twitter_timeline_tag
2021-02-15 17:09:18 +01:00
Nandan Kumar
30bf47a445
feature added : add-discussion-length-in-brackets #12324 (#12518)
* feature added  add-discussion-length-in-brackets #12324

* changed class name from comments-count to js-comments-count
2021-02-02 15:14:01 +00:00
Andrea Martz
0c0e28dd35
Add missing aria label for campaign close button (#12489) 2021-01-29 17:51:18 -05:00
Marcy Sutton
f072730f0f
Header navigation dropdown accessibility (#11509)
* Improve keyboard a11y of header menu dropdown

This commit also includes some cleanup of unnecessary functions that seemed to degrade performance.

Closes https://github.com/forem/forem/issues/1154

* Add temporary focus style on navigation-button

* Put menu items in a list

* Adjust menu button based on VoiceOver testing

* Refactor menu logic to be reusable/work on touch

* Preserve admin link visibility

* Focus on first item on menu open

* Clean up some HTML and CSS

* Apply suggestions from code review

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

* Ensure menu hides on click outside

* Rename toggle function and adjust formatting

* Update nav button focus style

* Clean up padding on header avatar focus style

* Make button show focus state for keyboard only

Using .focus-visible:focus targets keyboard focus and eliminates a flash of the blue border on click before focus is moved to the child item (which also has no focus style on mouse click)

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

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

* Add some defensive programming

* Removed initializeTouchDevice from base.js.erb

* navigation-butt ID is now member-menu-button

* Moved all the logic from initializeTouchDevice.js into a pack file/utilities.

* committing re-ordered schema after setup

* add tests for initializeTouchDevice

* remove some unneeded html setup

* make sure menu doesn't close if user tabs back from sign out

* Revert "committing re-ordered schema after setup"

This reverts commit a41a1c861cca3b97d8a7b8a99268b8afaae9f028.

* optimized code

* small tweaks, only show outline when focused

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-01-27 09:39:17 +00:00
Ben Halpern
d7732499b9
Improve cumulative layout shift on comment reactions + optimizations (#12309)
* Improve content layout shift on comment reactions + optimizations

* Clean ups, tests, and docs

* Fix test typo

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

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update docs/technical-overview/architecture.md

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

* Update docs/technical-overview/architecture.md

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

* Update docs/technical-overview/architecture.md

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

* Refactor and add jsdoc

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2021-01-18 19:29:44 -05:00
Josh Puetz
8c5b7bacb4
Show comment posting errors (#12184) 2021-01-08 14:29:01 -06:00
Chien-Wei Huang (Michael)
025a46e012
Update all followed tag with one click (#11454)
* Replace follows#update with follows#bulk_update

* Allow follows#bulk_update to receive multiple follows and remove follows#update

* Add FollowPolicy#bulk_update? and remove update?

* Combine save button into one in following_tag.html

* Rename follows_update_spec to follows_bulk_update_spec and update

* Update buildTagsHTML to conform to the view

* Allow scrolls down dashboard test to update multiple tag values

* Includes follower and followable in follows#bulk_update

* Mark and pass changed field.

* fix typo in html

* Update follows in transaction

* Extract js script to another file and update view

* Rename disableUnchangedButton.js to dashboardTagsDisableUnchangedButtons.js
2021-01-05 16:15:37 +01:00
ludwiczakpawel
6f65aff143
Turn off "preview" mode after adding comment (#12127)
* tooltips 1.0.1

* tooltips 1.0.1

* .
2021-01-05 15:23:45 +01:00
Ben Halpern
c668496e9a
Remove swipe gestures and other unnecessary code (#12027) 2020-12-30 12:17:29 -05:00
Fernando Valverde
e48abdc586
Fix the way we check for AndroidBridge global (#11969)
* Change the way we check for AndroidBridge global

* Modify logic to check for not undefined
2020-12-18 09:44:53 -06:00
ludwiczakpawel
73e560f7a2
Updating navigation (especially mobile) (#10424)
* .

* .

* .

* .

* .

* specs

* specs

* .

* .

* merge

* moving cheese around

* layout

* .

* merge

* Fixed invalid selector for search.

* Fixed issue with URL not updating after a search.

* do things better

* kinda merge

* whoops

* whoops

* .

* .

* im a backend developer

* tooltips 1.0.1

* tooltips 1.0.1

* fix

* specs

* .

* reduce the spacing

* schema drop

* reverts

* revert

* reverts

* revert

* drop unused nav

* drop unused nav

* drop unused nav

* drop unused nav

* typos

* paths fixes

* speeding up JS

* js

* search

* Reworked initializeTopBarIcons.js

* Reworked initializeNavigation.js

* Small refactor and updated exported function API docs.

* Fixed a bug I created when refactoring the top navigation icons.

* sidebar nav links

* spec

* Fixed issues with logged out experience for top nav icons.

* Small refactor of top nav icons.

* Small refactor and added some API docs.

* Added @testing-library/dom

* Added tests for top navigation utilities.

* spec

* spec

Co-authored-by: Nick Taylor <nick@dev.to>
2020-12-08 15:59:21 +01:00
Ridhwana
57b13ffa72
Move the color picker to its own initializer file (#11693)
* refactor: move the color picker to its own initializer file

* fix:wrap in the initializecolorpicker function with use strict
2020-12-01 15:34:44 +02:00
Nick Taylor
bf7780cd2c
Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
ludwiczakpawel
70706d0a62
Comments UI update (#11283)
* tooltips 1.0.1

* tooltips 1.0.1

* init

* .

* drop not needed files

* .

* init

* init

* .

* comments

* border

* missing bits

* build comment JS

* .

* .

* specs

* sloan avatar fix

* bunch of fixes

* specs and fixes

* specs

* .

* swap order of links

* contrast

* js for dropdown

* icons

* op-author

* three dots icon

* reverts

* test: capybara- make sure that we click the dropdown before clicking on edit

* permalink --> link

* tiny fixes

* aria-label on form

* proper alt on user's avatar

* aria has popup

* use UL > LI instead of DIV

* add aria-labels to dropdown items

* another aria-label

* better links: nav

* contrast

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-11-18 18:21:19 -05:00
rhymes
f9506affb5
Use faster JS selection methods (#11409)
* Add JS tips section to frontend documentation

* Replace document.getElementsByTagName('body') with document.body

* Replace querySelectorAll with faster selecting methods where appropriate

* Replace querySelector with faster selecting methods where appropriate

* Fix typo

* Fix forEach and getElementsByClassName

* Change querySelector* to faster methods in erb files

* Change querySelector* to faster methods in ruby files

* Fix runkit tag

* Various fixes

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

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

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

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

* Commenting out flaky spec

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-11-16 17:35:50 +01:00
irmela
9af120561c
Make markup for dashboard ellipsis menu more consistent (#10764)
* Make markup for dashboard ellipsis menu more consistent

* Rename js-dashboard-row-more to js-ellipsis-menu
2020-11-15 14:26:37 +01:00
Ben Halpern
badefcabeb
Developer experience/security: Make dev/test blow up if current_user is used erroneously (#11237)
* Let dev/test blow up if current_user is used erroneously

* Fix logic

* Fix click-to-edit permissions

* Change test to check for new behavior

* linting

* Edit tests

* Change test

* Clean up implementation

* Update comment

* Fix instance vars

* Update app/controllers/concerns/caching_headers.rb

* Merge origin and add request_store gem
2020-11-12 11:54:23 -05:00
ludwiczakpawel
ab34b37c49
Badges area on profile (#11384)
* tooltips 1.0.1

* tooltips 1.0.1

* badges size

* badges size

* .

* button style

* pawel messing with controllers

* math is stupid

* good boys write docs

* typos
2020-11-12 15:53:14 +01:00
ludwiczakpawel
de5a22ecf7
Profile UI update (#11357)
* tooltips 1.0.1

* tooltips 1.0.1

* profile layout

* fix

* whoops

* better github repos

* spec

* brining back doc, and making liitle fixes

* button placement, stats styling

* rename
2020-11-12 08:47:04 +01:00
Nizar
7058d628af
Added Copy Permalink Functionality to Comment Dropdown (#8311)
* Added Copy Permalink Functionality to Comment Dropdown

Copy functionality is similar to the way 'copy article link' is implemented. It checks for the android bridge first, then the navigator, then fallsback to the default document copy command

Since the codes were really similar, I moved the copy functionality to a function of its own with callbacks and fallbacks as lambdas, and triggered it with the copyArticleLink and the copyPermalink

* Replaced Copy Permalink Callbacks with Promises

* Keep anchor tags instead of buttons (#1)

* copy permalink using anchor tag

* Missing closing button tag

* Adds 'Copied to Clipboard' Snackbar Message

* Patches bug introduced in #10323

Patch suggested in following comment: https://github.com/forem/forem/pull/8311\#pullrequestreview-492011202

* Removes import statement for addSnackbarItem and Suppresses ESLint Error

Initializer runs in global scope

* Unhandles exception when copying permalink so Honeybadger can handle it

* Replaces ButtonListener suffix for copyPermalink method with Listener

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2020-11-11 08:32:10 -05:00
Fernando Valverde
756acebaed
Podcast + Video player native bridge small refactor (#11345) 2020-11-10 07:36:05 -06:00
Fernando Valverde
f11523f29a
Makes Runtime.js detect the generalized ForemWebView User Agent (#11288)
* Makes Runtime.js detect the generalized ForemWebView User Agent extension

* Adds tests
2020-11-05 14:18:17 -06:00
Josh Puetz
542ee58ab8
Rate Limit Modal - Comments (#11102)
* Non-preact modal

* Some cleanup

* Toggle modal on navigation

* Use rate limit modal on comments page

* Added JSdocs

* Remove explanation link

* Comment rate limit test

* Tests and method renaming
2020-11-03 15:49:20 -06:00
ludwiczakpawel
5d3691bcc5
Notifications redesign (#11084)
* notifications

* fix

* .

* REVERT

* .

* drop ccss

* REVERT

* specs

* drop colons

* fixse

* fix

* spec 1

* eh

* Fix notification specs

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-10-29 20:38:17 +01:00
ludwiczakpawel
1636bdf4c8
Autoresize on comment textarea + comment submit on CMD/CTRL+Return (#11115)
* .

* whoops

* revert typo

* Handle glitches and edge cases.

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-10-29 09:33:11 +01:00
Ben Halpern
531f26bad6
Add admin shortcut to tag page (#11092)
* Add admin shortcut to tag page

* Fix spec

* Add more check

* Change admin location
2020-10-28 12:19:21 -04:00