mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
[INJIMOB-1816]: update logic to sent all errorMessage of issuer to UI (#1581)
* [INJIMOB-1816]: update logic to sent all errorMessage of issuer to UI Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-1816] update error text for wellknown fetch error Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> --------- Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> Co-authored-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
@@ -62,6 +62,15 @@ export const IssuersActions = (model: any) => {
|
||||
resetSelectedCredentialType: model.assign({
|
||||
selectedCredentialType: {},
|
||||
}),
|
||||
setFetchWellknownError:model.assign({
|
||||
errorMessage:(_: any, event: any)=>{
|
||||
const error = event.data.message;
|
||||
if (error.includes(NETWORK_REQUEST_FAILED)) {
|
||||
return ErrorMessage.NO_INTERNET;
|
||||
}
|
||||
return ErrorMessage.TECHNICAL_DIFFICULTIES
|
||||
}
|
||||
}),
|
||||
setError: model.assign({
|
||||
errorMessage: (_: any, event: any) => {
|
||||
console.error('Error occurred ', event.data.message);
|
||||
|
||||
@@ -98,7 +98,7 @@ export const IssuersMachine = model.createMachine(
|
||||
target: 'downloadCredentialTypes',
|
||||
},
|
||||
onError: {
|
||||
actions: ['setError', 'resetLoadingReason'],
|
||||
actions: ['setFetchWellknownError', 'resetLoadingReason'],
|
||||
target: 'error',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"verifyCredential": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
|
||||
};
|
||||
missingImplementations: {
|
||||
actions: "getKeyPairFromStore" | "loadKeyPair" | "logDownloaded" | "resetError" | "resetIsVerified" | "resetLoadingReason" | "resetSelectedCredentialType" | "resetVerificationErrorMessage" | "sendBackupEvent" | "sendDownloadingFailedToVcMeta" | "sendErrorEndEvent" | "sendImpressionEvent" | "sendSuccessEndEvent" | "setCredentialWrapper" | "setError" | "setIsVerified" | "setIssuers" | "setLoadingReasonAsDisplayIssuers" | "setLoadingReasonAsDownloadingCredentials" | "setLoadingReasonAsSettingUp" | "setMetadataInCredentialData" | "setNoInternet" | "setOIDCConfigError" | "setPrivateKey" | "setPublicKey" | "setSelectedCredentialType" | "setSelectedIssuerId" | "setSelectedIssuers" | "setSupportedCredentialTypes" | "setTokenResponse" | "setVCMetadata" | "setVerifiableCredential" | "storeKeyPair" | "storeVcMetaContext" | "storeVcsContext" | "storeVerifiableCredentialData" | "storeVerifiableCredentialMeta" | "updateIssuerFromWellknown" | "updateVerificationErrorMessage";
|
||||
actions: "getKeyPairFromStore" | "loadKeyPair" | "logDownloaded" | "resetError" | "resetIsVerified" | "resetLoadingReason" | "resetSelectedCredentialType" | "resetVerificationErrorMessage" | "sendBackupEvent" | "sendDownloadingFailedToVcMeta" | "sendErrorEndEvent" | "sendImpressionEvent" | "sendSuccessEndEvent" | "setCredentialWrapper" | "setError" | "setFetchWellknownError" | "setIsVerified" | "setIssuers" | "setLoadingReasonAsDisplayIssuers" | "setLoadingReasonAsDownloadingCredentials" | "setLoadingReasonAsSettingUp" | "setMetadataInCredentialData" | "setNoInternet" | "setOIDCConfigError" | "setPrivateKey" | "setPublicKey" | "setSelectedCredentialType" | "setSelectedIssuerId" | "setSelectedIssuers" | "setSupportedCredentialTypes" | "setTokenResponse" | "setVCMetadata" | "setVerifiableCredential" | "storeKeyPair" | "storeVcMetaContext" | "storeVcsContext" | "storeVerifiableCredentialData" | "storeVerifiableCredentialMeta" | "updateIssuerFromWellknown" | "updateVerificationErrorMessage";
|
||||
delays: never;
|
||||
guards: "canSelectIssuerAgain" | "hasKeyPair" | "hasUserCancelledBiometric" | "isCustomSecureKeystore" | "isGenericError" | "isInternetConnected" | "isOIDCConfigError" | "isOIDCflowCancelled" | "isSignedIn" | "isVerificationPendingBecauseOfNetworkIssue" | "shouldFetchIssuersAgain";
|
||||
services: "checkInternet" | "downloadCredential" | "downloadCredentialTypes" | "downloadIssuerWellknown" | "downloadIssuersList" | "generateKeyPair" | "invokeAuthorization" | "isUserSignedAlready" | "verifyCredential";
|
||||
@@ -54,7 +54,8 @@
|
||||
"sendImpressionEvent": "done.invoke.issuersMachine.displayIssuers:invocation[0]";
|
||||
"sendSuccessEndEvent": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
|
||||
"setCredentialWrapper": "done.invoke.issuersMachine.downloadCredentials:invocation[0]";
|
||||
"setError": "error.platform.issuersMachine.displayIssuers:invocation[0]" | "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
|
||||
"setError": "error.platform.issuersMachine.displayIssuers:invocation[0]" | "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
|
||||
"setFetchWellknownError": "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]";
|
||||
"setIsVerified": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
|
||||
"setIssuers": "done.invoke.issuersMachine.displayIssuers:invocation[0]";
|
||||
"setLoadingReasonAsDisplayIssuers": "TRY_AGAIN";
|
||||
|
||||
@@ -13,10 +13,7 @@ export function selectSelectedIssuer(state: State) {
|
||||
}
|
||||
|
||||
export function selectErrorMessageType(state: State) {
|
||||
const nonGenericErrors = ['', ErrorMessage.NO_INTERNET];
|
||||
return nonGenericErrors.includes(state.context.errorMessage)
|
||||
? state.context.errorMessage
|
||||
: null;
|
||||
return state.context.errorMessage;
|
||||
}
|
||||
|
||||
export function selectLoadingReason(state: State) {
|
||||
|
||||
Reference in New Issue
Block a user