Conversation
frontends/ol-components/src/components/BaseLearningResourceCard/BaseLearningResourceCard.tsx
Outdated
Show resolved
Hide resolved
…d allow for MitxOnlineCourseCard to render all of the same things as a LearningResourceCard, then set ProgramPage to render MitxOnlineCourseCard in list presentation
73f790d to
1a93adb
Compare
...ends/ol-components/src/components/LearningResourceCard/LearningResourceListCardCondensed.tsx
Show resolved
Hide resolved
ChristopherChudzicki
left a comment
There was a problem hiding this comment.
I noticed two issues, one is pretty small (the colon spacing). The other to do with prices display twice.
| // Try page.current_price first (single course price) | ||
| if ( | ||
| course.page?.current_price !== undefined && | ||
| course.page?.current_price !== null | ||
| ) { | ||
| return formatCurrency(course.page.current_price) | ||
| } |
There was a problem hiding this comment.
I'm not actually sure what's preferable here.
current_priceis the true actual price based on the product for the next unexpired run (next_run_id)min_price/max_priceare coming from wagtail- in the price range allows for financial aid display
- It's what Learn uses in its cards, i believe
There was a problem hiding this comment.
I think the following issue is specifically with the MITxOnline data source version of the cards, but when I have both a cert/product + min/max price set, I see the price twice:
I think:
- we should only see cert price or course price, not both.
- except maybe for cert courses that are also auditable, we show cert price + free
That said, I realize that we don't have the data in place to distinguish mitxonlines courses that are paid-only vs paid+free-no-cert options. I think until it's in place, we should assume everything is free-or-paid-for-cert, like ETL assumes. What do you think?
Additional minor issue:
In image above, there seems to be an extra space between Certificate and the colon, i.e., should be "Certificate: " not "Certificate :"
This seems also to happen on the main search page, where the data comes from ETL
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/10165
Description (What does it do?)
This PR primarily sets up the course cards on MITx Online to display in "list" format like they do on the search results page. A good deal of refactoring was also done on all of the
LearningResourceCardtype components. The presentation layer of these components was extracted out intoBaseLearningResourceCardso that other components that implement it can do all of the same things that a normalLearningResourceCarddoes that's passed aLearningResource. This mainly has to do with the fact that the handling of grid vs list etc. was previously handled inResourceCard. This functionality was basically bubbled up intoBaseLearningResourceCardso MitxOnlineCourseCard (and any other card data source in the future) can control this behavior.Screenshots (if appropriate):
How can this be tested?
mitxonline-product-pagesfeature flag enabled/programs/readable-idwherereadable-idis the readable ID of your program in MITx Online