Commit graph

828 commits

Author SHA1 Message Date
Michael Kohl
7c7a8dcd45
Remove experimental /call functionality from Connect ✂️✂️✂️ (#12979)
* Remove Twilio gem

* remove VideoChatsController + views and specs

* Remove /call related code

* Update spec

* More JS cleanup

* Restore wrongly deleted files

* Remove obsolete files

* More cleanup
2021-03-17 17:06:15 +01:00
Rafi
09c645f5a1
Adding aria labels in Suggested people to follow screen during onboarding (#12384)
Co-authored-by: Nick Taylor <nick@dev.to>
2021-03-17 11:59:50 -04:00
Suzanne Aitchison
76a7ed6dbe
Update storybook autocomplete component (#12980) 2021-03-17 11:49:16 -04:00
Nick Taylor
c884082aa0
Turned off deprecated rule in jsx-a11y eslint plugin. (#12986) 2021-03-16 12:36:16 +01:00
Suraj Vishwakarma
3417dd5447
Fix : background box of the button on profile via chat section issue 2nd PR: #12879 (#12920)
* chat-profile

* updated-chat-profile
2021-03-12 13:32:13 +01:00
Suzanne Aitchison
494d92d74c
Create mention autocomplete: initial storybook component (#12831)
* initial setup of component

* initial styles applied

* add some initial docs

* small tweaks to story

* add some very initial tests

* tweaks to styles to add border bottom

* add some preact tests

* import default style in jsx, ignore in jest

* WIP - create MentionAutocompleteListener, attempt to position popover

* position dropdown correctly, exit selection in various scenarios

* refactor

* make sure cursor placed correctly after selection

* only import autocomplete when needed

* rename files, add jsdoc

* update tests and story notes

* tidy up scss file

* fix story styling

* fix aria label in story

* fix issue with key event not triggering in mobile

* position dropdown at input left if small screen

* fix issue with deleting and re-entering

* don't trigger search if directly following a letter or number

* stop change event being fired with highihted text

* move regex out of function into constant
2021-03-05 13:18:26 +00:00
Miguel Guardia
364c3a8252
Fix subscribe to discussion button when user is not logged in (#12837)
* Add logic to subscribe button that shows login modal if user is not logged in
Pass in userstatus to CommentSubscription
Remove logic that loads comment subscription button for logged-in users only

* Modify test to account for new userStatus input in CommentSubscription

* Change UserStatus to isLoggedIn
Add propType to isLoggedIn
Remove preventDefault from click event

* Fix indentation and input on commentSubscription test
Create new isLoggedIn variable that returns boolean
Replace all instances of userStatus to isLoggedIn
Create test for showLoginModal when subscribing
2021-03-03 18:50:29 -06:00
Jacob Herrington
92217be4ed
Add admin overview page (#12726)
* Add admin overview page

* Rename admin_portals spec

* Fix admin nav bug

* Add ahoy tracking to admin overview

* Fix PR Feedback

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

* Make decorative element more visible

* Remove inline layout styles

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2021-03-01 18:59:05 -06:00
Andy Zhao
1fd0ec4041
Try yarn instead over npm for storybook deploys (#12376)
* Try yarn instead over npm

* Remove ignore flag and use default flag

* Add yarn version

* Remove --docs

* Use NPM :( we don't have a yarn.lock in app/javascript

* Use NPM :( we don't have a yarn.lock in app/javascript

* Updated base to root to use yarn

* hack the command with cd 🙃

* debuggng

* copy package.json and yarn.lock from root

* Set flag to use yarn explicitly

* Oops

* Try a different way

* Package.json not yarn.lock

* Maybe??

* Install yarn with npm then run yarn install??

* Add a Node version

* Try one more thing...

* Syntax error

* I think it's working...

* nvm it didn't work

* Use any 14.14 node version -- syntax correct maybe?

* Fix broken redirects smh

* Update redirects for storybook

* Remove unnecessary redirect rule

* Trigger notifications

* Trigger notifications

* Remove some unused comments
2021-02-26 10:30:56 -05:00
Nick Taylor
bd46c1ff57
Added react aliases in Storybook webpack configuration. (#12825) 2021-02-26 09:25:38 +00:00
Jacob Herrington
e235036ecd
Fix typo (#12824) 2021-02-25 15:03:16 -06: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
Jacob Herrington
dd3121e91c
Add username to onboarding (#12697)
* Add username to onboarding

* Add margin to profile form error alert

* Update user controller for onboarding

Co-authored-by: Michael Kohl <me@citizen428.net>
2021-02-24 10:48:31 -06:00
Suzanne Aitchison
5bed8f56d4
improve keyboard accessibility of modals 12427 10610 (#12511)
* 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>
2021-02-24 16:01:10 +00:00
Nick Taylor
2bba2a6ee4
Added the @components webpack alias to the project (#12808)
* 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>
2021-02-24 16:07:48 +01:00
Suzanne Aitchison
5abe88c69b
Add skip links to readinglist, podcasts, and listings (#12769)
* add skip link functionality to readinglist, listings and podcasts

* fix initscrolling reference to podcasts
2021-02-23 08:33:26 +00:00
ludwiczakpawel
57bc51e65f
Sidebar fix on iPad (#12705)
* ipad sidebar fix

* ipad sidebar fix
2021-02-22 17:41:16 +01:00
Fernando Valverde
11da7ddb9f
Remove 'showing' from settings dropdown in mobile devices when page loads (#12753) 2021-02-19 16:47:38 -06:00
Nick Taylor
13803d94a9
Reading List 15 minute fixes to prepare for #11983 (#12710)
* 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.
2021-02-18 11:16:50 +01:00
Alex
d952e504a5
Close hamburger menu on click (#12723)
Co-authored-by: Nick Taylor <nick@dev.to>
2021-02-17 17:41:00 -05:00
ludwiczakpawel
1be3602724
Ghost textarea fixes (#12717)
* comment textarea padding

* font family fix

* one more
2021-02-17 18:33:08 +01:00
Nick Taylor
66e4747d3f
Change fetch to our request utility function. (#12709) 2021-02-17 10:37:05 -05:00
Dan Ott
544fa8d33e
Fixing gap property for all occurrences of flex to work in Safari (#12667)
* 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.
2021-02-17 11:40:38 +01:00
Suzanne Aitchison
c761c3f9a7
Provide skip links: Tweak skip link style, refactor main area ID (#12694)
* 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
2021-02-17 10:15:31 +00:00
ludwiczakpawel
74894fd90e
bugfix (#12703) 2021-02-16 15:50:37 +01:00
ludwiczakpawel
3b2480ed0a
CSS size reduce + cleanups. (#12625)
* tooltips 1.0.1

* tooltips 1.0.1

* fixes and cleanups

* whoops

* aria

* revert
2021-02-16 13:44:26 +01:00
Jacob Herrington
aae592f86c
Add JSDoc comments to Chat components (#12647)
* Add JSDoc comments to Chat components

* Expand documentation comment on ChannelImage

* Update app/javascript/chat/components/ChannelImage.jsx

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-02-12 17:21:13 -06:00
Jacob Herrington
4b9c62e585
Extract ChannelFilterButton from Chat.jsx (#12630)
* Extract ChannelFilterButton from Chat class
2021-02-10 11:23:49 -06:00
Katie Davis
4e1745ce4a
Revert "fix dropdown-menu not closing on mobile (#12602)" (#12644)
This reverts commit 063a1d2850.
2021-02-10 10:56:37 -05:00
Jacob Herrington
20f4890051
Replace redundant div with Fragment (#12613)
* Replace redundant div with Fragment
2021-02-09 11:41:46 -06:00
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