Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/course-outline/CourseOutline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import { useState, useEffect, useCallback } from 'react';
import { useIntl } from '@edx/frontend-platform/i18n';
import {
Container,
Hyperlink,
Icon,
Layout,
PageBanner,
Row,
TransitionReplace,
Toast,
StandardModal,
} from '@openedx/paragon';
import { ArrowForward, CheckCircle as CheckCircleIcon } from '@openedx/paragon/icons';
import { getConfig } from '@edx/frontend-platform';
import { Helmet } from 'react-helmet';
import { CheckCircle as CheckCircleIcon } from '@openedx/paragon/icons';
import { useSelector } from 'react-redux';
import {
arrayMove,
Expand Down Expand Up @@ -60,6 +64,7 @@ import {
} from './drag-helper/utils';
import { useCourseOutline } from './hooks';
import messages from './messages';
import releaseNotesMessages from '../release-notes/messages';
import { getTagsExportFile } from './data/api';
import OutlineAddChildButtons from './OutlineAddChildButtons';

Expand All @@ -70,6 +75,7 @@ interface CourseOutlineProps {
const CourseOutline = ({ courseId }: CourseOutlineProps) => {
const intl = useIntl();
const location = useLocation();
const [showPageBanner, setShowPageBanner] = useState(getConfig().ENABLE_RELEASE_NOTES_BANNER);

const {
courseUsageKey,
Expand Down Expand Up @@ -282,6 +288,25 @@ const CourseOutline = ({ courseId }: CourseOutlineProps) => {

return (
<>
{showPageBanner
&& (
<PageBanner
show={showPageBanner}
variant="accentA"
dismissible
onDismiss={() => setShowPageBanner(false)}
>
🎉 {intl.formatMessage(releaseNotesMessages.releaseNotesBannerText)}
<Hyperlink
destination={`${getConfig().BASE_URL}/release-notes`}
target="_blank"
className="ml-2"
>
{intl.formatMessage(releaseNotesMessages.releaseNotesBannerLinkText)}
<Icon className="ml-1" src={ArrowForward} />
</Hyperlink>
</PageBanner>
)}
<Helmet>
<title>{getPageHeadTitle(courseName, intl.formatMessage(messages.headingTitle))}</title>
</Helmet>
Expand Down
3 changes: 3 additions & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
} from './library-authoring';
import initializeStore from './store';
import CourseAuthoringRoutes from './CourseAuthoringRoutes';
import ReleaseNotes from './release-notes/ReleaseNotes';
import Head from './head/Head';
import { StudioHome } from './studio-home';
import CourseRerun from './course-rerun';
Expand Down Expand Up @@ -91,6 +92,7 @@ const App = () => {
<Route path="/legacy/preview-changes/:usageKey" element={<PreviewChangesEmbed />} />
<Route path="/course/:courseId/*" element={<CourseAuthoringRoutes />} />
<Route path="/course_rerun/:courseId" element={<CourseRerun />} />
<Route path="/release-notes" element={<ReleaseNotes />} />
{getConfig().ENABLE_ACCESSIBILITY_PAGE === 'true' && (
<Route path="/accessibility" element={<AccessibilityPage />} />
)}
Expand Down Expand Up @@ -177,6 +179,7 @@ initialize({
ENABLE_GRADING_METHOD_IN_PROBLEMS: process.env.ENABLE_GRADING_METHOD_IN_PROBLEMS === 'true',
LIBRARY_UNSUPPORTED_BLOCKS: (process.env.LIBRARY_UNSUPPORTED_BLOCKS || 'conditional,step-builder,problem-builder').split(','),
COURSE_TEAM_SUPPORT_EMAIL: process.env.COURSE_TEAM_SUPPORT_EMAIL || null,
ENABLE_RELEASE_NOTES_BANNER: process.env.ENABLE_RELEASE_NOTES_BANNER || null,
}, 'CourseAuthoringConfig');
},
},
Expand Down
1 change: 1 addition & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@import "group-configurations/GroupConfigurations";
@import "optimizer-page/scan-results/ScanResults";
@import "legacy-libraries-migration/";
@import "release-notes/ReleaseNotes.scss";

// To apply the glow effect to the selected Section/Subsection, in the Course Outline
div.row:has(> div > div.highlight) {
Expand Down
5 changes: 5 additions & 0 deletions src/release-notes/ReleaseNotes.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

const ReleaseNotes = () => <h1>Welcome to release-notes!</h1>;

export default ReleaseNotes;
32 changes: 32 additions & 0 deletions src/release-notes/ReleaseNotes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.pgn__pageBanner__accentA {
background-color: #5DE3BF;
color: #000000;
text-align: center;
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: 20px;

a {
color: #000000;
font-size: 14px;
font-style: normal;
font-weight: 600;
line-height: 20px;
text-decoration-line: underline;
text-decoration-style: solid;
text-decoration-skip-ink: auto;
text-decoration-thickness: auto;
text-underline-offset: auto;
text-underline-position: from-font;
}

.pgn__icon {
height: 16px !important;
width: 16px !important;
}

.pgn__hyperlink__external-icon {
display: none;
}
}
14 changes: 14 additions & 0 deletions src/release-notes/messages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineMessages } from '@edx/frontend-platform/i18n';

const messages = defineMessages({
releaseNotesBannerText: {
id: 'release-notes.page.banner.text',
defaultMessage: 'Introducing edX Release Notes! See what\'s new and what\'s coming.',
},
releaseNotesBannerLinkText: {
id: 'release-notes.page.banner.link.text',
defaultMessage: 'Explore release notes',
},
});

export default messages;