Skip to content

Commit

Permalink
Merge branch 'develop' into inji-368-integrate-irisScan-android-ios
Browse files Browse the repository at this point in the history
Signed-off-by: adityankannan-tw <[email protected]>
  • Loading branch information
adityankannan-tw authored Oct 19, 2023
2 parents 67ad230 + ad76243 commit 3d96017
Show file tree
Hide file tree
Showing 36 changed files with 528 additions and 494 deletions.
3 changes: 0 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ DEBUG_MODE=false

#supported languages( en, fil, ar, hi, kn, ta)
APPLICATION_LANGUAGE=en

#Toggle for openID for VC
ENABLE_OPENID_FOR_VC=true
6 changes: 6 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ fileignoreconfig:
checksum: 9a61cd59a3718adf1f14faf3024fec66a3295ef373878a878a28e5cb1287afaa
- filename: ios/Podfile.lock
checksum: cc123c3e1f04d41b394ceb16843b15c08bac3ba619ae853ff322717739761a85
- filename: machines/store.ts
checksum: bbee269bd9703644c2a345819291caa42479b5ad0d5288713da780495b2ffb49
- filename: shared/fileStorage.ts
checksum: 07cb337dc1d5b0f0eef56270ac4f4f589260ee5e490183c024cf98a2aeafb139
- filename: shared/storage.ts
checksum: c8d874aa373bdf526bf59192139822f56915e702ef673bac4e0d7549b0fea3d0
Binary file removed assets/digit-icon.png
Binary file not shown.
3 changes: 2 additions & 1 deletion components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ const WalletUnverifiedActivationDetails: React.FC<
crossAlign="center"
style={{
flex: 1,
maxWidth: 255,
}}>
{props.verifiableCredential && <WalletUnverifiedIcon />}
<Text
color={Theme.Colors.Details}
testID="activationPending"
weight="regular"
margin="8 10 10 5"
margin="8"
style={
!props.verifiableCredential
? Theme.Styles.loadingTitle
Expand Down
10 changes: 6 additions & 4 deletions components/VC/MosipVCItem/MosipVCItemContent.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react';
import {useTranslation} from 'react-i18next';
import {Image, ImageBackground, View} from 'react-native';
import {Image, ImageBackground} from 'react-native';
import {getLocalizedField} from '../../../i18n';
import {VerifiableCredential} from '../../../types/VC/ExistingMosipVC/vc';
import VerifiedIcon from '../../VerifiedIcon';
import {Column, Row, Text} from '../../ui';
import {Theme} from '../../ui/styleUtils';
import {CheckBox, Icon} from 'react-native-elements';
import testIDProps from '../../../shared/commonUtil';
import {logoType} from '../../../machines/issuersMachine';

const getDetails = (arg1, arg2, verifiableCredential) => {
if (arg1 === 'Status') {
Expand Down Expand Up @@ -87,11 +88,12 @@ function getIdNumber(id: string) {
return '*'.repeat(id.length - 4) + id.slice(-4);
}

const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: string) => {
const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: logoType) => {
if (isOpenId4VCI) {
return (
<Image
src={issuerLogo}
src={issuerLogo?.url}
alt={issuerLogo?.alt_text}
style={Theme.Styles.issuerLogo}
resizeMethod="scale"
resizeMode="contain"
Expand Down Expand Up @@ -167,7 +169,7 @@ export const MosipVCItemContent: React.FC<
</ImageBackground>

<Column margin="0 0 10 20" height={96} align="space-between">
<Column>
<Column style={{maxWidth: 230}}>
<Text
testID="fullNameTitle"
weight="regular"
Expand Down
28 changes: 21 additions & 7 deletions components/VC/MosipVCItem/MosipVCItemDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {format, formatDistanceToNow, parse} from 'date-fns';
import React from 'react';
import * as DateFnsLocale from 'date-fns/locale';
import {useTranslation} from 'react-i18next';
import {Image, ImageBackground, View} from 'react-native';
import {Dimensions, Image, ImageBackground, View} from 'react-native';
import {Icon} from 'react-native-elements';
import {VC, CredentialSubject} from '../../../types/VC/ExistingMosipVC/vc';
import {CredentialSubject, VC} from '../../../types/VC/ExistingMosipVC/vc';
import {Button, Column, Row, Text} from '../../ui';
import {Theme} from '../../ui/styleUtils';
import {TextItem} from '../../ui/TextItem';
Expand All @@ -20,10 +20,17 @@ import {
VerifiablePresentation,
} from '../../../types/VC/EsignetMosipVC/vc';
import {WalletBindingResponse} from '../../../shared/cryptoutil/cryptoUtil';
import {logoType} from '../../../machines/issuersMachine';

const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: string) => {
const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: logoType) => {
if (isOpenId4VCI) {
return <Image src={issuerLogo} style={Theme.Styles.issuerLogo} />;
return (
<Image
src={issuerLogo?.url}
alt={issuerLogo?.alt_text}
style={Theme.Styles.issuerLogo}
/>
);
}
return <Image source={Theme.MosipLogo} style={Theme.Styles.vcDetailsLogo} />;
};
Expand Down Expand Up @@ -68,7 +75,7 @@ export const MosipVCItemDetails: React.FC<
}

return (
<Column margin="10 0 10 0">
<Column margin="10 4 10 4">
<ImageBackground
imageStyle={{width: '100%'}}
resizeMethod="scale"
Expand Down Expand Up @@ -101,6 +108,7 @@ export const MosipVCItemDetails: React.FC<
<Text
testID="fullNameValue"
weight="semibold"
style={{maxWidth: 190}}
size="smaller"
color={Theme.Colors.Details}>
{getLocalizedField(
Expand Down Expand Up @@ -139,6 +147,7 @@ export const MosipVCItemDetails: React.FC<
<Text
testID="nationalCard"
weight="bold"
style={{MinWidth: 65}}
size="smaller"
color={Theme.Colors.Details}>
{t('nationalCard')}
Expand Down Expand Up @@ -202,6 +211,7 @@ export const MosipVCItemDetails: React.FC<
<Column margin="20 0 0 0">
<Text
testID="dateOfBirth"
style={{maxWidth: 121}}
weight="regular"
size="smaller"
color={Theme.Colors.DetailsLabel}>
Expand All @@ -215,7 +225,8 @@ export const MosipVCItemDetails: React.FC<
{formattedDateOfBirth()}
</Text>
</Column>
<Column margin="25 0 0 0">
<Column
style={{marginTop: Dimensions.get('window').height * 0.04}}>
<Text
testID="status"
weight="regular"
Expand All @@ -231,16 +242,19 @@ export const MosipVCItemDetails: React.FC<
{props.vc?.isVerified && <VerifiedIcon />}
<Text
testID="valid"
style={{maxWidth: 63}}
weight="semibold"
size="smaller"
color={Theme.Colors.Details}>
{t('valid')}
</Text>
</Row>
</Column>
<Column margin="92 0 0 0">
<Column
style={{marginTop: Dimensions.get('window').height * 0.1}}>
<Text
testID="phoneNumber"
style={{maxWidth: 80}}
weight="regular"
size="smaller"
color={Theme.Colors.DetailsLabel}>
Expand Down
3 changes: 1 addition & 2 deletions components/openId4VCI/Issuer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export const Issuer: React.FC<IssuerProps> = (props: IssuerProps) => {
const {t} = useTranslation('IssuersScreen');

function getIssuerLogo() {
if (props.logoUrl) return {uri: props.logoUrl};
return Theme.DigitIcon;
return {uri: props.logoUrl};
}

return (
Expand Down
5 changes: 2 additions & 3 deletions components/ui/themes/DefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ export const DefaultTheme = {
height: 30,
backgroundColor: Colors.Grey,
marginVertical: 8,
marginLeft: -35,
marginRight: 15,
marginLeft: -25,
marginRight: 12,
},
closeCardBgContainer: {
borderRadius: 10,
Expand Down Expand Up @@ -1261,7 +1261,6 @@ export const DefaultTheme = {
protectPrivacy: require('../../../assets/intro-unlock-method.png'),
NoInternetConnection: require('../../../assets/no-internet-connection.png'),
SomethingWentWrong: require('../../../assets/something-went-wrong.png'),
DigitIcon: require('../../../assets/digit-icon.png'),

elevation(level: ElevationLevel): ViewStyle {
// https://ethercreative.github.io/react-native-shadow-generator/
Expand Down
5 changes: 2 additions & 3 deletions components/ui/themes/PurpleTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ export const PurpleTheme = {
height: 30,
backgroundColor: Colors.Grey,
marginVertical: 8,
marginLeft: -35,
marginRight: 15,
marginLeft: -25,
marginRight: 12,
},
closeCardBgContainer: {
borderRadius: 10,
Expand Down Expand Up @@ -1259,7 +1259,6 @@ export const PurpleTheme = {
protectPrivacy: require('../../../assets/intro-unlock-method.png'),
NoInternetConnection: require('../../../assets/no-internet-connection.png'),
SomethingWentWrong: require('../../../assets/something-went-wrong.png'),
DigitIcon: require('../../../assets/digit-icon.png'),

elevation(level: ElevationLevel): ViewStyle {
// https://ethercreative.github.io/react-native-shadow-generator/
Expand Down
4 changes: 4 additions & 0 deletions locales/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@
"title": "لا يوجد اتصال بالإنترنت",
"message": "الرجاء التحقق من اتصالك وإعادة المحاولة"
},
"downloadLimitExpires":{
"title": "الخطأ تحميل",
"message": "حدثت مشكلة أثناء تنزيل البطاقات التالية. حاول مرة اخرى"
}
}
},
"OnboardingOverlay": {
Expand Down
4 changes: 4 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@
"noInternetConnection": {
"title": "No internet connection",
"message": "Please check your connection and retry"
},
"downloadLimitExpires":{
"title": "Download Error",
"message": "There was an issue downloading following cards. Please try again"
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions locales/fil.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@
"noInternetConnection": {
"title": "Pakisuri ang iyong koneksyon at subukang muli",
"message": "Mangyaring kumonekta sa internet at subukang muli."
},
"downloadLimitExpires":{
"title": "Error sa Pag-download",
"message": "Nagkaroon ng isyu sa pag-download ng mga sumusunod na card. Pakisubukang muli"
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions locales/hin.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@
"title": "कोई इंटरनेट कनेक्शन नहीं",
"message": "कृपया अपना कनेक्शन जांचें और पुनः प्रयास करें"
},
"downloadLimitExpires":{
"title": "डाउनलोड त्रुटि",
"message": "निम्नलिखित कार्ड डाउनलोड करने में एक समस्या थी। कृपया पुन: प्रयास करें"
}
}
},
"OnboardingOverlay": {
Expand Down
4 changes: 4 additions & 0 deletions locales/kan.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@
"title": "ಇಂಟರ್ನೆಟ್ ಸಂಪರ್ಕವಿಲ್ಲ",
"message": "ದಯವಿಟ್ಟು ನಿಮ್ಮ ಸಂಪರ್ಕವನ್ನು ಪರಿಶೀಲಿಸಿ ಮತ್ತು ಮರುಪ್ರಯತ್ನಿಸಿ"
},
"downloadLimitExpires":{
"title": "ಡೌನ್‌ಲೋಡ್ ದೋಷ",
"message": "ಕೆಳಗಿನ ಕಾರ್ಡ್‌ಗಳನ್ನು ಡೌನ್‌ಲೋಡ್ ಮಾಡುವಲ್ಲಿ ಸಮಸ್ಯೆ ಕಂಡುಬಂದಿದೆ. ದಯವಿಟ್ಟು ಪುನಃ ಪ್ರಯತ್ನಿಸಿ"
}
}
},
"OnboardingOverlay": {
Expand Down
4 changes: 4 additions & 0 deletions locales/spa.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@
"title": "Sin conexión a Internet",
"message": "Por favor verifique su conexión y vuelva a intentarlo"
},
"downloadLimitExpires":{
"title": "Error de descarga",
"message": "Hubo un problema al descargar las siguientes tarjetas. Inténtalo de nuevo"
}
}
},
"OnboardingOverlay": {
Expand Down
6 changes: 5 additions & 1 deletion locales/tam.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"idType": "ஐடி வகை",
"id": "ஐடி",
"qrCodeHeader": "க்யு ஆர் குறியீடு",
"nationalCard": "தேசிய அட்டை್",
"nationalCard": "தேசிய அட்டை",
"uin": "UIN",
"vid": "VID",
"enableVerification": "செயல்படுத்த",
Expand Down Expand Up @@ -292,6 +292,10 @@
"noInternetConnection": {
"title": "இணைய இணைப்பு இல்லை",
"message": "உங்கள் இணைப்பைச் சரிபார்த்து மீண்டும் முயற்சிக்கவும்"
},
"downloadLimitExpires":{
"title": "பதிவிறக்கப் பிழை",
"message": "பின்வரும் கார்டுகளைப் பதிவிறக்குவதில் சிக்கல் ஏற்பட்டது. தயவு செய்து மீண்டும் முயற்சிக்கவும்"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
WalletBindingResponse,
} from '../../../shared/cryptoutil/cryptoUtil';
import {log} from 'xstate/lib/actions';
import {OpenId4VCIProtocol} from '../../../shared/openId4VCI/Utils';
import {Protocols} from '../../../shared/openId4VCI/Utils';
import {StoreEvents} from '../../../machines/store';
import {MIMOTO_BASE_URL, MY_VCS_STORE_KEY} from '../../../shared/constants';
import {VcEvents} from '../../../machines/vc';
Expand Down Expand Up @@ -500,7 +500,7 @@ export const EsignetMosipVCItemMachine = model.createMachine(
context => ({
type: 'GET_VC_ITEM',
vcMetadata: context.vcMetadata,
protocol: OpenId4VCIProtocol,
protocol: Protocols.OpenId4VCI,
}),
{
to: context => context.serviceRefs.vc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ export const ExistingMosipVCItemMachine =
actions: ['setMaxDownloadCount', 'setDownloadInterval'],
},
onError: {
actions: log((_, event) => (event.data as Error).message),
actions: [
log((_, event) => (event.data as Error).message),
'sendDownloadLimitExpire',
],
target: 'checkingStatus',
},
},
Expand Down Expand Up @@ -808,6 +811,18 @@ export const ExistingMosipVCItemMachine =
},
),

sendDownloadLimitExpire: send(
(_context, event) => {
return {
type: 'DOWNLOAD_LIMIT_EXPIRED',
vcMetadata: _context.vcMetadata,
};
},
{
to: context => context.serviceRefs.vc,
},
),

setWalletBindingError: assign({
walletBindingError: () =>
i18n.t(`errors.genericError`, {
Expand Down
Loading

0 comments on commit 3d96017

Please sign in to comment.