* WIP: add the validation
* feat/WIP: set the color of the button to red
* feat: change color temporarily
* feat: add accessibility for validation
* feat: add the styling changes for the multi input
* feat: add focus visible styling as well
* fix: add comma to scss file to separate attributes
* chore: rename regex to inputRegex
* refactor: move out validation into a function
* chore: rename regex to inputRegex
* feat: add a validation Regex as a prop
* feat: update the text description
* chore: update spelling oops
* feat: remove comment
* remove comments
* rename error
* feat: add showLabel and labelText to the stories component
* cater for when we don't pass in a validationRegex
* some small tweaks
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* refactor: use the DefaultSelectionTemplate to list out the items
* refactor: rename function so that we map it to the deselect item event
* feat: first pass of adding edit functionality
* feat: update the name of the function from clearSelection to clearInput
* feat: setup the edit state by ensuring that we set the editValue and the inputPosition and then use useEffect to monitor changes
* chore: remove the old method in favour of a shared component
* feat: set the order of the items
* refactor: rename handleBlur function name to handleInputBlur
* feat: ensure that the edit field gets resized according to its current input
* feat: oops add inputSizerRef
* feat: when an item is being edited we need to ensure that it gets set back into the correct position and that we clear the previous state
* feat: handle the actual resizing fo the field on an input edit
* feat: use a shared DefaultSelectionTemplate for both the multiautocomplete and the multiinput component
* feat: make the defaultSelectionTemplate customizable based on the variant adn the classname
* feat: pressing backspace will start editing a previous selection if there is one
* feat: read out the selected items as its removed or edited
* feat: pass the regex through as a prop
* feat: move the functions around
* feat: add screen-reader only class
* Update app/javascript/crayons/MultiInput/__stories__/MultiInput.stories.jsx
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* Update app/javascript/crayons/MultiInput/MultiInput.jsx
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* feat: add the props to JSDoc
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* add an xl breakpoint and use in member index view
* expand search controls at medium breakpoint
* tweak small screen layout options per breakpoint, add overflow button
* small fix
* switch where role appears depending on breakpoint
* adjust for smallest layout
* tweaks for medium layout
* tweaks for large layout
* tweaks for XL table
* add default placeholder, remove focus on first load
* fix some bugs re autofocus and mouse click to select
* allow custom selected styles to be passed in
* operate on objects with name property rather than plain strings
* WIP main functionality in place
* set default selections, allow a max to be placed on selections
* switch help context
* bug fixes to edit mode, static suggestions
* make sure suggestion resumes when edit begins
* cleanup and docs
* update existing form test
* add component tests
* add more component test cases
* refactor max selections flow, ensure default tag data only loads once
* stop removing combobox properties now the input stays visible
* add max selections test
* refactor
* make sure input refocus happens after blur event
* update cypress tests
* some small renames and doc changes
* only fetch exact matches from added tags
* fix test, update dark theme background
* set a max height on the popover, and ensure options can be scrolled into view
* woops - max height
* Update app/javascript/article-form/components/TagsField.jsx
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* refactors
* stop dropdown from flickering
* use ButtonNew
* remove redundant variant
* nudge PR checks
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* 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>
* enable debug for warnings in dev env
* remove preact/devtools call no longer needed
* fix majority of proptype errors on home page
* sweep up proptype errors from listings page
* fix article form error
* Some div soup to semantic markup.
* Small refactor to inline mapping of available tags.
* Renamed <ItemListTags /> component to <TagList />.
* Now a select is used for picking a tag to filter on.
* Added custom Cypress command to create an article.
* Added documentation for the create article custom command.
* Removed unnecesary properties from payload to create an article.
* reading list mobile view wip.
* Reworked styles in <TagList />.
* Reworked reading list to use <MediaQuery /> component.
* Removed bottom padding from reading list header.
* styling tweaks if there are no available tags.
* Added some E2E tests.
* Removed reading list component test in favour of e2e test.
* Made breakpoint values numbers.
* Added some padding and more grid gap to filter on small screens.
* Adjusted jest coverage thresholds as we're moving some tests to e2e tests.
* Reverting a VS Code setting change caused by one of my extensions.
* First pass for E2E tests for the reading list.
* Added some more grid gap.
* Fixed load next page to send tags properly.
* Added some more tests.
* Improved label and placeholder for text filter in reading list.
* Added more tests
* Fixed media queries so it works in Chrome as well.
* Removed aside as tag filters are not complimentary information.
* Update app/javascript/readingList/components/TagList.jsx
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update docs/tests/e2e-tests.md
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Turned off deprecated rule in jsx-a11y eslint plugin.
* Reverted to links instead of radio buttons.
* Added an all tags link and select option.
* Fixed relayout issue.
* Fixed View Archive button size.
* Fixed styling of the load more button.
* Fixed empty list issue toggling between archive and reading list.
* Fixed request changes from PR review.
* Removed CSS change that is no longer required.
* Trigger Build
* Fixed centering of items in top fieldset.
* Fixed issue with search text field resetting reading list.
* Fixed component tests for the reading list.
* Fixed empty state popping up between search queries.
* Fixed casing of fixture filenames.
* Update app/javascript/readingList/readingList.jsx
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Reverted change in reading list component test.
* Added missing JSDoc comment.
* Now links are in an unordered list.
* Promoted some CSS classes from the <nav /> to the <ul /> for spacing.
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* 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>
* 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
* fix: Clear chat input after Enter key submit
* fix: Rename Composer component
* test: Add integration tests for input value
* After pressing Enter
* After clicking Send
* After clicking Save edit
* After clicking Close edit
* i dont know how to test
* fix i guess
* layout update
* layout updates
* edit
* edit listing
* fix
* tags field
* specs|
* Update app/javascript/listings/__tests__/ContactViaConnect.test.jsx
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
* Stop allowing accented characters in tags
This commit will add strict frontend and backend validation for tags
disallowing accented characters.
* Update tags validation error message
* Add more character sets to tag validation spec
* Change models and related files
* Update controllers and specs
* More renaming
* Seek and destroy, I mean search and replace
* Round up the stragglers
* Ground control to Major Travis...
* More fixes
* PR feedback
* Various fixes
* Rename view
* Fix list query builder
* Unify request specs
* Fix some API spec errors
* Fix remaining API specs
* Make spec conform to API
* Fix leftover problems
* Fix JS tests
* Fix column name in select
* Fix API specs
* Fix search specs
* Paging Mr. Travis
* Add name to tags component
* Remove old form field
* Update Jest snapshots
* Put form field back in
* Remove explicit name from form field
* Add comment explaining keeping tag_list form field
* Typo - faciliate --> facilitate
* fix: glicth when using writing tags
* Revert "fix: glicth when using writing tags"
This reverts commit f3c7b44b51698921e621dde491aee28477a6d03d.
* fix: glitch when typing uncommon tags