Skip to content

Commit

Permalink
fix(deps): upgrade credo deps, proxy client, fix person bug (bcgov#2218)
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce McMath <[email protected]>
  • Loading branch information
bryce-mcmath authored Oct 10, 2024
1 parent b0f0ce4 commit faed084
Show file tree
Hide file tree
Showing 8 changed files with 265 additions and 226 deletions.
1 change: 1 addition & 0 deletions app/container-imp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export class AppContainer implements Container {
{
component: PersonCredentialLoading,
name: 'PersonCredentialLoading',
stackOptions: { headerShown: false },
},
],
pageTitle: 'PersonCredential.PageTitle',
Expand Down
8 changes: 4 additions & 4 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- anoncreds (0.2.2):
- anoncreds (0.2.4):
- React
- React-callinvoker
- React-Core
Expand Down Expand Up @@ -445,7 +445,7 @@ PODS:
- React-jsinspector (0.72.5)
- React-logger (0.72.5):
- glog
- "react-native-attestation (1.0.0-alpha.338+92b87193)":
- "react-native-attestation (1.0.0-alpha.342+d7dbeef6)":
- RCT-Folly (= 2021.07.22.00)
- React-Core
- react-native-config (1.5.0):
Expand Down Expand Up @@ -891,7 +891,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
anoncreds: c709906b5a3caaf6bbe871646e6c16b522c6531d
anoncreds: 045f191123bb20d7dcdc2f7c19df57ae30c427f6
aries-askar: 3a78d5cfc8faedbfc55a9ff35e2309fc4574a147
boost: 57d2868c099736d80fcd648bf211b4431e51a558
CatCrypto: a477899b6be4954e75be4897e732da098cc0a5a8
Expand Down Expand Up @@ -931,7 +931,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: ff70a72027dea5cc7d71cfcc6fad7f599f63987a
React-jsinspector: aef73cbd43b70675f572214d10fa438c89bf11ba
React-logger: 2e4aee3e11b3ec4fa6cfd8004610bbb3b8d6cca4
react-native-attestation: d46ae990ce701264d514e6db2fa3bfc5f22e8e59
react-native-attestation: 2fce2f60bd1eaa80040509b63b941a16e44e4e2d
react-native-config: 5330c8258265c1e5fdb8c009d2cabd6badd96727
react-native-encrypted-storage: db300a3f2f0aba1e818417c1c0a6be549038deb7
react-native-get-random-values: a6ea6a8a65dc93e96e24a11105b1a9c8cfe1d72a
Expand Down
32 changes: 16 additions & 16 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@
"gradle:write-locks": "cd android && ./gradlew app:dependencies --write-locks"
},
"dependencies": {
"@credo-ts/anoncreds": "0.5.9",
"@credo-ts/askar": "0.5.9",
"@credo-ts/core": "0.5.9",
"@credo-ts/drpc": "0.5.9",
"@credo-ts/indy-sdk-to-askar-migration": "0.5.9",
"@credo-ts/indy-vdr": "0.5.9",
"@credo-ts/openid4vc": "0.5.9",
"@credo-ts/anoncreds": "0.5.11",
"@credo-ts/askar": "0.5.11",
"@credo-ts/core": "0.5.11",
"@credo-ts/drpc": "0.5.11",
"@credo-ts/indy-sdk-to-askar-migration": "0.5.11",
"@credo-ts/indy-vdr": "0.5.11",
"@credo-ts/openid4vc": "0.5.11",
"@credo-ts/push-notifications": "0.7.0",
"@credo-ts/question-answer": "0.5.9",
"@credo-ts/question-answer": "0.5.11",
"@credo-ts/react-hooks": "0.6.0",
"@credo-ts/react-native": "0.5.9",
"@credo-ts/react-native": "0.5.11",
"@formatjs/intl-datetimeformat": "4.2.4",
"@formatjs/intl-displaynames": "5.2.4",
"@formatjs/intl-getcanonicallocales": "1.7.3",
Expand All @@ -60,13 +60,13 @@
"@formatjs/intl-numberformat": "7.2.4",
"@formatjs/intl-pluralrules": "4.1.4",
"@formatjs/intl-relativetimeformat": "9.3.1",
"@hyperledger/anoncreds-react-native": "0.2.2",
"@hyperledger/anoncreds-react-native": "0.2.4",
"@hyperledger/aries-askar-react-native": "0.2.3",
"@hyperledger/aries-bifold-core": "1.0.0-alpha.338",
"@hyperledger/aries-bifold-remote-logs": "1.0.0-alpha.338",
"@hyperledger/aries-bifold-verifier": "1.0.0-alpha.338",
"@hyperledger/aries-oca": "1.0.0-alpha.338",
"@hyperledger/aries-react-native-attestation": "1.0.0-alpha.338",
"@hyperledger/aries-bifold-core": "1.0.0-alpha.342",
"@hyperledger/aries-bifold-remote-logs": "1.0.0-alpha.342",
"@hyperledger/aries-bifold-verifier": "1.0.0-alpha.342",
"@hyperledger/aries-oca": "1.0.0-alpha.342",
"@hyperledger/aries-react-native-attestation": "1.0.0-alpha.342",
"@hyperledger/indy-vdr-react-native": "0.2.2",
"@hyperledger/indy-vdr-shared": "0.2.2",
"@react-native-async-storage/async-storage": "1.15.11",
Expand All @@ -80,7 +80,7 @@
"@react-navigation/stack": "6.0.11",
"axios": "1.4.0",
"buffer": "6.0.3",
"credo-ts-indy-vdr-proxy-client": "0.1.3",
"credo-ts-indy-vdr-proxy-client": "0.2.3",
"i18next": "21.10.0",
"lodash.flatten": "4.4.0",
"lodash.merge": "4.6.2",
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/AddCredentialButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { testIdWithKey, HeaderButton, ButtonLocation } from '@hyperledger/aries-bifold-core'
import { testIdWithKey, IconButton, ButtonLocation } from '@hyperledger/aries-bifold-core'
import React, { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { DeviceEventEmitter } from 'react-native'
Expand All @@ -13,7 +13,7 @@ const AddCredentialButton = () => {
}, [])

return (
<HeaderButton
<IconButton
buttonLocation={ButtonLocation.Right}
accessibilityLabel={t('Credentials.AddCredential')}
testID={testIdWithKey('AddCredential')}
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/FauxHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ButtonLocation, HeaderButton, testIdWithKey, useTheme } from '@hyperledger/aries-bifold-core'
import { ButtonLocation, IconButton, testIdWithKey, useTheme } from '@hyperledger/aries-bifold-core'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { View, Text, StyleSheet, Platform } from 'react-native'
Expand Down Expand Up @@ -50,7 +50,7 @@ const FauxHeader: React.FC<FauxHeaderProps> = ({ title, onBackPressed }) => {
return (
<View style={styles.header}>
<View style={styles.left}>
<HeaderButton
<IconButton
buttonLocation={ButtonLocation.Left}
accessibilityLabel={t('Global.Back')}
testID={testIdWithKey('BackButton')}
Expand Down
2 changes: 1 addition & 1 deletion app/src/helpers/bc-agent-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function getBCAgentModules({
registries: [new IndyVdrProxyAnonCredsRegistry({ proxyBaseUrl, cacheOptions: proxyCacheSettings })],
})
modules.dids = new DidsModule({
resolvers: [new IndyVdrProxyDidResolver(proxyBaseUrl)],
resolvers: [new IndyVdrProxyDidResolver({ proxyBaseUrl })],
})
}

Expand Down
78 changes: 40 additions & 38 deletions app/src/screens/PersonCredentialLoading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,12 @@ import {
BifoldError,
AttestationEventTypes,
useServices,
Stacks,
} from '@hyperledger/aries-bifold-core'
import { StackScreenProps } from '@react-navigation/stack'
import React, { useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
DeviceEventEmitter,
EmitterSubscription,
Modal,
SafeAreaView,
ScrollView,
StyleSheet,
Text,
View,
} from 'react-native'
import { DeviceEventEmitter, EmitterSubscription, SafeAreaView, ScrollView, StyleSheet, Text, View } from 'react-native'

import PersonCredentialSpinner from '../components/PersonCredentialSpinner'
import { connectToIASAgent, authenticateWithServiceCard, WellKnownAgentDetails } from '../helpers/BCIDHelper'
Expand Down Expand Up @@ -91,9 +83,15 @@ const PersonCredentialLoading: React.FC<PersonProps> = ({ navigation }) => {

// when a person credential offer is received, show the
// offer screen to the user.
const goToCredentialOffer = useCallback((credentialId: string) => {
navigation.replace(Screens.CredentialOffer, { credentialId })
}, [navigation])
const goToCredentialOffer = useCallback(
(credentialId: string) => {
navigation.getParent()?.navigate(Stacks.ConnectionStack, {
screen: Screens.Connection,
params: { credentialId },
})
},
[navigation]
)

useEffect(() => {
const handleFailedAttestation = (error: BifoldError) => {
Expand Down Expand Up @@ -152,7 +150,13 @@ const PersonCredentialLoading: React.FC<PersonProps> = ({ navigation }) => {
.catch((error) => {
logger.error('Completed service card authentication with error, error: ', error.message)
})
}, [remoteAgentDetails, didCompleteAttestationProofRequest, logger, navigation, store.developer.environment.iasPortalUrl])
}, [
remoteAgentDetails,
didCompleteAttestationProofRequest,
logger,
navigation,
store.developer.environment.iasPortalUrl,
])

useEffect(() => {
for (const credential of receivedCredentialOffers) {
Expand All @@ -170,31 +174,29 @@ const PersonCredentialLoading: React.FC<PersonProps> = ({ navigation }) => {
}, [navigation])

return (
<Modal transparent animationType={'slide'}>
<SafeAreaView style={{ backgroundColor: ColorPallet.brand.modalPrimaryBackground }}>
<ScrollView style={styles.container}>
<View style={styles.messageContainer}>
<Text style={[TextTheme.modalHeadingThree, styles.messageText]} testID={testIdWithKey('RequestProcessing')}>
{t('ProofRequest.RequestProcessing')}
</Text>
</View>

<View style={styles.image}>
<PersonCredentialSpinner />
</View>
<Text style={[TextTheme.normal, styles.messageText]}>This can take a few seconds</Text>
</ScrollView>
<View style={styles.controlsContainer}>
<Button
title={t('Global.GoBack')}
accessibilityLabel={t('Global.GoBack')}
testID={testIdWithKey('BackToPersonScreen')}
onPress={onDismissModalTouched}
buttonType={ButtonType.ModalSecondary}
/>
<SafeAreaView style={{ backgroundColor: ColorPallet.brand.modalPrimaryBackground }}>
<ScrollView style={styles.container}>
<View style={styles.messageContainer}>
<Text style={[TextTheme.modalHeadingThree, styles.messageText]} testID={testIdWithKey('RequestProcessing')}>
{t('ProofRequest.RequestProcessing')}
</Text>
</View>

<View style={styles.image}>
<PersonCredentialSpinner />
</View>
</SafeAreaView>
</Modal>
<Text style={[TextTheme.normal, styles.messageText]}>This can take a few seconds</Text>
</ScrollView>
<View style={styles.controlsContainer}>
<Button
title={t('Global.GoBack')}
accessibilityLabel={t('Global.GoBack')}
testID={testIdWithKey('BackToPersonScreen')}
onPress={onDismissModalTouched}
buttonType={ButtonType.ModalSecondary}
/>
</View>
</SafeAreaView>
)
}

Expand Down
Loading

0 comments on commit faed084

Please sign in to comment.