From 42211134c7333462fffb248fa2a12b9769ef0c1b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=B4mulo=20Penido?=
Date: Mon, 10 Nov 2025 16:49:25 -0300
Subject: [PATCH] fix: migrate library alert text
---
.../ConfirmationView.tsx | 1 +
.../LegacyLibMigrationPage.test.tsx | 18 +++----
src/legacy-libraries-migration/messages.ts | 48 +++++++++----------
3 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/src/legacy-libraries-migration/ConfirmationView.tsx b/src/legacy-libraries-migration/ConfirmationView.tsx
index 270940d7e4..99acf23c33 100644
--- a/src/legacy-libraries-migration/ConfirmationView.tsx
+++ b/src/legacy-libraries-migration/ConfirmationView.tsx
@@ -74,6 +74,7 @@ export const ConfirmationView = ({
{...messages.confirmationViewAlert}
values={{
count: legacyLibraries.length,
+ libraryName: destination.title,
b: BoldText,
}}
/>
diff --git a/src/legacy-libraries-migration/LegacyLibMigrationPage.test.tsx b/src/legacy-libraries-migration/LegacyLibMigrationPage.test.tsx
index 418e7f88ec..d262fd774e 100644
--- a/src/legacy-libraries-migration/LegacyLibMigrationPage.test.tsx
+++ b/src/legacy-libraries-migration/LegacyLibMigrationPage.test.tsx
@@ -185,7 +185,7 @@ describe('', () => {
nextButton.click();
// Should show alert of SelectDestinationView
- expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
+ expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
const backButton = screen.getByRole('button', { name: /back/i });
backButton.click();
@@ -211,7 +211,7 @@ describe('', () => {
nextButton.click();
// Should show alert of SelectDestinationView
- expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
+ expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
// The next button is disabled
expect(nextButton).toBeDisabled();
@@ -237,7 +237,7 @@ describe('', () => {
await user.click(nextButton);
// Should show alert of SelectDestinationView
- expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
+ expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
expect(await screen.findByText('Test Library 1')).toBeInTheDocument();
const radioButton = screen.getByRole('radio', { name: /test library 1/i });
await user.click(radioButton);
@@ -245,7 +245,7 @@ describe('', () => {
await user.click(nextButton);
const alert = await screen.findByRole('alert');
expect(await within(alert).findByText(
- /All content from the legacy library you selected will be migrated to the Content Library you select/i,
+ /All content from the legacy library you selected will be migrated to/,
)).toBeInTheDocument();
const backButton = screen.getByRole('button', { name: /back/i });
@@ -274,7 +274,7 @@ describe('', () => {
nextButton.click();
// Should show alert of SelectDestinationView
- expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
+ expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
const createButton = await screen.findByRole('button', { name: /create new library/i });
expect(createButton).toBeInTheDocument();
@@ -344,7 +344,7 @@ describe('', () => {
await user.click(nextButton);
// Should show alert of SelectDestinationView
- expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
+ expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
expect(await screen.findByText('Test Library 1')).toBeInTheDocument();
const radioButton = screen.getByRole('radio', { name: /test library 1/i });
await user.click(radioButton);
@@ -354,7 +354,7 @@ describe('', () => {
// Should show alert of ConfirmationView
const alert = await screen.findByRole('alert');
expect(await within(alert).findByText(
- /All content from the 3 legacy libraries you selected will be migrated to the Content Library you select/i,
+ /All content from the 3 legacy libraries you selected will be migrated to/,
)).toBeInTheDocument();
expect(screen.getByText('MBA')).toBeInTheDocument();
expect(screen.getByText('Legacy library 1')).toBeInTheDocument();
@@ -401,7 +401,7 @@ describe('', () => {
await user.click(nextButton);
// Should show alert of SelectDestinationView
- expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
+ expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
expect(await screen.findByText('Test Library 1')).toBeInTheDocument();
const radioButton = screen.getByRole('radio', { name: /test library 1/i });
await user.click(radioButton);
@@ -411,7 +411,7 @@ describe('', () => {
// Should show alert of ConfirmationView
const alert = await screen.findByRole('alert');
expect(await within(alert).findByText(
- /All content from the 3 legacy libraries you selected will be migrated to the Content Library you select/i,
+ /All content from the 3 legacy libraries you selected will be migrated to/,
{ exact: false },
)).toBeInTheDocument();
expect(screen.getByText('MBA')).toBeInTheDocument();
diff --git a/src/legacy-libraries-migration/messages.ts b/src/legacy-libraries-migration/messages.ts
index d93ed8dadd..00e828342a 100644
--- a/src/legacy-libraries-migration/messages.ts
+++ b/src/legacy-libraries-migration/messages.ts
@@ -65,24 +65,24 @@ const messages = defineMessages({
id: 'legacy-libraries-migration.select-destination.alert.text',
defaultMessage: 'All content from the'
+ ' {count, plural, one {legacy library} other {{count} legacy libraries}} you selected will'
- + ' be migrated to this new library, organized into collections. Legacy library content used in courses will'
- + ' continue to work as-is. To receive any future changes to migrated content, you must update these'
- + ' references within your course.',
+ + ' be migrated to the Content Library you select, organized into collections. Legacy library content used'
+ + ' in courses will continue to work as-is. To receive any future changes to migrated content,'
+ + ' you must update these references within your course.',
description: 'Alert text in the select destination step of the legacy libraries migration page.',
},
confirmationViewAlert: {
id: 'legacy-libraries-migration.select-destination.alert.text',
defaultMessage: 'All content from the'
+ ' {count, plural, one {legacy library} other {{count} legacy libraries}} you selected will'
- + ' be migrated to the Content Library you select, organized into collections. Legacy library content used in courses will'
- + ' continue to work as-is. To receive any future changes to migrated content, you must update these'
- + ' references within your course.',
+ + ' be migrated to {libraryName} and organized into collections. Legacy library content used'
+ + ' in courses will continue to work as-is. To receive any future changes to migrated content,'
+ + ' you must update these references within your course.',
description: 'Alert text in the confirmation step of the legacy libraries migration page.',
},
previouslyMigratedAlert: {
id: 'legacy-libraries-migration.confirmation-step.card.previously-migrated.text',
defaultMessage: 'Previously migrated library. Any problem bank links were already'
- + ' moved will be migrated to {libraryName}',
+ + ' moved will be migrated to {libraryName}',
description: 'Alert text when the legacy library is already migrated.',
},
helpAndSupportTitle: {
@@ -98,8 +98,8 @@ const messages = defineMessages({
helpAndSupportFirstQuestionBody: {
id: 'legacy-libraries-migration.helpAndSupport.q1.body',
defaultMessage: 'In the new Content Libraries experience, you can author sections,'
- + ' subsections, units, and many types of components. Library content can be reused across many courses,'
- + ' and kept up-to-date. Content libraries now support increased collaboration across authoring teams.',
+ + ' subsections, units, and many types of components. Library content can be reused across many courses,'
+ + ' and kept up-to-date. Content libraries now support increased collaboration across authoring teams.',
description: 'Body of the first question in the Help & Support sidebar',
},
helpAndSupportSecondQuestionTitle: {
@@ -110,9 +110,9 @@ const messages = defineMessages({
helpAndSupportSecondQuestionBody: {
id: 'legacy-libraries-migration.helpAndSupport.q2.body',
defaultMessage: 'All legacy library content is supported in the new experience.'
- + ' Content from legacy libraries will be migrated to its own collection in the new Content Libraries experience.'
- + ' This collection will have the same name as your original library. Courses that use legacy library content will'
- + ' continue to function as usual, linked to the migrated version within the new libraries experience.',
+ + ' Content from legacy libraries will be migrated to its own collection in the new Content Libraries experience.'
+ + ' This collection will have the same name as your original library. Courses that use legacy library content will'
+ + ' continue to function as usual, linked to the migrated version within the new libraries experience.',
description: 'Body of the second question in the Help & Support sidebar',
},
helpAndSupportThirdQuestionTitle: {
@@ -123,18 +123,18 @@ const messages = defineMessages({
helpAndSupportThirdQuestionBody: {
id: 'legacy-libraries-migration.helpAndSupport.q3.body.2',
defaultMessage: 'There are three steps to migrating legacy libraries:
'
- + '1 - Select Legacy Libraries
'
- + 'You can select up to 50 legacy libraries for migration in this step. By default, only libraries that have'
- + ' not yet been migrated are shown. To see all libraries, remove the filter.'
- + ' You can select up to 50 legacy libraries for migration, but only one destination'
- + ' v2 Content Library per migration.
'
- + '2 - Select Destination
'
- + 'You can migrate legacy libraries to an existing Content Library in the new experience,'
- + ' or you can create a new destination. You can only select one v2 Content Library per migration.'
- + ' All your content will be migrated, and kept organized in collections.'
- + '3 - Confirm
'
- + 'In this step, review your migration. Once you confirm, migration will begin.'
- + ' It may take some time to complete.',
+ + '1 - Select Legacy Libraries
'
+ + 'You can select up to 50 legacy libraries for migration in this step. By default, only libraries that have'
+ + ' not yet been migrated are shown. To see all libraries, remove the filter.'
+ + ' You can select up to 50 legacy libraries for migration, but only one destination'
+ + ' v2 Content Library per migration.'
+ + '2 - Select Destination
'
+ + 'You can migrate legacy libraries to an existing Content Library in the new experience,'
+ + ' or you can create a new destination. You can only select one v2 Content Library per migration.'
+ + ' All your content will be migrated, and kept organized in collections.'
+ + '3 - Confirm
'
+ + 'In this step, review your migration. Once you confirm, migration will begin.'
+ + ' It may take some time to complete.',
description: 'Part 2 of the Body of the third question in the Help & Support sidebar',
},
migrationInProgress: {