Skip to content

Commit

Permalink
feat: verifier proof improvements (#1191)
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce McMath <[email protected]>
  • Loading branch information
bryce-mcmath authored Jul 10, 2024
1 parent 9edeb14 commit 56d8263
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const CredentialCard11: React.FC<CredentialCard11Props> = ({

const parseAttribute = (item: (Attribute & Predicate) | undefined) => {
let parsedItem = item
if (item && item.value != null) {
if (item && item.pValue != null) {
parsedItem = pTypeToText(item, t, attributeTypes) as Attribute & Predicate
}
const parsedValue = formatIfDate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
TextInput,
TouchableOpacity,
} from 'react-native'
import Icon from 'react-native-vector-icons/MaterialIcons'

import ImageModal from '../../components/modals/ImageModal'
import { TOKENS, useContainer } from '../../container-api'
Expand Down Expand Up @@ -261,6 +262,9 @@ const VerifierCredentialCard: React.FC<VerifierCredentialCardProps> = ({
{ylabel}
</Text>
<View style={{ flexDirection: 'row', flexWrap: 'wrap', alignItems: 'flex-end' }}>
{item.satisfied && !preview ? (
<Icon style={{ marginRight: 5 }} size={24} name={'check-circle'} color={ColorPallet.semantic.success} />
) : null}
<Text style={[TextTheme.bold, styles.textContainer, predicateStyles.predicateType]}>{item.pType}</Text>
{/* Only allow editing parametrizable predicates in preview mode */}
{item.parameterizable && preview && onChangeValue ? (
Expand Down
3 changes: 1 addition & 2 deletions packages/legacy/core/App/localization/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,7 @@ const translation = {
"GenerateNewQR": "Request another proof",
"BackToList": "Back to list",
"ShareLink": "Share link",
"ScanQR": "Show this QR code to the other person",
"ScanQRComment": "After the QR code is scanned, a proof request will be sent.",
"ScanQR": "Show this QR code to the other person to verify:",
"InformationReceived": "Information received.",
"InformationReceivedDetails": "Review the information below.",
"ProofVerificationFailed": "Proof verification failed",
Expand Down
3 changes: 1 addition & 2 deletions packages/legacy/core/App/localization/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,7 @@ const translation = {
"GenerateNewQR": "Demander une autre preuve",
"BackToList": "Retour à la liste",
"ShareLink": "Lien de partage",
"ScanQR": "Afficher ce code QR à la personne qui demande la preuve",
"ScanQRComment": "Après le scan du code QR, une demande de preuve sera envoyée.",
"ScanQR": "Afficher ce code QR à la personne qui demande la preuve:",
"InformationReceived": "Information reçue.",
"InformationReceivedDetails": "Revoyer les informations ci-dessous.",
"ProofVerificationFailed": "La vérification de la preuve a échoué",
Expand Down
3 changes: 1 addition & 2 deletions packages/legacy/core/App/localization/pt-br/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,7 @@ const translation = {
"GenerateNewQR": "Requisitar outra prova",
"BackToList": "Voltar para a lista",
"ShareLink": "Compartilhar link",
"ScanQR": "Mostrar este QR code para a outra pessoa",
"ScanQRComment": "Depois do QR code ser scaneado, a requisição de prova será enviada.",
"ScanQR": "Mostrar este QR code para a outra pessoa:",
"InformationReceived": "Informação recebida.",
"InformationReceivedDetails": "Revisar a informação abaixo.",
"ProofVerificationFailed": "A verificação da prova falhou",
Expand Down
9 changes: 5 additions & 4 deletions packages/legacy/core/App/screens/ProofRequesting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ const ProofRequesting: React.FC<ProofRequestingProps> = ({ route, navigation })
},
headerContainer: {
alignItems: 'center',
padding: 16,
marginHorizontal: 30,
paddingVertical: 16,
marginHorizontal: 20,
textAlign: 'center',
},
primaryHeaderText: {
...TextTheme.headingThree,
textAlign: 'center',
marginTop: 20,
},
secondaryHeaderText: {
...TextTheme.normal,
Expand Down Expand Up @@ -216,8 +217,8 @@ const ProofRequesting: React.FC<ProofRequestingProps> = ({ route, navigation })
{message && <QRRenderer value={message} size={qrSize} />}
</View>
<View style={styles.headerContainer}>
<Text style={styles.primaryHeaderText}>{t('Verifier.ScanQR')}</Text>
<Text style={styles.secondaryHeaderText}>{t('Verifier.ScanQRComment')}</Text>
<Text style={styles.secondaryHeaderText}>{t('Verifier.ScanQR')}</Text>
<Text style={styles.primaryHeaderText}>{template?.name}</Text>
</View>
</ScrollView>
<View style={styles.buttonContainer}>
Expand Down
1 change: 1 addition & 0 deletions packages/legacy/core/App/utils/oca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const buildFieldsFromSharedAnonCredsProof = (data: CredentialSharedProofD
name: predicate.name,
pType: predicate.predicateType,
pValue: predicate.predicateValue,
satisfied: true,
})
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,19 @@ exports[`ProofRequesting Component generate new qr works correctly 1`] = `
style={
Object {
"alignItems": "center",
"marginHorizontal": 30,
"padding": 16,
"marginHorizontal": 20,
"paddingVertical": 16,
"textAlign": "center",
}
}
>
<Text
style={
Object {
"color": "#FFFFFF",
"fontSize": 26,
"fontWeight": "bold",
"color": "#000000",
"fontSize": 18,
"fontWeight": "normal",
"marginTop": 8,
"textAlign": "center",
}
}
Expand All @@ -98,15 +99,15 @@ exports[`ProofRequesting Component generate new qr works correctly 1`] = `
<Text
style={
Object {
"color": "#000000",
"fontSize": 18,
"fontWeight": "normal",
"marginTop": 8,
"color": "#FFFFFF",
"fontSize": 26,
"fontWeight": "bold",
"marginTop": 20,
"textAlign": "center",
}
}
>
Verifier.ScanQRComment
Student full name
</Text>
</View>
</View>
Expand Down Expand Up @@ -274,18 +275,19 @@ exports[`ProofRequesting Component renders correctly 1`] = `
style={
Object {
"alignItems": "center",
"marginHorizontal": 30,
"padding": 16,
"marginHorizontal": 20,
"paddingVertical": 16,
"textAlign": "center",
}
}
>
<Text
style={
Object {
"color": "#FFFFFF",
"fontSize": 26,
"fontWeight": "bold",
"color": "#000000",
"fontSize": 18,
"fontWeight": "normal",
"marginTop": 8,
"textAlign": "center",
}
}
Expand All @@ -295,15 +297,15 @@ exports[`ProofRequesting Component renders correctly 1`] = `
<Text
style={
Object {
"color": "#000000",
"fontSize": 18,
"fontWeight": "normal",
"marginTop": 8,
"color": "#FFFFFF",
"fontSize": 26,
"fontWeight": "bold",
"marginTop": 20,
"textAlign": "center",
}
}
>
Verifier.ScanQRComment
Student full name
</Text>
</View>
</View>
Expand Down Expand Up @@ -427,18 +429,19 @@ exports[`ProofRequesting Component renders correctly 2`] = `
style={
Object {
"alignItems": "center",
"marginHorizontal": 30,
"padding": 16,
"marginHorizontal": 20,
"paddingVertical": 16,
"textAlign": "center",
}
}
>
<Text
style={
Object {
"color": "#FFFFFF",
"fontSize": 26,
"fontWeight": "bold",
"color": "#000000",
"fontSize": 18,
"fontWeight": "normal",
"marginTop": 8,
"textAlign": "center",
}
}
Expand All @@ -448,15 +451,15 @@ exports[`ProofRequesting Component renders correctly 2`] = `
<Text
style={
Object {
"color": "#000000",
"fontSize": 18,
"fontWeight": "normal",
"marginTop": 8,
"color": "#FFFFFF",
"fontSize": 26,
"fontWeight": "bold",
"marginTop": 20,
"textAlign": "center",
}
}
>
Verifier.ScanQRComment
Student full name
</Text>
</View>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ exports[`displays a proof request screen with a proof request displays a proof r
testID="com.ariesbifold:id/CredentialCard"
>
<View
accessibilityLabel="Credentials.IssuedBy Unknown Contact, Credential Credentials.Credential. age, <= 18,,"
accessibilityLabel="Credentials.IssuedBy Unknown Contact, Credential Credentials.Credential. age, ProofRequest.PredicateLe 18,,"
accessible={true}
style={
Object {
Expand Down

0 comments on commit 56d8263

Please sign in to comment.