mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
[Inji 388] : Error message in QR login (#1050)
* feat(INJI-388): update error message of qr login to specific message Signed-off-by: Alka <prasadalka1998@gmail.com> * fix(INJI-388): add missing error id constants in telemetry Signed-off-by: Alka <prasadalka1998@gmail.com> --------- Signed-off-by: Alka <prasadalka1998@gmail.com>
This commit is contained in:
@@ -394,7 +394,10 @@
|
||||
"cancel": "Cancel",
|
||||
"essentialClaims": "Important Claims",
|
||||
"voluntaryClaims": "Voluntary Claims",
|
||||
"required": "It is necessary"
|
||||
"required": "It is necessary",
|
||||
"errors":{
|
||||
"invalidQR": "QR code is invalid. Please try again!"
|
||||
}
|
||||
},
|
||||
"ReceiveVcScreen": {
|
||||
"header": "Card details",
|
||||
|
||||
@@ -24,7 +24,7 @@ import i18n from '../i18n';
|
||||
import {parseMetadatas, VCMetadata} from '../shared/VCMetadata';
|
||||
import {
|
||||
getEndEventData,
|
||||
sendEndEvent
|
||||
sendEndEvent,
|
||||
} from '../shared/telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
|
||||
import {API_URLS} from '../shared/api';
|
||||
@@ -340,10 +340,21 @@ export const qrLoginMachine =
|
||||
},
|
||||
|
||||
SetErrorMessage: assign({
|
||||
errorMessage: (context, event) =>
|
||||
i18n.t(`errors.genericError`, {
|
||||
ns: 'common',
|
||||
}),
|
||||
errorMessage: (context, event) => {
|
||||
const message = event.data.name;
|
||||
const ID_ERRORS_MAP = {
|
||||
invalid_link_code: 'invalidQR',
|
||||
};
|
||||
const errorMessage = ID_ERRORS_MAP[message]
|
||||
? i18n.t(`errors.${ID_ERRORS_MAP[message]}`, {
|
||||
ns: 'QrLogin',
|
||||
})
|
||||
: i18n.t(`errors.genericError`, {
|
||||
ns: 'common',
|
||||
});
|
||||
|
||||
return errorMessage;
|
||||
},
|
||||
}),
|
||||
|
||||
setConsentClaims: assign({
|
||||
|
||||
@@ -30,6 +30,8 @@ export const TelemetryConstants = {
|
||||
hardwareKeyStore:
|
||||
'Some security features will be unavailable as hardware key store is not available',
|
||||
activationCancelled: 'Activation Cancelled',
|
||||
vcsAreTampered:
|
||||
'Tampered cards detected and removed for security reasons. Please download again',
|
||||
}),
|
||||
|
||||
ErrorId: Object.freeze({
|
||||
@@ -40,6 +42,7 @@ export const TelemetryConstants = {
|
||||
activationFailed: 'ACTIVATION_FAILED',
|
||||
tampered: 'TAMPERED',
|
||||
dataRetrieval: 'DATA_RETRIEVAL',
|
||||
vcsAreTampered: 'VC_TAMPERED',
|
||||
}),
|
||||
|
||||
Screens: Object.freeze({
|
||||
|
||||
Reference in New Issue
Block a user