Sean Doyle
614580270d
Locate fill_in_rich_text_area
by <label>
text
...
This commit dovetails with [#38551 ] in its focus on improving the
ability to test calls to `rich_text_area` in accessibility-minded ways.
In addition to searching for `<trix-editor>` elements with the
appropriate [`aria-label`][aria-label] attribute, also support locating
elements that match the corresponding `<label>` element's text.
Now that [basecamp/trix#829 ][] has been merged and released, clicking on
`<label>` elements that reference `<trix-editor>` elements will move
focus into the `<trix-editor>` element.
There are still some accessible [label text][] improvements that could
be made, but extending `fill_in_rich_text_area` to account for `<label
for="...">` elements is a good start.
[#38551 ]: https://github.com/rails/rails/pull/38551
[aria-label]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute
[basecamp/trix#829 ]: https://github.com/basecamp/trix/pull/829
[label text]: https://github.com/basecamp/trix/pull/829#issuecomment-699119852
2020-10-02 18:02:14 -04:00
Kyohei Toyoda
07533a3d2f
Add method to confirm rich text content existence by adding ? after content name
...
This change introduces a rich text object to make
it easier to confirm it context is existing or not.
If we have a class like below.
class Information < ApplicationRecord
has_rich_text :notes
end
Before:
i = Information.new
i.notes? => NoMethodError
i.notes = "Some sample text"
i.notes.present? => true
After:
i = Information.new
i.notes? => false
i.notes = "Some sample text"
i.notes? => true
2019-12-13 12:58:42 +09:00
Javan Makhmali
296cc53277
Fix ActiveStorage::Blob → ActionText::TrixAttachment conversion
...
A regression introduced in 764803e07a
caused blobs to appear as HTML content attachments instead of file / image attachments when editing rich text content. This change restores the original intended behavior.
References: https://github.com/rails/rails/pull/35485 , https://github.com/basecamp/trix/issues/706
2019-12-03 05:57:36 -05:00
Jan Habermann
40be6b1d4d
Cleanup unneeded blank string params in ActionText
2019-08-23 20:17:38 +02:00
Javan Makhmali
55a5aac670
Optimize Action Text's plain text conversion
...
Fixes that converting deeply nested elements could exceed the stack level.
2019-08-22 16:24:51 -04:00
Akira Matsuda
530f7805ed
It may be better to explicitly require 'object/try' where we call try
...
In most cases it works now without explicit require because it's accidentally required through
active_support/core_ext/date_and_time/calculations.rb where we still call `try`,
but that would stop working if we changed the Calculations implementation and remove the require call there.
2019-08-01 18:51:51 +09:00
Akira Matsuda
0196551e60
Use match? where we don't need MatchData
2019-07-29 14:23:10 +09:00
George Claghorn
930402101c
Implement ActiveStorage::Blob#attachable_plain_text_representation
...
Fixes that file attachments without captions would not be represented in plain text generated from rich-text content, causing ActionText::RichText#present? to return false.
Closes #36607 .
2019-07-07 22:03:06 -04:00
George Claghorn
339be65d66
Allow filling in the only rich-text area without a locator
2019-05-19 01:55:53 -04:00
George Claghorn
a0b102999a
Prefer Capybara::Node::Element#execute_script
2019-05-19 01:47:29 -04:00
George Claghorn
b2b6341374
Add ActionDispatch::SystemTestCase#fill_in_rich_text_area
2019-05-13 12:44:06 -04:00
Rafael Mendonça França
9834be6565
Start Rails 6.1 development
2019-04-24 15:57:14 -04:00
George Claghorn
ff7948b1c2
Avoid creating ActionText::RichText records unnecessarily
...
Assigning a has_one association for a persisted record saves the change immediately, so attempting to read a rich-text attribute on a persisted record without a corresponding ActionText::RichText would eagerly create one. Avoid assigning the rich text association to fix.
2019-03-23 10:04:48 -04:00
George Claghorn
c399f7d07a
Fix updating rich text via nested attributes
...
Closes #35159 .
2019-03-17 17:22:46 -04:00
eileencodes
a2bd669ed2
v6.0.0.beta3 release
...
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEEvJkGf0BARV+D0L2ulxXUSC76N8FAlyJN4cACgkQulxXUSC7
6N9ZXAf/Wx7edIct8kZzcC6irlROx4DzpNbrrH792sO1OAcnoFDE7DPkokllTEP/
4kzC42lca/XG27MCl7E0dtVD8hIyAl89nxid6cwKFVZVTPIRVc1wjXkoiWy/cvd7
6+9IjxhlgrzxGnw3aWZJG7H3iqz69yr55aoSDU/TbMqq5kQrqNF95vr2nc8LEUco
SLQj0pO/tfJdHquSeX0JiXn3VSEHT+5TdLGQ3J/w0wFU6mkecH4MJMJvMwLFx/v4
llnvF6HyfSLASWbrpdD3h6MQHpImDoee5vILXAHzPdSaEVcVa1cDFtMcPMYiu8Dw
AGdCAaHQhZFFGoYK472+o6pur0dxEA==
=5dET
-----END PGP SIGNATURE-----
Merge tag 'v6.0.0.beta3'
v6.0.0.beta3 release
2019-03-13 13:11:10 -04:00
eileencodes
7c87fd5635
Prep release
...
* Update RAILS_VERSION
* Bundle
* rake update_versions
* rake changelog:header
2019-03-11 11:58:15 -04:00
Chris Oliver
764803e07a
Adds default trix partial
2019-03-05 11:29:32 -06:00
Rafael Mendonça França
5e6e505083
Preparing for 6.0.0.beta2 release
2019-02-25 17:45:04 -05:00
Rafael Mendonça França
5a0230c67f
Preparing for 6.0.0.beta1 release
2019-01-18 15:42:12 -05:00
George Claghorn
02d2958b6c
Reset ActionText::Content.renderer before and after each request
2019-01-05 16:59:54 -05:00
George Claghorn
0decd2ddc4
Import Action Text
2019-01-04 22:22:49 -05:00