Skip to content

Commit

Permalink
Merge pull request #78 from tw-mosip/new-ui-merge-issues
Browse files Browse the repository at this point in the history
fix(INJI-206): [Vijay] fix mmkv storage issue, environment url change persistance and literal change

Issues Fixed :

INJI-139 - persist environment url changes
INJI-206 - VC Storage Issue between MMKV & RNFS
  • Loading branch information
vijay151096 authored Jul 11, 2023
2 parents 582178f + 4a1e72e commit 7a81507
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 6 deletions.
5 changes: 2 additions & 3 deletions components/EditableListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ export const EditableListItem: React.FC<EditableListItemProps> = (props) => {
}}
/>
{props.credentialRegistryResponse === 'error' && (
<Text style={Theme.TextStyles.error}>
please try again after sometime...
</Text>
<Text style={Theme.TextStyles.error}>{props.errorMessage}</Text>
)}
{props.credentialRegistryResponse === 'success' &&
overlayOpened &&
Expand Down Expand Up @@ -105,4 +103,5 @@ interface EditableListItemProps {
credentialRegistryResponse: string;
onCancel: () => void;
progress?: boolean;
errorMessage?: string;
}
1 change: 1 addition & 0 deletions locales/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"language": "لغة",
"aboutInji": "حول إنجي",
"credentialRegistry": "سجل الاعتماد",
"errorMessage": "تم إدخال عنوان URL غير صحيح. الرجاء إدخال عنوان URL صالح للمتابعة." ,
"injiTourGuide": "مرشد إنجي السياحي",
"logout": "تسجيل خروج",
"resetInjiProps": "إعادة تعيين دعائم إنجي ..."
Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"language": "Language",
"aboutInji": "About Inji",
"credentialRegistry": "Credential Registry",
"errorMessage": "Incorrect URL entered. Please enter a valid URL to proceed.",
"injiTourGuide": "Inji Tour Guide",
"logout": "Logout",
"resetInjiProps": "Resetting Inji Props..."
Expand Down
1 change: 1 addition & 0 deletions locales/fil.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"language": "Wika",
"aboutInji": "About Inji",
"credentialRegistry": "Credential Registry",
"errorMessage": "Maling URL ang inilagay. Mangyaring maglagay ng wastong URL upang magpatuloy.",
"injiTourGuide": "Inji Tour Guide",
"logout": "Mag-logout",
"resetInjiProps": "Nire-reset ang Inji Props..."
Expand Down
1 change: 1 addition & 0 deletions locales/hin.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"language": "भाषा",
"aboutInji": "इंजी के बारे में",
"credentialRegistry": "क्रेडेंशियल रजिस्ट्री",
"errorMessage": "गलत यूआरएल दर्ज किया गया। कृपया आगे बढ़ने के लिए एक वैध यूआरएल दर्ज करें।",
"injiTourGuide": "इंजी टूर गाइड",
"logout": "लॉग आउट",
"resetInjiProps": "इंजी प्रॉप्स को रीसेट किया जा रहा है..."
Expand Down
1 change: 1 addition & 0 deletions locales/kan.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"language": "ಭಾಷೆ",
"aboutInji": "ಇಂಜಿ ಬಗ್ಗೆ",
"credentialRegistry": "ರುಜುವಾತು ನೋಂದಣಿ",
"errorMessage": "ತಪ್ಪಾದ URL ನಮೂದಿಸಲಾಗಿದೆ. ದಯವಿಟ್ಟು ಮುಂದುವರೆಯಲು ಮಾನ್ಯ URL ಅನ್ನು ನಮೂದಿಸಿ.",
"injiTourGuide": "ಇಂಜಿ ಪ್ರವಾಸ ಮಾರ್ಗದರ್ಶಿ",
"logout": "ಲಾಗ್ ಔಟ್",
"resetInjiProps": "ಇಂಜಿ ಪ್ರಾಪ್ಸ್ ಅನ್ನು ಮರುಹೊಂದಿಸಲಾಗುತ್ತಿದೆ..."
Expand Down
1 change: 1 addition & 0 deletions locales/tam.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"language": "மொழி",
"aboutInji": "இன்ஜி பற்றி",
"credentialRegistry": "நற்சான்றிதழ் பதிவு",
"errorMessage": "தவறான URL உள்ளிடப்பட்டது. தொடர சரியான URL ஐ உள்ளிடவும்.",
"injiTourGuide": "இன்ஜி சுற்றுலா வழிகாட்டி",
"logout": "வெளியேறு",
"resetInjiProps": "இன்ஜி ப்ராப்ஸை மீட்டமைக்கிறது..."
Expand Down
1 change: 1 addition & 0 deletions machines/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export const settingsMachine = model.createMachine(
actions: [
'updateCredentialRegistrySuccess',
'updateCredentialRegistry',
'storeContext',
],
target: 'idle',
},
Expand Down
1 change: 1 addition & 0 deletions screens/Settings/SettingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const SettingScreen: React.FC<SettingProps & RootRouteProps> = (
onCancel={controller.CANCEL}
onEdit={controller.UPDATE_CREDENTIAL_REGISTRY}
Icon="star"
errorMessage={t('errorMessage')}
progress={controller.isResetInjiProps}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion shared/commonprops/commonProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const COMMON_PROPS_KEY: string =
export default async function getAllConfigurations(host = undefined) {
try {
host && changeCrendetialRegistry(host);
var response = await Storage.getItem(COMMON_PROPS_KEY);
const response = await Storage.getItem(COMMON_PROPS_KEY);
if (response) {
return JSON.parse(response);
} else {
Expand Down
3 changes: 2 additions & 1 deletion shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export const VC_ITEM_STORE_KEY = (vc: Partial<VC>) =>
`vc:${vc.idType}:${vc.id}:${vc.requestId}:${vc.isPinned}`;

//Regex expression to evaluate if the key is for a VC
export const VC_ITEM_STORE_KEY_REGEX = '^vc:(UIN|VID):[0-9]+:[a-z0-9-]+$';
export const VC_ITEM_STORE_KEY_REGEX =
'^vc:(UIN|VID):[0-9]+:[a-z0-9-]+:[true|false]+$';

export let individualId = '';

Expand Down
3 changes: 2 additions & 1 deletion shared/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ class Storage {
};
}
/**
* The VC file name will not have the pinned / unpinned state, we will splice the state as this will change.
* replace ':' with '_' in the key to get the file name as ':' are not allowed in filenames
* eg: "vc:UIN:6732935275:e7426576-112f-466a-961a-1ed9635db628" is changed to "vc_UIN_6732935275_e7426576-112f-466a-961a-1ed9635db628"
*/
const getFileName = (key: string) => {
return key.split(':').join('_');
return key.split(':').splice(0, 4).join('_');
};

/**
Expand Down

0 comments on commit 7a81507

Please sign in to comment.