-
Notifications
You must be signed in to change notification settings - Fork 3
Advertise parent programs on course product pages #3029
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
293394c
feat: move enrollment button below course summary content
ChristopherChudzicki c3890ef
feat: add program bundle upsell to course summary sidebar
ChristopherChudzicki b337fec
refactor: single-structure info box with CSS grid, fix bundle upsell …
ChristopherChudzicki 9560cdf
feat: remove product page navbar/navigation links
ChristopherChudzicki 807f11a
refactor: split SummaryCard/SummaryContent, delete ProductNavbar, add…
ChristopherChudzicki 2071c13
refactor: simplify sidebar layout, tablet 2-col metadata, row-style u…
ChristopherChudzicki a6e49db
refactor: move sticky to SummaryCol, use HEADER_HEIGHT, add column-rule
ChristopherChudzicki 0f250d3
feat: refine bundle upsell copy, pricing, and AskTIM layout
ChristopherChudzicki 07332bd
feat: restore enrollment button at all breakpoints, update upsell tests
ChristopherChudzicki 7c50d0a
fix: hide empty upsell, parameterize AskTIM, require enrollButton
ChristopherChudzicki 6488ee4
fix some minor spacing issues
ChristopherChudzicki af9f081
fix: replace hardcoded dates in ProductSummary tests with relative dates
ChristopherChudzicki e61dd43
test: add error-state test for ProgramBundleUpsell, use deferred prom…
ChristopherChudzicki ba561d2
refactor: extract hardcoded bundle discount to named constant
ChristopherChudzicki 8d195d2
feat: add loading skeleton to ProgramBundleUpsell, improve tests
ChristopherChudzicki 3b0588c
feat: create CourseInfoBox wrapper component
ChristopherChudzicki c09eec9
feat: create ProgramInfoBox wrapper component
ChristopherChudzicki 6ac1270
test: assert summary mocks are rendered in InfoBox tests
ChristopherChudzicki ff080ad
refactor: simplify ProductPageTemplate to single infoBox prop
ChristopherChudzicki c32ffd4
fix: log warning when program bundle upsell queries fail
ChristopherChudzicki 17321ce
refactor: rename and reorganize InfoBox components
ChristopherChudzicki c84e283
refactor: extract ProgramBundleUpsell to its own module
ChristopherChudzicki c79c37f
test: assert summary mocks are rendered in InfoBox tests
ChristopherChudzicki 179af08
remove asktim
ChristopherChudzicki 8d329ca
refactor: clean up review feedback and batch program queries
ChristopherChudzicki ee92f44
simplify a test call
ChristopherChudzicki 6cc91c1
align enrollment button to right column on tablet
ChristopherChudzicki 22721e8
refactor program bundle upsell layout and remove best value header
ChristopherChudzicki 8796b26
restore disabled link behavior
ChristopherChudzicki 105bf6e
fix wrapping
ChristopherChudzicki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
frontends/main/src/app-pages/ProductPages/InfoBoxCourse.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import React from "react" | ||
| import { VisuallyHidden } from "@mitodl/smoot-design" | ||
| import type { CourseWithCourseRunsSerializerV2 } from "@mitodl/mitxonline-api-axios/v2" | ||
| import { HeadingIds } from "./util" | ||
| import { CourseSummary } from "./ProductSummary" | ||
| import ProgramBundleUpsell from "./ProgramBundleUpsell" | ||
| import CourseEnrollmentButton from "./CourseEnrollmentButton" | ||
| import { InfoBoxCard, InfoBoxContent, InfoBoxEnrollArea } from "./InfoBoxParts" | ||
|
|
||
| type CourseInfoBoxProps = { | ||
| course: CourseWithCourseRunsSerializerV2 | ||
| } | ||
|
|
||
| const CourseInfoBox: React.FC<CourseInfoBoxProps> = ({ course }) => { | ||
| return ( | ||
| <InfoBoxCard as="section" aria-labelledby={HeadingIds.Summary}> | ||
| <VisuallyHidden> | ||
| <h2 id={HeadingIds.Summary}>Course Information</h2> | ||
| </VisuallyHidden> | ||
| <InfoBoxContent> | ||
| <CourseSummary course={course} /> | ||
| </InfoBoxContent> | ||
| <InfoBoxEnrollArea> | ||
| <CourseEnrollmentButton course={course} /> | ||
| </InfoBoxEnrollArea> | ||
| {course.programs?.length ? ( | ||
| <ProgramBundleUpsell programs={course.programs} /> | ||
| ) : null} | ||
| </InfoBoxCard> | ||
| ) | ||
| } | ||
|
|
||
| export default CourseInfoBox |
39 changes: 39 additions & 0 deletions
39
frontends/main/src/app-pages/ProductPages/InfoBoxParts.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { styled } from "@mitodl/smoot-design" | ||
|
|
||
| /** | ||
| * Outer card wrapper: border, shadow, radius. No padding — children control | ||
| * their own insets so that elements like the bundle upsell can span edge-to-edge. | ||
| */ | ||
| export const InfoBoxCard = styled.div(({ theme }) => ({ | ||
| border: `1px solid ${theme.custom.colors.lightGray2}`, | ||
| backgroundColor: theme.custom.colors.white, | ||
| borderRadius: "4px", | ||
| boxShadow: "0 8px 20px 0 rgba(120, 147, 172, 0.10)", | ||
| overflow: "hidden", | ||
| })) | ||
|
|
||
| /** Padded content area inside the summary card. */ | ||
| export const InfoBoxContent = styled.div(({ theme }) => ({ | ||
| padding: "24px", | ||
| [theme.breakpoints.up("md")]: { | ||
| padding: "24px 32px", | ||
| }, | ||
| [theme.breakpoints.down("sm")]: { | ||
| padding: "16px", | ||
| }, | ||
| })) | ||
|
|
||
| export const InfoBoxEnrollArea = styled.div(({ theme }) => ({ | ||
| padding: "8px 24px 24px", | ||
| [theme.breakpoints.up("md")]: { | ||
| padding: "8px 32px 24px", | ||
| }, | ||
| [theme.breakpoints.between("sm", "md")]: { | ||
| display: "flex", | ||
| justifyContent: "flex-end", | ||
| "> *": { flex: "0 1 50%" }, | ||
| }, | ||
| [theme.breakpoints.down("sm")]: { | ||
| padding: "8px 16px 16px", | ||
| }, | ||
| })) | ||
36 changes: 36 additions & 0 deletions
36
frontends/main/src/app-pages/ProductPages/InfoBoxProgram.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import React from "react" | ||
| import { VisuallyHidden } from "@mitodl/smoot-design" | ||
| import type { | ||
| V2ProgramDetail, | ||
| CourseWithCourseRunsSerializerV2, | ||
| } from "@mitodl/mitxonline-api-axios/v2" | ||
| import { HeadingIds } from "./util" | ||
| import { ProgramSummary } from "./ProductSummary" | ||
| import ProgramEnrollmentButton from "./ProgramEnrollmentButton" | ||
| import { InfoBoxCard, InfoBoxContent, InfoBoxEnrollArea } from "./InfoBoxParts" | ||
|
|
||
| type ProgramInfoBoxProps = { | ||
| program: V2ProgramDetail | ||
| courses?: CourseWithCourseRunsSerializerV2[] | ||
| } | ||
|
|
||
| const ProgramInfoBox: React.FC<ProgramInfoBoxProps> = ({ | ||
| program, | ||
| courses, | ||
| }) => { | ||
| return ( | ||
| <InfoBoxCard as="section" aria-labelledby={HeadingIds.Summary}> | ||
| <VisuallyHidden> | ||
| <h2 id={HeadingIds.Summary}>Program Information</h2> | ||
| </VisuallyHidden> | ||
| <InfoBoxContent> | ||
| <ProgramSummary program={program} courses={courses} /> | ||
| </InfoBoxContent> | ||
| <InfoBoxEnrollArea> | ||
| <ProgramEnrollmentButton program={program} /> | ||
| </InfoBoxEnrollArea> | ||
| </InfoBoxCard> | ||
| ) | ||
| } | ||
|
|
||
| export default ProgramInfoBox |
69 changes: 0 additions & 69 deletions
69
frontends/main/src/app-pages/ProductPages/ProductNavbar.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to change this here but I'm a bit confused as to the scope of the changes here. This PR is supposed to be about the program upsell but seems to be doing a lot of change to the layout, but doesn't completely align it with the current Figma.
The tablet view is rendering the enrollment button inside the info box here, but it seems it's supposed to be in the image area. I imagine that work is being saved for a future PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scope of this PR is "Program Bundle Upsell" / "Unified HTML structure" / " InfoBox refactor".
The banner updates are handled in
Let me confirm the enrollment button removal with Steve/Bilal tomorrow. I suspect that's finalized now, and since the banner PR is pretty much ready, we can remove it now. (Figma still shows it for Mobile, but that may be a mistake; we will keep it in the infobox on desktop.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapping issue resolved, btw