mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-07 20:53:54 -05:00
[Inji 434 & INJI 441]: Add events in receiver VC sharing flow and cancel button handle (#990)
* refactor(INJI-434): rename some variables and functions to meaning names Signed-off-by: Alka <prasadalka1998@gmail.com> * feat(INJI-434): add telemetry events in the VC share flow on verifier end Signed-off-by: Alka <prasadalka1998@gmail.com> * fix(INJI-434): handle cancel button press during vc share Signed-off-by: Alka <prasadalka1998@gmail.com> * fix(INJI-441): handle cancel button press during vc share Signed-off-by: Alka <prasadalka1998@gmail.com> * refactor(INJI-434): extracts telemetry constants to a seperate file Signed-off-by: Alka <prasadalka1998@gmail.com> * refactor(INJI-434): remove unused imports Signed-off-by: Alka <prasadalka1998@gmail.com> * fix(INJI-441): update the CANCEL event on press of cancel button Signed-off-by: Alka <prasadalka1998@gmail.com> * refactor(INJI-434): update the method name Signed-off-by: Alka <prasadalka1998@gmail.com> --------- Signed-off-by: Alka <prasadalka1998@gmail.com> Signed-off-by: Alka Prasad <Alka1703@users.noreply.github.com>
This commit is contained in:
@@ -58,6 +58,8 @@ fileignoreconfig:
|
||||
checksum: 6d22bc5c77398316b943c512c208ce0846a9fff674c1ccac79e07f21962acd5f
|
||||
- filename: machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts
|
||||
checksum: 10889302ca05646a283386be1bbe7a5fb510c02bb62a308ee45f3c2a872ae64e
|
||||
- filename: shared/telemetry/TelemetryConstants.js
|
||||
checksum: 9d9acf3981cbde452489eacbbd70ebaa0b853c1c04e9712fa71368c089a9662b
|
||||
- filename: .github/workflows/internal-build.yml
|
||||
checksum: 3a3b4dea51cb496729c4e568113fc19cf5b008481bb4a5d157f211a2128b951b
|
||||
- filename: .github/workflows/push-triggers.yml
|
||||
@@ -74,4 +76,5 @@ fileignoreconfig:
|
||||
checksum: a0686e9a5c006176fd720b84bc36ca947db1422caf65c90cd0c2d1102a9e96df
|
||||
- filename: ios/fastlane/Fastfile
|
||||
checksum: feea5a7f044ef6961d53e7d1e1ffb92a3e0f72761496424f6e64288e3718d605
|
||||
version: ""
|
||||
version: ""
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ import {PasscodeVerify} from '../components/PasscodeVerify';
|
||||
import {Column, Text} from '../components/ui';
|
||||
import {Theme} from '../components/ui/styleUtils';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getImpressionEventData,
|
||||
sendImpressionEvent,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export const Passcode: React.FC<PasscodeProps> = props => {
|
||||
useEffect(() => {
|
||||
|
||||
@@ -24,9 +24,9 @@ import i18n from '../i18n';
|
||||
import {parseMetadatas, VCMetadata} from '../shared/VCMetadata';
|
||||
import {
|
||||
getEndEventData,
|
||||
sendEndEvent,
|
||||
TelemetryConstants,
|
||||
sendEndEvent
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
import {API_URLS} from '../shared/api';
|
||||
import getAllConfigurations from '../shared/commonprops/commonProps';
|
||||
|
||||
|
||||
@@ -30,8 +30,9 @@ import {
|
||||
sendEndEvent,
|
||||
sendInteractEvent,
|
||||
sendStartEvent,
|
||||
TelemetryConstants,
|
||||
} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
import {API_URLS} from '../../../shared/api';
|
||||
|
||||
const model = createModel(
|
||||
|
||||
@@ -34,11 +34,12 @@ import {
|
||||
getEndEventData,
|
||||
getStartEventData,
|
||||
sendEndEvent,
|
||||
TelemetryConstants,
|
||||
sendInteractEvent,
|
||||
getInteractEventData,
|
||||
sendStartEvent,
|
||||
} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
import {API_URLS} from '../../../shared/api';
|
||||
|
||||
const model = createModel(
|
||||
|
||||
@@ -23,6 +23,17 @@ import {VerifierDataEvent} from 'react-native-tuvali/src/types/events';
|
||||
import {BLEError} from '../types';
|
||||
import Storage from '../../../shared/storage';
|
||||
import {VCMetadata} from '../../../shared/VCMetadata';
|
||||
import {
|
||||
getEndEventData,
|
||||
getErrorEventData,
|
||||
getImpressionEventData,
|
||||
getStartEventData,
|
||||
sendEndEvent,
|
||||
sendErrorEvent,
|
||||
sendImpressionEvent,
|
||||
sendStartEvent,
|
||||
} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryConstants';
|
||||
// import { verifyPresentation } from '../shared/vcjs/verifyPresentation';
|
||||
|
||||
const {verifier, EventTypes, VerificationStatus} = tuvali;
|
||||
@@ -107,7 +118,7 @@ export const requestMachine =
|
||||
},
|
||||
BLE_ERROR: {
|
||||
target: '.handlingBleError',
|
||||
actions: 'setBleError',
|
||||
actions: ['sendBLEConnectionErrorEvent', 'setBleError'],
|
||||
},
|
||||
RESET: {
|
||||
target: '.checkNearbyDevicesPermission',
|
||||
@@ -241,7 +252,11 @@ export const requestMachine =
|
||||
},
|
||||
CONNECTED: {
|
||||
target: 'waitingForVc',
|
||||
actions: ['setSenderInfo', 'setReceiverInfo'],
|
||||
actions: [
|
||||
'setSenderInfo',
|
||||
'setReceiverInfo',
|
||||
'sendVCReceivingStartEvent',
|
||||
],
|
||||
},
|
||||
|
||||
DISCONNECT: {
|
||||
@@ -256,6 +271,12 @@ export const requestMachine =
|
||||
initial: 'inProgress',
|
||||
states: {
|
||||
inProgress: {
|
||||
on: {
|
||||
CANCEL: {
|
||||
target: '#request.cancelling',
|
||||
actions: ['sendVCReceivingTerminatedEvent'],
|
||||
},
|
||||
},
|
||||
after: {
|
||||
SHARING_TIMEOUT: {
|
||||
target: '#request.waitingForVc.timeout',
|
||||
@@ -268,6 +289,7 @@ export const requestMachine =
|
||||
on: {
|
||||
CANCEL: {
|
||||
target: '#request.cancelling',
|
||||
actions: 'sendVCReceiveFlowTimeoutEndEvent',
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -275,6 +297,7 @@ export const requestMachine =
|
||||
on: {
|
||||
DISCONNECT: {
|
||||
target: 'disconnected',
|
||||
actions: ['sendVCReceivingDisconnectedEvent'],
|
||||
},
|
||||
VC_RECEIVED: {
|
||||
target: 'reviewing.accepting',
|
||||
@@ -300,7 +323,10 @@ export const requestMachine =
|
||||
},
|
||||
FACE_INVALID: {
|
||||
target: 'invalidIdentity',
|
||||
actions: 'setReceiveLogTypeUnverified',
|
||||
actions: [
|
||||
'setReceiveLogTypeUnverified',
|
||||
'sendVCReceiveFailedEvent',
|
||||
],
|
||||
},
|
||||
CANCEL: {
|
||||
target: 'idle',
|
||||
@@ -394,6 +420,7 @@ export const requestMachine =
|
||||
'sendVcReceived',
|
||||
'setReceiveLogTypeRegular',
|
||||
'logReceived',
|
||||
'sendVCReceiveSuccessEvent',
|
||||
],
|
||||
invoke: {
|
||||
src: 'sendVcResponse',
|
||||
@@ -408,7 +435,11 @@ export const requestMachine =
|
||||
},
|
||||
},
|
||||
rejected: {
|
||||
entry: ['setReceiveLogTypeDiscarded', 'logReceived'],
|
||||
entry: [
|
||||
'setReceiveLogTypeDiscarded',
|
||||
'logReceived',
|
||||
'sendVCReceiveRejectedEvent',
|
||||
],
|
||||
invoke: {
|
||||
src: 'sendVcResponse',
|
||||
data: {
|
||||
@@ -452,7 +483,11 @@ export const requestMachine =
|
||||
},
|
||||
savingFailed: {
|
||||
initial: 'idle',
|
||||
entry: ['setReceiveLogTypeDiscarded', 'logReceived'],
|
||||
entry: [
|
||||
'setReceiveLogTypeDiscarded',
|
||||
'logReceived',
|
||||
'sendVCReceiveRejectedEvent',
|
||||
],
|
||||
invoke: {
|
||||
src: 'sendVcResponse',
|
||||
data: {
|
||||
@@ -672,6 +707,98 @@ export const requestMachine =
|
||||
shouldVerifyPresence: false,
|
||||
}),
|
||||
}),
|
||||
|
||||
sendVCReceivingStartEvent: () => {
|
||||
sendStartEvent(
|
||||
getStartEventData(TelemetryConstants.FlowType.receiverVcShare),
|
||||
);
|
||||
sendImpressionEvent(
|
||||
getImpressionEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
TelemetryConstants.Screens.sharingInProgressScreen,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
sendVCReceiveFlowTimeoutEndEvent: () => {
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
TelemetryConstants.EndEventStatus.failure,
|
||||
{comment: 'VC sharing timeout'},
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
sendVCReceiveSuccessEvent: () => {
|
||||
sendImpressionEvent(
|
||||
getImpressionEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
TelemetryConstants.Screens.vcReceivedSuccessPage,
|
||||
),
|
||||
);
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
TelemetryConstants.EndEventStatus.success,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
sendVCReceiveFailedEvent: () => {
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
TelemetryConstants.EndEventStatus.failure,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
sendBLEConnectionErrorEvent: (_, event) => {
|
||||
sendErrorEvent(
|
||||
getErrorEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
event.bleError.code,
|
||||
event.bleError.message,
|
||||
),
|
||||
);
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
TelemetryConstants.EndEventStatus.failure,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
sendVCReceiveRejectedEvent: () => {
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
TelemetryConstants.EndEventStatus.failure,
|
||||
{comment: 'VC Rejected by the verifier'},
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
sendVCReceivingTerminatedEvent: () => {
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
TelemetryConstants.EndEventStatus.failure,
|
||||
{comment: 'Verifier Disconnected'},
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
sendVCReceivingDisconnectedEvent: () => {
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.receiverVcShare,
|
||||
TelemetryConstants.EndEventStatus.failure,
|
||||
{comment: 'VC Sharing cancelled by sender'},
|
||||
),
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
services: {
|
||||
@@ -763,6 +890,7 @@ export const requestMachine =
|
||||
},
|
||||
|
||||
monitorConnection: () => callback => {
|
||||
const verifierErrorCodePrefix = 'TVV';
|
||||
const subscription = verifier.handleDataEvents(event => {
|
||||
if (event.type === EventTypes.onDisconnected) {
|
||||
callback({type: 'DISCONNECT'});
|
||||
@@ -770,7 +898,7 @@ export const requestMachine =
|
||||
|
||||
if (
|
||||
event.type === EventTypes.onError &&
|
||||
event.code.includes('TVV')
|
||||
event.code.includes(verifierErrorCodePrefix)
|
||||
) {
|
||||
callback({
|
||||
type: 'BLE_ERROR',
|
||||
|
||||
@@ -44,12 +44,13 @@ import {
|
||||
getEndEventData,
|
||||
sendStartEvent,
|
||||
sendEndEvent,
|
||||
TelemetryConstants,
|
||||
sendImpressionEvent,
|
||||
getImpressionEventData,
|
||||
sendErrorEvent,
|
||||
getErrorEventData,
|
||||
} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
import {logState} from '../../../shared/commonUtil';
|
||||
|
||||
const {wallet, EventTypes, VerificationStatus} = tuvali;
|
||||
@@ -401,12 +402,12 @@ export const scanMachine =
|
||||
{
|
||||
target: 'connecting',
|
||||
cond: 'isOpenIdQr',
|
||||
actions: ['sendTelemetryStartEvent', 'setUri'],
|
||||
actions: ['sendVcSharingStartEvent', 'setUri'],
|
||||
},
|
||||
{
|
||||
target: 'showQrLogin',
|
||||
cond: 'isQrLogin',
|
||||
actions: ['sendTelemetryStartEvent', 'setLinkCode'],
|
||||
actions: ['sendVcSharingStartEvent', 'setLinkCode'],
|
||||
},
|
||||
{
|
||||
target: 'invalid',
|
||||
@@ -527,6 +528,12 @@ export const scanMachine =
|
||||
initial: 'inProgress',
|
||||
states: {
|
||||
inProgress: {
|
||||
on: {
|
||||
CANCEL: {
|
||||
target: '#scan.reviewing.cancelling',
|
||||
actions: ['sendVCShareFlowCancelEndEvent'],
|
||||
},
|
||||
},
|
||||
after: {
|
||||
SHARING_TIMEOUT: {
|
||||
target: '#scan.reviewing.sendingVc.timeout',
|
||||
@@ -911,13 +918,13 @@ export const scanMachine =
|
||||
sendVcShareSuccessEvent: () => {
|
||||
sendImpressionEvent(
|
||||
getImpressionEventData(
|
||||
TelemetryConstants.FlowType.vcShare,
|
||||
TelemetryConstants.FlowType.senderVcShare,
|
||||
TelemetryConstants.Screens.vcShareSuccessPage,
|
||||
),
|
||||
);
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.vcShare,
|
||||
TelemetryConstants.FlowType.senderVcShare,
|
||||
TelemetryConstants.EndEventStatus.success,
|
||||
),
|
||||
);
|
||||
@@ -926,26 +933,26 @@ export const scanMachine =
|
||||
sendBLEConnectionErrorEvent: (context, event) => {
|
||||
sendErrorEvent(
|
||||
getErrorEventData(
|
||||
TelemetryConstants.FlowType.vcShare,
|
||||
TelemetryConstants.FlowType.senderVcShare,
|
||||
event.bleError.code,
|
||||
event.bleError.message,
|
||||
),
|
||||
);
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.vcShare,
|
||||
TelemetryConstants.FlowType.senderVcShare,
|
||||
TelemetryConstants.EndEventStatus.failure,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
sendTelemetryStartEvent: () => {
|
||||
sendVcSharingStartEvent: () => {
|
||||
sendStartEvent(
|
||||
getStartEventData(TelemetryConstants.FlowType.vcShare),
|
||||
getStartEventData(TelemetryConstants.FlowType.senderVcShare),
|
||||
);
|
||||
sendImpressionEvent(
|
||||
getImpressionEventData(
|
||||
TelemetryConstants.FlowType.vcShare,
|
||||
TelemetryConstants.FlowType.senderVcShare,
|
||||
TelemetryConstants.Screens.scanScreen,
|
||||
),
|
||||
);
|
||||
@@ -954,7 +961,7 @@ export const scanMachine =
|
||||
sendVCShareFlowCancelEndEvent: () => {
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.vcShare,
|
||||
TelemetryConstants.FlowType.senderVcShare,
|
||||
TelemetryConstants.EndEventStatus.cancel,
|
||||
{comment: 'User cancelled VC share'},
|
||||
),
|
||||
@@ -964,7 +971,7 @@ export const scanMachine =
|
||||
sendVCShareFlowTimeoutEndEvent: () => {
|
||||
sendEndEvent(
|
||||
getEndEventData(
|
||||
TelemetryConstants.FlowType.vcShare,
|
||||
TelemetryConstants.FlowType.senderVcShare,
|
||||
TelemetryConstants.EndEventStatus.failure,
|
||||
{comment: 'VC sharing timeout'},
|
||||
),
|
||||
@@ -1019,13 +1026,14 @@ export const scanMachine =
|
||||
},
|
||||
|
||||
monitorConnection: () => callback => {
|
||||
const walletErrorCodePrefix = 'TVW';
|
||||
const subscription = wallet.handleDataEvents(event => {
|
||||
if (event.type === EventTypes.onDisconnected) {
|
||||
callback({type: 'DISCONNECT'});
|
||||
}
|
||||
if (
|
||||
event.type === EventTypes.onError &&
|
||||
event.code.includes('TVW')
|
||||
event.code.includes(walletErrorCodePrefix)
|
||||
) {
|
||||
callback({
|
||||
type: 'BLE_ERROR',
|
||||
|
||||
@@ -31,12 +31,13 @@ import {
|
||||
} from '../shared/openId4VCI/Utils';
|
||||
import {VCMetadata} from '../shared/VCMetadata';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getEndEventData,
|
||||
getImpressionEventData,
|
||||
sendEndEvent,
|
||||
sendImpressionEvent,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
|
||||
import {
|
||||
CredentialWrapper,
|
||||
VerifiableCredential,
|
||||
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
getInteractEventData,
|
||||
sendInteractEvent,
|
||||
sendStartEvent,
|
||||
TelemetryConstants,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export const AuthScreen: React.FC<RootRouteProps> = props => {
|
||||
const {t} = useTranslation('AuthScreen');
|
||||
|
||||
@@ -25,8 +25,8 @@ import {
|
||||
getImpressionEventData,
|
||||
getEndEventData,
|
||||
sendEndEvent,
|
||||
TelemetryConstants,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export function useAuthScreen(props: RootRouteProps) {
|
||||
const {appService} = useContext(GlobalContext);
|
||||
|
||||
@@ -8,11 +8,11 @@ import {RootRouteProps} from '../routes';
|
||||
import {useBiometricScreen} from './BiometricScreenController';
|
||||
import {Passcode} from '../components/Passcode';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getEventType,
|
||||
incrementRetryCount,
|
||||
resetRetryCount,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export const BiometricScreen: React.FC<RootRouteProps> = props => {
|
||||
const {t} = useTranslation('BiometricScreen');
|
||||
|
||||
@@ -26,9 +26,10 @@ import {
|
||||
sendEndEvent,
|
||||
sendInteractEvent,
|
||||
sendStartEvent,
|
||||
TelemetryConstants,
|
||||
resetRetryCount,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
|
||||
import {isAndroid} from '../shared/constants';
|
||||
|
||||
export function useBiometricScreen(props: RootRouteProps) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import {OtpVerificationModal} from './OtpVerificationModal';
|
||||
import {IdInputModal} from './IdInputModal';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
import {GET_INDIVIDUAL_ID} from '../../../shared/constants';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export const AddVcModal: React.FC<AddVcModalProps> = props => {
|
||||
const {t} = useTranslation('AddVcModal');
|
||||
|
||||
@@ -17,8 +17,9 @@ import {
|
||||
getInteractEventData,
|
||||
sendErrorEvent,
|
||||
sendInteractEvent,
|
||||
TelemetryConstants,
|
||||
} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
import {API_URLS} from '../../../shared/api';
|
||||
|
||||
const model = createModel(
|
||||
|
||||
@@ -4,7 +4,7 @@ import {useGetVcModal, GetVcModalProps} from './GetVcModalController';
|
||||
import {OtpVerificationModal} from './OtpVerificationModal';
|
||||
import {GetIdInputModal} from './GetIdInputModal';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export const GetVcModal: React.FC<GetVcModalProps> = props => {
|
||||
const {t} = useTranslation('GetVcModal');
|
||||
|
||||
@@ -6,18 +6,19 @@ import {ModalProps, Modal} from '../../../components/ui/Modal';
|
||||
import {Theme} from '../../../components/ui/styleUtils';
|
||||
import {Image, TouchableOpacity} from 'react-native';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getImpressionEventData,
|
||||
incrementRetryCount,
|
||||
resetRetryCount,
|
||||
sendImpressionEvent,
|
||||
} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryConstants';
|
||||
import {MessageOverlay} from '../../../components/MessageOverlay';
|
||||
import {
|
||||
OtpVerificationModalProps,
|
||||
useOtpVerificationModal,
|
||||
} from './OtpVerificationModalController';
|
||||
|
||||
|
||||
export const OtpVerificationModal: React.FC<
|
||||
OtpVerificationModalProps
|
||||
> = props => {
|
||||
|
||||
@@ -13,12 +13,12 @@ import {ExistingMosipVCItemMachine} from '../../../machines/VCItemMachine/Existi
|
||||
import testIDProps from '../../../shared/commonUtil';
|
||||
import {VCMetadata} from '../../../shared/VCMetadata';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getEndEventData,
|
||||
getErrorEventData,
|
||||
sendEndEvent,
|
||||
sendErrorEvent,
|
||||
} from '../../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export const WalletBinding: React.FC<WalletBindingProps> = props => {
|
||||
const controller = useKebabPopUp(props);
|
||||
|
||||
@@ -16,10 +16,11 @@ import {groupBy} from '../../shared/javascript';
|
||||
import {VcItemContainer} from '../../components/VC/VcItemContainer';
|
||||
import {BannerNotification} from '../../components/BannerNotification';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getErrorEventData,
|
||||
sendErrorEvent,
|
||||
} from '../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
import {Error} from '../../components/ui/Error';
|
||||
|
||||
const pinIconProps = {iconName: 'pushpin', iconType: 'antdesign'};
|
||||
|
||||
@@ -12,12 +12,12 @@ import {OtpVerificationModal} from './MyVcs/OtpVerificationModal';
|
||||
import {BindingVcWarningOverlay} from './MyVcs/BindingVcWarningOverlay';
|
||||
import {VcDetailsContainer} from '../../components/VC/VcDetailsContainer';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getEndEventData,
|
||||
getErrorEventData,
|
||||
sendEndEvent,
|
||||
sendErrorEvent,
|
||||
} from '../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export const ViewVcModal: React.FC<ViewVcModalProps> = props => {
|
||||
const {t} = useTranslation('ViewVcModal');
|
||||
|
||||
@@ -17,12 +17,12 @@ import {
|
||||
Protocols,
|
||||
} from '../../shared/openId4VCI/Utils';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getInteractEventData,
|
||||
getStartEventData,
|
||||
sendInteractEvent,
|
||||
sendStartEvent,
|
||||
} from '../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../shared/telemetry/TelemetryConstants';
|
||||
import {Icon} from 'react-native-elements';
|
||||
|
||||
export const IssuersScreen: React.FC<
|
||||
|
||||
@@ -10,7 +10,6 @@ import {usePasscodeScreen} from './PasscodeScreenController';
|
||||
import {hashData} from '../shared/commonUtil';
|
||||
import {argon2iConfig} from '../shared/constants';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getEndEventData,
|
||||
getEventType,
|
||||
getImpressionEventData,
|
||||
@@ -18,6 +17,8 @@ import {
|
||||
sendEndEvent,
|
||||
sendImpressionEvent,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
|
||||
import {BackHandler} from 'react-native';
|
||||
import {incrementRetryCount} from '../shared/telemetry/TelemetryUtils';
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ import {
|
||||
import {PasscodeRouteProps} from '../routes';
|
||||
import {GlobalContext} from '../shared/GlobalContext';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getEndEventData,
|
||||
getEventType,
|
||||
sendEndEvent,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export function usePasscodeScreen(props: PasscodeRouteProps) {
|
||||
const {appService} = useContext(GlobalContext);
|
||||
|
||||
@@ -110,6 +110,7 @@ export function useScanLayout() {
|
||||
statusOverlay = {
|
||||
title: t('status.inProgress'),
|
||||
progress: true,
|
||||
onButtonPress: CANCEL,
|
||||
};
|
||||
} else if (isConnectingTimeout) {
|
||||
statusOverlay = {
|
||||
@@ -144,6 +145,7 @@ export function useScanLayout() {
|
||||
title: t('status.sharing.title'),
|
||||
hint: t('status.sharing.hint'),
|
||||
progress: true,
|
||||
onButtonPress: CANCEL,
|
||||
};
|
||||
} else if (isSendingVcTimeout) {
|
||||
statusOverlay = {
|
||||
|
||||
@@ -14,10 +14,10 @@ import {VcItemContainer} from '../../components/VC/VcItemContainer';
|
||||
import {VCMetadata} from '../../shared/VCMetadata';
|
||||
import {createEsignetMosipVCItemMachine} from '../../machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine';
|
||||
import {
|
||||
TelemetryConstants,
|
||||
getImpressionEventData,
|
||||
sendImpressionEvent,
|
||||
} from '../../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export const SendVcScreen: React.FC = () => {
|
||||
const {t} = useTranslation('SendVcScreen');
|
||||
@@ -50,7 +50,7 @@ export const SendVcScreen: React.FC = () => {
|
||||
useEffect(() => {
|
||||
sendImpressionEvent(
|
||||
getImpressionEventData(
|
||||
TelemetryConstants.FlowType.vcShare,
|
||||
TelemetryConstants.FlowType.senderVcShare,
|
||||
TelemetryConstants.Screens.vcList,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -18,8 +18,8 @@ import {
|
||||
getInteractEventData,
|
||||
sendInteractEvent,
|
||||
sendStartEvent,
|
||||
TelemetryConstants,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
|
||||
export function useWelcomeScreen(props: RootRouteProps) {
|
||||
const {appService} = useContext(GlobalContext);
|
||||
|
||||
54
shared/telemetry/TelemetryConstants.js
Normal file
54
shared/telemetry/TelemetryConstants.js
Normal file
@@ -0,0 +1,54 @@
|
||||
export const TelemetryConstants = {
|
||||
FlowType: Object.freeze({
|
||||
vcDownload: 'VC Download',
|
||||
qrLogin: 'QR Login',
|
||||
senderVcShare: 'Sender VC Share',
|
||||
receiverVcShare: 'Receiver VC Share',
|
||||
vcActivation: 'VC Activation',
|
||||
vcActivationFromKebab: 'VC Activation from kebab popup',
|
||||
appOnboarding: 'App Onboarding',
|
||||
appLogin: 'App Login',
|
||||
vcLockOrRevoke: 'VC Lock / VC Revoke',
|
||||
getVcUsingAid: 'Get VC using AID',
|
||||
}),
|
||||
|
||||
EndEventStatus: Object.freeze({
|
||||
success: 'SUCCESS',
|
||||
cancel: 'CANCEL',
|
||||
failure: 'FAILURE',
|
||||
}),
|
||||
|
||||
InteractEventSubtype: Object.freeze({
|
||||
click: 'CLICK',
|
||||
}),
|
||||
|
||||
ErrorMessage: Object.freeze({
|
||||
authenticationCancelled: 'Authentication Cancelled',
|
||||
passcodeDidNotMatch: 'Pass code did not match',
|
||||
resendOtp: 'Otp is requested multiple times',
|
||||
hardwareKeyStore:
|
||||
'Some security features will be unavailable as hardware key store is not available',
|
||||
activationCancelled: 'Activation Cancelled',
|
||||
}),
|
||||
|
||||
ErrorId: Object.freeze({
|
||||
mismatch: 'MISMATCH',
|
||||
doesNotExist: 'DOES_NOT_EXIST',
|
||||
userCancel: 'USER_CANCEL',
|
||||
resend: 'RESEND',
|
||||
activationFailed: 'ACTIVATION_FAILED',
|
||||
}),
|
||||
|
||||
Screens: Object.freeze({
|
||||
home: 'Home',
|
||||
passcode: 'Passcode',
|
||||
webViewPage: 'Web View Page',
|
||||
otpVerificationModal: 'Otp Verification Modal',
|
||||
issuerList: 'Issuer List',
|
||||
scanScreen: 'Scan Screen',
|
||||
sharingInProgressScreen: 'Sharing in Progress',
|
||||
vcList: 'VC List',
|
||||
vcShareSuccessPage: 'VC Successfully Shared Page',
|
||||
vcReceivedSuccessPage: 'VC Successfully Received Page',
|
||||
}),
|
||||
};
|
||||
@@ -13,6 +13,7 @@ import {OBSRV_HOST} from 'react-native-dotenv';
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
import {isHardwareKeystoreExists} from '../cryptoutil/cryptoUtil';
|
||||
import * as RNLocalize from 'react-native-localize';
|
||||
import {TelemetryConstants} from './TelemetryConstants';
|
||||
|
||||
export function sendStartEvent(data) {
|
||||
telemetry.start({}, '', '', data, {});
|
||||
@@ -180,60 +181,3 @@ const languageCodeMap = {
|
||||
kn: 'Kannada',
|
||||
ta: 'Tamil',
|
||||
};
|
||||
export const TelemetryConstants = {
|
||||
FlowType: Object.freeze({
|
||||
vcDownload: 'VC Download',
|
||||
qrLogin: 'QR Login',
|
||||
vcShare: 'VC Share',
|
||||
vcActivation: 'VC Activation',
|
||||
vcActivationFromKebab: 'VC Activation from kebab popup',
|
||||
appOnboarding: 'App Onboarding',
|
||||
appLogin: 'App Login',
|
||||
vcLockOrRevoke: 'VC Lock / VC Revoke',
|
||||
getVcUsingAid: 'Get VC using AID',
|
||||
}),
|
||||
|
||||
EndEventStatus: Object.freeze({
|
||||
success: 'SUCCESS',
|
||||
cancel: 'CANCEL',
|
||||
failure: 'FAILURE',
|
||||
}),
|
||||
|
||||
InteractEventSubtype: Object.freeze({
|
||||
click: 'CLICK',
|
||||
}),
|
||||
|
||||
ErrorMessage: Object.freeze({
|
||||
authenticationCancelled: 'Authentication Cancelled',
|
||||
passcodeDidNotMatch: 'Pass code did not match',
|
||||
resendOtp: 'Otp is requested multiple times',
|
||||
hardwareKeyStore:
|
||||
'Some security features will be unavailable as hardware key store is not available',
|
||||
activationCancelled: 'Activation Cancelled',
|
||||
appWasReset:
|
||||
'Due to the fingerprint / facial recognition update, app security was impacted, and downloaded cards were removed. Please download again',
|
||||
vcsAreTampered:
|
||||
'Tampered cards detected and removed for security reasons. Please download again',
|
||||
}),
|
||||
|
||||
ErrorId: Object.freeze({
|
||||
mismatch: 'MISMATCH',
|
||||
doesNotExist: 'DOES_NOT_EXIST',
|
||||
userCancel: 'USER_CANCEL',
|
||||
resend: 'RESEND',
|
||||
activationFailed: 'ACTIVATION_FAILED',
|
||||
appWasReset: 'APP_WAS_RESET',
|
||||
vcsAreTampered: 'VCS_ARE_TAMPERED',
|
||||
}),
|
||||
|
||||
Screens: Object.freeze({
|
||||
home: 'Home',
|
||||
passcode: 'Passcode',
|
||||
webViewPage: 'Web View Page',
|
||||
otpVerificationModal: 'Otp Verification Modal',
|
||||
issuerList: 'Issuer List',
|
||||
scanScreen: 'Scan Screen',
|
||||
vcList: 'VC List',
|
||||
vcShareSuccessPage: 'VC Successfully Shared Page',
|
||||
}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user