* Set no-var eslint rule to error.
* Fixed npm script lint:frontend
* Replaced vars with lets as per new no-var erroring out rule.
* Fixed lint errors that surfaced after fixing the lint:frontend npm script.
* feat: add a color contrast utility
* feat: add an error when the color contrast is low
* feat: add form validations
* refactor: treat WCAGColorContrast as a library that can be intercanged at any time
* fix: styling
* test: add a test for the contrast
* feat: add test for WCAGColorContrast
* feat: update cypress tests for brand color and color contrast ratios
* feat: update the message to read better
* chore: update the styling
* refactor: address all feedback/suggestions
* Update cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Replaced other .trigger('change')s with .blur()
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Nick Taylor <nick@dev.to>
* initial add of toolbar to v2 editor WIP
* fix Form test knocked out by rebase
* basic image upload functionality added to toolbar
* add cypress tests for toolbar
* move image tests to previous cypress spec
* test markdown insertion from buttons in jest
* small tidy up
* remove right padding in scrollable layout, hide scrollbar
* update tests following new line changes
* add more doc comments
* tweak padding css
* create constant for image placeholder
* add image uploader change missed in staging after merge conflict resolution
* window.ForemMobile namespaced functions
* Fix broken Buildkite
* Wait for data-loaded before using Runtime in pack
* Bring back sprockets base
* Better error handling
* Smal fixes to ConsumerApp to support Android platform
* Fix typo
* utilities/waitForDataLoaded.js
* Update app/javascript/utilities/waitForDataLoaded.js
Co-authored-by: Nick Taylor <nick@forem.com>
* Review feedback
* Fix failing spec
* Cleanup promise
* Remove old utility file
* Add Cypress check for namespaced availability
* More specs
* Refactor to rely on ForemMobile for native bridge messaging
* Fix spec/requests/api/v0/instances_spec.rb
* Fix devices spec
* Remove changes to /api/instance
* Refactor to dynamic import
* Fix typo
* Fixed custom event detail payload for tests.
* mock ForemMobile function instead of webkit call directly
* failing jest test debug
* Another attempt
* Fixed broken test that was missing an onMainImageUrlChange prop on the component.
* Fixed mobile bridging E2E tests.
* Move Cypress tests to mobileFlows
* Add JSDocs + cypress spec for injectJSMessage when logged out
* Cleanup + Disable native image upload until AppStore approval
Co-authored-by: Nick Taylor <nick@forem.com>
Co-authored-by: Nick Taylor <nick@dev.to>
* Added alias for app/javascript/controllers
* Added hooks for Stimulus controller.
* Fixed eslint issue with @controllers alias.
* Initial working logo preview.
* Added explicit accept values for png and svg files only for a logo.
* Fixed content layout shift issue and resize to max height 80px.
* Cleaned up logo preview resizing.
* Added focus style to Upload logo label.
* Now the logo preview image has empty alt text as it's visual only.
* Fixed position of upload logo button.
* Removed tooltip for logo.
* Fixed check to load client-side controller.
* Put back tooltip, minus the aria-describedby
* Fixed E2E tests I broke.
* Made the logo preview visible to the accessibility tree.
* feat: update the brand colors on the page when we select a new one
* feat: update the radio button_tags to use crayons-radio
* feat: remove the fill attributes in the svg
* Added support for JPG image upload.
* Fixed height adjustment when width exceeds max preview width.
* feat: add form-background class with an accent
* feat: update the briightness accent on the page
* Fixed JS error if user cancelled file selection for a logo.
* Added the @routes webpack alias for routes.js.erb.
* Fixed data tooltip for assistive technologies.
* Fixed preview logo alignment with upload logo button.
* remove required as it's not doing anything
* feat: update the code brigtness code
* Opting to not show friendly error message if route fails to load.
* Fixed validation message not appearing for logo.
* Revert "Added the @routes webpack alias for routes.js.erb."
This reverts commit 3b6621dcde541f2fa05df6ff75af38955842b88e.
* Reverted to default styling of input[type="file"].
* Moved creator_settings_controller to admin/controllers.
* Updated E2E test for logo preview on the creator settings page.
* create tests for the brand color updates
* feat: update the description
* Update cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Update app/javascript/admin/controllers/creator_settings_controller.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* feat: do not update branding if an invalid color is provided
* feat: move the brightness code to its own accent calculator file in js utilities
* test: brightness ratios
* chore: remove whitespace
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Remove Connect
* Remove more Connect specs
* Remove a lot more Connect code
* 🚮
* It all has to go
* Explicitly add httpclient
* Update application layout
* Remove messages association from User
* Start fixing specs
* reintroduce util function and refactor references
* Remove Connect Cypress test
* Fix more specs
* Remove Connect from listings
* Ignore contact_via_connect column on listings
* Remove contact_via_connect usages
* Ignore mod_chat_channel_id on tags
* Drop Connect tables
* Remove email_connect_messages from user notification settings
* Re-add httpclient 2.8.3
This was mistakenly removed as a merge conflict
* Don't need to exclude removed chat channel file
* Remove unneeded style for chat channels
* Remove unneeded channel list prop type
* Remove chat channels index/connect-link from getPageEntries
* Re-add comment from httpclient in Gemfile
* Remove connect references from mailers
Tag Moderators no longer have a chat channel
No longer will users be notified about new messages (there won't be
any)
No longer will users be notified about channel invites (you can't
invite anyone anymore)
* Don't configure Pusher and remove PUSHER_* from .env_sample
since it's removed from gemfile, the Pusher constant will not resolve, if this is
configured in the environment variables we'll fail to boot.
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Dan Uber <dan@forem.com>
* WIP - main formatters with undo syntax
* tests for new text area utils
* WIP: formatters undoing and formatting, tests to follow
* small tweak
* WIP - tweaks to heading
* add heading level tests
* refactor link formatting into separate functions, flesh out tests
* add missing test case, adjust link undo
* rough starting point, roving tabindex in toolbar, bold and italic buttons
* refactor, add link
* add ul
* add ordered list
* core formatters in place, wip
* overflow options
* add keyboard shortcuts
* tidy up some dodgy classes
* add mocks for runtime in test and storybook, use correct modifier key for tooltip
* style tweaks
* refactor tooltips
* add markdown formatters tests
* add tests for toolbar component, fix mistake in overflow menu tooltips
* undo change no longer needed to button
* fix issue accessing runtime in formatters file
* only show darkened buttons and tooltips when focus-visible is true
* mobile view
* fix for responsive buttons & roving tabindex
* tweaks from PR review
* update cursor position on link insertion
* add a new line after block selection formatting
* align icons in center
* tidy up overflow menu listeners
* small refactors
* test for new text area util
* tidy up new lines after syntaxes
* fix logic in cursor offsets for links
* prevent scroll jumps after inserting syntax
* some style tweaks
* insert level 2 heading with new lines above and below
* update icons
* use margin instead of gap
* Admin-configurable display locale
* Add i18n-js and namespacing
* Basic tests and clean up
* A few test adjustments
* Update vendor cache
* Fix a few tests
* Fix a few tests
* Update app/views/articles/_actions.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/articles/_comments_actions.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/articles/_single_story.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/articles/_single_story.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/comments/_comment_header.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/layouts/_sidebar_tags.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update app/views/listings/index.html.erb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update spec/system/homepage/user_visits_homepage_articles_spec.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Update spec/system/user/view_user_index_spec.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Alphabetical locale page
* Add activerecord custom validation error translations
* Add i18n to webpacker
* Fix a few tests
* Adjust error messages
* Add i18n-tasks
* Adjust JS to get working with jest
* Adjust the way translations are pulled in
* Adjust jest tests
* Remove time localization
* Remove superfluous public js
* Add basic tests for i18n application controller
* Remove unnecessary content
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Fixed an issue with the moderation button not appearing on some posts.
* Added some E2E tests to ensure moderation button is on posts for trusted users.
* Added some more tests.
* Added a test to ensure moderation button does not appear when logged out.
* use the dropdown initializer in post editor options
* use dropdown initializer in comment subs dropdown
* use Dropdown component in listings
* show the dropdown button when it's focused
* update storybook notes and components
* add cypress tests for post options dropdown
* add comment subscription tests
* make sure page is properly initialized before setting button functionality
* add jsdoc comments, props types, rely on optional chaining
* Update app/javascript/crayons/Dropdown/__stories__/dropdowns.md
Co-authored-by: rhymes <github@rhymes.dev>
* Update app/javascript/crayons/Dropdown/__stories__/dropdowns.md
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: rhymes <github@rhymes.dev>
* make connect message dropdown accessible
* add a cypress test
* use crayons buttons throughout
* fix some unhandled error affecting cypress
* make message options a list
* minor tweak to test
* guard against filter error being triggered in test
* utilise newer dropdown helpers
* wait for message to fully send
* use optional chaining
* replace inline attribute defer with external js - show.html.erb
* fix typo in filename
* disable no-undef and bail if not defined
* put js on subfolder utilities
* refactor jsx instead of loading chunk with defer
* fix typo in desc
* better name for global gist helper
* use InstantClick
* working script on preview AND single view, not dynamic import, though
* embed only if gists
* combine all approaches to make dynamic import work
* make gist embeds work on submit comment form
* make gist embeds work on preview comment
* refactor - preview comments and submit
* add pack editComment + helper embedGistsInComments
* comment gist helper
* delete useless file utility
* use new syntax for events
* put code in method embedGistsInComments
* delete older pack gist
* handle edge case 'view full discussion'
* resolve conflict with package ibm-openapi-validator
* resolve conflict with package husky
* empty commit to test random error travis
* better name for class dismiss
* handle future events submit
* delete test code on click toggle form
* delete unused file
* rename pack as js file, not jsx
* Added POC using MutationObserver.
* missing case: notification page
* use custom pack notification page
* add e2e test for comment with embed gist
* add e2e test for preview post with embed gist
* add an extra step in tests to check gist is present
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* use dropdownutils in dashboard and manage pages
* add tests for the toggle menu on dashboard
* add test for archiving from manage post view
* small tweak to avoid unhandled errors
* small tweaks to form methods
* initial rough version
* link to relevant rules, extract image text, only show if more than 0 errors
* jsdoc and tweaks
* refactors
* add tests
* open info links in new tab
* add new window link icon
* WIP - basic init of comment dropdowns with open and close on click
* WIP - initialize the share dropdown
* initialize all post dropdowns within packs, init copy to clipboard announcer
* refactor and add JSDocs to helper
* undo changes to base jsx
* update accessible name of post actions button in cypress test
* make sure dropdowns pack loaded on comment index page
* undo prettier changes in base jsx
* undo prettier changes in base jsx
* initialize comment dropdowns in podcasts
* add test for the post actions
* add article comment tests
* add cypress tests for comment dropdowns
* 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>
* 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>
* 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
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>
* Prep work to sync mobile search in #10424
* Added a comment about the custom search event.
* Refactor to fix already defined error caused by const and InstantClick.
* Moved <SearchFormSync /> out of the pack file.
* Fixed broken tests.
* Renamed getInitialSearchTerm utility function to getSearchTermFromUrl
* Added some API docs to getSearchTermFromUrl
* Fixed a typo.
* Added some more API docs.
* Switched to a custom event so a custom payload can be passed.
* Added some API docs.
* Fixed bad destructuring statement.
* wip for some more tests.
* Refactored getSearchTermFromUrl to use URLSearchParams
* lazy loaded state for search term initial value.
* test broken still. Need to think on it.
* filterXSS is now set up in testSetup.js
* Fixed tests.
* Added the @utilities alias to Storybooks webpack config.
* Almost 100% coverage with two useful tests.
* Added some comments explaining document.body usage in the tests.
* Fixed issue where search attemps to get results on first load.
* Small refactor for setting the window.location in tests.
* Clarified an explanation in a comment.
* Fixed unhandled rejection in <ImageUploader /> test.
* Fixed <FollowUsers /> tests.
* Fixed the tests for the <RequestManager /> component.
* Fixed unhandled rejection in search utilities.
* Added an unhandledRejection listener so tests will fail if a Promise fails.
* Added a comment about why you might get an unhandled rejection exception.