handle null values coming back on feature_img_src from mitxonline#3015
handle null values coming back on feature_img_src from mitxonline#3015
Conversation
ChristopherChudzicki
left a comment
There was a problem hiding this comment.
We shouldn't merge this till the mitxonline one is merged, right?
I tried this branch with the updated client. It has a bunch of TS errors, but they are mostly to do with mitodl/mitxonline#3326.
There were a few errors because instructor.feature_image_src is now nullable ... I guess it was defaulting to the course image before.
Hm, this is a good point. I had thought we would want to merge this first, because if we merge and release the MITx Online PR first then it will start delivering nulls that Learn is not currently set up to deal with. Even if you're using the old version of the API client, null will still come back in the data which will cause errors? Although, now that I think about it that might be okay temporarily seeing as everything is still feature flagged? |
|
no you're right, we should merge this first! |
I'll be putting a follow-up to this up after the MITx Online release to update the API client version and remove the unnecessary code in the tests that handles the fact that the API current says the field is non-nullable. |
6dafac6 to
b274a7a
Compare
b274a7a to
7b6d240
Compare
What are the relevant tickets?
Pre-requisite for https://github.com/mitodl/hq/issues/10433
Description (What does it do?)
This PR sets up uses of
feature_img_srcon Wagtail pages coming back from the MITx Online API to handle the value beingnull. Currently, this field is not nullable, but when mitodl/mitxonline#3351 merges, it will be. If the field is null,DEFAULT_RESOURCE_IMGis used.How can this be tested?
mitxonline-product-pagesfeature flag enabledcg/null-course-imagebranch/courses/course-readable-id/programs/program-readable-idChecklist:
@mitodl/mitxonline-api-axiospackage and strip out some of the test logic that was necessary in this PR because the field is not nullable yet. Themit-dome.pngimage that is unused by Learn itself should also be removed.