Commit graph

798 commits

Author SHA1 Message Date
Jacob Herrington
ae4ca6d94b
Enable eslint in chat.jsx (#12617) 2021-02-09 08:19:05 -06:00
Jacob Herrington
2c0bbe317b
Convert Connect settings menu div to nav (#12578)
* 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>
2021-02-08 14:56:35 -06:00
Jacob Herrington
e921952414
Fix a false positive test (#12561) 2021-02-08 11:41:12 -06:00
Tulio Calil
063a1d2850
fix dropdown-menu not closing on mobile (#12602) 2021-02-08 17:07:41 +00: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
João Gabriel Quaresma
b1e0dbcfa9
Add icon uploader in admin navigation links (#12388)
* 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
2021-02-04 13:54:59 +00:00
Ridhwana
d67a259d91
feat: update the messages on the page to use the filename instead of the id. (#12568) 2021-02-04 15:50:02 +02: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
Jacob Herrington
a1799dee01
Update verbiage around connect invitations (#12558)
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.
2021-02-03 18:15:43 -06:00
Rafi
ef9336f5ed
Refactoring SidebarWidget and sidebarUser (#10887)
* Refactoring suggested users

* Refactoring sidebarUser

* Returning null instead of empty fragment

* Removing useCallback

* Removing empty object

* Removing use callback

* Removing index prop

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-02-03 17:47:54 +00:00
Ridhwana
def4b95616
chore: counter should be 20 not 0 :/ (#12555) 2021-02-03 14:31:41 +02:00
Nick Taylor
4a67d66ec5
Stimulus controllers needed to be default exports. (#12543) 2021-02-02 13:35:28 -05:00
Katie Davis
7fdb16c577
remove default import for onboarding (#12541) 2021-02-02 12:46:39 -05:00
Ridhwana
530e927060
Add ability to re-run a data script from the the data update script page (#12424)
* 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>
2021-02-02 17:24:39 +02: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
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
Arit Amana
23f3386f3f
Don't display '0 reactions' on article feed (#12425)
* Implement for Feed Card only

* update snapshot

* write tests

* Implement changes in other article-feed-card views

* modify failing spec

* Address code review comments
2021-01-27 11:13:10 -05:00
Marcy Sutton
f072730f0f
Header navigation dropdown accessibility (#11509)
* 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>
2021-01-27 09:39:17 +00: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
Rafi
931d9169fd
Fixing link focus (#12362)
* 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
2021-01-22 09:26:51 -05: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
Rafi
940c7ee37d
Adding aria labels and role to onboarding modal (#12363)
1. Adding role dialog
2. Adding aria-labelledby and aria-describedby
2021-01-21 13:58:55 -05:00
Nick Taylor
86eb75cee7
Report a Message in Connect (#12229)
* 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>
2021-01-19 12:07:47 -05:00
Jacob Herrington
db335ff84b
Display message from the back end when leaving a channel (#11711)
* 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>
2021-01-19 09:06:47 -06:00
Suzanne Aitchison
516bab133f
Storybook dropdown should be accessible 11724 (#12295)
* 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>
2021-01-19 08:51:37 +00:00
Nick Taylor
425c3072f7
Fix broken test pre-Preact upgrade (#12328)
* Removed import of xss as it already happens in testSetup.js

* Fixed invalid setting for a the children prop.
2021-01-18 14:39:17 -05:00
Ben Halpern
472c3d2922
Fix and refactor hide user content (#12307) 2021-01-18 11:08:23 -05:00
Arit Amana
3a984c8ee7
[2020 EOY Issue] Modal alert when enabling Auth Provider without keys (#12135)
* 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
2021-01-13 13:54:39 -05:00
rhymes
202053cf96
Admin: Change label of toggle buttons in Configuration panel (#12183) 2021-01-11 16:38:16 +01:00
Michael Kohl
2e202b0399
Remove looking for work columns (#12173)
* Remove looking for work columns

* Fix schema.rb

* Undo accidental change

* Update spec
2021-01-11 11:22:39 +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
Chien-Wei Huang (Michael)
025a46e012
Update all followed tag with one click (#11454)
* Replace follows#update with follows#bulk_update

* Allow follows#bulk_update to receive multiple follows and remove follows#update

* Add FollowPolicy#bulk_update? and remove update?

* Combine save button into one in following_tag.html

* Rename follows_update_spec to follows_bulk_update_spec and update

* Update buildTagsHTML to conform to the view

* Allow scrolls down dashboard test to update multiple tag values

* Includes follower and followable in follows#bulk_update

* Mark and pass changed field.

* fix typo in html

* Update follows in transaction

* Extract js script to another file and update view

* Rename disableUnchangedButton.js to dashboardTagsDisableUnchangedButtons.js
2021-01-05 16:15:37 +01:00
Ben Halpern
b8ff9a4565
Small clean ups in post form (#12113) 2021-01-05 08:52:36 -05:00
Andy Zhao
06d6089d73
Use anchor tag instead of button for edit/delete links (#12098)
* Use anchor tag instead of button for edit/delete links

* Remove unused class

* Use proper instance variable
2021-01-04 11:03:15 -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
Ben Halpern
c668496e9a
Remove swipe gestures and other unnecessary code (#12027) 2020-12-30 12:17:29 -05:00
Julianna Tetreault
ca6ba1af7d
Replace collective_noun with community_name (#11846) [deploy]
* Removes collective_noun and collective_noun_disabled from app

* Config Generalization: replaces community_qualified_name with community_name
  - Generalizes SiteConfig after the removal of collective_noun field
  - Updates copy where necessary to be readable with community_name
  - Makes the community_name SiteConfig description more explicit
  - Adds flexibility for Admins by removing appended "community"

* Adds a data_update script to remove collective_noun and collective_noun_disabled

* Removes appended community from stories_controller.rb

* Removes unnecessary quotation marks around SiteConfig.community_name.to_s

* Makes SiteConfig community_name description more explicit

* Removes topic from #email_from and replaces arg with _

* Removes argument from #email_from (facepalm)

* Reverts changes to application_mailer and notify_mailer_spec

* Removes default "Community" topic from application_mailer and makes topic optional

* Refactors #prepopulate_new_form to resolve Code Climate failures

* Refactors #email_from even further by use of a ternary operator per review suggestion

* Simplifies the data_update script used to remove collective_noun per review request

* Adds a data_update script to append community to community_name

* Updates data_update script to correctly append Community to community_name

* Removes RemoveCollectiveNounFromConfig and updates other script

* Removes superfluous false from data_update script

* Updates data_update script to be more idiomatic
2020-12-28 09:34:17 -07: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
narender2031
01f7dbd24f
fix mention in chat (#10493)
* fix mention in chat

* fix mention bug

* fix conflict issue

* fix load channel issue initally render

* add test case

* remove comments and add nitpick
2020-12-23 06:21:28 -05:00
Sarthak Sharma
bb532d39b3
Canvas in draw in now responsie 🚀 (#11876) 2020-12-15 13:08:09 -05:00
rhymes
8a9bb8e9ff
Switch node-sass to dart-sass (#11873)
* Quiet StoryBook on Travis

* Fix StoryBook glob

* Switch node-sass to dart-sass

* Fix Netlify build error

* Tell Netlify to install Yarn

* Netlify defaults to npm, let's stick to it
2020-12-14 22:06:06 -05:00
rhymes
174950a827
Remove duplicate test file (#11883)
* Remove duplicate membership test

* Restore single Membership.test.jsx
2020-12-14 14:59:26 +01:00
benhalpern
ae7c9a4f75 Fetch homepage right sidebar async (and don't fetch for narrow screens) 2020-12-13 18:41:47 -05:00
Ridhwana
7a9629172d
Profile generalization for the onboarding workflow (#11629)
* feat: v1 of the profile form

* feat: fix inputs and create a handleChange event

* feat: update the submit values to represent values from the form

* feat: ensure that errors and success is handled on send

* refactor: remove unused code

* feat: replace the old profile form with a new one

* fix: use the renames file

* refactor: safety net for groups

* chore: fix code climate issue

* tests: amend + add tests

* test: fix broken spec

* feat: update the setup for the test

* tests: refactored them to move the fake response into the before all

* feat: clunky way to quickly cater for color field since it was a quick and easy implementation

* feat: add a field.description to the color field

* refactor: pull some duplicate code into a new function

* chore: cater for a textarea field

* overflow issue

* refactor: use FormField instead of manual divs

* Update spec/requests/users_onboarding_spec.rb

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Update spec/requests/users_onboarding_spec.rb

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* refactor: move out of method and into a constant

* refactor: user_onboarding_update to be more readable

* refactor: use current.save instead of declaring a new variable

* refactor: remove explicit check for bookean

* refactor: use request from '@utilities/http' instead :)

* refactor: no need for if with destructured groups

* refactor: move color field to its own component

* chore: remove colorfield now thats its a component

* fix: forgot about field

* feat: a text area component

* chore: remove textField function in favor of component

* refactor: checkbox refactor

* refactor: add a switch statement

* chore: move into a more organized folder

* fix: move the handler to props and off from field

* fix: add a conditional so we dont hit an error undefined method `success?' for nil:NilClass

* refactor: change from component to function

* feat: add a key attribute

* refactor: add role for readers

* refactor: remove unnecessary guard clauses

* refactor: use function instead of an arrow

* chore: document components

* test

* padding

* fixes

* test: fix the tests by using more general matchers

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-12-08 19:53:00 +02:00
ludwiczakpawel
73e560f7a2
Updating navigation (especially mobile) (#10424)
* .

* .

* .

* .

* .

* specs

* specs

* .

* .

* merge

* moving cheese around

* layout

* .

* merge

* Fixed invalid selector for search.

* Fixed issue with URL not updating after a search.

* do things better

* kinda merge

* whoops

* whoops

* .

* .

* im a backend developer

* tooltips 1.0.1

* tooltips 1.0.1

* fix

* specs

* .

* reduce the spacing

* schema drop

* reverts

* revert

* reverts

* revert

* drop unused nav

* drop unused nav

* drop unused nav

* drop unused nav

* typos

* paths fixes

* speeding up JS

* js

* search

* Reworked initializeTopBarIcons.js

* Reworked initializeNavigation.js

* Small refactor and updated exported function API docs.

* Fixed a bug I created when refactoring the top navigation icons.

* sidebar nav links

* spec

* Fixed issues with logged out experience for top nav icons.

* Small refactor of top nav icons.

* Small refactor and added some API docs.

* Added @testing-library/dom

* Added tests for top navigation utilities.

* spec

* spec

Co-authored-by: Nick Taylor <nick@dev.to>
2020-12-08 15:59:21 +01:00