Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ internal class SyncInfoFragment : Fragment(R.layout.fragment_sync_info) {
// Footer
val isFooterSyncInProgressVisible = config.isSyncInfoLogoutOnComplete && records.isFooterSyncInProgressVisible
binding.textFooterRecordSyncInProgress.isGone = !isFooterSyncInProgressVisible
binding.textFooterRecordLoggingOut.isGone = !records.isFooterReadyToLogOutVisible
binding.layoutFooterRecordLoggingOut.isGone = !records.isFooterReadyToLogOutVisible
binding.textFooterRecordSyncIncomplete.isGone = !records.isFooterSyncIncompleteVisible
binding.textFooterRecordLastSyncedWhen.isGone = !records.isFooterLastSyncTimeVisible
binding.textFooterRecordLastSyncedWhen.text =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ internal class ObserveSyncInfoUseCase @Inject constructor(
counterRecordsToDownload = recordsToDownload?.let { "${it.count}${if (it.isLowerBound) "+" else ""}" }.orEmpty(),
isCounterImagesToUploadVisible = isPreLogoutUpSync,
counterImagesToUpload = imagesToUpload?.toString().orEmpty(),
isInstructionDefaultVisible = eventSyncVisibleState == OnStandby,
isInstructionDefaultVisible = eventSyncVisibleState == OnStandby && !isPreLogoutUpSync,
isInstructionCommCarePermissionVisible = eventSyncVisibleState == CommCareError,
isInstructionNoModulesVisible = eventSyncVisibleState == NoModulesError,
isInstructionOfflineVisible = eventSyncVisibleState == OfflineError,
Expand Down
40 changes: 31 additions & 9 deletions feature/dashboard/src/main/res/layout/fragment_sync_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -552,16 +552,39 @@
android:text="@string/sync_info_footer_sync_incomplete"
android:visibility="gone" />

<TextView
android:id="@+id/textFooterRecordLoggingOut"
style="@style/Text.Body2.Secondary"
android:textColor="@color/simprints_green_dark"
android:layout_width="wrap_content"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layoutFooterRecordLoggingOut"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginHorizontal="8dp"
android:text="@string/sync_info_footer_sync_complete_logging_out"
android:visibility="gone" />
android:visibility="gone">

<ProgressBar
android:id="@+id/footerRecordLoggingOutProgress"
style="@style/Widget.Simprints.CircularProgressIndicator"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="8dp"
android:indeterminate="true"
android:indeterminateTint="@color/simprints_green_dark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textFooterRecordLoggingOut"
style="@style/Text.Body2.Secondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sync_info_footer_sync_complete_logging_out"
android:textColor="@color/simprints_green_dark"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/footerRecordLoggingOutProgress"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

</FrameLayout>

Expand Down Expand Up @@ -815,4 +838,3 @@

</LinearLayout>


Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,24 @@ class ObserveSyncInfoUseCaseTest {
assertThat(result.syncInfoSectionRecords.isInstructionDefaultVisible).isTrue()
}

@Test
fun `should hide default instruction for pre-logout sync`() = runTest {
createUseCase()

val result = useCase(isPreLogoutUpSync = true).first()

assertThat(result.syncInfoSectionRecords.isInstructionDefaultVisible).isFalse()
}

@Test
fun `should not hide default instruction for regular non-pre-logout sync`() = runTest {
createUseCase()

val result = useCase().first()

assertThat(result.syncInfoSectionRecords.isInstructionDefaultVisible).isTrue()
}

@Test
fun `sync button should be disabled when not on standby`() = runTest {
val mockSyncingEventSyncState = mockk<EventSyncState>(relaxed = true) {
Expand Down
1 change: 0 additions & 1 deletion infra/resources/src/main/res/values-am-rET/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@
<!-- Dashboard - Logout request -->
<string name="dashboard_logout_title">መውጣት</string>
<string name="dashboard_logout_confirmation_sync_decline_button">ሳይመሳሰል ውጣ</string>
<string name="dashboard_logout_confirmation_sync_info">በመሳሪያዎ ላይ ከመውጣትዎ በፊት መመሳሰል ያለባቸው መዝገቦች አሉ። እባክህ የማመሳሰል ሂደቱ እንዲጠናቀቅ ፍቀድ። ማመሳሰል እንደጨረሰ ዘግተህ መውጣት ትችላለህ።</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_title">ማስጠንቀቂያ</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_body">የእርስዎ ፕሮጀክት ወቅታዊ መዛግብት እንዳለው ለማረጋገጥ የውሂብ ማመሳሰል አስፈላጊ ነው። ያለ ትክክለኛ ምክንያት የእርስዎን ውሂብ ማመሳሰል አለመቻል የስራ ባልደረቦችዎ ጠቃሚ መዝገቦችን ማግኘት እና የፕሮጀክቱን ትክክለኛ ሪፖርት የማድረግ ችሎታ ላይ ተጽእኖ ያሳድራል። እና ለእርስዎ እና ለፕሮጀክቱ የማይፈለጉ ውጤቶችን ሊያስከትል ይችላል.</string>
<string name="dashboard_logout_confirmation_title">መውጣት</string>
Expand Down
1 change: 0 additions & 1 deletion infra/resources/src/main/res/values-am/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@
<!-- Dashboard - Logout request -->
<string name="dashboard_logout_title">መውጣት</string>
<string name="dashboard_logout_confirmation_sync_decline_button">ሳይመሳሰል ውጣ</string>
<string name="dashboard_logout_confirmation_sync_info">በመሳሪያዎ ላይ ከመውጣትዎ በፊት መመሳሰል ያለባቸው መዝገቦች አሉ። እባክህ የማመሳሰል ሂደቱ እንዲጠናቀቅ ፍቀድ።\n\nአንዴ ማመሳሰል እንደተጠናቀቀ ዘግተህ መውጣት ትችላለህ።</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_title">ማስጠንቀቂያ</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_body">የእርስዎ ፕሮጀክት ወቅታዊ መዛግብት እንዳለው ለማረጋገጥ የውሂብ ማመሳሰል አስፈላጊ ነው። ያለ ትክክለኛ ምክንያት የእርስዎን ውሂብ ማመሳሰል አለመቻል የስራ ባልደረቦችዎ ጠቃሚ መዝገቦችን ማግኘት እና የፕሮጀክቱን ትክክለኛ ሪፖርት የማድረግ ችሎታ ላይ ተጽእኖ ያሳድራል። እና ለእርስዎ እና ለፕሮጀክቱ የማይፈለጉ ውጤቶችን ሊያስከትል ይችላል.</string>
<string name="dashboard_logout_confirmation_title">መውጣት</string>
Expand Down
1 change: 0 additions & 1 deletion infra/resources/src/main/res/values-bn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@
<!-- Dashboard - Logout request -->
<string name="dashboard_logout_title">লগআউট করুন</string>
<string name="dashboard_logout_confirmation_sync_decline_button">সিঙ্ক ব্যাতিত লগ আউট করুন</string>
<string name="dashboard_logout_confirmation_sync_info">আপনার এই ডিভাইসে কিছু তথ্য সংরক্ষিত আছে যা সিঙ্ক করা প্রয়োজন। অনুগ্রহ করে সিঙ্ক প্রক্রিয়া সম্পন্ন করুণ। \n\nসিঙ্ক প্রক্রিয়া সম্পন্ন হলে লগ আউট করতে পারবেন।</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_title">সতর্কতা</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_body">আপনার প্রকল্পের সকল রেকর্ড আপ-টু-ডেট রয়েছে তা নিশ্চিত করার জন্য ডেটা সিঙ্ক্রোনাইজেশন অপরিহার্য। কোনো বৈধ কারণ ছাড়া ডেটা সিঙ্ক্রোনাইজ করতে ব্যর্থ হলে তা আপনার সহকর্মীদের গুরুত্বপূর্ণ রেকর্ডে অ্যাক্সেস এবং প্রকল্পের সঠিকভাবে রিপোর্ট করার ক্ষমতাকে প্রভাবিত করবে।\n\nকোনও বৈধ কারণ ছাড়া ডেটা সিঙ্ক্রোনাইজ করতে ব্যর্থ হওয়া ডেটা সংগ্রহ প্রোটোকলের লঙ্ঘনও হিসেবে গণ্য হতে পারে যার ফলে প্রকল্পের অবাঞ্ছিত পরিণতি হবার সুযোগ থাকে।</string>
<string name="dashboard_logout_confirmation_title">লগআউট করুন</string>
Expand Down
1 change: 0 additions & 1 deletion infra/resources/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@
<!-- Dashboard - Logout request -->
<string name="dashboard_logout_title">Déconnexion</string>
<string name="dashboard_logout_confirmation_sync_decline_button">Se déconnecter sans synchronisation</string>
<string name="dashboard_logout_confirmation_sync_info">Il y a des enregistrements sur votre appareil qui doivent être synchronisés avant de vous déconnecter. Veuillez laisser le processus de synchronisation se terminer.\n\nUne fois la synchronisation terminée, vous pourrez vous déconnecter.</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_title">Avertissement</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_body">La synchronisation des données est essentielle pour garantir que votre projet dispose d\'enregistrements à jour. Ne pas synchroniser vos données sans raison valable aura un impact sur l\'accès de vos collègues aux enregistrements importants et sur la capacité du projet à générer des rapports précis.\n\nNe pas synchroniser les données sans raison valable peut également constituer une violation du protocole de collecte de données et peut entraîner des conséquences indésirables pour vous et le projet.</string>
<string name="dashboard_logout_confirmation_title">Déconnexion</string>
Expand Down
1 change: 0 additions & 1 deletion infra/resources/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@
<!-- Dashboard - Logout request -->
<string name="dashboard_logout_title">लॉग-आउट</string>
<string name="dashboard_logout_confirmation_sync_decline_button">डेटा सिंक किए बिना लॉग आउट करें</string>
<string name="dashboard_logout_confirmation_sync_info">आपके डिवाइस पर ऐसे रिकॉर्ड हैं जिन्हें लॉग आउट करने से पहले सिंक्रनाइज़ करने की आवश्यकता है। कृपया सिंक्रोनाइज़ेशन प्रक्रिया को पूरा होने दें।\n\nएक बार सिंक्रोनाइज़ेशन समाप्त हो जाने पर आप लॉग आउट कर सकेंगे।</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_title">चेतावनी</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_body">यह सुनिश्चित करने के लिए कि आपके प्रोजेक्ट में अद्यतन रिकॉर्ड हैं, डेटा सिंक्रनाइज़ेशन आवश्यक है। बिना किसी वैध कारण के आपके डेटा को सिंक्रोनाइज़ करने में विफल रहने से आपके सहकर्मियों की महत्वपूर्ण रिकॉर्ड तक पहुंच और प्रोजेक्ट की सटीक रिपोर्ट करने की क्षमता प्रभावित होगी।\n\nबिना किसी वैध कारण के डेटा को सिंक्रोनाइज़ करने में विफल होना भी डेटा संग्रह प्रोटोकॉल का उल्लंघन हो सकता है और इसके परिणामस्वरूप आपके और प्रोजेक्ट के लिए अवांछित परिणाम हो सकते हैं।</string>
<string name="dashboard_logout_confirmation_title">लॉग-आउट</string>
Expand Down
1 change: 0 additions & 1 deletion infra/resources/src/main/res/values-om/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@
<!-- Dashboard - Logout request -->
<string name="dashboard_logout_title">Keessaa bahi</string>
<string name="dashboard_logout_confirmation_sync_decline_button">Walsimsiisaa malee ba\'aa</string>
<string name="dashboard_logout_confirmation_sync_info">Meeshaa keessan irratti galmeewwan osoo hin ba\'iin dura walsimsiisuu qaban jiru. Mee adeemsi walsimsiisaa akka xumuramu hayyami.Erga walsimsiisni xumurame bahuu ni dandeessa.</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_title">Akeekkachiisa</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_body">Pirojektiin kee galmee yeroo ammaa akka qabu mirkaneessuuf walsimsiisni deetaa barbaachisaa dha. Sababa sirrii malee deetaa kee walsimsiisuu dadhabuun galmeewwan barbaachisoo ta\'uu fi dandeettii pirojektichi sirritti gabaasuu irratti dhiibbaa qaba.\n\nSababni sirrii malee deetaa walsimsiisuu dadhabuunis pirootokoolii walitti qabuu deetaa cabsuu ta\'uu danda\'a akkasumas bu’aa hin barbaachifne siifi pirojektichaaf fiduu danda’a.</string>
<string name="dashboard_logout_confirmation_title">Keessaa bahi</string>
Expand Down
4 changes: 3 additions & 1 deletion infra/resources/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@

<string name="sync_info_total_records">Total records</string>

<string name="sync_info_last_sync">Last sync: %1$s</string>

<string name="sync_info_footer_sync_in_progress">Sync in progress</string>
<string name="sync_info_footer_sync_incomplete">Sync incomplete</string>
<string name="sync_info_footer_sync_complete_logging_out">Sync complete, logging you out…</string>
Expand Down Expand Up @@ -446,7 +448,7 @@
<!-- Dashboard - Logout request -->
<string name="dashboard_logout_title">Logout</string>
<string name="dashboard_logout_confirmation_sync_decline_button">Log out without sync</string>
<string name="dashboard_logout_confirmation_sync_info">There are records on your device that need to be synchronised before logging out. Please allow the synchronisation process to complete.\n\nOnce the synchronization is finished you will be able to log out.</string>
<string name="dashboard_logout_confirmation_sync_info">Records on your device will be automatically synchronised before logging out. Please allow the synchronisation process to complete.\n\nOnce the synchronization is finished you will be able to log out.</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_title">Warning</string>
<string name="dashboard_logout_confirmation_sync_decline_warning_body">Data synchronisation is essential for ensuring your project has up-to-date records. Failing to synchronise your data without a valid reason will impact your colleagues\' access to important records and the project\'s ability to report accurately.\n\nFailing to synchronise data without a valid reason may also be a breach of data collection protocol and may result in unwanted consequences for you and the project.</string>
<string name="dashboard_logout_confirmation_title">Logout</string>
Expand Down