Commit Graph

130 Commits

Author SHA1 Message Date
Kasper Timm Hansen 64ff6bc4c6
Tune ActionText::Generators::InstallGenerator
* Use rails_command instead of run (will also print "rails" in the output)
* Generally tune colors: print green for the status updates,
  red for the warning to get the eye.
* Combine migration copying into running one task and pass FROM.
  Generates "create_tables.engine_name.rb" migrations.
* Slim some variables and style the copy_file invocation.
2019-12-15 21:08:48 +01: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
Vinicius Stock 028d1611cd
Run app:update:bin from actiontext generator 2019-11-15 08:58:11 -05:00
Vinicius Stock 0bc9c16ffc
Fix rubocop offenses 2019-11-15 08:58:11 -05:00
Vinicius Stock b1f6be8f49
Create GEM_ROOT and make js_dependencies private 2019-11-15 08:58:11 -05:00
Vinicius Stock 0875c94b09
Create ActionText install generator 2019-11-15 08:58:11 -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
Abhay Nikam cfe30cee3e Adds a warning message for action text installer if application pack is missing. 2019-04-19 08:30:59 +05:30
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
Vinicius Brasil 95e00befbc
Add line break to Action Text installation outputs
The Action Text installations appends `require("trix")` to the application.js file. The problem is that there isn't a line break in the beginning of the installation output, leading to syntax errors, e.g.:

```
import './application.scss'require("trix")
```

This commit moves the line break from the end to the beginning of the output, fixing it to:

```
import './application.scss'
require("trix")
```
2019-01-27 22:30:17 -02:00
Rafael Mendonça França 5a0230c67f
Preparing for 6.0.0.beta1 release 2019-01-18 15:42:12 -05:00
Javan Makhmali 866da19fd9 Tidy up action_text:install task
Automate installing the appropriate packages with yarn and appending them to the default application.js pack.
2019-01-17 10:42:09 -05:00
Javan Makhmali 86b489e3d6 Move all npm packages to @rails scope
Fixes #33083
2019-01-10 11:01:57 -05:00
yuuji.yaginuma 5df737b7e8 Enable `Lint/DeprecatedClassMethods` cop to avoid using deprecated methods 2019-01-09 12:00:08 +09: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