Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Inji-435): add telemetry events for vc activation flow #949

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6cbc8ee
refactor(INJI-435): add enum for flow type,end event status & interac…
PuBHARGAVI Oct 16, 2023
99b11f4
fix(INJI-435): change flow type value to camel case in getEventType f…
PuBHARGAVI Oct 17, 2023
f1ee71f
feat(INJI-435): add start,interact & impression events in vc activati…
PuBHARGAVI Oct 18, 2023
72b7e43
feat(INJI-435): add end,error events in vc activation flow
PuBHARGAVI Oct 18, 2023
6e78a8b
feat(INJI-435): increase the pressable area of kebab icon
PuBHARGAVI Oct 19, 2023
e071a19
feat: generate impression event only after going into otp modal & tra…
PuBHARGAVI Oct 19, 2023
cac4546
fix(INJI-435): resolve merge conflicts
PuBHARGAVI Oct 19, 2023
ed551f5
refactor(INJI-435): move sendImpression event from addVc modal to otp…
PuBHARGAVI Oct 19, 2023
62505c8
fix(INJI-435): add missing impression event in issuer machine
PuBHARGAVI Oct 19, 2023
733e2ad
refactor(INJI-435): return bindingAuthFailedError from state machines…
PuBHARGAVI Oct 20, 2023
86e7025
fix(INJI-435): add padding and fix the activation status overflow in …
PuBHARGAVI Oct 20, 2023
d1d275f
refactor(INJI-435): change the telemetry sdk path in package.json
PuBHARGAVI Oct 20, 2023
c9f4987
fix(INJI-435): resolve merge conflicts
PuBHARGAVI Oct 20, 2023
4147c0b
Merge remote-tracking branch 'upstream/develop' into inji-435-add-tel…
PuBHARGAVI Oct 25, 2023
3c049bc
refactor(INJI-435): extract esignetMosipVcItem and existingMosipVcIte…
PuBHARGAVI Oct 25, 2023
8b633ec
refactor(INJI-435): remove duplicate assignments of selectors
PuBHARGAVI Oct 25, 2023
c146b6d
Merge branch 'develop' into inji-435-add-telemetry-events-for-vc-acti…
swatigoel Oct 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fileignoreconfig:
- filename: package.json
checksum: fdd5905228a1afbfb004c710fd6c61adf073a12840200327c0592b76bea5e7e3
- filename: package-lock.json
checksum: fc26d97edecbacd0b7507032c6fc1acfcea9f01f5dbe66a2a0341506e2f0daca
checksum: 4515c3d663d9435eab0f56b75480c93c5209aa59befb2b71f2b3fe7c9051d80a
- filename: components/PasscodeVerify.tsx
checksum: 14654c0f038979fcd0d260170a45894a072f81e0767ca9a0e66935d33b5cc703
- filename: i18n.ts
Expand Down Expand Up @@ -58,3 +58,7 @@ fileignoreconfig:
checksum: 237a2640b7db70770d65da67c79f2929581e32f1162517e50b8d37e409f3387d
- filename: shared/cryptoutil/cryptoUtil.ts
checksum: b785ff3f01ab9530119072c4d38195048bfeee6155c54ea7dd031559acb722f3
- filename: machines/store.typegen.ts
checksum: 6d22bc5c77398316b943c512c208ce0846a9fff674c1ccac79e07f21962acd5f
- filename: machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts
checksum: 533785a3c8096ea93afc59c65025679c24d379e824e784e745ab298a0978cd2a
77 changes: 19 additions & 58 deletions components/KebabPopUpController.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {useSelector} from '@xstate/react';
import {ActorRefFrom} from 'xstate';
import {
ExistingMosipVCItemEvents,
ExistingMosipVCItemMachine,
selectBindingAuthFailedError,
selectEmptyWalletBindingId,
selectIsPinned,
Expand All @@ -15,22 +13,14 @@ import {
selectShowActivities,
selectShowWalletBindingError,
selectWalletBindingError,
} from '../machines/VCItemMachine/commonSelectors';
import {
ExistingMosipVCItemEvents,
ExistingMosipVCItemMachine,
} from '../machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine';

import {
EsignetMosipVCItemEvents,
EsignetMosipVCItemMachine,
selectEmptyWalletBindingId as esignetSelectEmptyWalletBindingId,
selectIsPinned as esignetSelectIsPinned,
selectKebabPopUp as esignetSelectKebabPopUp,
selectKebabPopUpAcceptingBindingOtp as esignetSelectKebabPopUpAcceptingBindingOtp,
selectKebabPopUpBindingWarning as esignetSelectKebabPopUpBindingWarning,
selectKebabPopUpWalletBindingInProgress as esignetSelectKebabPopUpWalletBindingInProgress,
selectOtpError as esignetSelectOtpError,
selectRemoveWalletWarning as esignetSelectRemoveWalletWarning,
selectShowActivities as esignetSelectShowActivities,
selectShowWalletBindingError as esignetSelectShowWalletBindingError,
selectWalletBindingError as esignetSelectWalletBindingError,
} from '../machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine';
import {selectActivities} from '../machines/activityLog';
import {GlobalContext} from '../shared/GlobalContext';
Expand All @@ -57,60 +47,31 @@ export function useKebabPopUp(props) {
const SHOW_ACTIVITY = () => service.send(vcEvents.SHOW_ACTIVITY());
const INPUT_OTP = (otp: string) => service.send(vcEvents.INPUT_OTP(otp));
const RESEND_OTP = () => service.send(vcEvents.RESEND_OTP());
let isPinned = useSelector(service, selectIsPinned);
let isBindingWarning = useSelector(service, selectKebabPopUpBindingWarning);
let isRemoveWalletWarning = useSelector(service, selectRemoveWalletWarning);
let isAcceptingOtpInput = useSelector(
const isPinned = useSelector(service, selectIsPinned);
const isBindingWarning = useSelector(service, selectKebabPopUpBindingWarning);
const isRemoveWalletWarning = useSelector(service, selectRemoveWalletWarning);
const isAcceptingOtpInput = useSelector(
service,
selectKebabPopUpAcceptingBindingOtp,
);
let isWalletBindingError = useSelector(service, selectShowWalletBindingError);
let otpError = useSelector(service, selectOtpError);
let walletBindingError = useSelector(service, selectWalletBindingError);
let bindingAuthFailedError = useSelector(
const isWalletBindingError = useSelector(
service,
selectShowWalletBindingError,
);
const otpError = useSelector(service, selectOtpError);
const walletBindingError = useSelector(service, selectWalletBindingError);
const bindingAuthFailedError = useSelector(
service,
selectBindingAuthFailedError,
);
let WalletBindingInProgress = useSelector(
const WalletBindingInProgress = useSelector(
service,
selectKebabPopUpWalletBindingInProgress,
);
let emptyWalletBindingId = useSelector(service, selectEmptyWalletBindingId);
let isKebabPopUp = useSelector(service, selectKebabPopUp);
let isShowActivities = useSelector(service, selectShowActivities);
const emptyWalletBindingId = useSelector(service, selectEmptyWalletBindingId);
const isKebabPopUp = useSelector(service, selectKebabPopUp);
const isShowActivities = useSelector(service, selectShowActivities);

if (props.vcMetadata.isFromOpenId4VCI()) {
isPinned = useSelector(service, esignetSelectIsPinned);
isBindingWarning = useSelector(
service,
esignetSelectKebabPopUpBindingWarning,
);
isRemoveWalletWarning = useSelector(
service,
esignetSelectRemoveWalletWarning,
);
isAcceptingOtpInput = useSelector(
service,
esignetSelectKebabPopUpAcceptingBindingOtp,
);
isWalletBindingError = useSelector(
service,
esignetSelectShowWalletBindingError,
);
otpError = useSelector(service, esignetSelectOtpError);
walletBindingError = useSelector(service, esignetSelectWalletBindingError);
bindingAuthFailedError = useSelector(service, selectBindingAuthFailedError);
WalletBindingInProgress = useSelector(
service,
esignetSelectKebabPopUpWalletBindingInProgress,
);
emptyWalletBindingId = useSelector(
service,
esignetSelectEmptyWalletBindingId,
);
isKebabPopUp = useSelector(service, esignetSelectKebabPopUp);
isShowActivities = useSelector(service, esignetSelectShowActivities);
}
const {appService} = useContext(GlobalContext);
const activityLogService = appService.children.get('activityLog');

Expand Down
29 changes: 10 additions & 19 deletions components/VC/MosipVCItem/VcItemController.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
import {useContext, useRef} from 'react';
import {GlobalContext} from '../../../shared/GlobalContext';
import {
createExistingMosipVCItemMachine,
ExistingMosipVCItemEvents,
selectContext,
selectEmptyWalletBindingId,
selectGeneratedOn,
selectIsSavingFailedInIdle,
selectKebabPopUp,
selectVerifiableCredential,
} from '../../../machines/VCItemMachine/commonSelectors';
import {
createExistingMosipVCItemMachine,
ExistingMosipVCItemEvents,
selectIsSavingFailedInIdle,
} from '../../../machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine';
import {
createEsignetMosipVCItemMachine,
EsignetMosipVCItemEvents,
selectContext as esignetSelectContext,
selectEmptyWalletBindingId as esignetSelectEmptyWalletBindingId,
selectGeneratedOn as esignetSelectGeneratedOn,
selectKebabPopUp as esignetSelectKebabPopUp,
selectVerifiableCredentials as esignetSelectVerifiableCredentials,
} from '../../../machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine';
import {useInterpret, useSelector} from '@xstate/react';
import {EsignetMosipVCItemProps, ExistingMosipVCItemProps} from './MosipVCItem';
Expand Down Expand Up @@ -50,19 +47,13 @@ export function useVcItemController(
const storeErrorTranslationPath = 'errors.savingFailed';
let generatedOn = useSelector(service, selectGeneratedOn);
if (props.vcMetadata.isFromOpenId4VCI()) {
context = useSelector(service, esignetSelectContext);
isKebabPopUp = useSelector(service, esignetSelectKebabPopUp);
generatedOn = useSelector(service, esignetSelectGeneratedOn);
emptyWalletBindingId = useSelector(
service,
esignetSelectEmptyWalletBindingId,
);
context = useSelector(service, selectContext);
PuBHARGAVI marked this conversation as resolved.
Show resolved Hide resolved
isKebabPopUp = useSelector(service, selectKebabPopUp);
generatedOn = useSelector(service, selectGeneratedOn);
emptyWalletBindingId = useSelector(service, selectEmptyWalletBindingId);
DISMISS = () => service.send(EsignetMosipVCItemEvents.DISMISS());
KEBAB_POPUP = () => service.send(EsignetMosipVCItemEvents.KEBAB_POPUP());
verifiableCredential = useSelector(
service,
esignetSelectVerifiableCredentials,
);
verifiableCredential = useSelector(service, selectVerifiableCredential);
}
return {
service,
Expand Down
4 changes: 3 additions & 1 deletion components/VidItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import {CheckBox} from 'react-native-elements';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {ActorRefFrom} from 'xstate';
import {
createExistingMosipVCItemMachine,
selectVerifiableCredential,
selectGeneratedOn,
} from '../machines/VCItemMachine/commonSelectors';
import {
createExistingMosipVCItemMachine,
selectId,
ExistingMosipVCItemMachine,
} from '../machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,88 +924,3 @@ export const createEsignetMosipVCItemMachine = (
vcMetadata,
});
};

type State = StateFrom<typeof EsignetMosipVCItemMachine>;

export function selectVerifiableCredentials(state: State) {
return state.context.verifiableCredential;
}

export function selectKebabPopUp(state: State) {
return state.matches('kebabPopUp');
}

export function selectContext(state: State) {
return state.context;
}

export function selectGeneratedOn(state: State) {
return state.context.generatedOn;
}

export function selectWalletBindingSuccess(state: State) {
return state.context.walletBindingSuccess;
}

export function selectEmptyWalletBindingId(state: State) {
var val = state.context.walletBindingResponse
? state.context.walletBindingResponse.walletBindingId
: undefined;
return val == undefined || val == null || val.length <= 0 ? true : false;
}

export function selectWalletBindingError(state: State) {
return state.context.walletBindingError;
}

export function selectBindingAuthFailedError(state: State) {
return state.context.bindingAuthFailedMessage;
}

export function selectKebabPopUpAcceptingBindingOtp(state: State) {
return state.matches('kebabPopUp.acceptingBindingOtp');
}

export function selectKebabPopUpShowWalletBindingError(state: State) {
return state.matches('kebabPopUp.showingWalletBindingError');
}

export function selectKebabPopUpWalletBindingInProgress(state: State) {
return state.matches('kebabPopUp.requestingBindingOtp') ||
state.matches('kebabPopUp.addingWalletBindingId') ||
state.matches('kebabPopUp.addKeyPair') ||
state.matches('kebabPopUp.updatingPrivateKey')
? true
: false;
}

export function selectKebabPopUpBindingWarning(state: State) {
return state.matches('kebabPopUp.showBindingWarning');
}

export function selectRemoveWalletWarning(state: State) {
return state.matches('kebabPopUp.removeWallet');
}

export function selectIsPinned(state: State) {
return state.context.isPinned;
}

export function selectOtpError(state: State) {
return state.context.otpError;
}

export function selectShowActivities(state: State) {
return state.matches('kebabPopUp.showActivities');
}

export function selectShowWalletBindingError(state: State) {
return (
state.matches('showingWalletBindingError') ||
state.matches('kebabPopUp.showingWalletBindingError')
);
}

export function selectLogoUrl(state: State) {
return state.context.logoUrl;
}
Loading