Skip to content

Commit 445d538

Browse files
committed
Merge branch 'master' into chris/FAL-4282-max-blocks-per-content
2 parents d6f59d0 + 38dfb68 commit 445d538

5 files changed

Lines changed: 10 additions & 14 deletions

File tree

src/library-authoring/import-course/ImportDetailsPage.test.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ describe('<ImportDetailsPage />', () => {
109109
});
110110

111111
it('should render Partial Succeeded state', async () => {
112+
const user = userEvent.setup();
112113
mockGetModulestoreMigratedBlocksInfo.applyMockPartial();
113114
(useGetContentHits as jest.Mock).mockReturnValue({
114115
isPending: false,
@@ -143,12 +144,12 @@ describe('<ImportDetailsPage />', () => {
143144
expect(await screen.findByText(/partial import successful/i)).toBeInTheDocument();
144145

145146
expect(await screen.findByText(/Total Blocks/i)).toBeInTheDocument();
146-
expect(await screen.findByText('2/5')).toBeInTheDocument();
147+
expect(await screen.findByText('2/3')).toBeInTheDocument();
147148
expect(await screen.findByText(/Components/i)).toBeInTheDocument();
148-
expect(await screen.findByText('1/4')).toBeInTheDocument();
149+
expect(await screen.findByText('1/2')).toBeInTheDocument();
149150

150151
expect(await screen.findByText(
151-
/40% of course test course has been imported successfully/i,
152+
/66% of course test course has been imported successfully/i,
152153
)).toBeInTheDocument();
153154

154155
expect(await screen.findByRole('cell', {
@@ -165,7 +166,7 @@ describe('<ImportDetailsPage />', () => {
165166
name: /view imported content/i,
166167
});
167168

168-
await viewImportedContentBtn.click();
169+
await user.click(viewImportedContentBtn);
169170
await waitFor(() => expect(mockNavigate).toHaveBeenCalledWith('/library/lib:Axim:TEST/collection/coll'));
170171
});
171172
});

src/library-authoring/import-course/ImportDetailsPage.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@ const ImportDetailsContent = () => {
100100
// The migrations of this block is failed
101101
counts.unsupported += 1;
102102
resultUnsupportedIds.push(block.sourceKey);
103-
104-
if (block.unsupportedReason) {
105-
// Verify if the unsupported block has children
106-
const match = block.unsupportedReason.match(/It has (\d+) children/);
107-
counts.unsupported += match ? Number(match[1]) : 0;
108-
}
109103
} else {
110104
counts.totalBlocks += 1;
111105
const blockType = getBlockType(block.sourceKey);

src/library-authoring/import-course/messages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ const messages = defineMessages({
181181
},
182182
importCourseAnalysisCompleteSomeContentBody: {
183183
id: 'library-authoring.import-course.review-details.analysis-complete.100.body',
184-
defaultMessage: '{unsupportedBlockPercentage}% of content cannot be imported. For details see below.',
184+
defaultMessage: '{supportedBlockPercentage}% of course content will be imported into a collection in your library called {courseName}. Some content will not be imported. For details see below.',
185185
description: 'Body of the info card when course import analysis is complete and some data can be imported.',
186186
},
187187
importCourseAnalysisDetailsUnsupportedBlocksBody: {
188188
id: 'library-authoring.import-course.review-details.analysis-details.unsupportedBlocks.body',
189-
defaultMessage: 'The following block types cannot be imported into your library because they\'re are not yet supported. These block types will be replaced with a placeholder block in the library. For more information, reference the Help & Support sidebar.',
189+
defaultMessage: 'Some block types cannot be imported into your library because theyre not yet supported. These blocks will be replaced with a placeholder block in the library. For more information, reference the Help & Support sidebar.',
190190
description: 'Body of analysis details when some unsupported blocks are present',
191191
},
192192
importCourseComponentsUnsupportedInfo: {

src/library-authoring/import-course/stepper/ReviewImportDetails.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('ReviewImportDetails', () => {
119119
expect(await screen.findByRole('alert')).toBeInTheDocument();
120120
expect(await screen.findByText(/Import Analysis Complete/i)).toBeInTheDocument();
121121
expect(await screen.findByText(
122-
/25.00% of content cannot be imported. For details see below./i,
122+
/75% of course content will be imported into a collection in your library called Test Course. Some content will not be imported. For details see below./i,
123123
)).toBeInTheDocument();
124124
expect(await screen.findByText(/Total Blocks/i)).toBeInTheDocument();
125125
expect(await screen.findByText('15/20')).toBeInTheDocument();

src/library-authoring/import-course/stepper/ReviewImportDetails.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ const Banner = ({
115115
<FormattedMessage
116116
{...messages.importCourseAnalysisCompleteSomeContentBody}
117117
values={{
118-
unsupportedBlockPercentage: unsupportedBlockPercentage.toFixed(2),
118+
supportedBlockPercentage: (100 - unsupportedBlockPercentage).toFixed(0),
119+
courseName: data?.title || '',
119120
}}
120121
/>
121122
</p>

0 commit comments

Comments
 (0)