canvas_link_migrator 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a329fcce5ac60d34c29e9e09005e8bb5c6ced87ff0ca2b7529821ff70d280045
|
4
|
+
data.tar.gz: 4b05fe6dae29056eedba8384b00549942eb0d1f5dc72c2ec6310ea7b353e07af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37f76536082684d4f2c40c72a68f885921cd1a5570f1bfd5d0424b2a859933ead7dac479ae0c4fde8968d799eb3f233cf696602a5d4ac962f9e8257e80f781b8
|
7
|
+
data.tar.gz: eb9be3e0f256c16b6c4059f24b76d21d50d7c71ac40f73deb00ba737f2b32e3a4593ae86630ca5a364822839908328463741bafc42df27ddc95bfd3f2a97f01d
|
@@ -228,6 +228,9 @@ module CanvasLinkMigrator
|
|
228
228
|
media_id = file.try(:media_object)&.media_id || file["media_entry_id"]
|
229
229
|
node["data-media-id"] = media_id # safe to delete?
|
230
230
|
media_attachment_iframe_url(file["id"], node["data-media-type"])
|
231
|
+
elsif rel_path&.match(/\/media_attachments_iframe\/\d+/)
|
232
|
+
# media attachment from another course or something
|
233
|
+
rel_path
|
231
234
|
elsif node["data-media-id"].present?
|
232
235
|
file = @migration_id_converter.lookup_attachment_by_media_id(node["data-media-id"])
|
233
236
|
file ? media_attachment_iframe_url(file["id"], node["data-media-type"]) : nil
|
@@ -311,6 +311,16 @@ describe CanvasLinkMigrator::ImportedHtmlConverter do
|
|
311
311
|
expect(@converter.convert_exported_html(test_string)).to eq([converted_string, nil])
|
312
312
|
end
|
313
313
|
|
314
|
+
it "converts source tags to RCE media attachment iframes when link is an unknown media attachment reference (link from a public file in another course)" do
|
315
|
+
test_string = %(<video style="width: 400px; height: 225px; display: inline-block;" title="this is a media comment" data-media-type="video" allowfullscreen="allowfullscreen" allow="fullscreen" data-media-id="0_l4l5n0wt"><source src="/media_attachments_iframe/18?type=video" data-media-id="0_l4l5n0wt" data-media-type="video"></video>)
|
316
|
+
converted_string = %(<iframe style="width: 400px; height: 225px; display: inline-block;" title="this is a media comment" data-media-type="video" allowfullscreen="allowfullscreen" allow="fullscreen" data-media-id="0_l4l5n0wt" src="/media_attachments_iframe/18?type=video"></iframe>)
|
317
|
+
expect(@converter.convert_exported_html(test_string)).to eq([converted_string, nil])
|
318
|
+
|
319
|
+
test_string = %(<audio style="width: 400px; height: 225px; display: inline-block;" title="this is a media comment" data-media-type="audio" data-media-id="0_l4l5n0wu"><source src="/media_attachments_iframe/19?type=audio" data-media-id="0_l4l5n0wu" data-media-type="audio"></video>)
|
320
|
+
converted_string = %(<iframe style="width: 400px; height: 225px; display: inline-block;" title="this is a media comment" data-media-type="audio" data-media-id="0_l4l5n0wu" src="/media_attachments_iframe/19?type=audio"></iframe>)
|
321
|
+
expect(@converter.convert_exported_html(test_string)).to eq([converted_string, nil])
|
322
|
+
end
|
323
|
+
|
314
324
|
it "converts course copy style media attachmet iframe links" do
|
315
325
|
test_string = %(<video style="width: 400px; height: 225px; display: inline-block;" title="this is a media comment" data-media-type="video" allowfullscreen="allowfullscreen" allow="fullscreen" data-media-id="m-yodawg"><source src="$CANVAS_COURSE_REFERENCE$/file_ref/I?media_attachment=true&type=video" data-media-id="m-yodawg" data-media-type="video"></video>)
|
316
326
|
converted_string = %(<iframe style="width: 400px; height: 225px; display: inline-block;" title="this is a media comment" data-media-type="video" allowfullscreen="allowfullscreen" allow="fullscreen" data-media-id="m-yodawg" src="/media_attachments_iframe/9?type=video&embedded=true"></iframe>)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canvas_link_migrator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mysti Lilla
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-
|
14
|
+
date: 2024-04-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|