Commit graph

11 commits

Author SHA1 Message Date
Andrew Bone
75bec9b705
Add chaining to shortcuts (#11113)
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-11-10 09:21:39 -05:00
Andrew Bone
b7dfb2495a
Allow keyboard shortcuts (#10713)
* Create keyboardShortcuts.jsx

Add handler for keyboard shortcuts

* Match github's hotkey style

Makes objects clearer.

* Update keyboardShortcuts.jsx

* Allow single character shortcuts

update to allow single character shortcuts/hotkeys

* Add component documentation

Add inline documentation for the component.

* Fix example typo

* Move keyboardShortcuts to a hook

* Fixed useKeyboardShortcuts example

* Rename keyboardShortcuts.jsx to useKeyboardShortcuts.jsx

* Rebuild

* Move isFormField outside render cycle

Move the isFormField function outside of the render cycle.

* Prevent event listener on empty object

Don't add an event listener if the shortcuts property is an empty object or is null

* Add tests for useKeyboardShortcuts

Initial pass for adding tests to useKeyboardShortcuts

* Missed unmount

Missed a whole word...

* Fix typos

* Convert function type

* Add new test cases.

* Missing brackets

* Typo

* Update useKeyboardShortcuts.test.jsx

* Move event listener to document

* Update tests

* Use testing-library/user-event

* Correct fireEvent

* Update keyDown

* Slight tidy

* Change order, just in case

* Swap to render

* Make function async

* Rerun travis

* Add rerender

* Fix render function

* check event.key for fallback
2020-10-22 13:45:42 +02:00
Rafi
ea74a3d390
Using global util function for displaying date in listing dashboard (#10244)
* Common date util function for listing dashboard

* Making dateTime required

* Fixing typo

* Fixing tests

* Fixing deletion of function in globalThis
2020-09-09 09:35:05 +02: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
Nick Taylor
6542395b38
Upgraded to preact testing library 2.0.0 (#9103) 2020-07-06 14:53:10 -04:00
Nick Taylor
09bb730f9d
Added a11y tests to frontend tests that were missing them (#8873) 2020-06-24 14:38:39 -04:00
Nick Taylor
653ec12300
Upgrade to Preact 10.4.4 (#8739)
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-06-18 10:07:17 -04:00
Nick Taylor
530b13e8c7
made all frontend unit tests uniform by preffering it(...) over test(...) (#8113) 2020-05-28 17:18:15 +02:00
Molly Struve
a0c0e7c7e3
remove leftover algolia test code (#6409) [deploy] 2020-03-02 13:58:13 -05:00
Colby Melvin
4531679c23 fix tag input swallowing numeric keycodes [deploy] (#4283)
* fix tag input swallowing numeric keycodes

* add AR validation for Tags class

* allow whitespace in Tag.name

* fix specs

* whitespace

* reformat
2019-11-05 16:20:34 -05:00
Leonid Trofymchuk
5e347a6f94 Simplify key codes expression in Tags component (#4248)
* Simplifying this key codes expression in Tags component

* Refactor KeyboardEvent keyCode to key

* Simplify cyrillic letter regexp

* Wrap condition in 2 lines
2019-10-09 16:50:48 -04:00