8000 Mspyx 578 Add VC IDR Link to Toast Message by vincentiussundjaja Β· Pull Request #267 Β· uncefact/tests-untp Β· GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Open
wants to merge 4 commits into
base: next
Choose a base branch
from

Conversation

vincentiussundjaja
Copy link
@vincentiussundjaja vincentiussundjaja commented May 15, 2025

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

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?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“– Mock App docs site
  • πŸ“œ README.md
  • πŸ“• storybook
  • πŸ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

No

status: Status;
message: string;
linkURL: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
linkURL: string;
linkURL?: string | null;

position: 'top-right',
hideProgressBar: true,
closeOnClick: true,
// closeOnClick: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// closeOnClick: true,


// Render the component
render(<ToastMessage />);

// Call the toastMessage function
toastMessage({ status, message });
toastMessage({ status, message, linkURL });
Copy link
Collaborator

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"] });
Copy link
Collaborator
@ashleythedeveloper ashleythedeveloper May 27, 2025

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.

Suggested change
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.

Copy link
Collaborator

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?

@ashleythedeveloper
Copy link
Collaborator

Thank you for your contribution @vincentiussundjaja, it is much appreciated.

@vincentiussundjaja
Copy link
Author

Thanks @ashleythedeveloper for the comments and feedback! I'll have a look and implement them ASAP - will let you know once done

8000
@vincentiussundjaja
Copy link
Author

Hi @ashleythedeveloper , I've implemented your feedback. They're reflected in these 2 commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0