Miguel Nieto A
148f242892
Replace listings tag component ( #16855 )
...
* wip
* feat: ✨ Use MultiSelectAutocomplete for Tags
* feat: ✨ Add additional tags for listings
* refactor: ♻️ Use preact/hooks and refactor propTypes
* fix: 🐛 Fix addiional tags support depending on the selected category
- Add slug to returned array in select_options_for_categories helper
- Differentiate the fields categoryId and categorySlug
* fix: 🐛 Adjust propTypes
* test: 🚨 Change test for select_options_for_categories helper
* refactor: ♻️ Apply requested changes
* refactor: ♻️ Remove border prop - default is true
* test: 🚨 Add test suite for ListingTagsField component
* refactor: ♻️ Apply requested changes
* refactor: ♻️ Remove unnecessary forEach + Improve code legibility
* docs: 📚 Remove topTags from hook documentation
* refactor: ♻️ Use the alias for crayons folder + Use loclaCompare in sort
* test: 🚨 Clean up mock response
* fix: 🐛 Reorder styles
* style: 🎨 Add comment to TagAutocompleteOption/Selection components
2022-03-30 16:51:40 +01:00
Nick Taylor
6b21fe2bac
Fixed test that breaks once upgraded to Node 16. ( #15621 )
2021-12-01 09:24:03 -06:00
Suzanne Aitchison
58e3d6efd5
Suggest top tags when tag search is empty ( #14817 )
...
* show top tags when search is empty
* add cypress tests
* nudge travis
* tweak to e2e test
* show a 'top tags' heading
* only suggest tags that are supported
* Add supported scope to Tag
Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-09-30 09:41:20 +01:00
dependabot[bot]
f0700b2588
Bump jest from 26.6.3 to 27.2.0 ( #14722 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-09-14 11:20:15 -04:00
Nick Taylor
e0ee5e71f4
Some eslint fixes. ( #14605 )
2021-08-27 08:37:09 +01:00
Nick Taylor
d90e5662ef
Created the <MediaQuery /> component and useMediaQuery hook. ( #12809 )
...
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-02-25 14:28:44 -05: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
Rafi
335957edd5
Adding focus trap to trap focus within the modal ( #12366 )
...
* Adding focus trap to focus trap in the modal
* Adding yarn lock
* Removing Fragment
* Fixing focus trap casing
* Adding waitFor
2021-01-28 10:18:21 +01:00
Nick Taylor
bf7780cd2c
Ran prettier on *.js, *.jsx and *.md files. ( #11586 )
2020-11-23 20:45:50 -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
Robin Gagnon
27a3df7d73
A11y: Add keyboard navigation to article feed ( #10468 )
...
Co-authored-by: Andrew Bone <AndrewB05@gmail.com>
Co-authored-by: Nick Taylor <nick@dev.to>
2020-11-10 22:38:15 -05:00
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