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

Refactor(inji-472): refactoring api usage, fix warnings, and fix fabicon ui issue #952

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions .github/workflows/ios-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ jobs:
SLACK_URL: '${{ secrets.SLACK_WEBHOOK_DEVOPS }}'
MATCH_PASSWORD: '${{ secrets.INJI_IOS_MATCH_PASSWORD }}'
APPLICATION_THEME: ${{ github.event.inputs.theme }}
CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }}
MIMOTO_HOST: ${{ github.event.inputs.mimotoBackendServiceUrl }}
ESIGNET_HOST: ${{ github.event.inputs.esignetBackendServiceUrl }}
TESTFLIGHT_INTERNAL_TESTERS_GROUP: ${{ github.event.inputs.internal-testers }}
TESTFLIGHT_BETA_APP_DESCRIPTION: ${{ github.event.inputs.buildDescription }}

Expand Down
11 changes: 8 additions & 3 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
fileignoreconfig:
- filename: package.json
checksum: 30e3a548809705ba38385a1c286b312629ac5dd7dea0d6e26ffb9daf8def312d
- filename: package-lock.json
checksum: a4c1fe2521067e1a279610f079446c600e8b7d5cf1553934dc419c3c476b4844
- filename: components/PasscodeVerify.tsx
Expand Down Expand Up @@ -52,4 +50,11 @@ fileignoreconfig:
- filename: machines/store.ts
checksum: 0695d833df9ec1e1f6ae2bd81631630bb1039dec387718acb153bcb843c952cd
- filename: shared/cryptoutil/cryptoUtil.ts
checksum: b785ff3f01ab9530119072c4d38195048bfeee6155c54ea7dd031559acb722f3
checksum: b785ff3f01ab9530119072c4d38195048bfeee6155c54ea7dd031559acb722f3
- filename: package.json
checksum: 1a9d02d94424c1266503d58038cae2318ab71261ab50cf930c5f98e07c0f3ccd
- filename: machines/store.typegen.ts
checksum: 6d22bc5c77398316b943c512c208ce0846a9fff674c1ccac79e07f21962acd5f
- filename: machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts
checksum: 10889302ca05646a283386be1bbe7a5fb510c02bb62a308ee45f3c2a872ae64e
version: ""
1 change: 0 additions & 1 deletion components/VC/MosipVCItem/MosipVCItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export const MosipVCItem: React.FC<
vcMetadata={props.vcMetadata}
verifiableCredential={verifiableCredential}
emptyWalletBindingId={emptyWalletBindingId}
onPress={() => props.onPress(service)}
vijay151096 marked this conversation as resolved.
Show resolved Hide resolved
showOnlyBindedVc={props.showOnlyBindedVc}
/>
<View style={Theme.Styles.verticalLine} />
Expand Down
7 changes: 0 additions & 7 deletions components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React from 'react';
import {useTranslation} from 'react-i18next';
import {Dimensions} from 'react-native';
import {Icon} from 'react-native-elements';
import {ActorRefFrom} from 'xstate';
import {ExistingMosipVCItemMachine} from '../../../machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine';
import {VerifiableCredential} from '../../../types/VC/ExistingMosipVC/vc';
import {Row, Text} from '../../ui';
import {Theme} from '../../ui/styleUtils';
Expand Down Expand Up @@ -108,13 +106,11 @@ export const MosipVCItemActivationStatus: React.FC<
{props.emptyWalletBindingId ? (
<WalletUnverifiedActivationDetails
verifiableCredential={props.verifiableCredential}
onPress={props.onPress}
/>
) : (
<WalletVerifiedActivationDetails
verifiableCredential={props.verifiableCredential}
showOnlyBindedVc={props.showOnlyBindedVc}
onPress={props.onPress}
/>
)}
</Row>
Expand All @@ -123,18 +119,15 @@ export const MosipVCItemActivationStatus: React.FC<

interface ExistingMosipVCItemActivationStatusProps {
showOnlyBindedVc: boolean;
onPress: (vcRef?: ActorRefFrom<typeof ExistingMosipVCItemMachine>) => void;
verifiableCredential: VerifiableCredential;
emptyWalletBindingId: boolean;
}

interface WalletVerifiedDetailsProps {
showOnlyBindedVc: boolean;
onPress: (vcRef?: ActorRefFrom<typeof ExistingMosipVCItemMachine>) => void;
verifiableCredential: VerifiableCredential;
}

interface WalletUnVerifiedDetailsProps {
onPress: (vcRef?: ActorRefFrom<typeof ExistingMosipVCItemMachine>) => void;
verifiableCredential: VerifiableCredential;
}
10 changes: 3 additions & 7 deletions components/VC/MosipVCItem/MosipVCItemContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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 testIDProps, {getMaskedText} from '../../../shared/commonUtil';
import {logoType} from '../../../machines/issuersMachine';

const getDetails = (arg1, arg2, verifiableCredential) => {
Expand Down Expand Up @@ -84,10 +84,6 @@ const getDetails = (arg1, arg2, verifiableCredential) => {
}
};

function getIdNumber(id: string) {
return '*'.repeat(id.length - 4) + id.slice(-4);
}

const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: logoType) => {
if (isOpenId4VCI) {
return (
Expand Down Expand Up @@ -243,7 +239,7 @@ export const MosipVCItemContent: React.FC<
weight="semibold"
size="extraSmall"
color={Theme.Colors.statusLabel}>
{getIdNumber(uin)}
{getMaskedText(uin)}
</Text>
</Column>
) : null}
Expand All @@ -262,7 +258,7 @@ export const MosipVCItemContent: React.FC<
weight="semibold"
size="extraSmall"
color={Theme.Colors.Details}>
{getIdNumber(vid)}
{getMaskedText(vid)}
</Text>
</Column>
) : null}
Expand Down
5 changes: 3 additions & 2 deletions components/VC/MosipVCItem/MosipVCItemDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from '../../../types/VC/EsignetMosipVC/vc';
import {WalletBindingResponse} from '../../../shared/cryptoutil/cryptoUtil';
import {logoType} from '../../../machines/issuersMachine';
import {getMaskedText} from '../../../shared/commonUtil';

const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: logoType) => {
if (isOpenId4VCI) {
Expand Down Expand Up @@ -167,7 +168,7 @@ export const MosipVCItemDetails: React.FC<
weight="semibold"
size="smaller"
color={Theme.Colors.Details}>
{uin}
{getMaskedText(uin)}
vijay151096 marked this conversation as resolved.
Show resolved Hide resolved
</Text>
</Column>
) : null}
Expand All @@ -186,7 +187,7 @@ export const MosipVCItemDetails: React.FC<
weight="semibold"
size="smaller"
color={Theme.Colors.Details}>
{vid}
{getMaskedText(vid)}
</Text>
</Column>
) : null}
Expand Down
16 changes: 15 additions & 1 deletion components/ui/themes/DefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,14 +529,28 @@ export const DefaultTheme = {
width: 70,
borderRadius: 200,
padding: 10,
backgroundColor: Colors.Orange,
shadowColor: '#000',
shadowOpacity: 0.4,
elevation: 5,
position: 'absolute',
bottom: Dimensions.get('window').width * 0.1,
right: Dimensions.get('window').width * 0.1,
},
fabIconNormal: {
vijay151096 marked this conversation as resolved.
Show resolved Hide resolved
borderRadius: 200,
height: 70,
width: 70,
justifyContent: 'center',
position: 'absolute',
},
fabIconPressed: {
borderRadius: 200,
height: 70,
width: 70,
backgroundColor: Colors.Orange,
justifyContent: 'center',
position: 'absolute',
},
boxShadow: generateBoxShadowStyle(),
}),
QrCodeStyles: StyleSheet.create({
Expand Down
16 changes: 15 additions & 1 deletion components/ui/themes/PurpleTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,28 @@ export const PurpleTheme = {
width: 70,
borderRadius: 200,
padding: 10,
backgroundColor: Colors.Purple,
shadowColor: '#000',
shadowOpacity: 0.4,
elevation: 5,
position: 'absolute',
bottom: Dimensions.get('window').width * 0.1,
right: Dimensions.get('window').width * 0.1,
},
fabIconNormal: {
borderRadius: 200,
height: 70,
width: 70,
justifyContent: 'center',
position: 'absolute',
},
fabIconPressed: {
borderRadius: 200,
height: 70,
width: 70,
backgroundColor: Colors.Purple,
justifyContent: 'center',
position: 'absolute',
},
boxShadow: generateBoxShadowStyle(),
}),
QrCodeStyles: StyleSheet.create({
Expand Down
2 changes: 1 addition & 1 deletion ios/Inji.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -557,4 +557,4 @@
/* End XCConfigurationList section */
};
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {ActivityLogEvents} from '../../../machines/activityLog';
import {request} from '../../../shared/request';
import SecureKeystore from 'react-native-secure-keystore';
import {VerifiableCredential} from './vc';
import {API_URLS} from '../../../shared/api';

const model = createModel(
{
Expand Down Expand Up @@ -751,8 +752,8 @@ export const EsignetMosipVCItemMachine = model.createMachine(
},
addWalletBindnigId: async context => {
const response = await request(
'POST',
'/residentmobileapp/wallet-binding',
API_URLS.walletBinding.method,
API_URLS.walletBinding.buildURL(),
{
requestTime: String(new Date().toISOString()),
request: {
Expand Down Expand Up @@ -800,8 +801,8 @@ export const EsignetMosipVCItemMachine = model.createMachine(
},
requestBindingOtp: async context => {
const response = await request(
'POST',
'/residentmobileapp/binding-otp',
API_URLS.bindingOtp.method,
API_URLS.bindingOtp.buildURL(),
{
requestTime: String(new Date().toISOString()),
request: {
Expand Down
Loading