-
Notifications
You must be signed in to change notification settings - Fork 17
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: display course credentials on VC page #469
base: master
Are you sure you want to change the base?
feat: display course credentials on VC page #469
Conversation
Thanks for the pull request, @kyrylo-kh! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #469 +/- ##
==========================================
+ Coverage 73.25% 74.01% +0.76%
==========================================
Files 28 28
Lines 415 431 +16
Branches 89 100 +11
==========================================
+ Hits 304 319 +15
- Misses 110 111 +1
Partials 1 1 ☔ View full report in Codecov by Sentry. |
c6d3174
to
140ec21
Compare
@kyrylo-kh can you resolve the conflicts when you have a moment. |
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 good to me, although I have one small request, nonblocking. One more aperture person is probably going to look as well.
const [ | ||
verifiableCredentialIssuanceData, | ||
setVerifiableCredentialIssuanceData, | ||
] = useState({}); | ||
|
||
useEffect(() => { | ||
getProgramCertificates() | ||
getCertificates() |
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's a previously existing bug here, that you're not introducing. However, since it is in the verifiable credentials rendering codecode, it would be really nice if you fixed. (Nonblocking because it's a pre-existing bug in the verifiable credentials code, and presumably only turns up in certain configurations of instances, but still.)
On an out-of-the-box configuration, verifiable credentials shows up in the learner record as a tab whether or not they are configured or available:
Selecting that tab generates a runtime error, visible in development, pasted below.
I haven't looked closely enough to see what is going on to make it so the verifiable credentials is rendering and causing an error when clicked, but surely if it's not configured to run correctly, it shouldn't render at all.
can't access property "length", certificates.program_credentials is undefined
CertificatesList@webpack-internal:///./src/components/CertificatesList/CertificatesList.jsx:57:31
renderWithHooks@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:14985:27
updateFunctionComponent@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:17356:20
beginWork@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:19063:16
callCallback@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:3945:14
invokeGuardedCallbackDev@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:3994:16
invokeGuardedCallback@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4056:31
beginWork$1@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:23959:28
performUnitOfWork@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22771:12
workLoopSync@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22702:22
renderRootSync@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22665:7
performSyncWorkOnRoot@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22288:18
flushSyncCallbackQueueImpl/<@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:11327:26
unstable_runWithPriority@webpack-internal:///./node_modules/scheduler/cjs/scheduler.development.js:468:12
runWithPriority$1@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:11276:10
flushSyncCallbackQueueImpl@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:11322:26
flushSyncCallbackQueue@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:11309:3
scheduleUpdateOnFiber@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21888:9
dispatchAction@webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:16139:26
CertificatesList/</<@webpack-internal:///./src/components/CertificatesList/CertificatesList.jsx:61:22
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.
To be honest I can't reproduce this error locally. When I switch tab to Verifiable Credentials
I see only one message in console
Warning: Failed prop type: CertificateModal: prop type `data` is invalid; it must be a function, usually from the `prop-types` package, but received `undefined`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.
Could you tell me how to reproduce it?
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.
okay, I tracked this down. If you have the out-of-the-box dev configuration that you get from source (learner record MFE has ENABLE_VERIFIABLE_CREDENTIALS='true'
, credentials IDA does not have ENABLE_VERIFIABLE_CREDENTIALS = True
), you get this effect. If you explicitly disable ENABLE_VERIFIABLE_CREDENTIALS
on the MFE you obviously don't see the 2nd tab, and if you explicitly enable ENABLE_VERIFIABLE_CREDENTIALS
the credentials ida it works fine.
So i still would call this a bug just in terms of exception handling, but it's a bug it's only ever going to affect developers. In a production environment, if you have those 2 settings not matching, you've done something wrong.
tl;dr I'd love it if y'all opened to take it internally to make it so that if that circumstance happens you get some kind of graceful failure, just in case a production operator does the dumb thing. But it's definitely not a blocker 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.
package.json
Outdated
@@ -46,6 +46,9 @@ | |||
"@fortawesome/react-fontawesome": "0.2.2", | |||
"@openedx/frontend-plugin-framework": "^1.2.0", | |||
"@openedx/paragon": "^22.2.2", | |||
"ajv": "^8.12.0", | |||
"ajv-keywords": "^5.1.0", | |||
"axios": "^1.7.9", |
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.
axios
is already brought in as a dependency through frontend-platform
, is this version requiring anything new that can't be obtained from the one in frontend-platform
?
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.
Deleted this package from package.json
https://github.com/openedx/frontend-app-learner-record/compare/140ec21935491fbe9a1523a62f3314cc3480bac7..4f0a0eaa7f56173c8e88064f482bb1fece045256
package.json
Outdated
"regenerator-runtime": "0.14.1" | ||
"regenerator-runtime": "0.14.1", | ||
"schema-utils": "^4.2.0", | ||
"webpack-dev-server": "^4.15.2" |
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.
similarly with axios
, frontend-build
has webpack-dev-server already as a dependency, which I can see already exists in Learner Record as a dependency
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.
Deleted this package from package.json
https://github.com/openedx/frontend-app-learner-record/compare/140ec21935491fbe9a1523a62f3314cc3480bac7..4f0a0eaa7f56173c8e88064f482bb1fece045256
courseCredentialsDescription: { | ||
id: 'credentials.description', | ||
defaultMessage: | ||
'A certificate for a course will appear once you have completed course.', |
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.
'A certificate for a course will appear once you have completed course.', | |
'A course certificate will appear once you have completed a course.', |
This is only a suggestion, but I was trying to rewrite this so that the end of the sentence made it clear that a certificate would be received once the learner finished any course.
Another way to write this is:
"A certificate for a course will appear one you have completed the course."
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.
Changed text to A course certificate will appear once you have completed a course.
https://github.com/openedx/frontend-app-learner-record/compare/140ec21935491fbe9a1523a62f3314cc3480bac7..4f0a0eaa7f56173c8e88064f482bb1fece045256
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.
Aside from some comments about dependencies and a string message, this looks good to me!
4f0a0ea
to
46049a6
Compare
looks good to me. |
46049a6
to
68d2cfd
Compare
Description:
Display course credentials along with program credentials on the Verifiable Credentials tab
Related PR's: