Skip to content
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(Certificate): show more info to check issuer identity #353

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/components/atoms/CertificateDetails/CertificateDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export default function CertificateDetails ({
transactionLink,
transactionId,
direction,
hideRecipientName
hideRecipientName,
issuerURL,
recordLink
}) {
const details = [];
if (!hideRecipientName) {
Expand All @@ -66,10 +68,18 @@ export default function CertificateDetails ({
title: getText('text.issueDate'),
value: html`<time datetime$='${issuedOn}'>${issueDate}</time>`
},
{
title: getText('text.certIdURL'),
value: recordLink
},
{
title: getText('text.issuerName'),
value: issuerName
},
{
title: getText('text.issuerURL'),
value: issuerURL
},
{
title: getText('text.issuerPublicKey'),
value: issuerPublicKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
getIssuerPublicKey,
getRecipientName,
getTransactionId,
getTransactionLink
getTransactionLink,
getIssuerURL,
getRecordLink
} from '../../../selectors/certificate';

export const mapStateToProps = (state) => ({
Expand All @@ -19,7 +21,9 @@ export const mapStateToProps = (state) => ({
issuerLogo: getIssuerLogo(state),
transactionLink: getTransactionLink(state),
transactionId: getTransactionId(state),
issuerPublicKey: getIssuerPublicKey(state)
issuerPublicKey: getIssuerPublicKey(state),
issuerURL: getIssuerURL(state),
recordLink: getRecordLink(state)
});

const ownProps = {
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
blockcertsHint: 'Visit Blockcerts website',
by: 'by',
certified: 'Certified by',
certIdURL: 'Record URL',
closeButton: 'Click to close',
downloadLink: 'Download Record in JSON format',
dragAndDropHint: '(you can also drag & drop your file).',
Expand All @@ -23,6 +24,7 @@ export default {
issueDate: 'Issue Date',
issuerName: 'Issuer',
issuerPublicKey: 'Issuer\'s public key',
issuerURL: 'Issuer profile URL',
item: 'Item',
itemPlural: 'Items',
metadataButton: 'View Metadata',
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/lang/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
blockcertsHint: 'Visite el sitio web de Blockcerts',
by: 'por',
certified: 'Certificado por',
certIdURL: 'URL del Registro',
closeButton: 'Haz Click para cerrar',
downloadLink: 'Descarga el Registro en formato JSON',
dragAndDropHint: '(también puedes arrastrar y soltar tu archivo).',
Expand All @@ -23,6 +24,7 @@ export default {
issueDate: 'Fecha de Emisión',
issuerName: 'Emisor',
issuerPublicKey: 'Llave publica del Emisor',
issuerURL: 'URL del emisor',
item: 'Elemento',
itemPlural: 'Elementos',
metadataButton: 'Ver Metadata',
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/lang/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
blockcertsHint: 'Visiter le site de Blockcerts',
by: 'par',
certified: 'Certifié par',
certIdURL: 'URL du certificat',
closeButton: 'Cliquer pour fermer',
downloadLink: 'Télécharger le certificat au format JSON',
dragAndDropHint: '(vous pouvez aussi glisser et déposer votre fichier).',
Expand All @@ -23,6 +24,7 @@ export default {
issueDate: 'Date d\'émission',
issuerName: 'Émetteur',
issuerPublicKey: 'Clé publique de l\'émetteur',
issuerURL: 'URL de l\'émetteur',
item: 'point contrôlé',
itemPlural: 'points contrôlés',
metadataButton: 'Voir les métadata',
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/lang/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
blockcertsHint: 'Visita il sito Web Blockcerts',
by: 'da',
certified: 'Certificato da',
certIdURL: 'Record del certificato',
closeButton: 'Fai clic per chiudere',
downloadLink: 'Scarica il Record in formato JSON',
dragAndDropHint: '(puoi anche trascinare il file).',
Expand All @@ -23,6 +24,7 @@ export default {
issueDate: 'Data',
issuerName: 'Organizzazione Issuer',
issuerPublicKey: 'Chiave pubblica del Issuer',
issuerURL: 'Issuer profile URL',

Choose a reason for hiding this comment

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

URL del profilo del Issuer

item: 'Elemento',
itemPlural: 'Elementi',
metadataButton: 'Visualizza Metadata',
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/lang/mt.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
blockcertsHint: 'Visit Blockcerts website',
by: 'by',
certified: 'Certified by',
certIdURL: 'Record URL',
closeButton: 'Click to close',
downloadLink: 'Download Record in JSON format',
dragAndDropHint: '(you can also drag & drop your file).',
Expand All @@ -23,6 +24,7 @@ export default {
issueDate: 'Issue Date',
issuerName: 'Issuer',
issuerPublicKey: 'Issuer\'s public key',
issuerURL: 'Issuer profile URL',
item: 'Item',
itemPlural: 'Items',
metadataButton: 'View Metadata',
Expand Down
10 changes: 10 additions & 0 deletions src/selectors/certificate.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ export function getIssuerName (state) {
return '';
}

export function getIssuerURL (state) {
const certificateDefinition = getCertificateDefinition(state);

if (certificateDefinition) {
return certificateDefinition.issuer.id;
}

return '';
}

export function getIssuerLogo (state) {
const certificateDefinition = getCertificateDefinition(state);

Expand Down