-
Notifications
You must be signed in to change notification settings - Fork 94
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] Certificates page #872
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const url = new URL(certificateWebViewUrl, window.location.origin); | |
const url = () => new URL(certificateWebViewUrl, window.location.origin); |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this and use <Helmet />
in Certificates.jsx
. See AccessibilityPages.jsx
L20-L26. getPageHeadTitle
can still be used to format the mesage.
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
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes more sense for this to be use ActionRow
instead of Stack
and ActionRow.Spacer
to separate the text and button.
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.
}, | ||
editCertificateConfirmBtnText: { | ||
id: 'course-authoring.certificates.details.confirm.edit.btn.text', | ||
defaultMessage: 'Yes, continue', |
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.
defaultMessage: 'Yes, continue', | |
defaultMessage: 'Edit', |
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.
src/certificates/certificate-signatories/CertificateSignatories.jsx
Outdated
Show resolved
Hide resolved
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{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.
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.
Sure, fixed
src/certificates/certificate-signatories/CertificateSignatories.jsx
Outdated
Show resolved
Hide resolved
handleBlur: PropTypes.func, | ||
setFieldValue: PropTypes.func, | ||
setEditModes: PropTypes.func, | ||
arrayHelpers: PropTypes.shape({}), |
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.
Is the shape of arrayHelpers
unpredictable?
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
id: 'course-authoring.certificates.sidebar.about2.title', | ||
defaultMessage: 'Issuing certificates to learners', | ||
}, | ||
about_2_Description_1: { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.',
},
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</Card.Section> | ||
<Card.Footer className="justify-content-start"> | ||
<Button type="submit"> | ||
{intl.formatMessage(commonMesages.saveTooltip)} |
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.
Sure, fixed
src/certificates/certificate-signatories/CertificateSignatories.jsx
Outdated
Show resolved
Hide resolved
handleBlur: PropTypes.func, | ||
setFieldValue: PropTypes.func, | ||
setEditModes: PropTypes.func, | ||
arrayHelpers: PropTypes.shape({}), |
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
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dispatch(fetchCertificates(courseId)); | ||
}, [courseId]); | ||
|
||
document.title = getPageHeadTitle(courseTitle, intl.formatMessage(messages.headingTitleTabText)); |
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
id: 'course-authoring.certificates.sidebar.about2.title', | ||
defaultMessage: 'Issuing certificates to learners', | ||
}, | ||
about_2_Description_1: { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add descriptions to messages
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.
added
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.
Please add descriptions to messages
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.
added
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.
Please add descriptions to messages
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.
added
Sandbox deployment successful 🚀 |
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.
Works for me!
@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_page
in the CMS admin panel.new-certificates-page.mp4