diff --git a/locales/ara.json b/locales/ara.json index 4057c366..da84d241 100644 --- a/locales/ara.json +++ b/locales/ara.json @@ -409,7 +409,7 @@ } }, "MyVcsTab": { - "searchByName": "البحث عن طريق الإسم", + "searchByName": "يبحث", "bringYourDigitalID": "أحضر هويتك الرقمية", "generateVcDescription": "اضغط على \"إضافة بطاقة \" أدناه لتنزيل بطاقتك", "generateVcFABDescription": "اضغط على \"+\" أدناه لتنزيل بطاقتك", diff --git a/locales/en.json b/locales/en.json index 18904197..da095942 100644 --- a/locales/en.json +++ b/locales/en.json @@ -410,7 +410,7 @@ } }, "MyVcsTab": { - "searchByName": "Search by name", + "searchByName": "Search", "bringYourDigitalID": "Bring your digital identity", "generateVcDescription": "Tap on \"Download card\" below to download your card", "generateVcFABDescription": "Tap on \"+\" below to download your card", diff --git a/locales/fil.json b/locales/fil.json index 81a9e919..71ad4a26 100644 --- a/locales/fil.json +++ b/locales/fil.json @@ -409,7 +409,7 @@ } }, "MyVcsTab": { - "searchByName": "Maghanap ayon sa pangalan", + "searchByName": "Maghanap", "bringYourDigitalID": "Dalhin ang Iyong Digital ID", "generateVcDescription": "Upang i-download ang iyong card i-tap ang I-download card sa ibaba", "generateVcFABDescription": "Upang i-download ang iyong card i-tap ang + sa ibaba", diff --git a/locales/hin.json b/locales/hin.json index 4f22150b..eb61de62 100644 --- a/locales/hin.json +++ b/locales/hin.json @@ -410,7 +410,7 @@ } }, "MyVcsTab": { - "searchByName": "नाम से खोजें", + "searchByName": "खोजें", "downloadCard": "डाउनलोड कार्ड", "bringYourDigitalID": "अपनी डिजिटल आईडी लाओ", "generateVcDescription": "अपना कार्ड डाउनलोड करने के लिए नीचे डाउनलोड कार्ड टैप करें", diff --git a/locales/kan.json b/locales/kan.json index 13a3b840..016a85da 100644 --- a/locales/kan.json +++ b/locales/kan.json @@ -409,7 +409,7 @@ } }, "MyVcsTab": { - "searchByName": "ಹೆಸರಿನಿಂದ ಹುಡುಕಿ", + "searchByName": "ಹುಡುಕು", "downloadCard": "ಕಾರ್ಡ್ ಡೌನ್‌ಲೋಡ್ ಮಾಡಿ", "bringYourDigitalID": "ನಿಮ್ಮ ಡಿಜಿಟಲ್ ಐಡಿ ತನ್ನಿ", "generateVcDescription": "ನಿಮ್ಮ ಕಾರ್ಡ್ ಅನ್ನು ಡೌನ್‌ಲೋಡ್ ಮಾಡಲು ಕೆಳಗಿನ ಡೌನ್‌ಲೋಡ್ ಕಾರ್ಡ್ ಅನ್ನು ಟ್ಯಾಪ್ ಮಾಡಿ", diff --git a/locales/tam.json b/locales/tam.json index 2a575659..f98f3d17 100644 --- a/locales/tam.json +++ b/locales/tam.json @@ -409,7 +409,7 @@ } }, "MyVcsTab": { - "searchByName": "பெயரால் தேடுங்கள்", + "searchByName": "தேடு", "bringYourDigitalID": "உங்கள் டிஜிட்டல் ஐடியைக் கொண்டு வாருங்கள்", "generateVcDescription": "உங்கள் அட்டை ஐப் பதிவிறக்க, கீழே உள்ள பதிவிறக்கு அட்டை என்பதைத் தட்டவும்", "generateVcFABDescription": "உங்கள் அட்டை ஐப் பதிவிறக்க, கீழே உள்ள + என்பதைத் தட்டவும்", diff --git a/screens/Home/MyVcsTab.tsx b/screens/Home/MyVcsTab.tsx index 17f97d1e..cc903783 100644 --- a/screens/Home/MyVcsTab.tsx +++ b/screens/Home/MyVcsTab.tsx @@ -84,8 +84,9 @@ export const MyVcsTab: React.FC = props => { const credentialSubject = vc.verifiableCredential.credentialSubject || vc.verifiableCredential.credential.credentialSubject; - - if (credentialSubject) { + if(isStringAndContains(searchText,vc['vcMetadata'].credentialType)) + isVcFound=true + else if (credentialSubject) { isVcFound = searchNestedCredentialFields( searchTextLower, credentialSubject, diff --git a/shared/VCMetadata.ts b/shared/VCMetadata.ts index 5392a540..1e3ae00b 100644 --- a/shared/VCMetadata.ts +++ b/shared/VCMetadata.ts @@ -1,5 +1,6 @@ import { Credential, + CredentialTypes, VC, VcIdType, VerifiableCredential, @@ -8,6 +9,7 @@ import {Protocols} from './openId4VCI/Utils'; import {getMosipIdentifier} from './commonUtil'; import {VCFormat} from './VCFormat'; import {isMosipVC} from './Utils'; +import { getCredentialType } from '../components/VC/common/VCUtils'; const VC_KEY_PREFIX = 'VC'; const VC_ITEM_STORE_KEY_REGEX = '^VC_[a-zA-Z0-9_-]+$'; @@ -27,6 +29,7 @@ export class VCMetadata { isExpired: boolean = false; downloadKeyType: string = ''; + credentialType: string = ''; constructor({ idType = '', requestId = '', @@ -40,6 +43,7 @@ export class VCMetadata { format = '', downloadKeyType = '', isExpired = false, + credentialType = '', } = {}) { this.idType = idType; this.requestId = requestId; @@ -53,6 +57,7 @@ export class VCMetadata { this.format = format; this.downloadKeyType = downloadKeyType; this.isExpired = isExpired; + this.credentialType = credentialType } //TODO: Remove any typing and use appropriate typing @@ -74,6 +79,7 @@ export class VCMetadata { ? vc.vcMetadata.mosipIndividualId : getMosipIndividualId(vc.verifiableCredential, vc.issuer), downloadKeyType: vc.downloadKeyType, + credentialType: vc.credentialType }); } @@ -113,7 +119,7 @@ export function parseMetadatas(metadataStrings: object[]) { return metadataStrings.map(o => new VCMetadata(o)); } -export const getVCMetadata = (context: object, keyType: string) => { +export const getVCMetadata = (context: object, keyType: string, credType: CredentialTypes) => { const [issuer, protocol, credentialId] = context.credentialWrapper?.identifier.split(':'); @@ -131,6 +137,7 @@ export const getVCMetadata = (context: object, keyType: string) => { ), format: context['credentialWrapper'].format, downloadKeyType: keyType, + credentialType: getCredentialType(context.selectedCredentialType) }); };