eclipse-tractusx / portal-frontend

Portal Frontend
Apache License 2.0
5 stars 32 forks source link

Implement Revocation Functionality in Wallet UI #767

Open jjeroch opened 4 months ago

jjeroch commented 4 months ago

Description

This ticket requires the implementation of a revocation feature for credentials within the /companyWallet page of the Wallet UI. The feature should allow users with the "revoke_credential" permission to revoke credentials other than business partner numbers or memberships.


Acceptance Criteria

  1. Revoke Icon Addition:

    • Add a revoke icon to the bottom right of each credential card within the /companyWallet page
    • Revocation function to be available for credentials in status "ACTIVE" as well as NOT being Membership or BPNCredential

      Icon MaterialUI: SettingsBackupRestore

      image
    • The revoke icon should be visible only to users with the "revoke_credential" permission of the client "Cl24-CX-SSI-Credential-Issuer".
  2. Tooltip on Hover:

    • Display a tooltip with the text "Revoke Credential" when hovering over the revoke icon.
  3. Confirmation Overlay:

    • Upon clicking the revoke icon, present an overlay to the user asking for confirmation to proceed with revocation.
    • The overlay should provide "Cancel" and "Confirm" options.
  4. API Integration:

    • Trigger a call to https://ssi-credential-issuer-rc.dev.demo.catena-x.net/api/revocation/credentials/{credentialId} when the "Confirm" button is clicked.
    • The {credentialId} should be dynamically replaced with the ID of the credential being revoked.
  5. Loading State:

    • Display a loading element during the API call, preventing any further clicks on "Cancel" or "Confirm" until a response is received.
  6. Success/Error Handling:

    • Upon receiving a success response from the API, inform the user that the revocation was successful.
    • If an error response is received, display an error message to the user.
    • Unsuccess Message
      • DE: "Der Widerruf der Berechtigung war erfolglos. Bitte wenden Sie sich an den Administrator oder versuchen Sie es später erneut."
      • EN: "The revocation of the credential was unsuccessful. Please contact the administrator or try again later."
    • Success Message
      • DE: "Der Widerruf Ihrer Zugangsdaten wurde erfolgreich verarbeitet. Mit der erfolgreichen Sperrung verliert der Ausweis seine Gültigkeit. Beachten Sie, dass die Aktion nach dem Widerrufen eines Berechtigungsnachweises nicht mehr rückgängig gemacht werden kann und der Berechtigungsnachweis nicht mehr als gültig anerkannt wird. Wenn Sie die Zugangsdaten erneut anfordern möchten, starten Sie bitte eine neue Zugangsdatenanfrage."
      • EN: "You credential revocation has been successfully processed. With the successful revocation the credential is no longer valid. Note once a credential is revoked, the action cannot be undone, and the credential will no longer be recognized as valid. If you want to request the credential again, please initiate a new credential request."
  7. UI/UX:

    • Ensure that the revoke functionality is seamlessly integrated into the existing UI/UX of the /companyWallet page.
    • The design and placement of the revoke icon should be consistent with the current design language of the Wallet UI.
jjeroch commented 4 months ago

@nidhigarg-bmw

image