* 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
* Fix and clean up podcast pages
* Adjust tests
* Fix a test
* Fix missing i18n
* Fix tests
* Fix tests
* Fiddle with test
* Sure up css and tests
* Add featured as allowed param
* Fix a couple tests
* xit out test
* Update app/views/podcast_episodes/index.html.erb
* Update app/views/podcast_episodes/index.html.erb
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Turns out this caused a *different* problem. It would work for the first
delete batch in `BulkSqlDelete`, but subsequent `DELETE` queries would
then get their `statement_timeout`s reset to the global setting. The
issue was that `BulkSqlDelete` uses methods that don't respect nested
transactions, and we were already resetting the value of the setting to
its previous value anyway, so there was really no reason to run it
inside a transaction.
The only failure mode I know of here is that the `ensure` block breaks
because `connection` is severed. In that case, the value is reset anyway
when the connection pool replaces the connection so the failure does not
propagate.
* Allow Emails::RemoveOldEmailsWorker to run longer
We set the SQL statement timeout based on the STATEMENT_TIMEOUT
environment variable (defaulting to 2.5 seconds in production), but not
all SQL queries are created equal. Since some may take longer out of
necessity, this PR introduces a `Model.with_statement_timeout` method
that allows you to change the SQL statement timeout only for a given
block.
* EmailMessage doesn't inherit ApplicationRecord
It inherits from `Ahoy::Message`, which inherits directly from
`ActiveRecord::Base`.
[3] pry(main)> EmailMessage.ancestors
=> [EmailMessage(id: integer, clicked_at: datetime, content: text, feedback_message_id: integer, mailer: string, sent_at: datetime, subject: text, to: text, token: string, user_id: integer, user_type: string, utm_campaign: string, utm_content: string, utm_medium: string, utm_source: string, utm_term: string),
EmailMessage::GeneratedAssociationMethods,
EmailMessage::GeneratedAttributeMethods,
Ahoy::Message(id: integer, clicked_at: datetime, content: text, feedback_message_id: integer, mailer: string, sent_at: datetime, subject: text, to: text, token: string, user_id: integer, user_type: string, utm_campaign: string, utm_content: string, utm_medium: string, utm_source: string, utm_term: string),
Kaminari::ConfigurationMethods,
Kaminari::ActiveRecordModelExtension,
Ahoy::Message::GeneratedAssociationMethods,
Ahoy::Message::GeneratedAttributeMethods,
Bullet::SaveWithBulletSupport,
ActiveRecord::Base,
...
* Use milliseconds to match STATEMENT_TIMEOUT units
* Load any translation files in subdirectories
This ensures files in config/locales/views/ are loaded, for example.
* Move i18n load path additions from initializer to rails config
* Fix notifications not deleting because mentions already destroyed
* Fix spelling in spec
* Use rspec expect/to assertions for delete notification spec clarity
* resolve failing spec, and remove need for environment check 🎉
* When a user is blocked from commenting on an article, show correct error message
* Created new error type ModerationUnauthorizedError and changed error text for it
* I18nize nav_menu's list items
* reverted changes to admin list item in attempt to pass the one failed test in Travis CI
* Update reading_list value
Co-authored-by: Michael Kohl <citizen428@forem.com>
* Remove hard coded organization id from seed
Since we create (hopefully) an organization with a known slug, use
find_by here to set the organization_id on the seeded DisplayAd.
* Since the DisplayAd looks by slug, create org if slug not found
Change the seed guard to ensure an organization with slug "bachmanity"
is present - we'll find by slug in DisplayAd (rather than assuming
this is id 1).
It's confusing why we set model as the block binding, but still access
user from the method argument (reaching outside the `tap` block).
Within this block, use model consistently to name the user.
Only change the user variable, not _user_ within methods
* Bump jsdom from 16.7.0 to 18.0.0
Bumps [jsdom](https://github.com/jsdom/jsdom) from 16.7.0 to 18.0.0.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/master/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/16.7.0...18.0.0)
---
updated-dependencies:
- dependency-name: jsdom
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* Added custom environment for JS DOM to support text encoding/decoding.
* Fixed yarn.lock merge conflict.
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
* Make e2e seed safe to run twice
We have a number of checks in the seed file that prevent creating
objects if they're found in the database, but nothing is guarding
against this breaking.
Change a few create! to create_with().find_or_create_by() and update
guard clauses where we create if doesn't exist to match the objects
created. These had drifted, preventing subsequent runs of the seed in
a "dirty" database. In CI we're typically creating a new database,
loading schema, and only running this once, so the guards are never
checked and the objects are always created, but locally that might not
always be the case.
* Update multiple guards
We're creating test users against @forem.local domain, let's check
that there's not already a forem.local user with the same email
account.
Additionally, something was causing the "find article by title" to
miss identifying the commented article, but it was not create()'d due
to a slug collision, and the comment could not be created. Update the
call to use `create!` instead (since we rely on it existing in the
comment create) and guard against the slug instead of the title.