Skip to content

Commit

Permalink
refactor(inji-416): Refactoring Openid4vci components & fixing issues (
Browse files Browse the repository at this point in the history
…#889)

* refactor(inji-416): merged esignetvcitem and existingvcitem

* refactor(inji-416): remove the vc tag feature

* refactor(inji-416): wallet binding fixes with vc store key modification

* refactor(inji-416): display the vc's in the share vc screen

* fix(INJI-416): display issuer logo in VC downloaded via eSignet

Co-authored-by: Vijay <[email protected]>

* fix(INJI-416): display formatted generatedOn date

Co-authored-by: Vijay <[email protected]>

* refactor(INJI-416): add kebab popup operations events in esignetVcItemMachine

Co-authored-by: Vijay <[email protected]>

* fix(INJI-416): vc activation in secure keystore existient android device

vc unique identifier UIN is passed to generate keypair while wallet binding

* fix(INJI-416): display VC id in removal log

Co-authored-by: Vijay <[email protected]>

* fix(INJI-416): display dateOfBirth in vcDetails in Android

date parsing is causing issue in Android device due to JavaScript VM, thus using date-fns to parse.

* refactor(INJI-416): modify check for isOpenId4VCIEnabled

Co-authored-by: Vijay <[email protected]>

* refactor(INJI-416): extract method for face image source

* fix(INJI-416): show wallet binding success toaster appropriately on secure keystore available devices

* refactor(INJI-416): change locale value for download vc description

---------

Co-authored-by: Kiruthika Jeyashankar <[email protected]>
  • Loading branch information
vijay151096 and KiruthikaJeyashankar authored Oct 4, 2023
1 parent de8cbb8 commit 443d946
Show file tree
Hide file tree
Showing 38 changed files with 550 additions and 1,339 deletions.
1 change: 1 addition & 0 deletions components/KebabPopUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const KebabPopUp: React.FC<KebabPopUpProps> = props => {
label={t('offlineAuthenticationDisabled!')}
content={t('offlineAuthDisabledMessage')}
service={props.service}
vcMetadata={props.vcMetadata}
/>

<HistoryTab
Expand Down
77 changes: 59 additions & 18 deletions components/KebabPopUpController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,26 @@ import {
selectShowWalletBindingError,
selectWalletBindingError,
} from '../machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine';
import {selectActivities} from '../machines/activityLog';
import {GlobalContext} from '../shared/GlobalContext';
import {useContext} from 'react';
import {VCMetadata} from '../shared/VCMetadata';

import {
EsignetMosipVCItemEvents,
EsignetMosipVCItemMachine,
selectEmptyWalletBindingId as esignetSelectEmptyWalletBindingId,
selectIsPinned as esignetSelectIsPinned,
selectKebabPopUp as esignetSelectKebabPopUp,
selectKebabPopUpAcceptingBindingOtp as esignetSelectKebabPopUpAcceptingBindingOtp,
selectKebabPopUpBindingWarning as esignetSelectKebabPopUpBindingWarning,
selectKebabPopUpWalletBindingInProgress as esignetSelectKebabPopUpWalletBindingInProgress,
selectOtpError as esignetSelectOtpError,
selectRemoveWalletWarning as esignetSelectRemoveWalletWarning,
selectShowActivities as esignetSelectShowActivities,
selectShowWalletBindingError as esignetSelectShowWalletBindingError,
selectWalletBindingError as esignetSelectWalletBindingError,
} from '../machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine';
import {selectActivities} from '../machines/activityLog';
import {GlobalContext} from '../shared/GlobalContext';
import {useContext} from 'react';
import {VCMetadata} from '../shared/VCMetadata';

export function useKebabPopUp(props) {
const service = props.service as
Expand All @@ -44,26 +56,55 @@ export function useKebabPopUp(props) {
const SHOW_ACTIVITY = () => service.send(vcEvents.SHOW_ACTIVITY());
const INPUT_OTP = (otp: string) => service.send(vcEvents.INPUT_OTP(otp));
const RESEND_OTP = () => service.send(vcEvents.RESEND_OTP());
const isPinned = useSelector(service, selectIsPinned);
const isBindingWarning = useSelector(service, selectKebabPopUpBindingWarning);
const isRemoveWalletWarning = useSelector(service, selectRemoveWalletWarning);
const isAcceptingOtpInput = useSelector(
let isPinned = useSelector(service, selectIsPinned);
let isBindingWarning = useSelector(service, selectKebabPopUpBindingWarning);
let isRemoveWalletWarning = useSelector(service, selectRemoveWalletWarning);
let isAcceptingOtpInput = useSelector(
service,
selectKebabPopUpAcceptingBindingOtp,
);
const isWalletBindingError = useSelector(
service,
selectShowWalletBindingError,
);
const otpError = useSelector(service, selectOtpError);
const walletBindingError = useSelector(service, selectWalletBindingError);
const WalletBindingInProgress = useSelector(
let isWalletBindingError = useSelector(service, selectShowWalletBindingError);
let otpError = useSelector(service, selectOtpError);
let walletBindingError = useSelector(service, selectWalletBindingError);
let WalletBindingInProgress = useSelector(
service,
selectKebabPopUpWalletBindingInProgress,
);
const emptyWalletBindingId = useSelector(service, selectEmptyWalletBindingId);
const isKebabPopUp = useSelector(service, selectKebabPopUp);
const isShowActivities = useSelector(service, selectShowActivities);
let emptyWalletBindingId = useSelector(service, selectEmptyWalletBindingId);
let isKebabPopUp = useSelector(service, selectKebabPopUp);
let isShowActivities = useSelector(service, selectShowActivities);

if (props.vcMetadata.isFromOpenId4VCI()) {
isPinned = useSelector(service, esignetSelectIsPinned);
isBindingWarning = useSelector(
service,
esignetSelectKebabPopUpBindingWarning,
);
isRemoveWalletWarning = useSelector(
service,
esignetSelectRemoveWalletWarning,
);
isAcceptingOtpInput = useSelector(
service,
esignetSelectKebabPopUpAcceptingBindingOtp,
);
isWalletBindingError = useSelector(
service,
esignetSelectShowWalletBindingError,
);
otpError = useSelector(service, esignetSelectOtpError);
walletBindingError = useSelector(service, esignetSelectWalletBindingError);
WalletBindingInProgress = useSelector(
service,
esignetSelectKebabPopUpWalletBindingInProgress,
);
emptyWalletBindingId = useSelector(
service,
esignetSelectEmptyWalletBindingId,
);
isKebabPopUp = useSelector(service, esignetSelectKebabPopUp);
isShowActivities = useSelector(service, esignetSelectShowActivities);
}
const {appService} = useContext(GlobalContext);
const activityLogService = appService.children.get('activityLog');

Expand Down
113 changes: 0 additions & 113 deletions components/VC/EsignetMosipVCItem/EsignetMosipVCItem.tsx

This file was deleted.

This file was deleted.

Loading

0 comments on commit 443d946

Please sign in to comment.