Skip to content

Commit

Permalink
Merge branch 'rpenido/fal-3753-library-home-page-bare-bones' into rpe…
Browse files Browse the repository at this point in the history
…nido/fal-3768-create-new-library-form
  • Loading branch information
rpenido committed Jun 20, 2024
2 parents bccaedc + 3ae6fe8 commit e6b877d
Show file tree
Hide file tree
Showing 44 changed files with 646 additions and 861 deletions.
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ Tagging/Taxonomy functionality.
Feature: Libraries V2/Legacy Tabs
=================================

.. image:: ./docs/readme-images/feature-v2-and-legacy-libs.png

Configuration
-------------

Expand Down
Binary file removed docs/readme-images/feature-v2-and-legacy-libs.png
Binary file not shown.
294 changes: 119 additions & 175 deletions plugins/course-apps/proctoring/Settings.test.jsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/accessibility-page/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineMessages } from '@edx/frontend-platform/i18n';

const messages = defineMessages({
pageTitle: {
id: 'course-authoring.import.page.title',
id: 'course-authoring.accessibility.page.title',
defaultMessage: 'Studio Accessibility Policy| {siteName}',
},
});
Expand Down
8 changes: 4 additions & 4 deletions src/certificates/layout/header-buttons/HeaderButtons.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ describe('HeaderButtons Component', () => {
expect(previewLink).toHaveAttribute('href', expect.stringContaining(certificatesDataMock.courseModes[0]));

const dropdownButton = getByRole('button', { name: certificatesDataMock.courseModes[0] });
await userEvent.click(dropdownButton);
userEvent.click(dropdownButton);

const verifiedMode = await getByRole('button', { name: certificatesDataMock.courseModes[1] });
await userEvent.click(verifiedMode);
userEvent.click(verifiedMode);

await waitFor(() => {
expect(previewLink).toHaveAttribute('href', expect.stringContaining(certificatesDataMock.courseModes[1]));
Expand All @@ -78,7 +78,7 @@ describe('HeaderButtons Component', () => {
const { getByRole, queryByRole } = renderComponent();

const activationButton = getByRole('button', { name: messages.headingActionsActivate.defaultMessage });
await userEvent.click(activationButton);
userEvent.click(activationButton);

axiosMock.onPost(
getUpdateCertificateApiUrl(courseId, certificatesDataMock.certificates[0].id),
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('HeaderButtons Component', () => {
const { getByRole, queryByRole } = renderComponent();

const deactivateButton = getByRole('button', { name: messages.headingActionsDeactivate.defaultMessage });
await userEvent.click(deactivateButton);
userEvent.click(deactivateButton);

axiosMock.onPost(
getUpdateCertificateApiUrl(courseId, certificatesDataMock.certificates[0].id),
Expand Down
2 changes: 1 addition & 1 deletion src/content-tags-drawer/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const messages = defineMessages({
defaultMessage: 'Add a tag',
},
collapsibleNoTagsAddedText: {
id: 'course-authoring.content-tags-drawer.content-tags-collapsible.custom-menu.placeholder-text',
id: 'course-authoring.content-tags-drawer.content-tags-collapsible.custom-menu.no-tags-added-text',
defaultMessage: 'No tags added yet.',
},
collapsibleAddStagedTagsButtonText: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ const ChecklistItemComment = ({
<ul className="assignment-list">
{gradedAssignmentsOutsideDateRange.map(assignment => (
<li className="assignment-list-item" key={assignment.id}>
<Hyperlink
content={assignment.displayName}
destination={`${outlineUrl}#${assignment.id}`}
/>
<Hyperlink destination={`${outlineUrl}#${assignment.id}`}>
{assignment.displayName}
</Hyperlink>
</li>
))}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/course-outline/card-header/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const messages = defineMessages({
defaultMessage: 'Delete',
},
menuCopy: {
id: 'course-authoring.course-outline.card.menu.delete',
id: 'course-authoring.course-outline.card.menu.copy',
defaultMessage: 'Copy to clipboard',
},
menuProctoringLinkText: {
Expand Down
5 changes: 4 additions & 1 deletion src/course-outline/data/thunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ import {
const getErrorDetails = (error, dismissible = true) => {
const errorInfo = { dismissible };
if (error.response?.data) {
errorInfo.data = JSON.stringify(error.response.data);
const { data } = error.response;
if ((typeof data === 'string' && !data.includes('</html>')) || typeof data === 'object') {
errorInfo.data = JSON.stringify(data);
}
errorInfo.status = error.response.status;
errorInfo.type = API_ERROR_TYPES.serverError;
} else if (error.request) {
Expand Down
22 changes: 8 additions & 14 deletions src/course-outline/page-alerts/PageAlerts.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { uniqBy } from 'lodash';
import { getConfig } from '@edx/frontend-platform';
import { useDispatch, useSelector } from 'react-redux';
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';
Expand Down Expand Up @@ -336,15 +337,13 @@ const PageAlerts = ({
};

const renderApiErrors = () => {
const errorList = Object.entries(errors).filter(obj => obj[1] !== null).map(([k, v]) => {
let errorList = Object.entries(errors).filter(obj => obj[1] !== null).map(([k, v]) => {
switch (v.type) {
case API_ERROR_TYPES.serverError:
return {
key: k,
desc: v.data,
title: intl.formatMessage(messages.serverErrorAlert, {
status: v.status,
}),
desc: v.data || intl.formatMessage(messages.serverErrorAlertBody),
title: intl.formatMessage(messages.serverErrorAlert),
dismissible: v.dismissible,
};
case API_ERROR_TYPES.networkError:
Expand All @@ -356,11 +355,12 @@ const PageAlerts = ({
default:
return {
key: k,
desc: v.data,
title: v.data,
dismissible: v.dismissible,
};
}
});
errorList = uniqBy(errorList, 'title');
if (!errorList?.length) {
return null;
}
Expand All @@ -373,10 +373,7 @@ const PageAlerts = ({
key={msgObj.key}
dismissError={() => dispatch(dismissError(msgObj.key))}
>
{msgObj.title
&& (
<Alert.Heading>{msgObj.title}</Alert.Heading>
)}
<Alert.Heading>{msgObj.title}</Alert.Heading>
{msgObj.desc && <Truncate lines={2}>{msgObj.desc}</Truncate>}
</ErrorAlert>
) : (
Expand All @@ -385,10 +382,7 @@ const PageAlerts = ({
icon={ErrorIcon}
key={msgObj.key}
>
{msgObj.title
&& (
<Alert.Heading>{msgObj.title}</Alert.Heading>
)}
<Alert.Heading>{msgObj.title}</Alert.Heading>
{msgObj.desc && <Truncate lines={2}>{msgObj.desc}</Truncate>}
</Alert>
)
Expand Down
9 changes: 7 additions & 2 deletions src/course-outline/page-alerts/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const messages = defineMessages({
description: 'Learn more link in upgraded discussion notification alert',
},
discussionNotificationFeedback: {
id: 'course-authoring.course-outline.page-alerts.discussionNotificationLearnMore',
id: 'course-authoring.course-outline.page-alerts.discussionNotificationFeedback',
defaultMessage: 'Share feedback',
description: 'Share feedback link in upgraded discussion notification alert',
},
Expand Down Expand Up @@ -108,7 +108,12 @@ const messages = defineMessages({
},
serverErrorAlert: {
id: 'course-authoring.course-outline.page-alert.server-error.title',
defaultMessage: 'Request failed with status: {status}',
defaultMessage: 'The Studio servers encountered an error',
description: 'Generic server error alert title.',
},
serverErrorAlertBody: {
id: 'course-authoring.course-outline.page-alert.server-error.body',
defaultMessage: ' An error occurred in Studio and the page could not be loaded. Please try again in a few moments. We\'ve logged the error and our staff is currently working to resolve this error as soon as possible.',
description: 'Generic server error alert title.',
},
networkErrorAlert: {
Expand Down
2 changes: 1 addition & 1 deletion src/course-outline/status-bar/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const messages = defineMessages({
defaultMessage: 'Video Sharing',
},
videoSharingLink: {
id: 'course-authoring.course-outline.status-bar.video-sharing.title',
id: 'course-authoring.course-outline.status-bar.video-sharing.link',
defaultMessage: 'Learn more',
},
videoSharingPerVideoText: {
Expand Down
2 changes: 1 addition & 1 deletion src/course-outline/subsection-card/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const messages = defineMessages({
defaultMessage: 'New unit',
},
pasteButton: {
id: 'course-authoring.course-outline.subsection.button.new-unit',
id: 'course-authoring.course-outline.subsection.button.paste-unit',
defaultMessage: 'Paste unit',
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/course-team/course-team-member/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const messages = defineMessages({
defaultMessage: 'Add admin access',
},
removeButton: {
id: 'course-authoring.course-team.member.button.remove',
id: 'course-authoring.course-team.member.button.remove-admin-access',
defaultMessage: 'Remove admin access',
},
deleteUserButton: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ComponentModalView = ({
<ModalContainer
isOpen={isOpen}
close={close}
title={intl.formatMessage(messages.modalContainerTitle, { componentTitle: displayName.toLowerCase() })}
title={intl.formatMessage(messages.modalContainerTitle, { componentTitle: (displayName ?? '').toLowerCase() })}
btnText={intl.formatMessage(messages.modalBtnText)}
onSubmit={handleSubmit}
resetDisabled={() => setModuleTitle('')}
Expand Down
Loading

0 comments on commit e6b877d

Please sign in to comment.