Revert "feat: Add Scheduled content alert"

This reverts commit 83151d291c.
This commit is contained in:
Albert (AJ) St. Aubin
2021-07-07 10:35:05 -04:00
parent 1ad2cf73bf
commit e7c0ebdfe3
9 changed files with 1 additions and 90 deletions

View File

@@ -29,7 +29,6 @@ Factory.define('outlineTabData')
upgrade_url: `${host}/dashboard`,
}))
.attrs({
has_scheduled_content: null,
access_expiration: null,
can_show_upgrade_sock: false,
cert_data: {

View File

@@ -380,7 +380,6 @@ Object {
"block-v1:edX+DemoX+Demo_Course+type@course+block@bcdabcdabcdabcdabcdabcdabcdabcd3": Object {
"effortActivities": undefined,
"effortTime": undefined,
"hasScheduledContent": false,
"id": "course-v1:edX+DemoX+Demo_Course_1",
"sectionIds": Array [
"block-v1:edX+DemoX+Demo_Course+type@chapter+block@bcdabcdabcdabcdabcdabcdabcdabcd2",
@@ -449,7 +448,6 @@ Object {
},
"handoutsHtml": "<ul><li>Handout 1</li></ul>",
"hasEnded": undefined,
"hasScheduledContent": null,
"id": "course-v1:edX+DemoX+Demo_Course_1",
"offer": null,
"resumeCourse": Object {

View File

@@ -116,7 +116,6 @@ export function normalizeOutlineBlocks(courseId, blocks) {
id: courseId,
title: block.display_name,
sectionIds: block.children || [],
hasScheduledContent: block.has_scheduled_content,
};
break;
@@ -317,7 +316,6 @@ export async function getOutlineTabData(courseId) {
const datesWidget = camelCaseObject(data.dates_widget);
const enrollAlert = camelCaseObject(data.enroll_alert);
const handoutsHtml = data.handouts_html;
const hasScheduledContent = data.has_scheduled_content;
const hasEnded = data.has_ended;
const offer = camelCaseObject(data.offer);
const resumeCourse = camelCaseObject(data.resume_course);
@@ -336,7 +334,6 @@ export async function getOutlineTabData(courseId) {
datesWidget,
enrollAlert,
handoutsHtml,
hasScheduledContent,
hasEnded,
offer,
resumeCourse,

View File

@@ -23,7 +23,6 @@ import useCertificateAvailableAlert from './alerts/certificate-status-alert';
import useCourseEndAlert from './alerts/course-end-alert';
import useCourseStartAlert from './alerts/course-start-alert';
import usePrivateCourseAlert from './alerts/private-course-alert';
import useScheduledContentAlert from './alerts/scheduled-content-alert';
import { useModel } from '../../generic/model-store';
import WelcomeMessage from './widgets/WelcomeMessage';
import ProctoringInfoPanel from './widgets/ProctoringInfoPanel';
@@ -91,7 +90,6 @@ function OutlineTab({ intl }) {
const courseEndAlert = useCourseEndAlert(courseId);
const certificateAvailableAlert = useCertificateAvailableAlert(courseId);
const privateCourseAlert = usePrivateCourseAlert(courseId);
const scheduledContentAlert = useScheduledContentAlert(courseId);
const rootCourseId = courses && Object.keys(courses)[0];
@@ -154,7 +152,6 @@ function OutlineTab({ intl }) {
...certificateAvailableAlert,
...courseEndAlert,
...courseStartAlert,
...scheduledContentAlert,
}}
/>
)}

View File

@@ -694,27 +694,6 @@ describe('Outline Tab', () => {
expect(screen.queryByText('Verify your identity to earn a certificate!')).toBeInTheDocument();
});
});
describe('Scheduled Content Alert', () => {
it('appears correctly', async () => {
const now = new Date();
const { courseBlocks } = await buildMinimalCourseBlocks(courseId, 'Title', { hasScheduledContent: true });
const tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
setMetadata({ is_enrolled: true });
setTabData({
course_blocks: { blocks: courseBlocks.blocks },
date_blocks: [
{
date_type: 'course-end-date',
date: tomorrow.toISOString(),
title: 'End',
},
],
});
await fetchAndRender();
expect(screen.queryByText('More content is coming soon!')).toBeInTheDocument();
});
});
});
describe('Certificate (web) Complete Alert', () => {

View File

@@ -1,33 +0,0 @@
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import { Alert, Button } from '@edx/paragon';
import React from 'react';
const ScheduledContentAlert = () => (
<Alert variant="info">
<div className="row justify-content-between align-items-center">
<div className="col-lg-7">
<Alert.Heading>
<FormattedMessage
id="learning.outline.alert.scheduled-content.heading"
defaultMessage="More content is coming soon!"
/>
</Alert.Heading>
<FormattedMessage
id="learning.outline.alert.scheduled-content.body"
defaultMessage="This course will have more content released at a future date. look out for email updates or check back on this course for updates."
/>
</div>
<div className="m-auto m-lg-0 pr-lg-3">
<Button>
<FormattedMessage
id="learning.outline.alert.scheduled-content.button"
defaultMessage="View Course Schedule"
/>
</Button>
</div>
</div>
</Alert>
);
export default ScheduledContentAlert;

View File

@@ -1,20 +0,0 @@
import React from 'react';
import { useAlert } from '../../../../generic/user-messages';
import { useModel } from '../../../../generic/model-store';
const ScheduledContentAlert = React.lazy(() => import('./ScheduledCotentAlert'));
const useScheduledContentAlert = (courseId) => {
const { courseBlocks: { courses } } = useModel('outline', courseId);
const hasScheduledContent = !!Object.values(courses).find(course => course.hasScheduledContent === true);
const { isEnrolled } = useModel('courseHomeMeta', courseId);
useAlert(hasScheduledContent && isEnrolled, {
code: 'ScheduledContentAlert',
topic: 'outline-course-alerts',
});
return { ScheduledContentAlert };
};
export default useScheduledContentAlert;

View File

@@ -1 +0,0 @@
export { default } from './hooks';

View File

@@ -124,12 +124,7 @@ export function buildMinimalCourseBlocks(courseId, title, options = {}) {
)];
const courseBlock = options.courseBlock || Factory.build(
'block',
{
type: 'course',
display_name: title,
has_scheduled_content: options.hasScheduledContent || false,
children: sectionBlocks.map(block => block.id),
},
{ type: 'course', display_name: title, children: sectionBlocks.map(block => block.id) },
{ courseId },
);
return {