Commit graph

160 commits

Author SHA1 Message Date
Suzanne Aitchison
f49a6ce6d5
Revise editor publish logic (#14546)
* revise publish logic

* refactor arguments
2021-08-20 09:04:11 +01:00
Suzanne Aitchison
54e8fd8c8a
Refactor problematic markup for upload image (#13947) (#14431)
* refactor of ImageUploader

* refactor cover image uploader, update tests

* remove custom axe rules

* add cypress tests

* always render the hidden input

* tweaks
2021-08-09 16:00:01 +01:00
Nick Taylor
56bd0f9d2a
[15 min fix] Fixed regression for reverting changes in the article editor (#13365) 2021-07-07 08:30:36 -04:00
dependabot[bot]
a9449501a3
Bump @storybook/addon-a11y from 6.2.9 to 6.3.1 (#14094)
* Bump @storybook/addon-a11y from 6.2.9 to 6.3.1

Bumps [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/addons/a11y) from 6.2.9 to 6.3.1.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.3.1/addons/a11y)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

* add TODOs and exclusions for known a11y issues waiting on bugfixes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-06-29 14:19:28 +02:00
Suzanne Aitchison
af517bc5aa
Optimise dropdowns for accessibility: Preact component usages (#13948)
* use the dropdown initializer in post editor options

* use dropdown initializer in comment subs dropdown

* use Dropdown component in listings

* show the dropdown button when it's focused

* update storybook notes and components

* add cypress tests for post options dropdown

* add comment subscription tests

* make sure page is properly initialized before setting button functionality

* add jsdoc comments, props types, rely on optional chaining

* Update app/javascript/crayons/Dropdown/__stories__/dropdowns.md

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

* Update app/javascript/crayons/Dropdown/__stories__/dropdowns.md

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

Co-authored-by: rhymes <github@rhymes.dev>
2021-06-15 12:06:27 +01:00
Julien Maury
a2677cc0a9
Remove defer attributes from inline scripts - gist embeds (#13407)
* replace inline attribute defer with external js - show.html.erb

* fix typo in filename

* disable no-undef and bail if not defined

* put js on subfolder utilities

* refactor jsx instead of loading chunk with defer

* fix typo in desc

* better name for global gist helper

* use InstantClick

* working script on preview AND single view, not dynamic import, though

* embed only if gists

* combine all approaches to make dynamic import work

* make gist embeds work on submit comment form

* make gist embeds work on preview comment

* refactor - preview comments and submit

* add pack editComment + helper embedGistsInComments

* comment gist helper

* delete useless file utility

* use new syntax for events

* put code in method embedGistsInComments

* delete older pack gist

* handle edge case 'view full discussion'

* resolve conflict with package ibm-openapi-validator

* resolve conflict with package husky

* empty commit to test random error travis

* better name for class dismiss

* handle future events submit

* delete test code on click toggle form

* delete unused file

* rename pack as js file, not jsx

* Added POC using MutationObserver.

* missing case: notification page

* use custom pack notification page

* add e2e test for comment with embed gist

* add e2e test for preview post with embed gist

* add an extra step in tests to check gist is present

Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-06-11 08:22:50 +01:00
Suzanne Aitchison
8358571b29
Get a11y lint script paths from rails helper (#13912)
* retrieve paths from rails helper

* move assets to vendor folder, precompile in assets config

* drop coverage on lines

* remove unneeded line
2021-06-10 09:25:29 +01:00
Suzanne Aitchison
573c78d032
Advise users about potential accessibility failings in their posts - RFC #58 (#13745)
* initial rough version

* link to relevant rules, extract image text, only show if more than 0 errors

* jsdoc and tweaks

* refactors

* add tests

* open info links in new tab

* add new window link icon
2021-06-03 10:27:12 +01:00
Lisa Sy
e925d95f71
Rename WRITE A POST to CREATE POST (#13855)
* Rename WRITE A POST to CREATE POST

* Revert schema line removal
2021-05-25 10:30:30 -07:00
Andrew Bone
61cd4b3e14
🚑 Quick fix prevent grammarly from running on chromium based browsers (#13820) 2021-05-25 06:54:32 -04: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
Andrew Bone
f6e222f12e
Fix layout shift on active crayons-tabs change. (#13300) 2021-05-12 11:45:36 -04:00
Suzanne Aitchison
2829c7f848
stop adding a false class (#13710) 2021-05-10 13:54:23 +01:00
Suzanne Aitchison
783fb6fa24
Accessibility enhancements to navigation tabs (#13559)
* update storybook example and docs

* update desktop home feed tabs with a11y enhancements

* update storybook to reflect buttons usage, update post editor buttons

* update admin html variants tabs

* update admin sponsorships tabs

* re-add flex to the crayons-tab class to prevent regression in tab components not updated

* Revert "update admin sponsorships tabs"

This reverts commit d9e4a5e4b0d362e38a11c795b35ceb4442bc4d90.

* Revert "update admin html variants tabs"

This reverts commit 3d9f119e88dc2f2f102d664c57a1f56413490a36.

* update search tabs

* update v2 form erb html

* update tag index tabs

* update notifications tabs

* label the notifications nav

* update mod sidebar tabs

* update main analytics page tabs

* add cypress tests for home feed tabs

* add tab tests for the post editor

* add cypress tests for tags index navigation

* fix UI issue with search tabs, add search cypress tests

* add tests for the analytics dashboard tabs

* add mod nav tests

* add notifications navigation tests

* get new handles after view switch

* replace hardcoded mod paths

* apply review suggestions
2021-05-07 15:24:34 +01:00
Rafi
41cc771839
Refactoring help component (and fragmenting it too) (#10895)
* Refactoring Help component

* Fixing typo

* Adding missing prop types

* Removing setCommonProps

* Moving show to parent component

* Renaming Format component

* Converting help component to functional component

* Removing html from state

* Fixing modal toggle and eslint errors

* Adding arria hidden

* Using optional chaining

* Fixing variable names

* Renaming state variable

* Adding jsdoc

Co-authored-by: Nick Taylor <nick@dev.to>
2021-05-05 12:58:40 +07:00
Nick Taylor
2b13b9a593
[15 minute fix] Cleanup of post preview E2E tests (#13376) 2021-04-13 10:56:24 -04:00
Andy Zhao
7b119057b3
[15-min-fix] Fix removing cover img from v2 editor and dashboard link (#13227)
* Navigate back to dashboard instead of article.path

* Set mainImage to null to remove image properly

* Use dashboard_path over string path

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

* Handle apostrophe edge cases

* Allow main image to be set

* Add new test for removing article cover img

* Use potentially less flaky find

* Use findByAltText instead of get

Co-authored-by: Michael Kohl <me@citizen428.net>
2021-04-12 09:34:30 -04:00
Suzanne Aitchison
aa22266e9d
[15 min fix] Allow resize hook to contrain max-height as well as min (#13269)
* allow resize hook to contrain max-height as well as min

* trigger checks
2021-04-06 12:11:03 +01:00
Suzanne Aitchison
100910a072
[15 min fix] ✂️✂️✂️ Remove preact-textarea-autosize library ✂️✂️✂️ (#13234)
* remove lib from title component, use hook instead

* remove lib from chat compose, and remove package
2021-04-05 09:23:29 +01:00
Suzanne Aitchison
6f057fc8ce
Add mention autocomplete to posts (#13101)
* WIP - initial exploration into post mentioon autocomplete

* replace the autosize textarea with mention autocomplete, adjusting height

* add cypress tests for mentioning in a post

* fix resizing of text areas

* refactor text area resize hook

* refactoring

* update cypress tests

* remove mergeRefs from utils, extract UserListItemContent

* allow useTextAreaAutoResize elements to have height greater than minimum, apply styles to container

* Trigger Travis CI

* Travis plz

* small refactors

* add comments and constants as per PR feedback

Co-authored-by: Nick Taylor <nick@dev.to>
2021-03-31 14:42:59 +01:00
Jacob Herrington
8ab31f624f
Add missing CSS class (#13053) 2021-03-19 08:55:25 -05: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
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