From 084326a6564c428be153bf58fad4267c5d42d61d Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Mon, 22 Apr 2024 15:55:00 +0545 Subject: [PATCH] feat: Add VerifiableId in Profile EBSI in the Discover #2611 --- .../credential_subject_type_extension.dart | 3 +++ lib/credentials/cubit/credentials_cubit.dart | 3 ++- lib/dashboard/profile/models/profile.dart | 24 ++++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/app/shared/enum/type/credential_subject_type/credential_subject_type_extension.dart b/lib/app/shared/enum/type/credential_subject_type/credential_subject_type_extension.dart index e6dd6363d..abdce2a98 100644 --- a/lib/app/shared/enum/type/credential_subject_type/credential_subject_type_extension.dart +++ b/lib/app/shared/enum/type/credential_subject_type/credential_subject_type_extension.dart @@ -677,6 +677,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { VCFormatType.ldpVc, VCFormatType.jwtVcJson, VCFormatType.vcSdJWT, + VCFormatType.jwtVc, ]; case CredentialSubjectType.identityCredential: @@ -899,6 +900,8 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType { if (vcFormatType == VCFormatType.vcSdJWT) { type = 'identitycredential'; + } else if (vcFormatType == VCFormatType.jwtVc) { + type = 'individualverifiableattestation'; } link = '${Urls.id360Url}' diff --git a/lib/credentials/cubit/credentials_cubit.dart b/lib/credentials/cubit/credentials_cubit.dart index b2528e017..9a94dd22f 100644 --- a/lib/credentials/cubit/credentials_cubit.dart +++ b/lib/credentials/cubit/credentials_cubit.dart @@ -724,7 +724,8 @@ class CredentialsCubit extends Cubit { final displayVerifiableId = vcFormatType == VCFormatType.ldpVc && discoverCardsOptions.displayVerifiableId; final displayVerifiableIdJwt = - vcFormatType == VCFormatType.jwtVcJson && + (vcFormatType == VCFormatType.jwtVc || + vcFormatType == VCFormatType.jwtVcJson) && discoverCardsOptions.displayVerifiableIdJwt; final displayVerifiableIdSdJwt = vcFormatType == VCFormatType.vcSdJWT && diff --git a/lib/dashboard/profile/models/profile.dart b/lib/dashboard/profile/models/profile.dart index fbac64c53..b851d5588 100644 --- a/lib/dashboard/profile/models/profile.dart +++ b/lib/dashboard/profile/models/profile.dart @@ -50,7 +50,29 @@ class ProfileModel extends Equatable { blockchainOptions: BlockchainOptions.initial(), generalOptions: GeneralOptions.empty(), helpCenterOptions: HelpCenterOptions.initial(), - discoverCardsOptions: DiscoverCardsOptions.none(), + discoverCardsOptions: const DiscoverCardsOptions( + displayDefi: false, + displayHumanity: false, + displayHumanityJwt: false, + displayOver13: false, + displayOver15: false, + displayOver18: false, + displayOver18Jwt: false, + displayOver21: false, + displayOver50: false, + displayChainborn: false, + displayTezotopia: false, + displayVerifiableId: false, + displayVerifiableIdJwt: true, + displayOver65: false, + displayEmailPass: false, + displayEmailPassJwt: false, + displayPhonePass: false, + displayPhonePassJwt: false, + displayAgeRange: false, + displayGender: false, + displayExternalIssuer: [], + ), selfSovereignIdentityOptions: SelfSovereignIdentityOptions( displayManageDecentralizedId: true, customOidc4vcProfile: CustomOidc4VcProfile(