From cee236aaec66f9f9321eb87ff2935b04b3188803 Mon Sep 17 00:00:00 2001 From: Alka Prasad Date: Tue, 19 Mar 2024 11:52:00 +0530 Subject: [PATCH] [INJIMOB-631] Mini Card View Home Page Changes (#1294) * [INJI-631] add share and share with selfie options into kebab menu Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-631] change share vc component service attribute type to existingMosipVcItemMachine Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-631] change the kebab menu options name as per the wireframe Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-631] add missing otp screen confirmation dialog translations for kannada language Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-631] extract vcItemField name and value into two separate components for better usability Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-631] show mini card view of the loaded VC and change the styles as per the wireframe Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-631] do not show the activation status and kebab menu when sharing vc and while doing QR login Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-631] show mini card view usin shimmerPlaceholder component when card is in loading state Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-631] add svg images for wallet activated and unactivated icon Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-631] fix the postion of pin icon when there is no image displayed in VC Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] show help icon and meat ball menu in vc detailed view Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] add styles for detailed view profile icon and it's container Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-721]: add help icon on top bar and remove setting button Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-721]: move settings to bottom tab bar Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-721]: add search bar ui for vc search Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-721]: add search filter for the vc search Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-721]: refactor filtered data to show message when vc not found Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-631] redirect to the home screen when user gives confirmation to delete the vc from the detailed view Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-721]: add search svg for search bar and also style it Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-631] in existing vcitem machine close the kebab popup when an option is selected in kebab menu except for remove vc option Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] change the remove vc confirm popup as per the wireframe Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] add icons for the kebab menu options and show the number of cards available in home screen Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] remove tooltip in detailed view and show remove vc kebab menu option in red color Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] close the kebab menu when user clicks on cancel button in removal confirmation popup Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMON-631] show verification status for all the VCs in mini view and detailed view based on isVerified status Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631]: send vc data to scan machine while selecting share or share with selfie from meatball menu Signed-off-by: Alka Prasad * [INJIMOB-721]: add styles to search bar Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-721]: add text msg when field searched in the vc search bar is not found Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-631]: implement sharing VC flow from mini card view Signed-off-by: Alka Prasad * [INJIMOB-721]: refactor search bar component to show diff icon for vc search and issuers search Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-721]: remove unused code Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-631]: implement sharing VC with selfie flow from mini card view Signed-off-by: Alka Prasad * [INJIMOB-631]: handle face auth failure scenario in VC sharing with selfie Signed-off-by: Alka Prasad * [INJIMOB-631]: handle proper closing of kebab menu on VC share option click Signed-off-by: Alka Prasad * [INJIMOB-721]: add styles to the search bar Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-631]: handle navigation to history page from success vc share page Signed-off-by: Alka Prasad * [INJIMOB-721]: add background colour for home screen Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-631]: display proper label for QR login from meat ball menu Signed-off-by: Alka Prasad * [INJIMOB-631]: handle QR login flow for mini view card Signed-off-by: Alka Prasad * [INJIMOB-631] show count of cards available matching with search keyword Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] show activated icon for the sunbird cards in the mini view Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] hide share with selfie and qr login options in kebab menu if profile image is not available Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631]: updating logic to call isFromOpenId4VCI from an instance of VCMetadata Signed-off-by: Alka Prasad * [INJIMOB-631]: update kebab menu list icons to outline with black color Signed-off-by: Alka Prasad * [INJIMOB-631]: close kebab popup on selecting sharing option for esignet VCs Signed-off-by: Alka Prasad * [INJIMOB-631]: clear connect for invalid identity and back button click face auth during share with selfie Signed-off-by: Alka Prasad * [INJIMOB-631] fix the logic of showing how many cards available in the ui Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] remove styles for kebab menu pin icon Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631]: updating logic to call isFromOpenId4VCI from an instance of VCMetadata Signed-off-by: Alka Prasad * [INJIMOB-631]: reset the flowType and selectedVC variable in scan machine on any disconnect or success share of VC Signed-off-by: Alka Prasad * [INJIMOB-631] in detail view show activation status popup everytime in the bottom Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] replace activated icon with svg image in detailed view Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631]: remove unused files Signed-off-by: Alka Prasad * [INJIMOB-631] don't show activation details in detailed view if VC image is not available Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] show verification status as valid if credentials are available Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] adjust the size of the image, qr code, magnifier and logo in detialed view Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] increase the width of the activate button in the detialed view Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] in detialed view increase the divider with and change it's styles to show it as per wireframe Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] in detialed view move email and all the address fields to the bottom view for all type of VCs Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] filter the supported credentials of esignet wellknown config based on credential type of issuers config Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] show the horizontal line in detailed view only if email or one of the address fields available in vc Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] fix the spelling mistake of detailed view image styles Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] remove unused event in existing mosip vc item machine Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] change the name of the enum used for sharing flow from flow type to vc share flow type Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] create a new enum type to use it for showing the activation status in vcitem container Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] use logical and operator to decide whether to show horizontal line or not in detailed view and remove unnecessary logs Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] add test id to the profile icon container and adjust the styles of pin icon Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] move invalid identity message overlay to verify identity overlay component Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] show credential registry in the bottom section of detial view if it's env variable is set to true Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] add testId to detailed view qr code view and change settings tab title to settings Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] make whole kebab menu option as pressable Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631]: hide kebab menu from the VC on SendVCScreen Signed-off-by: Alka Prasad * [INJIMOB-631]: reset SelectedVc and flow type in scan machine for every kind of disconnect Signed-off-by: Alka Prasad * [INJIMOB-631]: remove redundant check on qr login Signed-off-by: Alka Prasad * [INJIMOB-631]: fix the prop value passed to the face scanner Signed-off-by: Alka Prasad * [INJIMOB-631] add email & address back to default fields and write a logic to remove bottom section fields from wellknown config supported fields Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] move detailed view bottom section fields list into vcUtils file Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] remove unused action selectIsVerifiable in existing vc item machine Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] pass the controller functions directly to verifyIdentityOverlay when calling it Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] add todo comment in vcVerification file to handled vc verification pending status as part of another task Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-631] render kebab menu options using flat list and make necessary changes related to menu options Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-721]: refactor search Filter for normal otp flow VC Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-721]: refactor search Filter for sunbird and esignet vc Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-721]: refactor to add metadata to esignet and sunbird vc on download before saving Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-721]: show no of cards when search data is updated Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-631] add back history tab file Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * INJIMOB-778 (#122) * [INJIMOB-778]: add new localistaion for set and confirm passcode screen Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: add authorization after the biometric unlock Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: add check for biometric and password for the toggle Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: add success toaster message when alternate unlock method is added Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: remove toaster when the app is reopened Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: add locales for succes toaster for biometric toggle Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: refactor to check for the toggle from settings Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: refactor function that handles biometric toggle Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: refactor toggle_biometric_unlock event Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: refactor banner notification to show success message Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-778]: add testID for new components Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> --------- Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> Signed-off-by: PoojaBabusing <115976560+PoojaBabusing@users.noreply.github.com> Co-authored-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * Injimob 784 (#124) * [INJIMOB-784] add face verification consent overlay Signed-off-by: adityankannan-tw * [INJIMOB-784] add dismiss for backdrop press Signed-off-by: adityankannan-tw * [INJIMOB-784] add pop up for qrlogin flow also Signed-off-by: adityankannan-tw * [INJIMOB-864] disable backup button when restoring and vice versa (#1279) Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> * [INJIMOB-867] - remove all files including unsynced files and get latest file based on date (#1281) Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> * [INJIMOB - 865,868] - Fix duplicate VC key for restored VC's and remove metadata if vc file not found (#1283) * [INJIMOB-something] use incremental timestamp for restore and make unload take a flag start time Signed-off-by: Harsh Vardhan * [INJIMOB-865,868] fix duplicate vckey value for restored vcs and remove vc metadata if file not found Co-authored-by: adityankannan-tw <109274996+adityankannan-tw@users.noreply.github.com> Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-869] remove unused method in store.ts machine Co-authored-by: adityankannan-tw <109274996+adityankannan-tw@users.noreply.github.com> Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-869] revert removing vc metadata if file not found Co-authored-by: adityankannan-tw <109274996+adityankannan-tw@users.noreply.github.com> Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-865] fix tamper vc removal When a VC is tampered, we get the tampered vc popup. Once we press okay button in the popup, we will be refreshing the vc machine's myVcs & recievedVcs context. Due to calling of parallel states, we were having issue with refreshing of myVcs. It is fixed by targeting to init state to refresh Co-authored-by: adityankannan-tw <109274996+adityankannan-tw@users.noreply.github.com> Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> * [INJIMOB-865] remove vc metadata when file is not found Co-authored-by: adityankannan-tw <109274996+adityankannan-tw@users.noreply.github.com> Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-869] add code comments & fix minor code issues Signed-off-by: Harsh Vardhan --------- Signed-off-by: Harsh Vardhan Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> Co-authored-by: Harsh Vardhan Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> * [INJIMOB-784] set context after getting the value from store Signed-off-by: adityankannan-tw * [INJIMOB-784] refactor the names and send isConsentGiven value properly to the scan machine event Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-784] store & fetch the face auth consent value with proper types Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * INJIMOB-604 VC Verification Failure Scenarios (#1228) * [INJI-604]: Handle Verification VC Error Scenarios Signed-off-by: BalachandarG * [INJIMOB-604] remove the card from UI when verify credential is failed and show error overlay Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-604] remove unused actions in existingMosipVcItem and issuers machine Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * INJIMOB-604 Replace Error message overlay with new error screen. Signed-off-by: BalachandarG * [INJI-611]: New Error screen implemented Signed-off-by: BalachandarG * [INJI-604]: Transation added for Verification error messages. Signed-off-by: BalachandarG * [INJI-604] merge develop and resolve conflicts Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJI-604] remove unnecessary log in error screen Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-604] remove removeVcFromMyVcs action from verify vc failed event and fix typegen warnings Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * INJIMOB-604 : Removing logs and renaming functions Signed-off-by: BalachandarG * [INJIMOB-604]: Removing unused method. Signed-off-by: BalachandarG * [Inji-604]: Fixing the issue of recursive VC deletion during Go Back event in Verification Error screen. Signed-off-by: BalachandarG * [Inji-604]: Fixing bugs post conflict resolve. Signed-off-by: BalachandarG * [Inji-604]: Removing unused events and adding translations for Go Back button * [Inji-604]: Removed angle brackets for Technical Error * [Inji-604]: Added ToDo to handle backup * [Inji-604]: Removing isVerified flag from the Existing VC Item Machine. * [Inji-604] iOS crash fixed for Verification error Go Back Button Signed-off-by: BalachandarG * [Inji-604]: Simplified condition for result in verify Credential call. Signed-off-by: BalachandarG --------- Signed-off-by: BalachandarG Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-784] add styles for the popup Signed-off-by: adityankannan-tw * [INJIMOB-784] add locales changes in all languages Signed-off-by: adityankannan-tw * [INJIMOB-784] send consent data using event to qrlogin machine Signed-off-by: adityankannan-tw * [INJIMOB-784] refactor scan and qr machines and remove logs Signed-off-by: adityankannan-tw * [INJIMOB-784] add testID for icons and buttons Signed-off-by: adityankannan-tw * [INJIMOB-784] add translations for help screen contents Signed-off-by: adityankannan-tw * [INJIMOB-784] add translations for help screen contents Signed-off-by: adityankannan-tw * [INJIMOB-784] change popup text and alter help screen msg order Signed-off-by: adityankannan-tw * Update SendVcScreenController.ts * [INJIMOB-784] refactor actions for show face auth consent screen Signed-off-by: adityankannan-tw --------- Signed-off-by: adityankannan-tw Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> Signed-off-by: Harsh Vardhan Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> Signed-off-by: BalachandarG Signed-off-by: adityankannan-tw <109274996+adityankannan-tw@users.noreply.github.com> Co-authored-by: adityankannan-tw Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> Co-authored-by: Sreenadh S <32409698+sree96@users.noreply.github.com> Co-authored-by: Harsh Vardhan Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> Co-authored-by: balachandarg-tw <115633327+balachandarg-tw@users.noreply.github.com> * [INJIMOB-631]: remove reset flowtype from disconnect as it is resetting the value each time on new connection Signed-off-by: Alka Prasad * [INJIMOB-631] remove unnecessary reset flow type event in scan machine and fix storage limit error overlay Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> --------- Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> Signed-off-by: Alka Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> Signed-off-by: Alka Prasad Signed-off-by: Alka Prasad Signed-off-by: PoojaBabusing <115976560+PoojaBabusing@users.noreply.github.com> Signed-off-by: adityankannan-tw Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> Signed-off-by: Sreenadh S <32409698+sree96@users.noreply.github.com> Signed-off-by: Harsh Vardhan Signed-off-by: BalachandarG Signed-off-by: adityankannan-tw <109274996+adityankannan-tw@users.noreply.github.com> Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> Co-authored-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> Co-authored-by: PoojaBabusing <115976560+PoojaBabusing@users.noreply.github.com> Co-authored-by: adityankannan-tw <109274996+adityankannan-tw@users.noreply.github.com> Co-authored-by: adityankannan-tw Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com> Co-authored-by: Sreenadh S <32409698+sree96@users.noreply.github.com> Co-authored-by: Harsh Vardhan Co-authored-by: balachandarg-tw <115633327+balachandarg-tw@users.noreply.github.com> --- assets/CheckedIcon.svg | 9 + assets/Detailed_view_kebab_icon.svg | 18 + assets/Info.svg | 9 + assets/Outlined_Delete_Icon.svg | 3 + assets/Outlined_Pin_Icon.svg | 3 + assets/Outlined_Schedule_Icon.svg | 3 + assets/Outlined_Share_Icon.svg | 3 + assets/Outlined_Share_With_Selfie_Icon.svg | 11 + assets/Outlined_Shielded_Icon.svg | 3 + assets/Search.svg | 3 + assets/Settings.svg | 9 + assets/Share_with_selfie.svg | 17 + assets/UnCheckedIcon.svg | 8 + assets/Wallet_Activated_Icon.svg | 6 + assets/Wallet_Activated_Large_Icon.svg | 10 + assets/Wallet_UnActivated_Icon.svg | 4 + assets/Wallet_UnActivated_Large_Icon.svg | 4 + assets/Warning_Icon.svg | 4 +- .../BackupAndRestoreBannerNotification.tsx | 6 +- components/BannerNotification.tsx | 11 +- components/BannerNotificationContainer.tsx | 27 +- components/BannerNotificationController.tsx | 23 + components/HelpScreen.tsx | 16 + components/KebabPopUp.tsx | 109 ++-- components/KebabPopUpController.tsx | 31 +- components/MessageOverlay.tsx | 3 + components/ProfileIcon.tsx | 28 +- components/QrCodeOverlay.tsx | 38 +- components/VC/MosipVCItem/MosipVCItem.tsx | 137 ----- .../MosipVCItemActivationStatus.tsx | 131 ----- .../VC/MosipVCItem/MosipVCItemContent.tsx | 332 ------------ .../VC/MosipVCItem/MosipVCItemDetails.tsx | 481 ------------------ components/VC/VcDetailsContainer.tsx | 17 +- components/VC/VcItemContainer.tsx | 17 +- .../VC/{MosipVCItem => }/VcItemController.tsx | 18 +- components/VC/Views/VCCardView.tsx | 71 +-- components/VC/Views/VCCardViewContent.tsx | 149 +++--- components/VC/Views/VCDetailView.tsx | 277 ++++++---- components/VC/common/VCCardInnerSkeleton.tsx | 73 --- components/VC/common/VCCardSkeleton.tsx | 55 +- components/VC/common/VCItemField.tsx | 86 ++-- components/VC/common/VCUtils.tsx | 36 +- components/VCVerification.tsx | 29 +- components/VcItemContainerProfileImage.tsx | 27 +- components/kebabMenuUtils.ts | 77 +++ components/ui/Button.tsx | 14 +- components/ui/Modal.tsx | 3 +- components/ui/SearchBar.tsx | 30 +- components/ui/Text.tsx | 2 +- components/ui/svg.tsx | 176 ++++++- components/ui/themes/DefaultTheme.ts | 166 ++++-- components/ui/themes/PurpleTheme.ts | 164 ++++-- injitest/README.md | 14 +- locales/ara.json | 58 ++- locales/en.json | 54 +- locales/fil.json | 56 +- locales/hin.json | 54 +- locales/kan.json | 54 +- locales/tam.json | 54 +- machines/QrLoginMachine.ts | 122 ++++- machines/QrLoginMachine.typegen.ts | 12 +- .../EsignetMosipVCItemMachine.ts | 37 +- .../ExistingMosipVCItemMachine.ts | 30 +- machines/VCItemMachine/vc.ts | 4 + machines/VCItemMachine/vc.typegen.ts | 1 - machines/auth.ts | 26 +- machines/bleShare/scan/scanMachine.ts | 179 ++++++- machines/bleShare/scan/scanMachine.typegen.ts | 44 +- machines/bleShare/scan/selectors.ts | 4 + machines/issuersMachine.ts | 19 + machines/settings.ts | 48 +- machines/store.ts | 8 +- machines/store.typegen.ts | 122 ++--- routes/main.ts | 22 +- routes/routesConstants.ts | 1 + screens/AuthScreen.tsx | 10 + screens/AuthScreenController.ts | 2 +- screens/Home/HomeScreen.tsx | 1 + screens/Home/HomeScreenController.ts | 14 +- screens/Home/MyVcs/HistoryTab.tsx | 32 +- screens/Home/MyVcs/RemoveVcWarningOverlay.tsx | 36 +- screens/Home/MyVcs/WalletBinding.tsx | 74 +-- screens/Home/MyVcsTab.tsx | 208 +++++++- screens/Home/MyVcsTabController.ts | 3 + screens/Home/ReceivedVcsTab.tsx | 3 +- screens/Home/ViewVcModal.tsx | 99 +++- screens/Home/ViewVcModalController.ts | 1 + screens/HomeScreenLayout.tsx | 51 +- screens/PasscodeScreen.tsx | 8 +- screens/PasscodeScreenController.ts | 5 +- screens/QrLogin/MyBindedVcs.tsx | 8 +- screens/QrLogin/QrLogin.tsx | 34 +- screens/QrLogin/QrLoginController.ts | 4 + screens/Request/ReceiveVcScreen.tsx | 29 +- screens/Scan/FaceVerificationAlertOverlay.tsx | 86 ++++ screens/Scan/ScanLayout.tsx | 80 +-- screens/Scan/ScanLayoutController.ts | 40 +- screens/Scan/ScanScreen.tsx | 9 +- screens/Scan/SelectVcOverlay.tsx | 3 +- screens/Scan/SendVcScreen.tsx | 19 +- screens/Scan/SendVcScreenController.ts | 16 +- screens/Settings/ReceivedCardsModal.tsx | 4 +- screens/Settings/SettingScreen.tsx | 255 +++++----- screens/Settings/SettingScreenController.ts | 36 +- screens/VerifyIdentityOverlay.tsx | 71 ++- shared/Utils.ts | 12 + shared/constants.ts | 2 + shared/openId4VCI/Utils.ts | 61 ++- types/VC/EsignetMosipVC/vc.ts | 3 + types/VC/ExistingMosipVC/vc.ts | 2 + 110 files changed, 2950 insertions(+), 2381 deletions(-) create mode 100644 assets/CheckedIcon.svg create mode 100644 assets/Detailed_view_kebab_icon.svg create mode 100644 assets/Info.svg create mode 100644 assets/Outlined_Delete_Icon.svg create mode 100644 assets/Outlined_Pin_Icon.svg create mode 100644 assets/Outlined_Schedule_Icon.svg create mode 100644 assets/Outlined_Share_Icon.svg create mode 100644 assets/Outlined_Share_With_Selfie_Icon.svg create mode 100644 assets/Outlined_Shielded_Icon.svg create mode 100644 assets/Search.svg create mode 100644 assets/Settings.svg create mode 100644 assets/Share_with_selfie.svg create mode 100644 assets/UnCheckedIcon.svg create mode 100644 assets/Wallet_Activated_Icon.svg create mode 100644 assets/Wallet_Activated_Large_Icon.svg create mode 100644 assets/Wallet_UnActivated_Icon.svg create mode 100644 assets/Wallet_UnActivated_Large_Icon.svg create mode 100644 components/BannerNotificationController.tsx delete mode 100644 components/VC/MosipVCItem/MosipVCItem.tsx delete mode 100644 components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx delete mode 100644 components/VC/MosipVCItem/MosipVCItemContent.tsx delete mode 100644 components/VC/MosipVCItem/MosipVCItemDetails.tsx rename components/VC/{MosipVCItem => }/VcItemController.tsx (75%) delete mode 100644 components/VC/common/VCCardInnerSkeleton.tsx create mode 100644 components/kebabMenuUtils.ts create mode 100644 screens/Scan/FaceVerificationAlertOverlay.tsx diff --git a/assets/CheckedIcon.svg b/assets/CheckedIcon.svg new file mode 100644 index 00000000..030abea1 --- /dev/null +++ b/assets/CheckedIcon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/Detailed_view_kebab_icon.svg b/assets/Detailed_view_kebab_icon.svg new file mode 100644 index 00000000..d969345a --- /dev/null +++ b/assets/Detailed_view_kebab_icon.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/Info.svg b/assets/Info.svg new file mode 100644 index 00000000..145baf59 --- /dev/null +++ b/assets/Info.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/Outlined_Delete_Icon.svg b/assets/Outlined_Delete_Icon.svg new file mode 100644 index 00000000..aaf8c7f5 --- /dev/null +++ b/assets/Outlined_Delete_Icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/Outlined_Pin_Icon.svg b/assets/Outlined_Pin_Icon.svg new file mode 100644 index 00000000..4d1af738 --- /dev/null +++ b/assets/Outlined_Pin_Icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/Outlined_Schedule_Icon.svg b/assets/Outlined_Schedule_Icon.svg new file mode 100644 index 00000000..d47f9748 --- /dev/null +++ b/assets/Outlined_Schedule_Icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/Outlined_Share_Icon.svg b/assets/Outlined_Share_Icon.svg new file mode 100644 index 00000000..fb8b80f7 --- /dev/null +++ b/assets/Outlined_Share_Icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/Outlined_Share_With_Selfie_Icon.svg b/assets/Outlined_Share_With_Selfie_Icon.svg new file mode 100644 index 00000000..32f732e0 --- /dev/null +++ b/assets/Outlined_Share_With_Selfie_Icon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/Outlined_Shielded_Icon.svg b/assets/Outlined_Shielded_Icon.svg new file mode 100644 index 00000000..77c53895 --- /dev/null +++ b/assets/Outlined_Shielded_Icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/Search.svg b/assets/Search.svg new file mode 100644 index 00000000..cc7b1654 --- /dev/null +++ b/assets/Search.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/Settings.svg b/assets/Settings.svg new file mode 100644 index 00000000..51ac2810 --- /dev/null +++ b/assets/Settings.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/Share_with_selfie.svg b/assets/Share_with_selfie.svg new file mode 100644 index 00000000..58f31c71 --- /dev/null +++ b/assets/Share_with_selfie.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/UnCheckedIcon.svg b/assets/UnCheckedIcon.svg new file mode 100644 index 00000000..69883064 --- /dev/null +++ b/assets/UnCheckedIcon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/Wallet_Activated_Icon.svg b/assets/Wallet_Activated_Icon.svg new file mode 100644 index 00000000..98329f0a --- /dev/null +++ b/assets/Wallet_Activated_Icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/Wallet_Activated_Large_Icon.svg b/assets/Wallet_Activated_Large_Icon.svg new file mode 100644 index 00000000..6d75c234 --- /dev/null +++ b/assets/Wallet_Activated_Large_Icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/Wallet_UnActivated_Icon.svg b/assets/Wallet_UnActivated_Icon.svg new file mode 100644 index 00000000..64da5b2b --- /dev/null +++ b/assets/Wallet_UnActivated_Icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/Wallet_UnActivated_Large_Icon.svg b/assets/Wallet_UnActivated_Large_Icon.svg new file mode 100644 index 00000000..f0125edb --- /dev/null +++ b/assets/Wallet_UnActivated_Large_Icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/Warning_Icon.svg b/assets/Warning_Icon.svg index 76deaee7..f08a4e35 100644 --- a/assets/Warning_Icon.svg +++ b/assets/Warning_Icon.svg @@ -13,10 +13,10 @@ - + - + diff --git a/components/BackupAndRestoreBannerNotification.tsx b/components/BackupAndRestoreBannerNotification.tsx index 4fe4ad80..1fdcdec8 100644 --- a/components/BackupAndRestoreBannerNotification.tsx +++ b/components/BackupAndRestoreBannerNotification.tsx @@ -3,7 +3,11 @@ import {useBackupScreen} from '../screens/backupAndRestore/BackupController'; import {BannerNotification} from './BannerNotification'; import {useTranslation} from 'react-i18next'; import {useBackupRestoreScreen} from '../screens/Settings/BackupRestoreController'; -import {BANNER_TYPE_SUCCESS, BANNER_TYPE_ERROR, BANNER_TYPE_INFO} from '../shared/constants'; +import { + BANNER_TYPE_SUCCESS, + BANNER_TYPE_ERROR, + BANNER_TYPE_INFO, +} from '../shared/constants'; export const BackupAndRestoreBannerNotification: React.FC = () => { const backUpController = useBackupScreen(); diff --git a/components/BannerNotification.tsx b/components/BannerNotification.tsx index c7ac5816..52f83f6f 100644 --- a/components/BannerNotification.tsx +++ b/components/BannerNotification.tsx @@ -4,7 +4,11 @@ import {Column, Row, Text} from './ui'; import {Theme} from './ui/styleUtils'; import {Icon} from 'react-native-elements'; import testIDProps from '../shared/commonUtil'; -import {BANNER_TYPE_SUCCESS, BANNER_TYPE_ERROR, BANNER_TYPE_INFO} from '../shared/constants'; +import { + BANNER_TYPE_SUCCESS, + BANNER_TYPE_ERROR, + BANNER_TYPE_INFO, +} from '../shared/constants'; export const BannerNotification: React.FC = props => { return ( @@ -37,5 +41,8 @@ export interface BannerNotificationProps { message: string; onClosePress: () => void; testId: string; - type: typeof BANNER_TYPE_SUCCESS | typeof BANNER_TYPE_ERROR | typeof BANNER_TYPE_INFO; + type: + | typeof BANNER_TYPE_SUCCESS + | typeof BANNER_TYPE_ERROR + | typeof BANNER_TYPE_INFO; } diff --git a/components/BannerNotificationContainer.tsx b/components/BannerNotificationContainer.tsx index 0d0d777d..4122188c 100644 --- a/components/BannerNotificationContainer.tsx +++ b/components/BannerNotificationContainer.tsx @@ -3,12 +3,15 @@ import {View} from 'react-native'; import {BannerNotification} from './BannerNotification'; import {UseWalletBindingSuccess} from './WalletBindingSuccessController'; import {BackupAndRestoreBannerNotification} from './BackupAndRestoreBannerNotification'; -import {t} from 'i18next'; +import {UseBannerNotification} from './BannerNotificationController'; +import {useTranslation} from 'react-i18next'; import {BANNER_TYPE_SUCCESS} from '../shared/constants'; export const BannerNotificationContainer: React.FC = () => { const WalletBindingController = UseWalletBindingSuccess(); const WalletBindingSuccess = WalletBindingController.isBindingSuccess; + const bannerNotificationController = UseBannerNotification(); + const {t} = useTranslation('BannerNotification'); return ( <> @@ -18,13 +21,33 @@ export const BannerNotificationContainer: React.FC = () => { )} + + {bannerNotificationController.isPasscodeUnlock && ( + + )} + + {bannerNotificationController.isBiometricUnlock && ( + + )} ); }; diff --git a/components/BannerNotificationController.tsx b/components/BannerNotificationController.tsx new file mode 100644 index 00000000..7aa0a740 --- /dev/null +++ b/components/BannerNotificationController.tsx @@ -0,0 +1,23 @@ +import {useSelector} from '@xstate/react'; +import { + selectIsPasscodeUnlock, + selectIsBiometricUnlock, + SettingsEvents, +} from '../machines/settings'; +import {useContext} from 'react'; +import {GlobalContext} from '../shared/GlobalContext'; + +export const UseBannerNotification = () => { + const {appService} = useContext(GlobalContext); + const settingsService = appService.children.get('settings'); + + return { + isPasscodeUnlock: useSelector(settingsService, selectIsPasscodeUnlock), + + isBiometricUnlock: useSelector(settingsService, selectIsBiometricUnlock), + + DISMISS: () => { + settingsService.send(SettingsEvents.DISMISS()); + }, + }; +}; diff --git a/components/HelpScreen.tsx b/components/HelpScreen.tsx index f0cde29a..6801b561 100644 --- a/components/HelpScreen.tsx +++ b/components/HelpScreen.tsx @@ -225,6 +225,22 @@ export const HelpScreen: React.FC = props => { ), }, + { + title: t('questions.inji.sixteen'), + data: ( + + {getTextField(t('answers.inji.sixteen'))} + + ), + }, + { + title: t('questions.inji.seventeen'), + data: ( + + {getTextField(t('answers.inji.seventeen'))} + + ), + }, { title: t('questions.inji.thirteen'), data: ( diff --git a/components/KebabPopUp.tsx b/components/KebabPopUp.tsx index adc94259..3cf2e89e 100644 --- a/components/KebabPopUp.tsx +++ b/components/KebabPopUp.tsx @@ -1,37 +1,43 @@ +import React from 'react'; import {Icon, ListItem, Overlay} from 'react-native-elements'; import {Theme} from '../components/ui/styleUtils'; import {Column, Row, Text} from '../components/ui'; -import {WalletBinding} from '../screens/Home/MyVcs/WalletBinding'; -import {Pressable, View} from 'react-native'; +import {View} from 'react-native'; import {useKebabPopUp} from './KebabPopUpController'; import {ActorRefFrom} from 'xstate'; import {ExistingMosipVCItemMachine} from '../machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine'; import {useTranslation} from 'react-i18next'; -import {HistoryTab} from '../screens/Home/MyVcs/HistoryTab'; -import {RemoveVcWarningOverlay} from '../screens/Home/MyVcs/RemoveVcWarningOverlay'; -import {ScrollView} from 'react-native-gesture-handler'; +import {FlatList} from 'react-native-gesture-handler'; import {VCMetadata} from '../shared/VCMetadata'; import testIDProps from '../shared/commonUtil'; +import {getKebabMenuOptions} from './kebabMenuUtils'; export const KebabPopUp: React.FC = props => { const controller = useKebabPopUp(props); const {t} = useTranslation('HomeScreenKebabPopUp'); + return ( - + {props.icon ? ( + props.icon + ) : ( + + )} - - + {t('title')} @@ -43,51 +49,29 @@ export const KebabPopUp: React.FC = props => { size={25} /> - - - - - - {props.vcMetadata.isPinned ? t('unPinCard') : t('pinCard')} + + ( + + + + {item.icon} + + + {item.label} - - - - - - - - - - - controller.REMOVE(props.vcMetadata)} - {...testIDProps('removeFromWallet')}> - - {t('removeFromWallet')} - - - - - - - + + + )} + /> ); @@ -97,7 +81,10 @@ export interface KebabPopUpProps { iconName: string; iconType?: string; vcMetadata: VCMetadata; - isVisible: boolean; + isVisible?: boolean; onDismiss: () => void; service: ActorRefFrom; + iconColor?: any; + icon?: any; + vcHasImage: boolean; } diff --git a/components/KebabPopUpController.tsx b/components/KebabPopUpController.tsx index 06f5242f..d4458e42 100644 --- a/components/KebabPopUpController.tsx +++ b/components/KebabPopUpController.tsx @@ -26,13 +26,27 @@ import { } from '../machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine'; import {selectActivities} from '../machines/activityLog'; import {GlobalContext} from '../shared/GlobalContext'; -import {useContext} from 'react'; +import {useContext, useState} from 'react'; import {VCMetadata} from '../shared/VCMetadata'; +import {ScanEvents} from '../machines/bleShare/scan/scanMachine'; +import { + BOTTOM_TAB_ROUTES, + SCAN_ROUTES, + ScanStackParamList, +} from '../routes/routesConstants'; +import {NavigationProp, useNavigation} from '@react-navigation/native'; +import {MainBottomTabParamList} from '../routes/main'; +import {selectIsScanning} from '../machines/bleShare/scan/selectors'; + +type ScanLayoutNavigation = NavigationProp< + ScanStackParamList & MainBottomTabParamList +>; export function useKebabPopUp(props) { const service = props.service as | ActorRefFrom | ActorRefFrom; + const navigation = useNavigation(); const vcEvents = props.vcKey !== undefined && props.vcMetadata.isFromOpenId4VCI() ? EsignetMosipVCItemEvents @@ -74,6 +88,12 @@ export function useKebabPopUp(props) { const email = useSelector(service, selectIsEmail); const {appService} = useContext(GlobalContext); const activityLogService = appService.children.get('activityLog'); + const scanService = appService.children.get('scan'); + const isScanning = useSelector(scanService, selectIsScanning); + + const GOTO_SCANSCREEN = () => { + navigation.navigate(BOTTOM_TAB_ROUTES.share); + }; return { isPinned, @@ -81,12 +101,21 @@ export function useKebabPopUp(props) { KEBAB_POPUP, ADD_WALLET_BINDING_ID, CONFIRM, + GOTO_SCANSCREEN, DISMISS, REMOVE, CANCEL, INPUT_OTP, RESEND_OTP, SHOW_ACTIVITY, + SELECT_VC_ITEM: ( + vcRef: ActorRefFrom, + flowType: string, + ) => { + const {serviceRefs, ...vcData} = vcRef.getSnapshot().context; + scanService.send(ScanEvents.SELECT_VC(vcData, flowType)); + }, + isScanning, isBindingWarning, isAcceptingOtpInput, isWalletBindingError, diff --git a/components/MessageOverlay.tsx b/components/MessageOverlay.tsx index 569f823d..2a110278 100644 --- a/components/MessageOverlay.tsx +++ b/components/MessageOverlay.tsx @@ -73,6 +73,7 @@ export const MessageOverlay: React.FC = props => { }; export const ErrorMessageOverlay: React.FC = ({ + testID, isVisible, error, onDismiss, @@ -86,6 +87,7 @@ export const ErrorMessageOverlay: React.FC = ({ title={t(error + '.title')} message={t(error + '.message')} onBackdropPress={onDismiss} + testID={testID} /> ); }; @@ -95,6 +97,7 @@ export interface ErrorMessageOverlayProps { error?: string; onDismiss?: () => void; translationPath: string; + testID?: string; } const Progress: React.FC> = props => { diff --git a/components/ProfileIcon.tsx b/components/ProfileIcon.tsx index c1b0c304..637c9e3d 100644 --- a/components/ProfileIcon.tsx +++ b/components/ProfileIcon.tsx @@ -5,27 +5,31 @@ import {Icon} from 'react-native-elements'; import {SvgImage} from './ui/svg'; import testIDProps from '../shared/commonUtil'; -export const ProfileIcon: React.FC = props => { +export const ProfileIcon: React.FC = props => { return ( - + <> - {props?.isPinned && SvgImage.pinIcon()} + {...testIDProps(`ProfileIconOuter`)} + style={Theme.Styles.ProfileContainer}> + style={props.profileIconContainerStyles}> + {props?.isPinned && + SvgImage.pinIcon(Theme.Styles.ProfileIconPinnedStyle)} - + ); }; + +interface ProfileIconProps { + isPinned?: boolean; + profileIconContainerStyles: object; + profileIconSize: number; +} diff --git a/components/QrCodeOverlay.tsx b/components/QrCodeOverlay.tsx index 1c6a0c30..ed246002 100644 --- a/components/QrCodeOverlay.tsx +++ b/components/QrCodeOverlay.tsx @@ -16,25 +16,25 @@ export const QrCodeOverlay: React.FC = props => { const toggleQrOverlay = () => setIsQrOverlayVisible(!isQrOverlayVisible); return ( - - - - - - - - {SvgImage.MagnifierZoom()} - - + + + + + {SvgImage.MagnifierZoom()} + + + + = props => { - let { - service, - context, - verifiableCredential, - emptyWalletBindingId, - isKebabPopUp, - isSavingFailedInIdle, - storeErrorTranslationPath, - generatedOn, - - DISMISS, - KEBAB_POPUP, - } = useVcItemController(props); - - let formattedDate = - generatedOn && format(new Date(generatedOn), 'MM/dd/yyyy'); - - useEffect(() => { - service.send( - ExistingMosipVCItemEvents.UPDATE_VC_METADATA(props.vcMetadata), - ); - }, [props.vcMetadata]); - - if (!verifiableCredential) { - return ; - } - - return ( - - props.onPress(service)} - disabled={!verifiableCredential} - style={ - props.selected - ? Theme.Styles.selectedBindedVc - : Theme.Styles.closeCardBgContainer - }> - props.onPress(service)} - isDownloading={props.isDownloading} - /> - - {props.isSharingVc ? null : ( - - - - - - - - - - - - )} - - - - ); -}; - -export interface ExistingMosipVCItemProps { - vcMetadata: VCMetadata; - margin?: string; - selectable?: boolean; - selected?: boolean; - showOnlyBindedVc?: boolean; - onPress?: (vcRef?: ActorRefFrom) => void; - onShow?: (vcRef?: ActorRefFrom) => void; - isSharingVc?: boolean; - isDownloading?: boolean; - isPinned?: boolean; -} - -export interface EsignetMosipVCItemProps { - vcMetadata: VCMetadata; - margin?: string; - selectable?: boolean; - selected?: boolean; - showOnlyBindedVc?: boolean; - onPress?: (vcRef?: ActorRefFrom) => void; - onShow?: (vcRef?: ActorRefFrom) => void; - isSharingVc?: boolean; - isDownloading?: boolean; - isPinned?: boolean; -} diff --git a/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx b/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx deleted file mode 100644 index 788f59b6..00000000 --- a/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx +++ /dev/null @@ -1,131 +0,0 @@ -import React from 'react'; -import {useTranslation} from 'react-i18next'; -import {Icon} from 'react-native-elements'; -import {VerifiableCredential} from '../../../types/VC/ExistingMosipVC/vc'; -import {Row, Text} from '../../ui'; -import {Theme} from '../../ui/styleUtils'; -import {View} from 'react-native'; -import {isActivationNeeded} from '../../../shared/openId4VCI/Utils'; -import {VCMetadata} from '../../../shared/VCMetadata'; - -const WalletUnverifiedIcon: React.FC = () => { - return ( - - ); -}; - -const WalletVerifiedIcon: React.FC = () => { - return ( - - ); -}; - -const WalletUnverifiedActivationDetails: React.FC< - WalletUnVerifiedDetailsProps -> = props => { - const {t} = useTranslation('VcDetails'); - return ( - - - {props.verifiableCredential && } - - - - - - ); -}; - -const WalletVerifiedActivationDetails: React.FC< - WalletVerifiedDetailsProps -> = props => { - const {t} = useTranslation('WalletBinding'); - return ( - - - - - - - - - ); -}; - -export const MosipVCItemActivationStatus: React.FC< - ExistingMosipVCItemActivationStatusProps -> = props => { - return ( - - {props.emptyWalletBindingId && - isActivationNeeded(props?.vcMetadata.issuer) ? ( - - ) : ( - - )} - - ); -}; - -interface ExistingMosipVCItemActivationStatusProps { - showOnlyBindedVc: boolean; - verifiableCredential: VerifiableCredential; - emptyWalletBindingId: boolean; -} - -interface WalletVerifiedDetailsProps { - showOnlyBindedVc: boolean; - verifiableCredential: VerifiableCredential; - vcMetadata: VCMetadata; -} - -interface WalletUnVerifiedDetailsProps { - verifiableCredential: VerifiableCredential; -} diff --git a/components/VC/MosipVCItem/MosipVCItemContent.tsx b/components/VC/MosipVCItem/MosipVCItemContent.tsx deleted file mode 100644 index f248e392..00000000 --- a/components/VC/MosipVCItem/MosipVCItemContent.tsx +++ /dev/null @@ -1,332 +0,0 @@ -import React from 'react'; -import {useTranslation} from 'react-i18next'; -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, {getMaskedText} from '../../../shared/commonUtil'; -import {logoType} from '../../../machines/issuersMachine'; -import {SvgImage} from '../../ui/svg'; -import {VcItemContainerProfileImage} from '../../VcItemContainerProfileImage'; - -const getDetails = (arg1, arg2, verifiableCredential) => { - if (arg1 === 'Status') { - return ( - - - {arg1} - - - {!verifiableCredential ? null : } - - {!verifiableCredential ? '' : arg2} - - - - ); - } else { - return ( - - - {arg1} - - - {!verifiableCredential ? '' : arg2} - - - ); - } -}; - -const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: logoType) => { - if (isOpenId4VCI) { - return ( - {issuerLogo?.alt_text} - ); - } - return SvgImage.MosipLogo(Theme.Styles.logo); -}; - -export const MosipVCItemContent: React.FC< - ExistingMosipVCItemContentProps | EsignetMosipVCItemContentProps -> = props => { - const verifiableCredential = props.isDownloading - ? null - : props.vcMetadata.isFromOpenId4VCI() - ? props.verifiableCredential?.credential - : props.verifiableCredential; - - //Assigning the UIN and VID from the VC details to display the idtype label - const uin = verifiableCredential?.credentialSubject.UIN; - const vid = verifiableCredential?.credentialSubject.VID; - const fullName = !verifiableCredential - ? '' - : getLocalizedField(verifiableCredential?.credentialSubject.fullName); - const {t} = useTranslation('VcDetails'); - const isvalid = !verifiableCredential ? '' : t('valid'); - const selectableOrCheck = props.selectable ? ( - - } - uncheckedIcon={ - - } - onPress={() => props.onPress()} - /> - ) : null; - - return ( - - - - - {VcItemContainerProfileImage(props, verifiableCredential)} - - - - - {t('fullName')} - - - {fullName} - - - - - - {t('idType')} - - - {t('nationalCard')} - - - - - - {verifiableCredential ? selectableOrCheck : null} - - - - - {uin ? ( - - - {t('uin')} - - - {getMaskedText(uin)} - - - ) : null} - - {vid ? ( - - - {t('vid')} - - - {getMaskedText(vid)} - - - ) : null} - {!verifiableCredential - ? getDetails(t('id'), uin || vid, verifiableCredential) - : null} - - - - - - - {t('generatedOn')} - - - {props.generatedOn} - - - - {verifiableCredential - ? getDetails(t('status'), isvalid, verifiableCredential) - : null} - - - {getIssuerLogo( - props.vcMetadata.isFromOpenId4VCI(), - props.verifiableCredential?.issuerLogo, - )} - - - - - ); -}; - -export interface ExistingMosipVCItemContentProps { - context: any; - verifiableCredential: VerifiableCredential; - generatedOn: string; - selectable: boolean; - selected: boolean; - isPinned?: boolean; - service: any; - onPress?: () => void; - isDownloading?: boolean; -} - -export interface EsignetMosipVCItemContentProps { - context: any; - credential: VerifiableCredential; - generatedOn: string; - selectable: boolean; - selected: boolean; - isPinned?: boolean; - service: any; - onPress?: () => void; - isDownloading?: boolean; -} - -MosipVCItemContent.defaultProps = { - isPinned: false, -}; diff --git a/components/VC/MosipVCItem/MosipVCItemDetails.tsx b/components/VC/MosipVCItem/MosipVCItemDetails.tsx deleted file mode 100644 index 6e7f42f0..00000000 --- a/components/VC/MosipVCItem/MosipVCItemDetails.tsx +++ /dev/null @@ -1,481 +0,0 @@ -import {format, parse} from 'date-fns'; -import React from 'react'; -import {useTranslation} from 'react-i18next'; -import {Dimensions, Image, ImageBackground, View} from 'react-native'; -import {Icon} from 'react-native-elements'; -import {CredentialSubject, VC} from '../../../types/VC/ExistingMosipVC/vc'; -import {Button, Column, Row, Text} from '../../ui'; -import {Theme} from '../../ui/styleUtils'; -import VerifiedIcon from '../../VerifiedIcon'; -import {getLocalizedField} from '../../../i18n'; -import {CREDENTIAL_REGISTRY_EDIT} from 'react-native-dotenv'; -import {QrCodeOverlay} from '../../QrCodeOverlay'; -import {VCMetadata} from '../../../shared/VCMetadata'; -import { - VcIdType, - VerifiableCredential, - VerifiablePresentation, -} from '../../../types/VC/EsignetMosipVC/vc'; -import {WalletBindingResponse} from '../../../shared/cryptoutil/cryptoUtil'; -import {logoType} from '../../../machines/issuersMachine'; -import {SvgImage} from '../../ui/svg'; - -const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: logoType) => { - if (isOpenId4VCI) { - return ( - {issuerLogo?.alt_text} - ); - } - return SvgImage.MosipLogo(Theme.Styles.vcDetailsLogo); -}; - -const getProfileImage = ( - props: ExistingMosipVCItemDetailsProps | EsignetMosipVCItemDetailsProps, - verifiableCredential, - isOpenId4VCI, -) => { - if (isOpenId4VCI) { - if (verifiableCredential?.credentialSubject.face) { - return {uri: verifiableCredential?.credentialSubject.face}; - } - } else { - if (props.vc?.credential?.biometrics?.face) { - return {uri: props.vc?.credential.biometrics.face}; - } - } - return ; -}; - -export const MosipVCItemDetails: React.FC< - ExistingMosipVCItemDetailsProps | EsignetMosipVCItemDetailsProps -> = props => { - const {t, i18n} = useTranslation('VcDetails'); - - let isOpenId4VCI = VCMetadata.fromVC(props.vc.vcMetadata).isFromOpenId4VCI(); - const issuerLogo = getIssuerLogo( - isOpenId4VCI, - props.vc?.verifiableCredential?.issuerLogo, - ); - const verifiableCredential = isOpenId4VCI - ? props.vc?.verifiableCredential.credential - : props.vc?.verifiableCredential; - - //Assigning the UIN and VID from the VC details to display the idtype label - const uin = verifiableCredential?.credentialSubject.UIN; - const vid = verifiableCredential?.credentialSubject.VID; - - if (verifiableCredential == null) { - return Loading details...; - } - - return ( - - - - - - - - - {issuerLogo} - - - - - {t('fullName')} - - - {getLocalizedField( - verifiableCredential?.credentialSubject.fullName, - )} - - - - - - - {t('gender')} - - - {getLocalizedField( - verifiableCredential?.credentialSubject.gender, - )} - - - - - {t('idType')} - - - {t('nationalCard')} - - - {uin ? ( - - - {t('uin')} - - - {uin} - - - ) : null} - - {vid ? ( - - - {t('vid')} - - - {vid} - - - ) : null} - - - {t('generatedOn')} - - - {new Date(props.vc?.generatedOn).toLocaleDateString()} - - - - - - - {t('dateOfBirth')} - - - {formattedDateOfBirth()} - - - - - {t('status')} - - - {props.vc && } - - {t('valid')} - - - - - {''} - {''} - - - - {t('phoneNumber')} - - - {getLocalizedField( - verifiableCredential?.credentialSubject.phone, - )} - - - - - - - - - - - {t('email')} - - - 25 - ? {flex: 1} - : {flex: 0} - } - weight="semibold" - size="smaller" - color={Theme.Colors.Details}> - {getLocalizedField( - verifiableCredential?.credentialSubject.email, - )} - - - - - - - {t('address')} - - - - {getFullAddress(verifiableCredential?.credentialSubject)} - - - - {CREDENTIAL_REGISTRY_EDIT === 'true' && ( - - - {t('credentialRegistry')} - - - {props.vc?.credentialRegistry} - - - )} - - - - {props.activeTab !== 1 ? ( - props.isBindingPending ? ( - - - - - {t('offlineAuthDisabledHeader')} - - - - {t('offlineAuthDisabledMessage')} - - -