Skip to content

Commit

Permalink
[Injimob-1067] fix the search bar issues (#1380)
Browse files Browse the repository at this point in the history
* [INJIMOB-1067]: delete vc from VCS context when deleted from kebab popup

Signed-off-by: Pooja Babusingh <[email protected]>

* [INJIMOB-1067]: rename myVcs to myVcsMetadata and receievedVcs to receievedVcsMetadata

Signed-off-by: Pooja Babusingh <[email protected]>
Co-authored-by: PuBHARGAVI <[email protected]>

* [INJIMOB-1067]: add seperate context variable to store myVcs and receivedVcs data

Signed-off-by: Pooja Babusingh <[email protected]>
Co-authored-by: PuBHARGAVI <[email protected]>

* [INJIMOB-1067]: add check for tampered vcs and reeceived cards

Signed-off-by: Pooja Babusingh <[email protected]>
Co-authored-by: PuBHARGAVI <[email protected]>

* [INJIMOB-1067] move tamperedVcs state into ready state in vcMetaMachine

Signed-off-by: PuBHARGAVI <[email protected]>

* [INJIMOB-1067]: fix selector for tampered VCs

Signed-off-by: Pooja Babusingh <[email protected]>

* [INJIMOB-1067] pass myvcs and received vcs metadata to store to fetch their data from the file storage

Signed-off-by: PuBHARGAVI <[email protected]>

* [INJIMOB-1067] store tampered vcs list in vcMeta machine to check if it is downloaded or tampered vc

Signed-off-by: PuBHARGAVI <[email protected]>

* [INJIMOB-1067] remove unused actions in vcItem and vcMeta machines

Signed-off-by: PuBHARGAVI <[email protected]>

* [INJIMOB-1067] reset search bar input every time we come into myvcs tab screen and refresh the filtered list if one of the filtered vc is removed

Signed-off-by: PuBHARGAVI <[email protected]>

* [INJIMOB-1067] remove unnecessary remove vc from myvcs action in vcItemMachine as we are already refreshing the vcs when delete it

Signed-off-by: PuBHARGAVI <[email protected]>

* [INJIMOB-1067] remoe unused context variable in vcMeta machine

Signed-off-by: PuBHARGAVI <[email protected]>

---------

Signed-off-by: Pooja Babusingh <[email protected]>
Signed-off-by: PuBHARGAVI <[email protected]>
Co-authored-by: Pooja Babusingh <[email protected]>
  • Loading branch information
PuBHARGAVI and PoojaBabusingh authored Apr 17, 2024
1 parent 636a8a9 commit 5d3301c
Show file tree
Hide file tree
Showing 10 changed files with 412 additions and 326 deletions.
16 changes: 9 additions & 7 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ fileignoreconfig:
checksum: ba3041b2ce380f44f6f52dc2c3df337d857df4494bd3c8727df9bf6fb5734750
- filename: shared/cryptoutil/cryptoUtil.ts
checksum: adbc2ff6df1df412e891c988c9ba03fc82f66c2f6c64339f87d513fc835d14cc
- filename: machines/store.typegen.ts
checksum: 6d22bc5c77398316b943c512c208ce0846a9fff674c1ccac79e07f21962acd5f
- filename: shared/telemetry/TelemetryConstants.js
checksum: fd8dc3a69cdef68855dc5f0531d8e634bfa2621bb4dc22f85b8247512a349c4c
- filename: shared/telemetry/TelemetryUtils.js
Expand All @@ -61,8 +59,6 @@ fileignoreconfig:
checksum: 8563a194a4d38814eff670f0652d1a7af77134cafb350462174b4f147dbd890d
- filename: assets/fingerprint_icon.svg
checksum: b2d3a50ca1336f60123d96a8cc8ea663c3316ed2d8c31833bce7e393ca51695b
- filename: machines/store.ts
checksum: aa2026ff278e489814ac308b49b08db4a14b08388c380230eb1e39c7adc01293
- filename: assets/Flip_Camera_Icon.svg
checksum: 736b5a7ddb86bd4376229ce198dbf8a663e7ac89fc3311bd4f19afd4a2b36ffd
- filename: assets/Finger_Print_Icon.svg
Expand Down Expand Up @@ -151,8 +147,6 @@ fileignoreconfig:
checksum: e93f988415bf91064e2cf5fbc09ff6c7226798baa5da721fa0715d5d0d6afddf
- filename: ios/Podfile.lock
checksum: c8f330a55ad911e59921215bf7d086db3dbdb5eab28202b3b450d780498ea880
- filename: screens/Home/MyVcsTab.tsx
checksum: 8133e2fefddfd0207eb7207b660d317f9a6acafbab6a65762d29ea86e33787cb
- filename: components/BackupAndRestoreBannerNotification.tsx
checksum: e465a9947727687d784d0cb9d8db1e28f765b0659bf4a3aa6d75643aa7b14102
- filename: components/ActivityLogEvent.ts
Expand Down Expand Up @@ -221,6 +215,8 @@ fileignoreconfig:
checksum: cc2798f843b776e70d957a4f7cdf47e199a29d9f6547fb9f59753108e8f252fa
- filename: machines/auth.ts
checksum: 46195ee93f9b7ac6794a06eeef5dee5ea242047a557af8bf95df04e1343d7b9e
- filename: machines/auth.typegen.ts
checksum: 53be3eb5ec658fccc2764a5e8b0a9992c5c2b86f70ccb122c6cf6fba50f0d0f8
- filename: shared/commonUtil.generated.test.ts
checksum: 4ca5983bb133f8f02bfd52fd0cc49ce37b24b164f3ca78a03ad97bb353ed00a4
- filename: __mocks__/en.mock.json
Expand All @@ -240,5 +236,11 @@ fileignoreconfig:
- filename: machines/IssuersMachine.typegen.ts
checksum: 959fef1e51f0f3d5b12933f7b362e96401fb776ab12f0d13c6e542918b2ff255
- filename: screens/Home/MyVcsTab.tsx
checksum: 4e94bbbd0fe486108a4612e461ae1066fe0c2f44187549158d6369b51a1ba055
checksum: 2dd6ce0466bf3a371e4a3fcc5a7f35e6c71f1668ce1e0572e5aa7a2b1f00fd72
- filename: machines/store.ts
checksum: 77bb25f9453169870496a15b7daa0a8094798895b70e3904e227a214ef4a1fec
- filename: machines/store.typegen.ts
checksum: 46f3a7c2d15ed03fc70e27ecae5a12c128011c49913b35cdb8edba12b1a999db
- filename: machines/VerifiableCredential/VCMetaMachine/VCMetaMachine.ts
checksum: c80ba680932ae3af7d1238f4db0b3f5e12c343c79335f0cd235f40068bbc03cb
version: ""
19 changes: 2 additions & 17 deletions machines/VerifiableCredential/VCItemMachine/VCItemActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ export const VCItemActions = model => {
to: context => context.serviceRefs.vcMeta,
},
),
requestStoredContext: send(
(context: any) => {
return StoreEvents.GET(
VCMetadata.fromVC(context.vcMetadata).getVcKey(),
);
},
{
to: context => context.serviceRefs.store,
},
),
setContext: model.assign((context, event) => {
return {
...context,
Expand Down Expand Up @@ -171,12 +161,6 @@ export const VCItemActions = model => {
to: (context: any) => context.serviceRefs.vcMeta,
},
),
sendTamperedVc: send(
(context: any) => VcMetaEvents.TAMPERED_VC(context.vcMetadata),
{
to: context => context.serviceRefs.vcMeta,
},
),
setErrorAsWalletBindingError: assign({
error: () =>
i18n.t('errors.genericError', {
Expand Down Expand Up @@ -326,11 +310,12 @@ export const VCItemActions = model => {
(context: any) => {
return StoreEvents.REMOVE(
MY_VCS_STORE_KEY,
context.vcMetadata.getVcKey(),
VCMetadata.fromVC(context.vcMetadata).getVcKey(),
);
},
{to: context => context.serviceRefs.store},
),

setVcKey: model.assign({
vcMetadata: (_, event) => event.vcMetadata,
}),
Expand Down
21 changes: 3 additions & 18 deletions machines/VerifiableCredential/VCItemMachine/VCItemMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,13 @@ export const VCItemMachine = model.createMachine(
cond: 'hasCredential',
target: `#vc-item-machine.idle`,
},
{
target: 'loadVcFromStore',
},
],
},
},
loadVcFromStore: {
entry: 'requestStoredContext',
description: 'Check if VC data is in secured local storage.',
on: {
STORE_RESPONSE: [
{
actions: ['setContext', 'storeVcInContext'],
cond: 'hasCredential',
target: '#vc-item-machine.idle',
},
{
actions: 'addVcToInProgressDownloads',
target: 'loadVcFromServer',
},
],
TAMPERED_VC: {
actions: 'sendTamperedVc',
target: '#vc-item-machine.idle',
},
},
},
Expand Down Expand Up @@ -252,7 +236,8 @@ export const VCItemMachine = model.createMachine(
invoke: {
src: 'requestBindingOTP',
onDone: {
target: '#vc-item-machine.walletBinding.acceptingBindingOTP',
target:
'#vc-item-machine.walletBinding.acceptingBindingOTP',
actions: ['setCommunicationDetails'],
},
onError: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,13 @@ export interface Typegen0 {
| 'removeVcItem'
| 'removeVcMetaDataFromStorage'
| 'removeVcMetaDataFromVcMachineContext'
| 'requestStoredContext'
| 'requestVcContext'
| 'resetIsMachineInKebabPopupState'
| 'resetPrivateKey'
| 'sendActivationStartEvent'
| 'sendActivationSuccessEvent'
| 'sendBackupEvent'
| 'sendDownloadLimitExpire'
| 'sendTamperedVc'
| 'sendTelemetryEvents'
| 'sendUserCancelledActivationFailedEndEvent'
| 'sendVcUpdated'
Expand Down Expand Up @@ -186,7 +184,7 @@ export interface Typegen0 {
| 'verifyCredential';
};
eventsCausingActions: {
addVcToInProgressDownloads: 'STORE_RESPONSE';
addVcToInProgressDownloads: 'GET_VC_RESPONSE';
closeViewVcModal: 'CLOSE_VC_MODAL' | 'STORE_RESPONSE';
incrementDownloadCounter:
| 'POLL'
Expand All @@ -212,7 +210,6 @@ export interface Typegen0 {
| 'STORE_ERROR'
| 'error.platform.vc-item-machine.verifyingCredential:invocation[0]';
removeVcMetaDataFromVcMachineContext: 'DISMISS';
requestStoredContext: 'GET_VC_RESPONSE';
requestVcContext: 'DISMISS' | 'REFRESH' | 'STORE_ERROR' | 'xstate.init';
resetIsMachineInKebabPopupState:
| ''
Expand All @@ -238,7 +235,6 @@ export interface Typegen0 {
sendDownloadLimitExpire:
| 'FAILED'
| 'error.platform.vc-item-machine.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]';
sendTamperedVc: 'TAMPERED_VC';
sendTelemetryEvents: 'STORE_RESPONSE';
sendUserCancelledActivationFailedEndEvent: 'DISMISS';
sendVcUpdated: 'PIN_CARD';
Expand All @@ -253,7 +249,7 @@ export interface Typegen0 {
setCommunicationDetails:
| 'done.invoke.vc-item-machine.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]'
| 'done.invoke.vc-item-machine.walletBinding.requestingBindingOTP:invocation[0]';
setContext: 'CREDENTIAL_DOWNLOADED' | 'GET_VC_RESPONSE' | 'STORE_RESPONSE';
setContext: 'CREDENTIAL_DOWNLOADED' | 'GET_VC_RESPONSE';
setDownloadInterval: 'done.invoke.vc-item-machine.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]';
setErrorAsVerificationError: 'error.platform.vc-item-machine.verifyingCredential:invocation[0]';
setErrorAsWalletBindingError:
Expand Down Expand Up @@ -292,7 +288,7 @@ export interface Typegen0 {
};
eventsCausingDelays: {};
eventsCausingGuards: {
hasCredential: 'GET_VC_RESPONSE' | 'STORE_RESPONSE';
hasCredential: 'GET_VC_RESPONSE';
isCustomSecureKeystore:
| 'done.invoke.vc-item-machine.walletBinding.addKeyPair:invocation[0]'
| 'done.invoke.vc-item-machine.walletBinding.addingWalletBindingId:invocation[0]';
Expand All @@ -310,7 +306,7 @@ export interface Typegen0 {
downloadCredential: 'DOWNLOAD_READY';
generateKeyPair: 'INPUT_OTP';
isUserSignedAlready: 'STORE_RESPONSE';
loadDownloadLimitConfig: 'STORE_ERROR' | 'STORE_RESPONSE';
loadDownloadLimitConfig: 'GET_VC_RESPONSE' | 'STORE_ERROR';
requestBindingOTP: 'CONFIRM' | 'RESEND_OTP';
updatePrivateKey: 'done.invoke.vc-item-machine.walletBinding.addingWalletBindingId:invocation[0]';
verifyCredential: 'CREDENTIAL_DOWNLOADED';
Expand All @@ -334,7 +330,6 @@ export interface Typegen0 {
| 'loadVc.loadVcFromServer.savingFailed.idle'
| 'loadVc.loadVcFromServer.savingFailed.viewingVc'
| 'loadVc.loadVcFromServer.verifyingDownloadLimitExpiry'
| 'loadVc.loadVcFromStore'
| 'verifyingCredential'
| 'verifyingCredential.handleVCVerificationFailure'
| 'verifyingCredential.idle'
Expand All @@ -361,7 +356,6 @@ export interface Typegen0 {
loadVc?:
| 'loadVcFromContext'
| 'loadVcFromServer'
| 'loadVcFromStore'
| {
loadVcFromServer?:
| 'checkingStatus'
Expand Down
Loading

0 comments on commit 5d3301c

Please sign in to comment.