Skip to content

Commit

Permalink
recognize suspended credentials in UI
Browse files Browse the repository at this point in the history
Signed-off-by: F-Node-Karlsruhe <christian.fries@eecc.de>
  • Loading branch information
F-Node-Karlsruhe committed Sep 1, 2023
1 parent 847b899 commit e76db3f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
12 changes: 7 additions & 5 deletions frontend/src/components/Credential.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
:data-bs-title="credential.status ? credential.status : 'Verifying...'">
<i v-if="credential.verified == true" style="font-size: 1.25rem;"
class="bi bi-check-circle-fill text-success" role="img" aria-label="Verified"></i>
<i v-else-if="credential.verified == false && !credential.revoked" style="font-size: 1.25rem;"
class="bi bi-x-circle-fill text-danger" role="img" aria-label="Unverified"></i>
<i v-else-if="credential.revoked" style="font-size: 1.25rem;"
class="bi bi-sign-turn-left text-warning" role="img" aria-label="Revoked"></i>
class="bi bi-sign-turn-left text-danger" role="img" aria-label="Revoked"></i>
<i v-else-if="credential.suspended" style="font-size: 1.25rem;"
class="bi bi-clock-history text-warning" role="img" aria-label="Suspended"></i>
<i v-else-if="credential.verified == false" style="font-size: 1.25rem;"
class="bi bi-x-circle-fill text-danger" role="img" aria-label="Unverified"></i>
<div v-else class="spinner-border text-secondary" role="status"
style="width: 1.25rem; height: 1.25rem;">
<span class="visually-hidden">Verifying...</span>
Expand Down Expand Up @@ -237,8 +239,8 @@ export default {
});
},
getStateColor(credential) {
if (credential.revoked) return 'warning';
if (!credential.verified) return 'error';
if (credential.suspended) return 'warning';
if (!credential.verified || credential.revoked) return 'danger';
return 'success';
},
downloadCredential(credential) {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function getPlainCredential(credential) {
var clean_credential = { ...credential };
delete clean_credential.verified;
delete clean_credential.revoked;
delete clean_credential.suspended;
delete clean_credential.status;
delete clean_credential.presentation;
delete clean_credential.context;
Expand Down
15 changes: 13 additions & 2 deletions frontend/src/views/Verify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,20 @@ export default {
if (result.statusResult && !result.statusResult.verified) {
credentialResult.revoked = true;
// TODO also make status arrays recognize suspension
if (credential.credentialStatus.statusPurpose && credential.credentialStatus.statusPurpose == 'suspension') {
message = 'Credential revoked!';
credentialResult.suspended = true;
message = 'Credential suspended!';
} else {
credentialResult.revoked = true;
message = 'Credential revoked!';
}
}
Expand Down

0 comments on commit e76db3f

Please sign in to comment.