Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom UI for a specific client #6

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
b2b99ae
feat: customize the course search card
tecoholic Apr 23, 2024
f0ae8d9
feat: remove enterprise banner
tecoholic Apr 23, 2024
323cced
feat: customize the header
tecoholic Apr 23, 2024
0e02c73
feat: change the dashboard page layout
tecoholic Apr 23, 2024
87f0b50
feat: use new course cards for the my-learning page
tecoholic Apr 24, 2024
435b1de
refactor: move layout to CourseEnrollments component
tecoholic Apr 24, 2024
c499623
chore: upgrade algoliasearch and react-instantsearch
tecoholic Apr 24, 2024
ef0f2ac
Revert "chore: upgrade algoliasearch and react-instantsearch"
tecoholic Apr 24, 2024
ee8a13e
feat: customize search page layout, search & filtering
tecoholic Apr 24, 2024
973701a
feat: custom course page
tecoholic Apr 24, 2024
bcb1f50
feat: adds the CourseEnrollmentsFilter to the sidebar
tecoholic Apr 24, 2024
8affb09
fix: prevent 2 no-enrollment erros showing up at the same time
tecoholic Apr 25, 2024
db1e2de
fix: show message when there are no filters
tecoholic Apr 25, 2024
26a85f7
fix: remove reference to popular content in no-results message
tecoholic Apr 25, 2024
4f01a4b
fix: remove borders when hovering on algolia search buttons
tecoholic Apr 25, 2024
c6df036
fix: hide the edx-support info on dashboard mobile view
tecoholic Apr 26, 2024
31339a3
fix: hide the sidebar in search and main page
tecoholic Apr 26, 2024
8bcb81c
fix: rename navbar items
tecoholic Apr 26, 2024
c92b417
fix: issues with cards in the dashboard
tecoholic Apr 26, 2024
6a86179
fix: show the border on top of the card
tecoholic Apr 26, 2024
592c254
fix: hide the course duration from the NewCourseCard
tecoholic Apr 26, 2024
ef4c909
fix: set min-height of inner content to 600px
tecoholic Apr 26, 2024
d0c83a4
fix: set orientaion breakpoint to minWidth on NewCourseCard
tecoholic Apr 26, 2024
9c88942
refactor: remove unused imports with big libs to reduce bundle size
tecoholic Apr 26, 2024
1f02703
refactor: upgrade paragon and get the card styles right
tecoholic Apr 26, 2024
31775ef
fix: hide the search bar in the course finder page
tecoholic Apr 27, 2024
50731c6
fix: corrections on the course-finder page
tecoholic Apr 27, 2024
2c33204
refactor: rework the course about page header layout
tecoholic Apr 27, 2024
9188a60
fix: set breadcrumb text in course page to course finder
tecoholic Apr 27, 2024
e2ba81d
fix: hide the verified pitch and comment out unused imports
tecoholic Apr 29, 2024
78a7ff8
feat: adds AccessUntil and enrollment status to course page
tecoholic Apr 29, 2024
2d258eb
fix: remove box around enroll button; adjust margins in course header
tecoholic Apr 29, 2024
1afbad0
fix: padding for course details
tecoholic Apr 29, 2024
b686bd8
fix: set the enroll button style to match others
tecoholic Apr 29, 2024
d2a9b4b
fix: style the header similary to other MFEs
tecoholic Apr 29, 2024
af2e1cf
feat: adds material-symbols icon for consistency
tecoholic Apr 29, 2024
5b7fb13
feat: disable the enterprise catalog from algolia search filters
tecoholic Apr 29, 2024
6ccd788
fix: chip mis-alignment in course about page
tecoholic Apr 29, 2024
0f6b0c4
fix: remove min-height for main content
tecoholic Apr 30, 2024
6c92fdb
fix: hide the edx welcome modal on first visit
tecoholic Apr 30, 2024
03d80bc
fix: show AccessUntil on course page only with subscription
tecoholic Apr 30, 2024
335c0c2
fix: style View Course button similary to others
tecoholic Apr 30, 2024
9ddb3da
fix: avoid empty box from showing up when course-about is empty
tecoholic Apr 30, 2024
8d0b929
fix: make the enrollment failure message generic
tecoholic Apr 30, 2024
23d615e
fix: prevent "edx intergration" modal from popping up
tecoholic May 6, 2024
d8725d7
fix: style buttons consistently; adds dashboard in navbar
tecoholic May 6, 2024
236f6a8
fix: adds the border to the navbar
tecoholic May 6, 2024
879e617
fix: prevent avatar dropdown from touching course finder button
tecoholic May 6, 2024
4c0cc21
fix: course run card message
tecoholic May 6, 2024
fc7f829
fix: remove the header link background color on hover
tecoholic May 6, 2024
9ed414a
feat: correct the navbar dropdown active item colors
tecoholic May 6, 2024
fb5446a
fix: show the org name from course metadata in the enrollment card
tecoholic May 7, 2024
d78c367
fix: style the header logo similary to other MFEs
tecoholic May 7, 2024
3bfc1ba
fix: use full path in the enrollment failure urls
tecoholic Apr 9, 2024
345c4ea
fix: license not getting auto-activated on first login
tecoholic May 15, 2024
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
529 changes: 521 additions & 8 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"@edx/frontend-enterprise-logistration": "3.4.0",
"@edx/frontend-enterprise-utils": "3.4.0",
"@edx/frontend-platform": "4.6.3",
"@edx/paragon": "20.45.4",
"@edx/paragon": "^21.5.6",
"@material-symbols/svg-400": "^0.17.3",
"@tanstack/react-query": "4.28.0",
"@tanstack/react-query-devtools": "4.29.0",
"algoliasearch": "4.6.0",
Expand Down
17 changes: 17 additions & 0 deletions src/assets/icons/course-search-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions src/components/app/AuthenticatedPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { getAuthenticatedUser } from '@edx/frontend-platform/auth';
import { getConfig } from '@edx/frontend-platform/config';
import { Hyperlink } from '@edx/paragon';
import { EnterprisePage } from '../enterprise-page';
import { EnterpriseBanner } from '../enterprise-banner';
import { Layout } from '../layout';
import LoginRefresh from './LoginRefresh';
import { ErrorPage } from '../error-page';
Expand Down Expand Up @@ -48,7 +47,6 @@ const AuthenticatedPage = ({ children, useEnterpriseConfigCache }) => {
<LoginRefresh>
<EnterprisePage useEnterpriseConfigCache={useEnterpriseConfigCache}>
<Layout>
<EnterpriseBanner />
{children}
</Layout>
</EnterprisePage>
Expand Down
178 changes: 64 additions & 114 deletions src/components/course/CourseMainContent.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { useContext } from 'react';
import { breakpoints, Hyperlink, MediaQuery } from '@edx/paragon';
import { AppContext } from '@edx/frontend-platform/react';
// import { AppContext } from '@edx/frontend-platform/react';
import { Col } from '@edx/paragon';

import { PreviewExpand } from '../preview-expand';
import { CourseContext } from './CourseContextProvider';
import CourseSidebar from './CourseSidebar';
import CreatedBy from './CreatedBy';
import VerifiedCertPitch from './VerifiedCertPitch';
// import CreatedBy from './CreatedBy';
// import VerifiedCertPitch from './VerifiedCertPitch';

function formatSponsorTextList(sponsors) {

Check failure on line 9 in src/components/course/CourseMainContent.jsx

View workflow job for this annotation

GitHub Actions / tests

'formatSponsorTextList' is defined but never used
const names = sponsors.map(sponsor => sponsor.name);
let sponsorTextList;

Expand All @@ -29,132 +27,84 @@
}

const CourseMainContent = () => {
const { config } = useContext(AppContext);
// const { config } = useContext(AppContext);
const { state } = useContext(CourseContext);
const { course, activeCourseRun } = state;

return (
<>
<MediaQuery minWidth={breakpoints.large.minWidth}>
{matches => !matches && (
<div className="mb-5">
<CourseSidebar />
</div>
)}
</MediaQuery>
<Col>
{course.fullDescription && (
<PreviewExpand
className="mb-5"
cta={{
labelToExpand: 'More about this course',
labelToMinimize: 'Collapse about this course',
id: 'about-this-course',
}}
heading={<h3>About this course</h3>}
>
<div className="my-5">
<h2>About</h2>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: course.fullDescription }} />
</PreviewExpand>
)}
{course.sponsors && course.sponsors.length > 0 && (
<div className="mb-5">
<h3>Sponsored by</h3>
<div className="row no-gutters mt-3">
{course.sponsors.map((sponsor) => (
<div className="col-lg-6 mb-3" key={sponsor.name}>
<div className="mb-2">
<a
href={`${config.MARKETING_SITE_BASE_URL}/${sponsor.marketingUrl}`}
aria-hidden="true"
tabIndex="-1"
target="_blank"
rel="noopener noreferrer"
>
<img src={sponsor.logoImageUrl} alt={`${sponsor.name} logo`} />
</a>
</div>
<Hyperlink
destination={`${config.MARKETING_SITE_BASE_URL}/${sponsor.marketingUrl}`}
target="_blank"
>
{sponsor.name}
</Hyperlink>
</div>
))}
</div>
<p>
The production of this course would not have been possible without the
generous contributions of {formatSponsorTextList(course.sponsors)}.
</p>
</div>
)}
{course.outcome && (
<PreviewExpand
className="mb-5"
cta={{
labelToExpand: 'Expand what you\'ll learn',
labelToMinimize: 'Collapse what you\'ll learn',
id: 'what-youll-learn',
}}
heading={<h3>What you&apos;ll learn</h3>}
>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: course.outcome }} />
</PreviewExpand>
)}
{course.syllabusRaw && (
<PreviewExpand
className="mb-5"
cta={{
labelToExpand: 'Expand syllabus',
labelToMinimize: 'Collapse syllabus',
id: 'course-syllabus',
}}
heading={<h3>Syllabus</h3>}
>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: course.syllabusRaw }} />
</PreviewExpand>
)}
<CreatedBy />
{activeCourseRun.type === 'verified' && (
<VerifiedCertPitch />
)}
{course.learnerTestimonials && (
<div className="mb-5">
<h3>Learner testimonials</h3>
<h2>What you&apos;ll learn</h2>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: course.learnerTestimonials }} />
</div>
)}
{course.faq && (
<div className="mb-5">
<h3>Frequently asked questions</h3>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: course.faq }} />
<div dangerouslySetInnerHTML={{ __html: course.outcome }} />
</div>
)}
{course.additionalInformation && (
{course.syllabusRaw && (
<div className="mb-5">
<h2>Syllabus</h2>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: course.additionalInformation }} />
</div>
)}
{activeCourseRun.hasOfacRestrictions && (
<div className="mb-5">
<h3>Who can take this course?</h3>
<p>
Unfortunately, learners from one or more of the following countries or regions will not
be able to register for this course: Iran, Cuba and the Crimea region of Ukraine.
While edX has sought licenses from the U.S. Office of Foreign Assets Control (OFAC) to
offer our courses to learners in these countries and regions, the licenses we have
received are not broad enough to allow us to offer this course in all locations. EdX
truly regrets that U.S. sanctions prevent us from offering all of our courses to
everyone, no matter where they live.
</p>
<div dangerouslySetInnerHTML={{ __html: course.syllabusRaw }} />
</div>
)}
</>
{/*
<CreatedBy />
*/}
{/*
activeCourseRun.type === 'verified' && (
<VerifiedCertPitch />
)
*/}
{
course.learnerTestimonials && (
<div className="mb-5">
<h3>Learner testimonials</h3>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: course.learnerTestimonials }} />
</div>
)
}
{
course.faq && (
<div className="mb-5">
<h3>Frequently asked questions</h3>
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: course.faq }} />
</div>
)
}
{
course.additionalInformation && (
<div className="mb-5">
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: course.additionalInformation }} />
</div>
)
}
{
activeCourseRun.hasOfacRestrictions && (
<div className="mb-5">
<h3>Who can take this course?</h3>
<p>
Unfortunately, learners from one or more of the following countries or regions will not
be able to register for this course: Iran, Cuba and the Crimea region of Ukraine.
While edX has sought licenses from the U.S. Office of Foreign Assets Control (OFAC) to
offer our courses to learners in these countries and regions, the licenses we have
received are not broad enough to allow us to offer this course in all locations. EdX
truly regrets that U.S. sanctions prevent us from offering all of our courses to
everyone, no matter where they live.
</p>
</div>
)
}
</Col>
);
};

Expand Down
6 changes: 4 additions & 2 deletions src/components/course/SubsidyRequestButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const props = {
requested: 'Awaiting approval',
},
disabledStates: ['requested'],
variant: 'primary',
variant: 'outline-primary',
className: 'mb-4 mt-1',
};

Expand Down Expand Up @@ -114,7 +114,9 @@ const SubsidyRequestButton = () => {
};

return (
<StatefulButton {...props} state={getButtonState()} onClick={handleRequestButtonClick} />
<div>
<StatefulButton {...props} state={getButtonState()} onClick={handleRequestButtonClick} />
</div>
);
};

Expand Down
Loading
Loading