Files
inji-wallet/components/kebabMenuUtils.ts
PuBHARGAVI 85627b2690 [Release-25-05-2024] Sprint 28 (#1457)
* [INJIMOB-1292] - Rename Mosip issuer to MosipOtp and ESignet to Mosip

Signed-off-by: Swati Goel <meet2swati@gmail.com>

* Update MoreOptionsPage.java (#1427)

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

* [INJIMOB-1281]: add localization support while doing authorization with e-signet (#1430)

Signed-off-by: Alka Prasad <prasadalka1998@gmail.com>

* [INJIMOB-695] fix vc detail view in receive screen (#1432)

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Co-authored-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

* [Injimob 695] Add logic to show the Banner message based on the verification call response for esignet and sunbird VC (#1435)

* [INJIMOB-990] - fix step to get client id based on app flavor

Signed-off-by: Swati Goel <meet2swati@gmail.com>

* [INJIMOB-990] - add checkout step to get client-id based on app flavor

Signed-off-by: Swati Goel <meet2swati@gmail.com>

* Update MoreOptionsPage.java (#1428)

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

* [INJIMOB-695] fix vc detail view in receive screen (#1431)

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Co-authored-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

* updated config file (#1433)

* Update MoreOptionsPage.java

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

* Update androidConfig.yml

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

---------

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

* [INJIMOB-695] store verification call response into storage for esignet and sunbird VC's

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] revert develop branch changes

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] revert develop branch changes in internal-build.yml file

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

---------

Signed-off-by: Swati Goel <meet2swati@gmail.com>
Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>
Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
Co-authored-by: Swati Goel <meet2swati@gmail.com>
Co-authored-by: Sreenadh S <32409698+sree96@users.noreply.github.com>
Co-authored-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>
Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Co-authored-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

* [Injimob-695]: Go back issue fixed in issuersMachine for Verification Error (#1439)

* [Injimob-695]: Go back issue fixed in issuersMachine for Verification Error.

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>

* [Injimob-695] Remove unused actions.

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>

* [Injimob-695]: Updating the catch block of verifyCredential to throw technical error.

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>

* [Injimob-695]: Updating the error logs for verification error.

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>

* [INJIMOB-695] change the name of isPendingVerificationError method to make it more meaningful and move vc verification status styles to theme files

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] change the verification failure banner message as per the wireframe

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] In vcItem services file pass VC credentials properly to the verify credential method

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] remove unused imports and return verification error message properly in vcItem actions

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] remove unused imports in issuersActions file

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

---------

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>
Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [Injimob 917] Close only camera disabled banner when user clicks on close icon in banner (#1447)

* [INJIMOB-917] add enable permission text with underline in camera disabled banner

When user clicks on this, app will redirect the user to the app settings to enable the permissions

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917] add translations for camera disable banner enable permission text

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] fix the logic of setting the isActive state of the app using AppState listener and fix the styles of Qr scanner

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917]fix the styles of the camera disabled screen

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917] revert appState listener changes in app.ts and set app active or inactive state everytime the app is launched

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917] remove unused imports

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917] remove unneccessary formatting change

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917] fix the styles of camera scanner and add margin styles to the share screen

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917] show activate option in kebab menu only if the VC has image

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917] remove call to verifyIdentityOverlay component in scan Layout and receive vc screen files as we are not using it and move Invalid Identity component to verifyIdentityOverlay to remove redundancy

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917] change the height of camera scanner to 320 and reduce the margin top and bottom of the whole scanner component to 20

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

---------

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [Injimob 917] remove unused imports and add missing styles in purple theme (#1448)

* [INJIMOB-917] add verifyIdentityOverlay back in scanLayout as we are using this for share with selfie option of kebab menu

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-917] remove unused imports and add missing style

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

---------

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [Injimob 1411] sync develop branch with qa develop branch (#1449)

* [INJIMOB-990] - fix step to get client id based on app flavor

Signed-off-by: Swati Goel <meet2swati@gmail.com>

* [INJIMOB-990] - add checkout step to get client-id based on app flavor

Signed-off-by: Swati Goel <meet2swati@gmail.com>

* Update MoreOptionsPage.java (#1428)

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

* [INJIMOB-695] fix vc detail view in receive screen (#1431)

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Co-authored-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

* updated config file (#1433)

* Update MoreOptionsPage.java

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

* Update androidConfig.yml

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

---------

Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>

* [INJIMOB-695] for esignet and sunbird show the banner message based on the verification call response (#1437)

* [INJIMOB-695] store verification call response into storage for esignet and sunbird VC's

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] change the verification failure banner message as per the wireframe

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] In vcItem services file pass VC credentials properly to the verify credential method

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

---------

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [Injimob-695]: Go back issue fixed for Verification error in Esignet Flow (#1442)

* [Injimob-695]: Go back issue fixed for Verification error in Esignet flow.

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>

* [INJIMOB-695] change the name of isPendingVerificationError method to make it more meaningful and move vc verification status styles to theme files

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] remove unused imports and return verification error message properly in vcItem actions

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-695] remove unused imports in issuersActions file

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

---------

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>
Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

---------

Signed-off-by: Swati Goel <meet2swati@gmail.com>
Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>
Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>
Co-authored-by: Swati Goel <meet2swati@gmail.com>
Co-authored-by: Sreenadh S <32409698+sree96@users.noreply.github.com>
Co-authored-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>
Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Co-authored-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
Co-authored-by: balachandarg-tw <115633327+balachandarg-tw@users.noreply.github.com>

* [INJIMOB-1411] fix the width of camera disabled banner and show translations properly

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

* [INJIMOB-1411] remove UIN and VID from detailed view add on fields

Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>

---------

Signed-off-by: Swati Goel <meet2swati@gmail.com>
Signed-off-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>
Signed-off-by: Alka Prasad <prasadalka1998@gmail.com>
Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Signed-off-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>
Co-authored-by: Swati Goel <meet2swati@gmail.com>
Co-authored-by: anup-nehe <117707464+anup-nehe@users.noreply.github.com>
Co-authored-by: Alka Prasad <Alka1703@users.noreply.github.com>
Co-authored-by: Sreenadh S <32409698+sree96@users.noreply.github.com>
Co-authored-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Co-authored-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
Co-authored-by: balachandarg-tw <115633327+balachandarg-tw@users.noreply.github.com>
2024-05-26 12:01:33 +05:30

78 lines
2.4 KiB
TypeScript

import {useTranslation} from 'react-i18next';
import {SvgImage} from './ui/svg';
import {useKebabPopUp} from './KebabPopUpController';
import {isActivationNeeded} from '../shared/openId4VCI/Utils';
import {VCShareFlowType} from '../shared/Utils';
export const getKebabMenuOptions = props => {
const controller = useKebabPopUp(props);
const {t} = useTranslation('HomeScreenKebabPopUp');
const loadScanScreen = flowType => () => {
controller.SELECT_VC_ITEM(props.service, flowType),
controller.GOTO_SCANSCREEN(),
props.service.send('CLOSE_VC_MODAL');
};
const activationNotCompleted =
!controller.walletBindingResponse &&
isActivationNeeded(props?.vcMetadata.issuer);
const vcActionsList = [
{
label: props.vcMetadata.isPinned ? t('unPinCard') : t('pinCard'),
icon: SvgImage.OutlinedPinIcon(),
onPress: controller.PIN_CARD,
testID: 'pinOrUnPinCard',
},
{
label: t('viewActivityLog'),
icon: SvgImage.OutlinedScheduleIcon(),
onPress: controller.SHOW_ACTIVITY,
testID: 'viewActivityLog',
},
{
label: t('removeFromWallet'),
icon: SvgImage.outlinedDeleteIcon(),
onPress: () => controller.REMOVE(props.vcMetadata),
testID: 'removeFromWallet',
},
];
const share = {
label: t('share'),
icon: SvgImage.OutlinedShareIcon(),
onPress: loadScanScreen(VCShareFlowType.MINI_VIEW_SHARE),
testID: 'shareVcFromKebab',
};
const shareWithSelfieOption = {
label: t('shareWithSelfie'),
icon: SvgImage.OutlinedShareWithSelfieIcon(),
onPress: loadScanScreen(VCShareFlowType.MINI_VIEW_SHARE_WITH_SELFIE),
testID: 'shareVcWithSelfieFromKebab',
};
const VCActivationOption = {
label: activationNotCompleted
? t('WalletBinding:offlineAuthenticationDisabled')
: isActivationNeeded(props.vcMetadata.issuer)
? t('WalletBinding:profileAuthenticated')
: t('WalletBinding:credentialActivated'),
icon: SvgImage.OutlinedShieldedIcon(),
onPress: activationNotCompleted
? controller.ADD_WALLET_BINDING_ID
: loadScanScreen(VCShareFlowType.MINI_VIEW_QR_LOGIN),
testID: 'pendingActivationOrActivated',
};
if (props.vcMetadata.isVerified) {
vcActionsList.splice(1, 0, share);
if (props.vcHasImage) {
vcActionsList.splice(2, 0, shareWithSelfieOption, VCActivationOption);
}
}
return vcActionsList;
};