-
Notifications
You must be signed in to change notification settings - Fork 17
Mspyx 578 Add VC IDR Link to Toast Message #267
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
base: next
Are you sure you want to change the base?
Mspyx 578 Add VC IDR Link to Toast Message #267
Conversation
packages/components/src/components/BarcodeGenerator/BarcodeGenerator.tsx
Outdated
Show resolved
Hide resolved
status: Status; | ||
message: string; | ||
linkURL: string; |
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.
linkURL: string; | |
linkURL?: string | null; |
position: 'top-right', | ||
hideProgressBar: true, | ||
closeOnClick: true, | ||
// closeOnClick: true, |
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.
// closeOnClick: true, |
|
||
// Render the component | ||
render(<ToastMessage />); | ||
|
||
// Call the toastMessage function | ||
toastMessage({ status, message }); | ||
toastMessage({ status, message, linkURL }); |
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.
Could you add unit tests to verify the functionality (i.e., does the link appear when a URL is provided, and does it not appear when no URL is provided)?
@@ -154,10 +154,10 @@ export const GenericFeature: React.FC<IGenericFeatureProps> = ({ components, ser | |||
|
|||
handler(result); | |||
setResult(result); | |||
toastMessage({ status: Status.success, message: 'Action Successful' }); | |||
toastMessage({ status: Status.success, message: 'Action Successful.', linkURL: state[0]["data"]["id"] }); |
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 have several concerns about this implementation, based on my assumption that the change aims to provide a clickable link for users to view a visual representation of the credential they have issued. When clicked, this link should redirect to the verify page with an appropriately constructed verify link, where the page fetches the credential from the storage service, verifies it, and renders it.
Setting linkURL: state[0]["data"]["id"]
assumes that the id
in the credential payload is a link resolver link that resolves to the verify link for the issued credential. This is not always true, as the id
should be the URI of the credentialβs storage location or a URN that is resolvable.
The link resolver is merely a mechanism to list data available for a given identifier scheme/identifier and may resolve to the issued credential, but this is not guaranteed.
If my assumption is correct, we should, for now, use the IDR link from the result returned by the executeServices
function, which should resolve to the issued credential. However, this approach assumes an isolated environment with a single user issuing credentials, which may not always hold.
toastMessage({ status: Status.success, message: 'Action Successful.', linkURL: state[0]["data"]["id"] }); | |
toastMessage({ status: Status.success, message: 'Action Successful.', linkURL: result?.linkResolver ?? null }); |
The optimal solution would be to include the constructed verify link, registered with the IDR service for the specific identifier/identifier scheme, in the result object and use that link instead. This ensures the link consistently directs users to the rendered view of the credential they have issued.
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.
Can we also add e2e tests?
Thank you for your contribution @vincentiussundjaja, it is much appreciated. |
Thanks @ashleythedeveloper for the comments and feedback! I'll have a look and implement them ASAP - will let you know once done |
β¦tsx to use linkResolver from result for toastMessage
Hi @ashleythedeveloper , I've implemented your feedback. They're reflected in these 2 commits |
What type of PR is this? (check all applicable)
Description
This was related to the issue raised by bcmine that they had a UX expectations that there should be some sort of way to access the VCs after issuing them
Related Tickets & Documents
NA
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
No