mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 05:27:57 -05:00
[INJIMOB-3647] refactor: update isRevoked data type (#2149)
* [INJIMOB-3647] refactor: modify data type of isRevoked to EvaluationStatus Type representing any possible value of EvaluationStatus. - "TRUE" → Condition was evaluated and is positively true - "FALSE" → Condition was evaluated and is definitively false - "UNDETERMINED" → Condition could not be evaluated due to an error Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3647] refactor: modify data type of isRevoked to EvaluationStatus Type representing any possible value of EvaluationStatus. - "TRUE" → Condition was evaluated and is positively true - "FALSE" → Condition was evaluated and is definitively false - "UNDETERMINED" → Condition could not be evaluated due to an error Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3647] refactor: change statuslistVC type to record from string Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> # Conflicts: # shared/vcjs/verifyCredential.ts * [INJIMOB-3647] refactor: update status revoke check to check for null status Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3647] refactor: VCMetadat constructor isRevoked param Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3647] refactor: rename EvaluationStatus to RevocationStatus Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3647] refactor: modify revocation status logs Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> --------- Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>
This commit is contained in:
committed by
GitHub
parent
0e667bd46d
commit
9457ad0d9f
@@ -1,30 +1,28 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
import { Column } from "../../ui";
|
||||
import { Theme } from "../../ui/styleUtils";
|
||||
import { Text } from "../../ui";
|
||||
import { VC_STATUS_KEYS } from "./VCUtils";
|
||||
import React from 'react';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
import {View} from 'react-native';
|
||||
import {Column} from '../../ui';
|
||||
import {Theme} from '../../ui/styleUtils';
|
||||
import {Text} from '../../ui';
|
||||
import {VC_STATUS_KEYS} from './VCUtils';
|
||||
|
||||
export const StatusTooltipContent = () => {
|
||||
const { t } = useTranslation('ViewVcModal');
|
||||
|
||||
return (
|
||||
<Column align="center" style={{marginTop:20}}>
|
||||
{VC_STATUS_KEYS.map(key => (
|
||||
<View key={key} style={{ marginBottom: 20 }}>
|
||||
<Text weight="semibold">{t(`statusToolTipContent.${key}.title`)}</Text>
|
||||
<Text
|
||||
weight="regular"
|
||||
style={[
|
||||
Theme.Styles.tooltipContentDescription,
|
||||
{ marginTop: 3 },
|
||||
]}>
|
||||
{t(`statusToolTipContent.${key}.description`)}
|
||||
</Text>
|
||||
</View>
|
||||
))}
|
||||
</Column>
|
||||
);
|
||||
};
|
||||
|
||||
const {t} = useTranslation('ViewVcModal');
|
||||
|
||||
return (
|
||||
<Column align="center" style={{marginTop: 20}}>
|
||||
{VC_STATUS_KEYS.map(key => (
|
||||
<View key={key} style={{marginBottom: 20}}>
|
||||
<Text weight="semibold">
|
||||
{t(`statusToolTipContent.${key}.title`)}
|
||||
</Text>
|
||||
<Text
|
||||
weight="regular"
|
||||
style={[Theme.Styles.tooltipContentDescription, {marginTop: 3}]}>
|
||||
{t(`statusToolTipContent.${key}.description`)}
|
||||
</Text>
|
||||
</View>
|
||||
))}
|
||||
</Column>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@ import {Row, Text} from './ui';
|
||||
import {Theme} from './ui/styleUtils';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
import {VCMetadata} from '../shared/VCMetadata';
|
||||
import {RevocationStatus} from '../shared/vcVerifier/VcVerifier';
|
||||
|
||||
export const VCVerification: React.FC<VCVerificationProps> = ({
|
||||
vcMetadata,
|
||||
@@ -20,12 +21,15 @@ export const VCVerification: React.FC<VCVerificationProps> = ({
|
||||
let statusIcon: JSX.Element;
|
||||
|
||||
if (vcMetadata.isVerified) {
|
||||
if (vcMetadata.isRevoked) {
|
||||
if (vcMetadata.isRevoked === RevocationStatus.TRUE) {
|
||||
statusText = t('revoked');
|
||||
statusIcon = <PendingIcon color="brown" />;
|
||||
} else if (vcMetadata.isExpired) {
|
||||
statusText = t('expired');
|
||||
statusIcon = <PendingIcon color="red" />;
|
||||
} else if (vcMetadata.isRevoked === RevocationStatus.UNDETERMINED) {
|
||||
statusText = t('pending');
|
||||
statusIcon = <PendingIcon color="orange" />;
|
||||
} else {
|
||||
statusText = t('valid');
|
||||
statusIcon = <VerifiedIcon />;
|
||||
|
||||
Reference in New Issue
Block a user