Skip to content

Commit b3da367

Browse files
Bump trix from 2.1.4 to 2.1.15 (#2846)
This required updating the implementation of `fill_in_rich_text_area`. In Rails 6.1+, this helper is provided by the framework, but in 6.0 it is not present. For that case we provide a "manual" version. Here, some change in Trix made our version fail, so this change updates is to copy exactly the Rails implementation as of the time of commit. This PR was initially created by dependabot. Standard dependabot summary follows. --- * Bump trix from 2.1.4 to 2.1.15 Bumps [trix](https://github.com/basecamp/trix) from 2.1.4 to 2.1.15. - [Release notes](https://github.com/basecamp/trix/releases) - [Commits](basecamp/trix@v2.1.4...v2.1.15) --- updated-dependencies: - dependency-name: trix dependency-version: 2.1.15 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Update assets after update of Trix * Selector that works in latest Trix --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pablo Brasero <[email protected]>
1 parent f728741 commit b3da367

File tree

7 files changed

+4315
-3743
lines changed

7 files changed

+4315
-3743
lines changed

app/assets/builds/administrate/application.css

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/builds/administrate/application.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/builds/administrate/application.js

Lines changed: 4270 additions & 3720 deletions
Large diffs are not rendered by default.

app/assets/builds/administrate/application.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"jquery": "^3.7.0",
1313
"sass": "^1.63.6",
1414
"selectize": "^0.12.6",
15-
"trix": "^2.1.4"
15+
"trix": "^2.1.15"
1616
},
1717
"devDependencies": {
1818
"@thoughtbot/stylelint-config": "^4.0.0",

spec/support/features/action_text.rb

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,21 @@ def fill_in_rich_text_area(locator = nil, with:)
99
end
1010

1111
Capybara.add_selector :rich_text_area do
12-
xpath do |label|
13-
trix_editor = XPath.descendant(:"trix-editor")
14-
15-
if label.nil?
16-
trix_editor
12+
# Lifted straight from https://github.com/rails/rails/blob/3235827585d87661942c91bc81f64f56d710f0b2/actiontext/lib/action_text/system_test_helper.rb
13+
label "rich-text area"
14+
xpath do |locator|
15+
if locator.nil?
16+
XPath.descendant(:"trix-editor")
1717
else
18-
trix_editor.where XPath.attr(:"aria-label").equals(label)
18+
input_located_by_name = XPath.anywhere(:input).where(XPath.attr(:name) == locator).attr(:id)
19+
input_located_by_label = XPath.anywhere(:label).where(XPath.string.n.is(locator)).attr(:for)
20+
21+
XPath.descendant(:"trix-editor").where \
22+
XPath.attr(:id).equals(locator) |
23+
XPath.attr(:placeholder).equals(locator) |
24+
XPath.attr(:"aria-label").equals(locator) |
25+
XPath.attr(:input).equals(input_located_by_name) |
26+
XPath.attr(:id).equals(input_located_by_label)
1927
end
2028
end
2129
end

yarn.lock

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@
254254
stylelint-declaration-block-no-ignored-properties "^2.8.0"
255255
stylelint-order "^6.0.4"
256256

257+
"@types/trusted-types@^2.0.7":
258+
version "2.0.7"
259+
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11"
260+
integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==
261+
257262
ajv@^8.0.1:
258263
version "8.12.0"
259264
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1"
@@ -479,6 +484,13 @@ dir-glob@^3.0.1:
479484
dependencies:
480485
path-type "^4.0.0"
481486

487+
dompurify@^3.2.5:
488+
version "3.2.6"
489+
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.2.6.tgz#ca040a6ad2b88e2a92dc45f38c79f84a714a1cad"
490+
integrity sha512-/2GogDQlohXPZe6D6NOgQvXLPSYBqIWMnZ8zzOhn09REE4eyAzb+Hed3jhoM9OkuaJ8P6ZGTTVWQKAi8ieIzfQ==
491+
optionalDependencies:
492+
"@types/trusted-types" "^2.0.7"
493+
482494
eastasianwidth@^0.2.0:
483495
version "0.2.0"
484496
resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
@@ -1319,10 +1331,12 @@ to-regex-range@^5.0.1:
13191331
dependencies:
13201332
is-number "^7.0.0"
13211333

1322-
trix@^2.1.4:
1323-
version "2.1.4"
1324-
resolved "https://registry.yarnpkg.com/trix/-/trix-2.1.4.tgz#a2f1e37fec03c9050bc7ba1d56056e606389a46f"
1325-
integrity sha512-f0AGnqBV8J2qW+fCtVU71JmvzjcxnO5Xbbd6Cl2KrHVRpgXKDqNGTmDmQzNHWU7T2OgtwHwvNiN+OIf3Z3KmHQ==
1334+
trix@^2.1.15:
1335+
version "2.1.15"
1336+
resolved "https://registry.yarnpkg.com/trix/-/trix-2.1.15.tgz#fabad796ea779a8ae96522402fbc214cbfc4015f"
1337+
integrity sha512-LoaXWczdTUV8+3Box92B9b1iaDVbxD14dYemZRxi3PwY+AuDm97BUJV2aHLBUFPuDABhxp0wzcbf0CxHCVmXiw==
1338+
dependencies:
1339+
dompurify "^3.2.5"
13261340

13271341
uri-js@^4.2.2:
13281342
version "4.4.1"

0 commit comments

Comments
 (0)