Skip to content

Commit

Permalink
Refactor(inji-472): refactoring api usage, fix warnings, and fix fabi…
Browse files Browse the repository at this point in the history
…con ui issue (#952)

* refactor(inji-472): refactoring api usage, fix warnings, and fix fab icon ui issue

Signed-off-by: Vijay <[email protected]>

* refactor(inji-472): remove masking in vc details page, add the testid for the download FAB icon

Signed-off-by: Vijay <[email protected]>

---------

Signed-off-by: Vijay <[email protected]>
  • Loading branch information
vijay151096 authored Oct 23, 2023
1 parent e79599f commit 4e64313
Show file tree
Hide file tree
Showing 24 changed files with 703 additions and 371 deletions.
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)}
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
20 changes: 17 additions & 3 deletions components/ui/themes/DefaultTheme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable sonarjs/no-duplicate-string */
import {Dimensions, Platform, StyleSheet, ViewStyle} from 'react-native';
import {Dimensions, StyleSheet, ViewStyle} from 'react-native';
import {Spacing} from '../styleUtils';
import {isIOS} from '../../../shared/constants';

Expand Down Expand Up @@ -524,19 +524,33 @@ export const DefaultTheme = {
borderBottomColor: Colors.platinumGrey,
borderBottomWidth: 1.3,
},
downloadFabIcon: {
downloadFabIconContainer: {
height: 70,
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,
},
downloadFabIconNormal: {
borderRadius: 200,
height: 70,
width: 70,
justifyContent: 'center',
position: 'absolute',
},
downloadFabIconPressed: {
borderRadius: 200,
height: 70,
width: 70,
backgroundColor: Colors.Orange,
justifyContent: 'center',
position: 'absolute',
},
boxShadow: generateBoxShadowStyle(),
}),
QrCodeStyles: StyleSheet.create({
Expand Down
20 changes: 17 additions & 3 deletions components/ui/themes/PurpleTheme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable sonarjs/no-duplicate-string */
import {Dimensions, Platform, StyleSheet, ViewStyle} from 'react-native';
import {Dimensions, StyleSheet, ViewStyle} from 'react-native';
import {Spacing} from '../styleUtils';
import {isIOS} from '../../../shared/constants';

Expand Down Expand Up @@ -526,19 +526,33 @@ export const PurpleTheme = {
borderBottomColor: Colors.platinumGrey,
borderBottomWidth: 1.3,
},
downloadFabIcon: {
downloadFabIconContainer: {
height: 70,
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,
},
downloadFabIconNormal: {
borderRadius: 200,
height: 70,
width: 70,
justifyContent: 'center',
position: 'absolute',
},
downloadFabIconPressed: {
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

0 comments on commit 4e64313

Please sign in to comment.