Skip to content

Commit 650bb62

Browse files
authored
fix: migrate library alert text (#2651)
This PR updates the alert texts on the Migrate Libraries Stepper
1 parent e2f1aed commit 650bb62

File tree

3 files changed

+34
-33
lines changed

3 files changed

+34
-33
lines changed

src/legacy-libraries-migration/ConfirmationView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const ConfirmationView = ({
7474
{...messages.confirmationViewAlert}
7575
values={{
7676
count: legacyLibraries.length,
77+
libraryName: destination.title,
7778
b: BoldText,
7879
}}
7980
/>

src/legacy-libraries-migration/LegacyLibMigrationPage.test.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ describe('<LegacyLibMigrationPage />', () => {
185185
nextButton.click();
186186

187187
// Should show alert of SelectDestinationView
188-
expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
188+
expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
189189

190190
const backButton = screen.getByRole('button', { name: /back/i });
191191
backButton.click();
@@ -211,7 +211,7 @@ describe('<LegacyLibMigrationPage />', () => {
211211
nextButton.click();
212212

213213
// Should show alert of SelectDestinationView
214-
expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
214+
expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
215215

216216
// The next button is disabled
217217
expect(nextButton).toBeDisabled();
@@ -237,15 +237,15 @@ describe('<LegacyLibMigrationPage />', () => {
237237
await user.click(nextButton);
238238

239239
// Should show alert of SelectDestinationView
240-
expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
240+
expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
241241
expect(await screen.findByText('Test Library 1')).toBeInTheDocument();
242242
const radioButton = screen.getByRole('radio', { name: /test library 1/i });
243243
await user.click(radioButton);
244244

245245
await user.click(nextButton);
246246
const alert = await screen.findByRole('alert');
247247
expect(await within(alert).findByText(
248-
/All content from the legacy library you selected will be migrated to the Content Library you select/i,
248+
/All content from the legacy library you selected will be migrated to/,
249249
)).toBeInTheDocument();
250250

251251
const backButton = screen.getByRole('button', { name: /back/i });
@@ -274,7 +274,7 @@ describe('<LegacyLibMigrationPage />', () => {
274274
nextButton.click();
275275

276276
// Should show alert of SelectDestinationView
277-
expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
277+
expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
278278

279279
const createButton = await screen.findByRole('button', { name: /create new library/i });
280280
expect(createButton).toBeInTheDocument();
@@ -344,7 +344,7 @@ describe('<LegacyLibMigrationPage />', () => {
344344
await user.click(nextButton);
345345

346346
// Should show alert of SelectDestinationView
347-
expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
347+
expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
348348
expect(await screen.findByText('Test Library 1')).toBeInTheDocument();
349349
const radioButton = screen.getByRole('radio', { name: /test library 1/i });
350350
await user.click(radioButton);
@@ -354,7 +354,7 @@ describe('<LegacyLibMigrationPage />', () => {
354354
// Should show alert of ConfirmationView
355355
const alert = await screen.findByRole('alert');
356356
expect(await within(alert).findByText(
357-
/All content from the 3 legacy libraries you selected will be migrated to the Content Library you select/i,
357+
/All content from the 3 legacy libraries you selected will be migrated to/,
358358
)).toBeInTheDocument();
359359
expect(screen.getByText('MBA')).toBeInTheDocument();
360360
expect(screen.getByText('Legacy library 1')).toBeInTheDocument();
@@ -401,7 +401,7 @@ describe('<LegacyLibMigrationPage />', () => {
401401
await user.click(nextButton);
402402

403403
// Should show alert of SelectDestinationView
404-
expect(await screen.findByText(/you selected will be migrated to this new library/i)).toBeInTheDocument();
404+
expect(await screen.findByText(/you selected will be migrated to the Content Library you/)).toBeInTheDocument();
405405
expect(await screen.findByText('Test Library 1')).toBeInTheDocument();
406406
const radioButton = screen.getByRole('radio', { name: /test library 1/i });
407407
await user.click(radioButton);
@@ -411,7 +411,7 @@ describe('<LegacyLibMigrationPage />', () => {
411411
// Should show alert of ConfirmationView
412412
const alert = await screen.findByRole('alert');
413413
expect(await within(alert).findByText(
414-
/All content from the 3 legacy libraries you selected will be migrated to the Content Library you select/i,
414+
/All content from the 3 legacy libraries you selected will be migrated to/,
415415
{ exact: false },
416416
)).toBeInTheDocument();
417417
expect(screen.getByText('MBA')).toBeInTheDocument();

src/legacy-libraries-migration/messages.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,24 @@ const messages = defineMessages({
6565
id: 'legacy-libraries-migration.select-destination.alert.text',
6666
defaultMessage: 'All content from the'
6767
+ ' {count, plural, one {legacy library} other {{count} legacy libraries}} you selected will'
68-
+ ' be migrated to this new library, organized into collections. Legacy library content used in courses will'
69-
+ ' continue to work as-is. To receive any future changes to migrated content, you must update these'
70-
+ ' references within your course.',
68+
+ ' be migrated to the Content Library you select, organized into collections. Legacy library content used'
69+
+ ' in courses will continue to work as-is. To receive any future changes to migrated content,'
70+
+ ' you must update these references within your course.',
7171
description: 'Alert text in the select destination step of the legacy libraries migration page.',
7272
},
7373
confirmationViewAlert: {
7474
id: 'legacy-libraries-migration.select-destination.alert.text',
7575
defaultMessage: 'All content from the'
7676
+ ' {count, plural, one {legacy library} other {{count} legacy libraries}} you selected will'
77-
+ ' be migrated to the Content Library you select, organized into collections. Legacy library content used in courses will'
78-
+ ' continue to work as-is. To receive any future changes to migrated content, you must update these'
79-
+ ' references within your course.',
77+
+ ' be migrated to <b>{libraryName}</b> and organized into collections. Legacy library content used'
78+
+ ' in courses will continue to work as-is. To receive any future changes to migrated content,'
79+
+ ' you must update these references within your course.',
8080
description: 'Alert text in the confirmation step of the legacy libraries migration page.',
8181
},
8282
previouslyMigratedAlert: {
8383
id: 'legacy-libraries-migration.confirmation-step.card.previously-migrated.text',
8484
defaultMessage: 'Previously migrated library. Any problem bank links were already'
85-
+ ' moved will be migrated to <b>{libraryName}</b>',
85+
+ ' moved will be migrated to <b>{libraryName}</b>',
8686
description: 'Alert text when the legacy library is already migrated.',
8787
},
8888
helpAndSupportTitle: {
@@ -98,8 +98,8 @@ const messages = defineMessages({
9898
helpAndSupportFirstQuestionBody: {
9999
id: 'legacy-libraries-migration.helpAndSupport.q1.body',
100100
defaultMessage: 'In the new Content Libraries experience, you can author sections,'
101-
+ ' subsections, units, and many types of components. Library content can be reused across many courses,'
102-
+ ' and kept up-to-date. Content libraries now support increased collaboration across authoring teams.',
101+
+ ' subsections, units, and many types of components. Library content can be reused across many courses,'
102+
+ ' and kept up-to-date. Content libraries now support increased collaboration across authoring teams.',
103103
description: 'Body of the first question in the Help & Support sidebar',
104104
},
105105
helpAndSupportSecondQuestionTitle: {
@@ -110,9 +110,9 @@ const messages = defineMessages({
110110
helpAndSupportSecondQuestionBody: {
111111
id: 'legacy-libraries-migration.helpAndSupport.q2.body',
112112
defaultMessage: 'All legacy library content is supported in the new experience.'
113-
+ ' Content from legacy libraries will be migrated to its own collection in the new Content Libraries experience.'
114-
+ ' This collection will have the same name as your original library. Courses that use legacy library content will'
115-
+ ' continue to function as usual, linked to the migrated version within the new libraries experience.',
113+
+ ' Content from legacy libraries will be migrated to its own collection in the new Content Libraries experience.'
114+
+ ' This collection will have the same name as your original library. Courses that use legacy library content will'
115+
+ ' continue to function as usual, linked to the migrated version within the new libraries experience.',
116116
description: 'Body of the second question in the Help & Support sidebar',
117117
},
118118
helpAndSupportThirdQuestionTitle: {
@@ -123,18 +123,18 @@ const messages = defineMessages({
123123
helpAndSupportThirdQuestionBody: {
124124
id: 'legacy-libraries-migration.helpAndSupport.q3.body.2',
125125
defaultMessage: '<p>There are three steps to migrating legacy libraries:</p>'
126-
+ '<p><div>1 - Select Legacy Libraries</div>'
127-
+ 'You can select up to 50 legacy libraries for migration in this step. By default, only libraries that have'
128-
+ ' not yet been migrated are shown. To see all libraries, remove the filter.'
129-
+ ' You can select up to 50 legacy libraries for migration, but only one destination'
130-
+ ' v2 Content Library per migration.</p>'
131-
+ '<p><div>2 - Select Destination</div>'
132-
+ 'You can migrate legacy libraries to an existing Content Library in the new experience,'
133-
+ ' or you can create a new destination. You can only select one v2 Content Library per migration.'
134-
+ ' All your content will be migrated, and kept organized in collections.</p>'
135-
+ '<p><div>3 - Confirm</div>'
136-
+ 'In this step, review your migration. Once you confirm, migration will begin.'
137-
+ ' It may take some time to complete.</p>',
126+
+ '<p><div>1 - Select Legacy Libraries</div>'
127+
+ 'You can select up to 50 legacy libraries for migration in this step. By default, only libraries that have'
128+
+ ' not yet been migrated are shown. To see all libraries, remove the filter.'
129+
+ ' You can select up to 50 legacy libraries for migration, but only one destination'
130+
+ ' v2 Content Library per migration.</p>'
131+
+ '<p><div>2 - Select Destination</div>'
132+
+ 'You can migrate legacy libraries to an existing Content Library in the new experience,'
133+
+ ' or you can create a new destination. You can only select one v2 Content Library per migration.'
134+
+ ' All your content will be migrated, and kept organized in collections.</p>'
135+
+ '<p><div>3 - Confirm</div>'
136+
+ 'In this step, review your migration. Once you confirm, migration will begin.'
137+
+ ' It may take some time to complete.</p>',
138138
description: 'Part 2 of the Body of the third question in the Help & Support sidebar',
139139
},
140140
migrationInProgress: {

0 commit comments

Comments
 (0)