* 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>
* Added the @shared webpack alias to the project.
* Added some documentation.
* Fixed a copy paste error.
* Renamed @shared to @components.
* Update docs/frontend/webpacker.md
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Some div soup to semantic markup.
* Converted an import to use our webpack @utilities alias.
* Removed unnecessary t variable to house .
* Removed state that can be derived from other component state.
* Removed unused state property .
* Reverted to <div /> as per PR feedback.
* Use grid instead of flex
* Use child margin instead of flex gap
* use .grid instead of .flex.flex-column
* Missed one conditional flex gap
* gap-2 safely deleted since there’s only one element
* Add class for crayons-btn-actions
This pattern occurs pretty often. Easy class addition and easy swap out once flex gap is supported in target browsers
* Use crayons-btn-actions
* Adjust styling to use negative margins
* apply crayons-btn-actions
* use margin-right instead of gap
* use .grid instead of .flex.flex-column
* use margin instead of gap for indicators/tooltips in headings
* remove unused class for clarity
* use flex and add margin to small element
* remove gap from flex container and add margin to figure
* crayons-article__main has neither flex nor grid thus gap has no effect
* fix typo
* use actual grid columns
* use gap instead of flex-column
* Apply crayons-btn-actions
* Fix modal window display
* Safari bein a real pain here
Apparently Safari uses a different model to calculate height than other browsers. who knew.
* change home page main id to main-ontent, update scroll, refresh and shortcut handlers
* update articles by timeframe test with new main-content id
* tidy up css
* Trigger Travis CI
* undo unneeded changes
* small refactors
* Fix typo in alt text
* Convert unsemantic div into nav
* Remove commented CSS
* Refactor connect config menu to be more usable
* Remove unused prop
* Return focus to button when config menu collapses
* Fix aria-label
* Add aria-expanded and fix aria-label text
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Add transparent background-color to config menu button
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* 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>
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>
* Added svg image picker to navigation link form
* Added svg image picker to navigation link form
* removed unnecessary attribute at _form.html.erb
* Added targets into SvgIconUploadController
* Fixed accept file type in .erb and stimulus controller
* Fixed UI form elements
The phrasing of this may reflect the code, but is a little confusing. A
user might not understand what a "joining request" is, so we should
probably just keep things simple for the time being.
* feat: add an error column to the data update script
* feat: save the error to the error field
* feat: save the error when the script fails
* feat: show the script error on the data update script page
* chore: pass the error to mark_as_failed instead of having its own function
* refactor: use presence
* test: ensure that we test an error case of a data update script
* chore: rename errorneous to failing
* test: update some specs, working on the others
* chore: update tests now that there are two files
* chore: change error from a string to a text to allow for more char
* feat: order the data update scripts by the latest script that ran
* feat: when the script has succeeded reset error to nil
* feat: create a model function that will allow the script to be force run
* chore: oops remove the functions form the worker to the model so it can be re-used
* feat: create an endpoint that will call the model method force run when we hit the api by clicking the button
* feat: ensure that the we add an ajax call that calls the controller endpoint
* chore: remove newline
* refactor: change to a more Restful route
* refactor: use Stimulus
* fix: move the code from the model back into the worker so that we can reuse it in the controller
* feat:call the worker in the force_run action and create a show route
* feat: very first draft of using a polling mechanism on the show method after we kickoff the sidekiq job (still need to error handle)
* chore: some syntax changes and unused variables
* fix: call the method correctly with the paramters
* feat: do some error handling
* feat: error handing on the frontend
* chore: use e instead of err
* refactor: just pass the id instead of the whole script
* chore: remove the button
* fix: allow the id to be passed
* feat: handle errors better
* feat: limit the filename column width
* refactor: use a common function to set the banner error
* test: add a test fro rerun button
* test: v1 of the data update script request
* test: write some specs for the js controller
* Update app/controllers/admin/data_update_scripts_controller.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* tests: update the data worker spec
* chore: clean up the js controller and its tests
* chore: remove whitespaces
* chore: swap the functions based on the controller
* chore: updates to the UI
* chore: remove the standard error catch
* chore: update the alert and error messages
* chore: remove test for error handling for sidekiq run
Co-authored-by: Michael Kohl <me@citizen428.net>
* Improve keyboard a11y of header menu dropdown
This commit also includes some cleanup of unnecessary functions that seemed to degrade performance.
Closes https://github.com/forem/forem/issues/1154
* Add temporary focus style on navigation-button
* Put menu items in a list
* Adjust menu button based on VoiceOver testing
* Refactor menu logic to be reusable/work on touch
* Preserve admin link visibility
* Focus on first item on menu open
* Clean up some HTML and CSS
* Apply suggestions from code review
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
* Ensure menu hides on click outside
* Rename toggle function and adjust formatting
* Update nav button focus style
* Clean up padding on header avatar focus style
* Make button show focus state for keyboard only
Using .focus-visible:focus targets keyboard focus and eliminates a flash of the blue border on click before focus is moved to the child item (which also has no focus style on mouse click)
* Update app/views/layouts/_top_bar.html.erb
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
* Add some defensive programming
* Removed initializeTouchDevice from base.js.erb
* navigation-butt ID is now member-menu-button
* Moved all the logic from initializeTouchDevice.js into a pack file/utilities.
* committing re-ordered schema after setup
* add tests for initializeTouchDevice
* remove some unneeded html setup
* make sure menu doesn't close if user tabs back from sign out
* Revert "committing re-ordered schema after setup"
This reverts commit a41a1c861cca3b97d8a7b8a99268b8afaae9f028.
* optimized code
* small tweaks, only show outline when focused
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Fixing link focus
1. Removing display content from link
2. Removing extra margin at the top of link
3. Adding before link
* Extending crayon-fields and removing margin-top
* Frontend Ready for Connect Report Abuse
* add feedback api
* js defination fix
* Added Hooks to the Component
* add json response in feedback
* Block popup added
* fix render issue
* Made changes in internal view
* change error message
* Added few design changes =
* add test cases
* Update app/javascript/chat/actions/requestActions.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* add PR suggestions
* add backend test cases
* report abuse form close
* Update app/javascript/chat/actions/requestActions.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Update app/javascript/chat/ReportAbuse/index.jsx
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* add test cases
* Update app/javascript/chat/ReportAbuse/index.jsx
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Update app/javascript/chat/ReportAbuse/index.jsx
Co-authored-by: Marcy Sutton <holla@marcysutton.com>
* Update app/javascript/chat/ReportAbuse/index.jsx
Co-authored-by: Marcy Sutton <holla@marcysutton.com>
* group the fieldset
* fix report abuse api
* fix test case
* fix request test case
* fix typo
* cleaned up markup in report abuse component.
* Fixed spacing between abuse options.
* Fixed wording in report abuse confirmation.
* Removed unnecessary data-testid and aria-label attributes.
* Added some top margin to the report abuse form.
* Update app/javascript/chat/message.jsx
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Added a legend to the the fieldset.
* Update app/javascript/chat/actions/requestActions.js
Co-authored-by: Michael Kohl <citizen428@dev.to>
Co-authored-by: Sarthak <7lovesharma7@gmail.com>
Co-authored-by: Narender Singh <narender2031@gmail.com>
Co-authored-by: Marcy Sutton <holla@marcysutton.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Display message from the back end when leaving a channel
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
Co-authored-by: Alberto Pérez de Rada Fiol <apdrf.94@gmail.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
* allow keyboard access to dropdown stories
* add accessibility notes to dropdown stories
* manage focus in html example
* Update reference to aria attributes in notes
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* add focus style to link for keyboard users
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* Start hooking things up
* further generalize adminModal, hook up relevant code
* Complete implementation
* remove comments
* Address QA suggestions
* Address QA suggestions
* Use object parameter for adminModal
* starting the admin cypress tests
* Code review suggestions
* remove incomplete test
* rename data attributes to make more sense
* complete the work
* use destructuring
* edit warning modal text