Commit graph

139 commits

Author SHA1 Message Date
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
ludwiczakpawel
1be3602724
Ghost textarea fixes (#12717)
* comment textarea padding

* font family fix

* one more
2021-02-17 18:33:08 +01:00
Nick Taylor
db7120ffae
Added E2E tests for #12585. (#12597)
* Added E2E tests for #12585.

* Added a check to ensure no error message when preview works.
2021-02-05 10:30:54 -06:00
Alex
5948c6cfca
Fix bug when trying to preview a blank draft article (#12585)
* Try to fix preview bug

* Now an error is thrown client side if HTTP status isn't 200

* Now the JSON response is thrown instead of the response when preview fails.

* Linter test

Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Fernando Valverde <fdov88@gmail.com>
2021-02-05 06:56:26 -06:00
ludwiczakpawel
a6fd2be9d9
/new form title fix font font-size (#12576)
* tooltips 1.0.1

* tooltips 1.0.1

* typography fix
2021-02-04 18:26:08 +01:00
Andrew Bone
9ef1534d83
Add paste image (#10212)
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-02-04 10:58:56 -05:00
ludwiczakpawel
c816ef4a61
Text styles (#11743)
* tooltips 1.0.1

* tooltips 1.0.1

* .

* styles

* styles

* update

* nahh

* .

* adjustments

* more
2021-02-04 11:43:59 +01:00
Katie Davis
76453b41fb
Updates ESLint rules to error on default imports (#12512)
* add rule

* add named imports

* more missed files

* so many files
2021-02-02 10:24:03 -05:00
Katie Davis
9d4b6c36ea
updates article form to have warning modal (#12430) 2021-01-28 11:32:28 -05:00
ludwiczakpawel
bf72758c4e
Close modal on escape keypress (#12428)
* tooltips 1.0.1

* tooltips 1.0.1

* close on esc

* simpler
2021-01-26 15:12:54 +01:00
Michael Kohl
6afaa25f50
Fix accidental publishing of draft articles (#12288)
* Fix accidental publishing of draft articles

* Add regression spec

* Fix spec
2021-01-22 08:47:16 +07:00
Fernando Valverde
a3de41f440
Adds ratio param to Cover Image native bridge image picker (#12139) 2021-01-05 14:50:36 -06:00
ludwiczakpawel
13ff4c7fbe
"Copied!" label no longer wrapping to the next line (#12128)
* tooltips 1.0.1

* tooltips 1.0.1

* button wrapping fix
2021-01-05 13:24:55 -05:00
ludwiczakpawel
1c4e54a25d
Dropdown CSS fix on /new view (#12078)
* tooltips 1.0.1

* tooltips 1.0.1

* fix
2021-01-03 17:12:44 +01:00
Fernando Valverde
90aa693204
First working version to integrate native bridge image upload (#11838)
* First working version to integrate native bridge image upload

* ImageUploader base64 experiment

* Adds message handling

* Adds support for cover image

* Revert pre-commit hook changes

* Revert pre-commit hook changes

* Better native image upload logic + mock Runtime class in tests

* Dont render hidden fields unless necessary

* Better test coverage & inline comments for better context/documentation

* Added an a11y test for when native iOS image upload is available.

* Added more test

Co-authored-by: Nick Taylor <nick@dev.to>
2020-12-23 10:02:39 -06:00
Nick Taylor
2c79a4c122
Remove non application files from frontend code coverage (#11752)
* Convert index.jsx to index.js as they are just barrel files.

* Removed prop types and eslint configs from code coverage.

* Using <root_dir> in test ignore patterns now.

* Added app/javascript/storybook-static to eslint's ignore list.

* Now .storybook is excluded from code coverage.

* Bumped coverage thresholds

* Fixed to <rootDir>
2020-12-04 20:00:20 -05:00
ludwiczakpawel
d43ff0d46c
Series overflow fix (#11683)
* tooltips 1.0.1

* tooltips 1.0.1

* series selector
2020-11-30 17:12:10 +01:00
Nick Taylor
d623157eee
Fixed some frontend tests causing unhandled rejection errors (#11627)
* Fixed unhandled rejection in <ImageUploader /> test.

* Fixed <FollowUsers /> tests.

* Fixed the tests for the <RequestManager /> component.

* Fixed unhandled rejection in search utilities.

* Added an unhandledRejection listener so tests will fail if a Promise fails.

* Added a comment about why you might get an unhandled rejection exception.
2020-11-26 06:11:25 -05:00
Thomas Bnt
3d8049697a
Edited URLs settings/ux to settings/customization (#11618) 2020-11-25 12:29:12 -05:00
Nick Taylor
bf7780cd2c
Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
Rafal Trojanowski
4bc8b80a90
Introduce tweet_timeline liquid tag (#7605) (#10825) 2020-10-30 11:03:40 +01:00
Rafi
52f2627e6c
Refactoring EditorAction (#10894)
* Refactoring EditorAction

* Removing useCallback

* Renaming variables to isVersionX
2020-10-29 09:06:30 +01:00
Cassey Lottman
64dce93088
clarify how to add multiple tags (#11082) 2020-10-26 14:57:51 +01:00
Andrew Bone
c629459ba9
refactor: Use keyboard shortcut hook in article form (#11014)
* Move to new keyboard shortcuts

* No longer required

* Import order

* Import order

* Add trailing comma

* Remove keyboardShortcutsHandler from exports

* Remove pointless arrow function
2020-10-22 12:03:10 -04:00
Mac Siri
dd8745ca33
[deploy] Store Article's main_image path unprocessed (#10867) 2020-10-16 14:46:37 -04:00
ludwiczakpawel
ebe398ba23
[deploy] Logo updates (#10840)
* logo updates

* fix

* fix

* drop it like its hot

* no siteconfig

* um...
2020-10-14 16:13:42 -04:00
Manaswini
e920155a93
Remove tabindex of -1 on upload image input in the write a post editor (#10543)
* Remove tabindex of -1 on upload image input in the write a post editor

* Remove negative tabindex on image uploader's outer button

* Give tabindex of -1 to outer button on image uploader

* Update buttons.scss
2020-10-08 21:57:22 +02:00
Akshay Mahajan
b592ab6c83
added z-index to post editor options dropdown (#10536) 2020-10-02 15:55:46 -04:00
Fernando Valverde
1aa8233d9e
Adds runtime copy to clipboard (#10323) 2020-09-14 14:45:54 -04:00
ludwiczakpawel
6c3f5d51fe
Drop containers styling (#10203)
* Refactored drag n drop functionality to a hook and component.

* Add the snackbar to the article editor.

* Now you can drag and drop images in the post body content.

* Cleaning up a few things.

* Now post cover images can be dragged and dropped.

* Removed unused empty function.

* Added @testing-library/preact-hooks so that we can test hooks.

* Some renaming, small refactor.

* Added tests

* Added more tests.

* Added more tests.

* Added message about dropping only one image in post body.

* Added message about dropping only one image for cover image.

* put onDrop into it's own meethod.

* More tests.

* Added some API documentation.

* Updated editor help with drag and drop image help.

* drag and drop styling

* .

* revert

* Fixed broken test.

Co-authored-by: Nick Taylor <nick@dev.to>
2020-09-09 09:37:16 +02:00
Nick Taylor
e2d43c4a73
[deploy] Fixed issue with drag and drop image for cover image in editor. (#10254) 2020-09-08 16:43:23 -04:00
Nick Taylor
f0963c1bfa
Drag and drop an image in the editor (#10145)
* Refactored drag n drop functionality to a hook and component.

* Add the snackbar to the article editor.

* Now you can drag and drop images in the post body content.

* Cleaning up a few things.

* Now post cover images can be dragged and dropped.

* Removed unused empty function.

* Added @testing-library/preact-hooks so that we can test hooks.

* Some renaming, small refactor.

* Added tests

* Added more tests.

* Added more tests.

* Added message about dropping only one image in post body.

* Added message about dropping only one image for cover image.

* put onDrop into it's own meethod.

* More tests.

* Added some API documentation.

* Updated editor help with drag and drop image help.

* Changed wording.

* Now the alt text for markdown removes the file extension.

* Updated help wording. Thanks @rhymes

* Now the image markdown adds a new line at the end as we currently do not support inline images.
2020-09-04 14:12:59 -04:00
ludwiczakpawel
11831e72c1
Extending documentation... (#10156)
* textarea component

* docs / faq: add new follower

* credits

* lang

* moving copy higher

* typo

* Update docs/faqs.md typo

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

* Update docs/faqs.md lang

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

* Update docs/faqs.md lang

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update app/javascript/article-form/components/Title.jsx

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

* Update docs/faqs.md

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

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-09-03 10:53:22 -04:00
Sarthak Sharma
b26b031616
🚀 Feature: Ability to upload images to connect by drag and drop (#9992) 2020-08-31 14:14:32 -04:00
rhymes
cd65273571
Use explicit name for Preact fragments (#10049) 2020-08-28 10:01:17 -04:00
Fernando Valverde
9da71a47c7
[deploy] Introduces Runtime class for standardized & other native cleanup + replace podcast GA with ahoy (#10026) 2020-08-28 05:52:04 -06:00
ludwiczakpawel
1776377234
Improve styling for series (#9893)
* .

* flare tag line height

* .

* series switcher

* .

* revert

* editor preview fix

* Fix broken spec

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-08-24 09:53:51 +02:00
ludwiczakpawel
877bdba176
Typography fix & Optimization (#9650)
* flare tag line height

* .

* dropdown fix + actions bar fix

* actions bar on mob

* fixing typography and improving font handling

* cleanup

* variables naming

* fonts swapping

* Makes user's default font render as SiteConfig.default_font

* Trigger checks

* Fixes missing user model specs

* Fixes storybook CI error import & logged out user font set with default

* Limits default_font config to serif, sans-serif & open-dyslexic

* Default font description text

Co-authored-by: Fernando Valverde <fdov88@gmail.com>
2020-08-18 08:05:51 -04:00
Sophia
f9137b2abd
[deploy] Update <ImageUploader /> class component to use hooks (#9369) 2020-07-27 17:09:28 -04:00
Jacob Herrington
cc6a79ad57
[deploy] Fix tag input patterns (#9363)
* Fix tag input patterns

* Trigger build

* Increase JS test coverage for CI
2020-07-20 08:06:36 -05:00
Jacob Herrington
9e08ae6f1f
[deploy] Restrict tags input regex (#9172) 2020-07-16 12:28:03 -04:00
ludwiczakpawel
9ee54bfe45
[deploy] Add crayons to pages (#9175)
* flare tag line height

* .

* dropdown fix + actions bar fix

* actions bar on mob

* .

* .
2020-07-07 09:43:54 -04:00
ludwiczakpawel
01f4183204
Code highlighter fix (#9176)
* flare tag line height

* .

* dropdown fix + actions bar fix

* actions bar on mob

* .

* typo

* .
2020-07-07 09:54:24 +02:00
Nick Taylor
6542395b38
Upgraded to preact testing library 2.0.0 (#9103) 2020-07-06 14:53:10 -04:00
ludwiczakpawel
82d99f5834
[deploy] Add collapsible panel to markdown help in editor (#9050) 2020-07-02 07:58:07 -05:00
Nick Taylor
9fc79cf034
Added pragmaFrag so terse Fragment syntax,<></>, can be used in Preact. (#9051) 2020-07-01 09:19:33 -04:00
Nick Taylor
3833b17a66
Added upload spinner for cover image in editor (#9041)
* Added the cover image upload spinner.

* Fixed skipped test for changing cover image.

* Added tests.
2020-07-01 11:18:26 +02:00
Nick Taylor
efc3a124a0
Added spinner/upload message when uploading an image to a post's content (#8986) 2020-06-30 13:52:47 -04:00
Nick Taylor
30bfe1adfd
More frontend lint fixes (#8931) 2020-06-29 08:19:13 -04:00
Nick Taylor
a7938ed287
Fixed a bunch of linting issues in components (#8921) 2020-06-26 10:26:02 -04:00