feat: [FC-0044] Certificates page - #872
Conversation
|
Thanks for the pull request, @khudym! 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. |
|
Sandbox deployment successful 🚀 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #872 +/- ##
==========================================
+ Coverage 91.91% 91.99% +0.08%
==========================================
Files 572 612 +40
Lines 10169 10734 +565
Branches 2199 2299 +100
==========================================
+ Hits 9347 9875 +528
- Misses 795 830 +35
- Partials 27 29 +2 ☔ View full report in Codecov by Sentry. |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment failed 💥 |
|
Sandbox deployment failed 💥 |
42210e0 to
75e7835
Compare
|
Sandbox deployment failed 💥 |
| const previewUrl = useMemo(() => { | ||
| if (!certificateWebViewUrl) { return ''; } | ||
|
|
||
| const url = new URL(certificateWebViewUrl, window.location.origin); |
There was a problem hiding this comment.
| const url = new URL(certificateWebViewUrl, window.location.origin); | |
| const url = () => new URL(certificateWebViewUrl, window.location.origin); |
There was a problem hiding this comment.
I wonder what the benefit is, since the creation of a url instance is already optimized by React.useMemo. Plus, this is no reusable logic, the url object is used immediately. Could you please explain this decision?
There was a problem hiding this comment.
There have been previous issues where URL was not created when it was not part of a function. See #706 for details about how it might throw an error
There was a problem hiding this comment.
Thanks, i see, i will fix it now
| dispatch(fetchCertificates(courseId)); | ||
| }, [courseId]); | ||
|
|
||
| document.title = getPageHeadTitle(courseTitle, intl.formatMessage(messages.headingTitleTabText)); |
There was a problem hiding this comment.
Remove this and use <Helmet /> in Certificates.jsx. See AccessibilityPages.jsx L20-L26. getPageHeadTitle can still be used to format the mesage.
| <Stack direction="horizontal" className="justify-content-center align-items-center" gap="3.5"> | ||
| <span className="small">{intl.formatMessage(messages.noCertificatesText)}</span> | ||
| <Button | ||
| iconBefore={AddIcon} | ||
| onClick={handleCreateMode} | ||
| > | ||
| {intl.formatMessage(messages.setupCertificateBtn)} | ||
| </Button> |
There was a problem hiding this comment.
It makes more sense for this to be use ActionRow instead of Stack and ActionRow.Spacer to separate the text and button.
| }, | ||
| editCertificateConfirmBtnText: { | ||
| id: 'course-authoring.certificates.details.confirm.edit.btn.text', | ||
| defaultMessage: 'Yes, continue', |
There was a problem hiding this comment.
| defaultMessage: 'Yes, continue', | |
| defaultMessage: 'Edit', |
There was a problem hiding this comment.
arbrandes
left a comment
There was a problem hiding this comment.
Looks great for the most part, but I do have a couple of questions and requests for changes.
| </Card.Section> | ||
| <Card.Footer className="justify-content-start"> | ||
| <Button type="submit"> | ||
| {intl.formatMessage(commonMesages.saveTooltip)} |
There was a problem hiding this comment.
| {intl.formatMessage(commonMesages.saveTooltip)} | |
| {intl.formatMessage(commonMessages.saveTooltip)} |
Even if this was an inherited typo, I believe we should fix it as part of this PR.
| handleBlur: PropTypes.func, | ||
| setFieldValue: PropTypes.func, | ||
| setEditModes: PropTypes.func, | ||
| arrayHelpers: PropTypes.shape({}), |
There was a problem hiding this comment.
Is the shape of arrayHelpers unpredictable?
| id: 'course-authoring.certificates.sidebar.about2.title', | ||
| defaultMessage: 'Issuing certificates to learners', | ||
| }, | ||
| about_2_Description_1: { |
There was a problem hiding this comment.
These message identifiers aren't very descriptive. Can we try and come up with some less generic ones? (It's bad enough that none of the messages have descriptions, but I'm not going to hold the PRs up on this... for now.)
There was a problem hiding this comment.
Renamed
Is this more appropriate?)
workingWithCertificatesTitle: {
id: 'course-authoring.certificates.sidebar.working-with-certificates.title',
defaultMessage: 'Working with certificates',
},
workingWithCertificatesFirstParagraph: {
id: 'course-authoring.certificates.sidebar.working-with-certificates.first-paragraph',
defaultMessage: 'Specify a course title to use on the certificate if the course\'s official title is too long to be displayed well.',
},
workingWithCertificatesSecondParagraph: {
id: 'course-authoring.certificates.sidebar.working-with-certificates.second-paragraph',
defaultMessage: 'For verified certificates, specify between one and four signatories and upload the associated images. To edit or delete a certificate before it is activated, hover over the top right corner of the form and select {strongText} or the delete icon.',
},
khudym
left a comment
There was a problem hiding this comment.
Thank you for the review!
Fixed most of the comments but also left a couple questions
| }, | ||
| editCertificateConfirmBtnText: { | ||
| id: 'course-authoring.certificates.details.confirm.edit.btn.text', | ||
| defaultMessage: 'Yes, continue', |
There was a problem hiding this comment.
| </Card.Section> | ||
| <Card.Footer className="justify-content-start"> | ||
| <Button type="submit"> | ||
| {intl.formatMessage(commonMesages.saveTooltip)} |
| handleBlur: PropTypes.func, | ||
| setFieldValue: PropTypes.func, | ||
| setEditModes: PropTypes.func, | ||
| arrayHelpers: PropTypes.shape({}), |
| <Stack direction="horizontal" className="justify-content-center align-items-center" gap="3.5"> | ||
| <span className="small">{intl.formatMessage(messages.noCertificatesText)}</span> | ||
| <Button | ||
| iconBefore={AddIcon} | ||
| onClick={handleCreateMode} | ||
| > | ||
| {intl.formatMessage(messages.setupCertificateBtn)} | ||
| </Button> |
| dispatch(fetchCertificates(courseId)); | ||
| }, [courseId]); | ||
|
|
||
| document.title = getPageHeadTitle(courseTitle, intl.formatMessage(messages.headingTitleTabText)); |
| id: 'course-authoring.certificates.sidebar.about2.title', | ||
| defaultMessage: 'Issuing certificates to learners', | ||
| }, | ||
| about_2_Description_1: { |
There was a problem hiding this comment.
Renamed
Is this more appropriate?)
workingWithCertificatesTitle: {
id: 'course-authoring.certificates.sidebar.working-with-certificates.title',
defaultMessage: 'Working with certificates',
},
workingWithCertificatesFirstParagraph: {
id: 'course-authoring.certificates.sidebar.working-with-certificates.first-paragraph',
defaultMessage: 'Specify a course title to use on the certificate if the course\'s official title is too long to be displayed well.',
},
workingWithCertificatesSecondParagraph: {
id: 'course-authoring.certificates.sidebar.working-with-certificates.second-paragraph',
defaultMessage: 'For verified certificates, specify between one and four signatories and upload the associated images. To edit or delete a certificate before it is activated, hover over the top right corner of the form and select {strongText} or the delete icon.',
},
| const previewUrl = useMemo(() => { | ||
| if (!certificateWebViewUrl) { return ''; } | ||
|
|
||
| const url = new URL(certificateWebViewUrl, window.location.origin); |
There was a problem hiding this comment.
I wonder what the benefit is, since the creation of a url instance is already optimized by React.useMemo. Plus, this is no reusable logic, the url object is used immediately. Could you please explain this decision?
75e7835 to
2c22c7c
Compare
|
Sandbox deployment failed 💥 |
42e3f41 to
28baed5
Compare
|
Sandbox deployment failed 💥 |
|
Sandbox deployment failed 💥 |
|
This PR depends on BE |
|
Sandbox deployment failed 💥 |
|
Sandbox deployment failed 💥 |
|
Sandbox deployment successful 🚀 |
28baed5 to
fdc514a
Compare
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
fdc514a to
77173dd
Compare
|
Sandbox deployment successful 🚀 |
77173dd to
5d6a68a
Compare
|
Sandbox deployment successful 🚀 |
There was a problem hiding this comment.
Please add descriptions to messages
There was a problem hiding this comment.
Please add descriptions to messages
There was a problem hiding this comment.
Please add descriptions to messages
|
Sandbox deployment successful 🚀 |
|
@khudym 🎉 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 Certificates page.
Issue: openedx/platform-roadmap#317
Developer notes
the page reloads after the user saves changes to the certificate or signature. This issue will be fixed within Group Configurations pull request;temporary added ModalNotification component that should be removed after merging this PR;Design
Figma design
Testing instructions
contentstore.new_studio_mfe.use_new_certificates_pagein the CMS admin panel.new-certificates-page.mp4