-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat: [FC-0044] Textbooks Page #890
feat: [FC-0044] Textbooks Page #890
Conversation
Thanks for the pull request, @vladislavkeblysh! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
a0f2e15
to
57e9a55
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #890 +/- ##
==========================================
+ Coverage 92.09% 92.20% +0.10%
==========================================
Files 685 703 +18
Lines 12090 12334 +244
Branches 2609 2667 +58
==========================================
+ Hits 11134 11372 +238
- Misses 920 926 +6
Partials 36 36 ☔ View full report in Codecov by Sentry. |
ba30003
to
e3e7c5e
Compare
Hi @vladislavkeblysh! Would you mind adding a description of your changes to the top of the pull request? |
You'll probably also want to make this a draft until it's ready. |
@mphilbrick211 @arbrandes Yes, sorry, PR is not ready |
9bf36c0
to
dd34a7a
Compare
fd3e274
to
c54d011
Compare
const onPreviewTextbookClick = () => { | ||
window.location.href = `${config.LMS_BASE_URL}/courses/${courseId}/pdfbook/${textbookIndex}/`; |
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 think a better user experience would be to have the preview open in a new tab.
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.
Fixed
src/CourseAuthoringRoutes.jsx
Outdated
@@ -120,6 +121,10 @@ const CourseAuthoringRoutes = () => { | |||
path="certificates" | |||
element={<PageWrap><Certificates courseId={courseId} /></PageWrap>} | |||
/> | |||
<Route | |||
path="/textbooks" |
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 redirect in edx-platform
needs to be updated to match the new path
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.
path="/textbooks" | |
path="textbooks" |
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.
Fixed
@@ -93,7 +102,9 @@ const ModalDropzone = ({ | |||
onProcessUpload={handleSelectFile} | |||
inputComponent={inputComponent} | |||
accept={accept} |
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 the accept is formatted the correct way because it is not only allowing PDFs to be selected for the textbooks page. I was able to select a .docx
file and was shown the invalid file type error.
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.
Fixed
e9e9e06
to
680beca
Compare
@vladislavkeblysh please merge in master to fix the upload to code cov causing validate/tests failure |
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 will approve this once a PR for the textbook url redirect in edx-platform
is merged in.
680beca
to
1eee61b
Compare
Done |
f8af63f
to
34d8fa1
Compare
@KristinAoki The edx-platform part for textbooks was finalized already, so this PR is good to merge, thanks! |
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.
Looks like you committed webpack.dev-tutor.config.js
by mistake. Other than that, a couple of minor requests for changes, and one big issue: it seems the URL that's being assumed here (as provided by https://github.com/openedx/edx-platform/blob/master/cms/djangoapps/contentstore/utils.py#L459) is not working. In a Tutor dev env, I must remove pages-and-resources
from the path for the textbooks page to work. Any idea why that might be?
If I go to the URL manually, though, the feature works as expected.
@@ -30,7 +30,7 @@ const FormikControl = ({ | |||
onChange={handleChange} | |||
onBlur={handleBlur} | |||
onFocus={handleFocus} | |||
isInvalid={fieldTouched && fieldError} | |||
isInvalid={!!fieldTouched && !!fieldError} |
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.
Out of curiosity, why was the forced boolean conversion (!!
) necessary, here?
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.
This condition did not always work correctly, and fieldError is not a boolean value and required additional transformation
src/textbooks/Textbooks.jsx
Outdated
} = useTextbooks(courseId); | ||
|
||
const { | ||
isShow: isShowProcessingNotification, |
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.
isShow: isShowProcessingNotification, | |
show: showProcessingNotification, |
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.
Fixed
src/textbooks/Textbooks.jsx
Outdated
</section> | ||
</Container> | ||
<ProcessingNotification | ||
isShow={isShowProcessingNotification} |
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.
isShow={isShowProcessingNotification} | |
isShow={showProcessingNotification} |
(I have a similar issue with the isShow
property in <ProcessingNotification />
, but that's a refactor for another day.)
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.
Fixed
src/textbooks/hooks.jsx
Outdated
}, | ||
{ | ||
label: '', | ||
href: `/course/${courseId}/pages-and-resources/textbooks`, |
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.
This seems to be the wrong URL. I could only get it to work (in a Tutor dev environment) with:
href: `/course/${courseId}/pages-and-resources/textbooks`, | |
href: `/course/${courseId}/textbooks`, |
23fe47e
to
f4f52fe
Compare
a5a05e9
to
7648801
Compare
feat: refactor after review
feat: refactor after review
7648801
to
6ecab8c
Compare
6ecab8c
to
6e5d91c
Compare
@arbrandes The review comments were addressed, PR was rebased and ready for review. |
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.
Thanks for addressing my comments! Approved.
I went through @KristinAoki's review, and it seems all comments were addressed. So I'm going ahead and merging it. If any problems remain, we can fix them individually later. |
@vladislavkeblysh 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Settings
Description
This PR adds fully implemented Texbooks page.
Issue: openedx/platform-roadmap#319
Design
Figma design
Testing instructions
Screen.Recording.2024-03-14.at.19.08.40.mov