* Remove search from connect
* Remove alternate approach
* Alphabetize CHAT_CHANNEL_PARAMS
* Remove default value for user_ids
* Add spec for result ordering
* Add flag link to profile dropdown view
* Add JS for flag button on profile
* Only show flag button to trusted users
* Quick fix for accidental unflagging
This will be more properly addressed in a future refactoring.
* Update reaction specs
* Update spec
* Make flagging togglable
* Make CodeClimate happy
* Revert accidentally changed file
* CodeClimate
* Update app/javascript/profileDropdown/flagButton.js
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* Add JSDoc
* Remove second popup
* Refactor and add system spec
* CodeClimate
* Change send to public_send
* Address PR feedback by @aitchiss
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* WIP - initial exploration into post mentioon autocomplete
* replace the autosize textarea with mention autocomplete, adjusting height
* add cypress tests for mentioning in a post
* fix resizing of text areas
* refactor text area resize hook
* refactoring
* update cypress tests
* remove mergeRefs from utils, extract UserListItemContent
* allow useTextAreaAutoResize elements to have height greater than minimum, apply styles to container
* Trigger Travis CI
* Travis plz
* small refactors
* add comments and constants as per PR feedback
Co-authored-by: Nick Taylor <nick@dev.to>
* Remove pro role on user, expose pro dashboard to all users as analytics
* Remove pro from Elasticsearch mappings
* Update user role docs to use :trusted over :pro
* Remove pro from Role model spec
* Remove more references to pro, as noted by @rhymes
* Now mention auto-complete dynamic imports are cached.
* Removed explicit setting of undefined.
* Put back setting window.Forem.mentionAutoCompleteImports to undefined to be explicit.
* Fixed bug with templates not being inserted for comments.
* Removed some trailing white space from a heading.
* Added custom Cypress command to create an article.
* Added E2E tests for creating comments on an article.
* Fixed adding a comment issue caused by mention auto-complete.
* Fixed a selector for the E2E tests.
* Removed some unnecessary white space and also making code climate happy.
* Updated E2E test.
* Added a bit more to the E2E tests.
* Now validation for comment doesn't need to loop through textareas.
* Merge remote-tracking branch 'origin/master' into nickytonline/fix-comment-template-insertion-bug
* Removed a similar spec file and added tests to the other file.
* wip
* Fixed bug where a response template could not be submitted.
* Added/updated E2E tests.
* Reverted a small change to condition for showing the combobox popover.
* Undoing some white space changes as not related to PR.
* Trigger Build
* Put back article seed data as it's used in tests outside of comment tests.
* Revert "Revert "Add (updated) mention autocomplete to post comments (#13061)" (#13116)"
This reverts commit e28bde043c.
* Fix issues with editing comments and arrow key navigation, update tests
* Update app/javascript/crayons/MentionAutocompleteTextArea/MentionAutocompleteTextArea.jsx
Co-authored-by: Nick Taylor <nick@forem.com>
* refactor adding of attributes
* destructure
Co-authored-by: Nick Taylor <nick@forem.com>
* Reinitialize variables in instantclick context
* Refactor and follow instantclick loading pattern elsewhere
* Actually fix conflicts oops
* Add navigation links to e2e seeds
* Add e2e tests for More button with instantclick
* Set element's onclick directly as opposed to use addEventListener
* Remove unnecessary null check
* Check for visibility instead of class list
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Chain .should since we can 👍
* Update test and seed data to account for merge
* Use .findAllByLabelText instead of .get
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* change tag to h2 to avoid the overflow
* delect commit
* make the font size bigger when screen size is more than 1000px
* Update chat.scss
Co-authored-by: Michael Kohl <citizen428@dev.to>
Co-authored-by: Michael Kohl <me@citizen428.net>
* Step one in populating the reading list with PG
This first attempt tries to recycle the `Search::ArticleSerializer` which is only
used in input in ES, but we're using it in output in PG.
For this reason it's currently 15.55x times slower
* Serialize only what is requested by the frontend
`Search::ArticleSerializer` which is only used in ES in the indexing step aims
to add as much info as possible for broader purposes, in this case
(with serialization in output) we should aim to save only what's requested from
the frontend.
* Optimize selection of articles columns
* Select only needed columns for users
* Compute total of reading list items
* Attach the basic filtering based on PG on the search controller
* Restructure in methods
* Add tags support
* Use LIKE on articles.cached_tag_list
* Fix tags as nil
* Fix default pagination
* Add optional FTS for reading list
* Reworded the tags comment explaining why
* Add index to reactions.status
* Fix total counter in Preact readingList component
* Fix total count in reading list backend search
* Add GIN index to articles.cached_tag_list
* Add service tests
* Add search request specs
* Added missing early return
* Update spec/requests/search_spec.rb
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* Extract MAX_PER_PAGE constant and add comments
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
* feat: add the nested sidebar with some elements
* feat: create a tabbed nav item menu
* feat: add the tabbed nav_item partial to the views that need tabbed nav items
* fix: change variable back
* feat: style the sidebar a bit more
* chore: add some more styles
* feat: add a spec for the nested navigational items
* refactor: a more dynamic tabbed admin helper
* feat: add some more nav items
* fix: controller for reports
* refactor: shorthand if statement
* chore: add the whitespace back
* refactor: rubocop fixes
* chore: use any
* chore: remove whitespace
* refactor: rename the variable
* refactor: use a DSL style admin helper
* chore: variable renaming and routes
* rubocop: fixes
* refactor: move files to more apt places
* chore: keep overview as it was previously
* Update app/views/admin/secrets/index.html.erb
Co-authored-by: Michael Kohl <me@citizen428.net>
* Update app/views/admin/shared/_tabbed_navbar.erb
Co-authored-by: Michael Kohl <me@citizen428.net>
* Update app/views/admin/badges/index.html.erb
Co-authored-by: Michael Kohl <me@citizen428.net>
* chore: disable blocklength
* refactor: move the logic to the model instead of in the view
* chore: remove get_ prefix
* chore: move the request mangling to a helper that finds the controller and scope
* Update app/helpers/admin_helper.rb
Co-authored-by: rhymes <rhymes@hey.com>
* Update app/helpers/admin_helper.rb
Co-authored-by: rhymes <rhymes@hey.com>
* refactor: Address feedback
* oops
* oops use tr
* feat: update specs
* feat: make the navbar a dropdown
* feat: add a cursor pointer to the dropdown
* feat: add the icons which results in changed data structure
* fix: badge achievements
* feat: rename to an html file, show and collapse links + show active links
* chore: rename tabbed view to an html file
* fix: scope should be apps not app
* feat: add icons for the admin menu
* feat: increase the margin left
* feat: move the overview into the feature flag block and add an icon
* chore:remove files
* chore: indent
* feat: update crayons -link to have no text-decoration
* feat: current link for a scope with one controller
* Update app/lib/menu.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* Update app/models/admin_menu.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* refactor: we added svg to the builder so remove it from creating the hash
* feat: undo change to crayons and add it to the admin stylesheet
* Update app/views/admin/shared/_nested_sidebar.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* refactor: change to use ul and li's + a button
* chore: add bracket to next line
* feat: add aria-page
* chore: remove brackets
* feat: added focus specifically for the sidebar
* Update app/views/admin/shared/_nested_sidebar.html.erb
Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
* chore: remove additional title
* chore: indent
* feat: add a visibilee keyword to the payload and set it to true by default
* feat: move the feature flagged routes into the correct sections
* feat: check if an item is visible before rendering it
* feat: amend the tabbed_navbar to be more accessible and add in visibilty checks
* chore: update comment
* chore: amend the styles
* chore: change url to path
* chore: comment
* test: add more tests
* Update app/assets/stylesheets/admin.scss
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/admin/shared/_nested_sidebar.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/layouts/admin.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* chore: merge
* feat: use focus for browsers that dont support focus-visible (I'm looking at you Safari) and move it within the crayons-link so we dont see it on mouse click
* WIP: first pass of stimulus controller code
* feat: interaction design
* chore: remove unnecessary condiition
* chore: only add transparent background when not the current link
* Update app/models/admin_menu.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* feat; comment explaining
* feat: add an id on the button to be clicked
* feat: disable currentNavItem
* chore: remove event params
* chore: update cursor
* feat: (safe fail)
only show the tabbed navbar when the roures contain values form the data structure
* chore: pass events through + tests
* trigger an onload event and test the disabling of the menu item
* refactor: tabbed menu items
* feat: account for the visibility of the feature flags
* chore: rubocop fixes
* chore: indentation
* feat: some refactors and updates for rubocop
* Update app/javascript/admin/controllers/sidebar_controller.js
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* feat: set to true
Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* add mention autocomplete functionality to article and notification comments
* add cypress tests
* make sure entry transitions dont replay
* undo change to async useeffect covered in other pr
* move search into dynamic import
* exit search if enter pressed in middle of search term
* refactor button activation code
* add a space after a mention is selected
* tweak cypress test for reply to ensure it awaits combobox
* small refactor
* 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
* 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
* 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
* Add username to onboarding
* Add margin to profile form error alert
* Update user controller for onboarding
Co-authored-by: Michael Kohl <me@citizen428.net>
* 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