Skip to content

Commit

Permalink
Merge pull request #19 from ravikp/new-error-overlay-for-sql-full-error
Browse files Browse the repository at this point in the history
fea(mosip#625): Show dialog when VC can't be stored on the sqlite disk full error
  • Loading branch information
ravikp authored Mar 14, 2023
2 parents 767a3c1 + 3e5ac1e commit 1de1738
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 205 deletions.
10 changes: 7 additions & 3 deletions locales/ara.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"ActivityLogText": {
"VC_SHARED": "مشترك",
"VC_RECEIVED": "الواردة",
Expand Down Expand Up @@ -244,8 +244,12 @@
"goToReceivedVCTab": "منظر تلقى {{vcLabel}}",
"errors": {
"savingFailed": {
"title": "فشل ل يحفظ {{vcLabel}}",
"title": "فشل حفظ {{vcLabel}}",
"message": "شئ ما ذهب خطأ بينما إنقاذ {{vcLabel}} ل ال محل."
},
"diskFullError": {
"title": "فشل حفظ {{vcLabel}}",
"message": "لا يمكن استلام المزيد من {{vcLabelPlural}} أو حفظه لأن بيانات التطبيق ممتلئة."
}
}
},
Expand Down Expand Up @@ -379,4 +383,4 @@
"allowAccess": "اسمح بالوصول إلى الكاميرا"
}
}
}
}
10 changes: 7 additions & 3 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,12 @@
"goToReceivedVCTab": "View Received {{vcLabel}}",
"errors": {
"savingFailed": {
"title": "Failed to save {{vcLabel}}",
"message": "Something went wrong while saving {{vcLabel}} to the store."
"title": "Failed to save the {{vcLabelSingular}}",
"message": "Something went wrong while saving {{vcLabelSingular}} to the store."
},
"diskFullError": {
"title": "Failed to save the {{vcLabelSingular}}",
"message": "No more {{vcLabelPlural}} can be received or saved as App Data is full."
}
}
},
Expand Down Expand Up @@ -332,7 +336,7 @@
"message": "Your {{vcLabel}} was discarded by {{receiver}}"
},
"bleError": {
"title": "Failed to transfer!",
"title": "Failed to transfer",
"message": "Something went wrong while transferring {{vcLabel}}. Please try again."
}
}
Expand Down
8 changes: 6 additions & 2 deletions locales/fil.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,12 @@
"goToReceivedVCTab": "Tingnan ang mga Natanggap na {{vcLabel}}",
"errors": {
"savingFailed": {
"title": "Nabigong i-save ang {{vcLabel}}",
"message": "Nagkaproblema habang nagse-save ng {{vcLabel}} sa tindahan."
"title": "Nabigong i-save ang {{vcLabelSingular}}",
"message": "Nagkaproblema habang nagse-save ng {{vcLabelSingular}} sa tindahan."
},
"diskFullError": {
"title": "Nabigong i-save ang {{vcLabelSingular}}",
"message": "Wala nang mga {{vcLabelSingular}} na matatanggap o mai-save dahil puno na ang Data ng App."
}
}
},
Expand Down
8 changes: 6 additions & 2 deletions locales/hin.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,12 @@
"goToReceivedVCTab": "प्राप्त {{vcLabel}} देखें",
"errors": {
"savingFailed": {
"title": "{{vcLabel}} सहेजने में विफल",
"message": "{{vcLabel}} को स्टोर में सेव करते समय कोई गड़बड़ी हुई."
"title": "{{vcLabelSingular}} सहेजने में विफल",
"message": "{{vcLabelSingular}} को स्टोर में सेव करते समय कोई गड़बड़ी हुई."
},
"diskFullError": {
"title": "{{vcLabelSingular}} सहेजने में विफल",
"message": "ऐप डेटा पूर्ण होने के कारण कोई और {{vcLabelPlural}} प्राप्त या सहेजा नहीं जा सकता है।"
}
}
},
Expand Down
14 changes: 9 additions & 5 deletions locales/kan.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"ActivityLogText": {
"VC_SHARED": "ಹಂಚಿಕೊಂಡಿದ್ದಾರೆ",
"VC_RECEIVED": "ಸ್ವೀಕರಿಸಿದರು",
Expand Down Expand Up @@ -244,8 +244,12 @@
"goToReceivedVCTab": "ಸ್ವೀಕರಿಸಿದ {{vcLabel}} ವೀಕ್ಷಿಸಿ",
"errors": {
"savingFailed": {
"title": "{{vcLabel}} ಉಳಿಸಲು ವಿಫಲವಾಗಿದೆ",
"message": "ಸ್ಟೋರ್‌ನಲ್ಲಿ {{vcLabel}} ಉಳಿಸುವಾಗ ಏನೋ ತಪ್ಪಾಗಿದೆ."
"title": "{{vcLabelSingular}} ಉಳಿಸಲು ವಿಫಲವಾಗಿದೆ",
"message": "ಸ್ಟೋರ್‌ನಲ್ಲಿ {{vcLabelSingular}} ಉಳಿಸುವಾಗ ಏನೋ ತಪ್ಪಾಗಿದೆ."
},
"diskFullError": {
"title": "{{vcLabelSingular}} ಉಳಿಸಲು ವಿಫಲವಾಗಿದೆ",
"message": "ಅಪ್ಲಿಕೇಶನ್ ಡೇಟಾ ತುಂಬಿರುವುದರಿಂದ ಹೆಚ್ಚಿನ {{vcLabelPlural}} ಸ್ವೀಕರಿಸಲು ಅಥವಾ ಉಳಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ."
}
}
},
Expand Down Expand Up @@ -325,7 +329,7 @@
"accepted": {
"title": "ಯಶಸ್ಸು!",
"message": "ನಿಮ್ಮ {{vcLabel}}ನ್ನು {{receiver}} ಅವರೊಂದಿಗೆ ಯಶಸ್ವಿಯಾಗಿ ಹಂಚಿಕೊಳ್ಳಲಾಗಿದೆ"

},
"rejected": {
"title": "ಗಮನಿಸಿ",
Expand Down Expand Up @@ -383,4 +387,4 @@
"genericError": "ಏನೋ ತಪ್ಪಾಗಿದೆ. ದಯವಿಟ್ಟು ಸ್ವಲ್ಪ ಸಮಯದ ನಂತರ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ!"
}
}
}
}
12 changes: 8 additions & 4 deletions locales/tam.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"ActivityLogText": {
"VC_SHARED": "பகிர்ந்து கொண்டார்",
"VC_RECEIVED": "பெற்றது",
Expand Down Expand Up @@ -244,8 +244,12 @@
"goToReceivedVCTab": "பெறப்பட்ட {{vcLabel}}களைப் பார்க்கவும் ",
"errors": {
"savingFailed": {
"title": "{{vcLabel}}ஐ சேமிப்பதில் தோல்வி",
"message": "கடையில் {{vcLabel}}ஐ சேமிக்கும் போது ஏதோ தவறு ஏற்பட்டது."
"title": "{{vcLabelSingular}}ஐ சேமிப்பதில் தோல்வி",
"message": "கடையில் {{vcLabelSingular}}ஐ சேமிக்கும் போது ஏதோ தவறு ஏற்பட்டது."
},
"diskFullError": {
"title": "{{vcLabelSingular}}ஐ சேமிக்க முடியவில்லை",
"message": "ஆப்ஸ் டேட்டா நிரம்பியதால் {{vcLabelPlural}} பெறவோ சேமிக்கவோ முடியாது."
}
}
},
Expand Down Expand Up @@ -382,4 +386,4 @@
"genericError": "ஏதோ தவறு நடந்துவிட்டது. சிறிது நேரம் கழித்து மீண்டும் முயற்சிக்கவும்!"
}
}
}
}
12 changes: 11 additions & 1 deletion machines/openIdBle/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const model = createModel(
senderInfo: {} as DeviceInfo,
receiverInfo: {} as DeviceInfo,
incomingVc: {} as VC,
storeError: null as Error,
connectionParams: '',
loggers: [] as EmitterSubscription[],
sharingProtocol: (Platform.OS === 'ios'
Expand Down Expand Up @@ -67,7 +68,7 @@ const model = createModel(
BLUETOOTH_DISABLED: () => ({}),
STORE_READY: () => ({}),
STORE_RESPONSE: (response: unknown) => ({ response }),
STORE_ERROR: () => ({}),
STORE_ERROR: (error: Error) => ({ error }),
RECEIVE_DEVICE_INFO: (info: DeviceInfo) => ({ info }),
RECEIVED_VCS_UPDATED: () => ({}),
VC_RESPONSE: (response: unknown) => ({ response }),
Expand Down Expand Up @@ -385,6 +386,7 @@ export const requestMachine =
},
on: {
STORE_ERROR: {
actions: 'setStoringError',
target: '#request.reviewing.savingFailed',
},
},
Expand Down Expand Up @@ -537,6 +539,10 @@ export const requestMachine =
},
}),

setStoringError: assign({
storeError: (_context, event) => event.error,
}),

registerLoggers: assign({
loggers: () => {
if (__DEV__) {
Expand Down Expand Up @@ -908,6 +914,10 @@ export function selectIsSavingFailedInIdle(state: State) {
return state.matches('reviewing.savingFailed.idle');
}

export function selectStoreError(state: State) {
return state.context.storeError;
}

export function selectIsRejected(state: State) {
return state.matches('reviewing.rejected');
}
Expand Down
Loading

0 comments on commit 1de1738

Please sign in to comment.