canvas-lms/gems/canvas_link_migrator
Mysti Lilla 007a202ce6 Add link_resolver to gem and test with migration object
refs LF-380
flag=none

Test plan
- Set up a course with several kinds of links
  to other Canvas assets (files, media files,
  wiki pages, discussion topics, etc)
- Run an import from an existing Canvas export
  package
- Run a course copy
- Run a BP course copy
- Verify links look correct after the migration

Change-Id: Ic7c9eff96ce0e6f75963ea2ec9d8c20929cc1bc2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/320567
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Logan <james.logan@instructure.com>
Reviewed-by: Paul Gray <paul.gray@instructure.com>
Product-Review: Paul Gray <paul.gray@instructure.com>
Product-Review: James Logan <james.logan@instructure.com>
QA-Review: James Logan <james.logan@instructure.com>
QA-Review: Paul Gray <paul.gray@instructure.com>
Build-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2023-07-07 19:02:45 +00:00
..
lib Add link_resolver to gem and test with migration object 2023-07-07 19:02:45 +00:00
spec Add link_resolver to gem and test with migration object 2023-07-07 19:02:45 +00:00
Gemfile Canvas Link Migrator gem start 2023-06-29 17:12:45 +00:00
Gemfile.lock Add link_resolver to gem and test with migration object 2023-07-07 19:02:45 +00:00
README.md Canvas Link Migrator gem start 2023-06-29 17:12:45 +00:00
canvas_link_migrator.gemspec Add link_resolver to gem and test with migration object 2023-07-07 19:02:45 +00:00
test.sh Canvas Link Migrator gem start 2023-06-29 17:12:45 +00:00

README.md

CanvasLinkMigration

CanvasLinkMigration handles importing links to other course content (ie Assignments, Quizzes, Content Pages etc, that are created by the RichContentService using Canvas APIs) exported from Canvas.

Usage

Create a CanvasLinkMigrator::ImportedHtmlConvert using an asset_id_mapping (Get the asset_id_mapping from Canvas API after a migration) and then pass in the html_string data to be imported.

converter = CanvasLinkMigrator::ImportedHtmlConvert.new(asset_id_mapping)
converter.convert_and_replace(html_string)

Use convert and resolve_content_links! separately if desired