Skip to content

Commit 26929ab

Browse files
authored
Merge pull request #3641 from dimagi/CCCT-2133-show_offline_error
Show inline error message with offline status when user enters refreshable Connect page while offline
2 parents b1d8707 + d1d5994 commit 26929ab

20 files changed

Lines changed: 213 additions & 6 deletions

File tree

RELEASES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ These are published publically on Playstore, Github Releases and CommCare Forums
1111
-->
1212

1313
#### What's New
14+
- Offline status shown on refreshable Connect pages when applicable
1415

1516
- [Relearn Tasking] Added relearn task notification UI to Connect opportunity cards
1617

@@ -35,6 +36,8 @@ we would like to communicate to QA as part of the release testing
3536
- Verify that the existing opportunity card UI is unchanged when there are no relearn tasks.
3637
- Verify that the opportunity card updates as expected when there are either pending relearn tasks or completed relearn tasks.
3738

39+
- Test the new offline status indicator at the top of refreshable Connect pages (Connect Home, Learning Progress, Delivery Progress). Verify that the error message appears when entering these pages while offline, and that it disappears once the device comes back online.
40+
3841
## CommCare 2.62
3942

4043

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="20dp" android:viewportHeight="38" android:viewportWidth="38" android:width="20dp">
2+
3+
<path android:fillColor="#ffffff" android:pathData="M19,19m-19,0a19,19 0,1 1,38 0a19,19 0,1 1,-38 0"/>
4+
5+
<group>
6+
7+
<clip-path android:pathData="M3,3h32v32h-32z"/>
8+
9+
<path android:fillColor="#EA6944" android:pathData="M27.42,16.346C27.42,17.165 27.302,17.973 27.067,18.769C26.831,19.566 26.472,20.302 25.992,20.979C25.84,21.173 25.648,21.277 25.417,21.292C25.185,21.308 24.973,21.219 24.779,21.026C24.6,20.846 24.514,20.635 24.523,20.392C24.532,20.15 24.608,19.925 24.751,19.718C25.061,19.204 25.291,18.66 25.441,18.088C25.591,17.517 25.667,16.931 25.667,16.333C25.667,15.602 25.547,14.894 25.308,14.212C25.068,13.528 24.727,12.901 24.285,12.328C24.132,12.121 24.054,11.897 24.05,11.654C24.046,11.411 24.133,11.2 24.313,11.021C24.492,10.841 24.701,10.755 24.94,10.764C25.178,10.773 25.373,10.873 25.526,11.067C26.139,11.819 26.608,12.643 26.933,13.54C27.258,14.436 27.42,15.372 27.42,16.346ZM19,13.385C19.822,13.385 20.519,13.67 21.091,14.242C21.663,14.814 21.949,15.511 21.949,16.333V16.564C21.949,16.641 21.935,16.718 21.908,16.795C21.858,17.036 21.712,17.186 21.468,17.246C21.224,17.306 21.007,17.24 20.815,17.049L18.285,14.518C18.102,14.335 18.042,14.125 18.104,13.888C18.166,13.652 18.311,13.497 18.538,13.426C18.615,13.398 18.692,13.385 18.769,13.385H19ZM31.82,16.333C31.82,17.766 31.598,19.145 31.154,20.471C30.709,21.796 30.049,23.027 29.174,24.162C29.022,24.355 28.827,24.455 28.588,24.464C28.35,24.473 28.141,24.387 27.962,24.208C27.782,24.028 27.697,23.817 27.705,23.574C27.714,23.332 27.79,23.107 27.933,22.9C28.629,21.949 29.159,20.917 29.522,19.803C29.885,18.688 30.067,17.531 30.067,16.333C30.067,15.002 29.844,13.723 29.399,12.497C28.953,11.272 28.305,10.155 27.454,9.146C27.288,8.953 27.203,8.737 27.199,8.499C27.194,8.26 27.282,8.051 27.462,7.872C27.641,7.692 27.852,7.61 28.095,7.626C28.338,7.641 28.542,7.745 28.708,7.938C29.708,9.118 30.476,10.424 31.014,11.856C31.552,13.289 31.82,14.781 31.82,16.333ZM28.703,31.533L20,22.831V29.41C20,29.694 19.904,29.932 19.713,30.123C19.521,30.315 19.284,30.41 19,30.41C18.716,30.41 18.479,30.315 18.287,30.123C18.096,29.932 18,29.694 18,29.41V20.831L12.487,15.338C12.436,15.511 12.397,15.677 12.372,15.836C12.346,15.995 12.333,16.161 12.333,16.333C12.333,17.065 12.453,17.772 12.692,18.455C12.932,19.138 13.273,19.766 13.715,20.338C13.868,20.545 13.946,20.77 13.95,21.013C13.954,21.256 13.867,21.467 13.687,21.646C13.508,21.826 13.299,21.911 13.06,21.903C12.822,21.894 12.627,21.793 12.474,21.6C11.883,20.856 11.419,20.036 11.083,19.14C10.748,18.243 10.58,17.308 10.58,16.333C10.58,15.904 10.61,15.484 10.672,15.073C10.733,14.662 10.845,14.25 11.008,13.838L8.974,11.805C8.627,12.526 8.367,13.263 8.194,14.014C8.02,14.765 7.933,15.538 7.933,16.333C7.933,17.665 8.156,18.944 8.601,20.169C9.047,21.395 9.695,22.512 10.546,23.521C10.712,23.714 10.797,23.93 10.801,24.168C10.806,24.406 10.718,24.615 10.538,24.795C10.359,24.974 10.148,25.056 9.905,25.041C9.662,25.026 9.458,24.921 9.292,24.728C8.292,23.549 7.524,22.241 6.986,20.804C6.448,19.367 6.18,17.877 6.18,16.333C6.18,15.304 6.3,14.296 6.541,13.309C6.782,12.322 7.148,11.375 7.639,10.469L6.467,9.297C6.282,9.113 6.188,8.884 6.183,8.612C6.179,8.339 6.274,8.099 6.467,7.892C6.674,7.685 6.911,7.582 7.18,7.582C7.448,7.582 7.685,7.685 7.892,7.892L30.128,30.128C30.326,30.326 30.424,30.559 30.422,30.824C30.419,31.09 30.315,31.326 30.108,31.533C29.901,31.726 29.667,31.826 29.405,31.833C29.144,31.84 28.91,31.74 28.703,31.533Z"/>
10+
11+
</group>
12+
13+
</vector>

app/res/layout/inline_error_layout.xml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,35 @@
2727
tools:text="This is the error message shown"
2828
android:textColor="@color/white"
2929
android:textSize="15sp"
30-
app:layout_constraintEnd_toEndOf="parent"
3130
app:layout_constraintBottom_toBottomOf="parent"
31+
app:layout_constraintEnd_toStartOf="@id/iv_offline"
3232
app:layout_constraintStart_toEndOf="@id/iv_error"
3333
app:layout_constraintTop_toTopOf="parent" />
3434

35-
</androidx.constraintlayout.widget.ConstraintLayout>
35+
<androidx.appcompat.widget.AppCompatImageView
36+
android:id="@+id/iv_offline"
37+
android:layout_width="20dp"
38+
android:layout_height="20dp"
39+
android:layout_marginEnd="5dp"
40+
android:src="@drawable/ic_offline_white"
41+
android:visibility="gone"
42+
app:layout_constraintBottom_toBottomOf="parent"
43+
app:layout_constraintEnd_toStartOf="@id/tv_offline_label"
44+
app:layout_constraintTop_toTopOf="parent"
45+
tools:visibility="visible" />
46+
47+
<androidx.appcompat.widget.AppCompatTextView
48+
android:id="@+id/tv_offline_label"
49+
android:layout_width="wrap_content"
50+
android:layout_height="wrap_content"
51+
android:layout_marginEnd="5dp"
52+
android:text="@string/connect_offline"
53+
android:textColor="@color/white"
54+
android:textSize="15sp"
55+
android:visibility="gone"
56+
app:layout_constraintBottom_toBottomOf="parent"
57+
app:layout_constraintEnd_toEndOf="parent"
58+
app:layout_constraintTop_toTopOf="parent"
59+
tools:visibility="visible" />
60+
61+
</androidx.constraintlayout.widget.ConstraintLayout>

app/res/values-es/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,4 +536,7 @@
536536
<string name="connect_job_info_view_opportunity">Ver oportunidad</string>
537537
<string name="install_barcode_top">¡Bienvenido a CommCare!</string>
538538
<string name="install_barcode_bottom">Por favor, elija un método de instalación a continuación</string>
539+
<string name="connect_last_synced">Última sincronización: %s</string>
540+
<string name="connect_offline">Sin conexión</string>
541+
<string name="connect_never">Nunca</string>
539542
</resources>

app/res/values-fr/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,4 +535,7 @@ License.
535535
<string name="connect_job_info_view_opportunity">Voir l\'opportunité</string>
536536
<string name="install_barcode_top">Bienvenue sur CommCare !</string>
537537
<string name="install_barcode_bottom">Veuillez choisir une méthode d\'installation ci-dessous</string>
538+
<string name="connect_last_synced">Dernière synchronisation : %s</string>
539+
<string name="connect_offline">Hors ligne</string>
540+
<string name="connect_never">Jamais</string>
538541
</resources>

app/res/values-ha/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,4 +530,7 @@ Don cikakken aiki na wurin zama na aikace-aikace da yawa, da fatan za a yi sabon
530530
<string name="wait_for_location_fix">CommCare yana ƙoƙarin samun wurinku. Da fatan za a jira ko danna Soke don soke.</string>
531531
<string name="notification_channel_user_session_title">Zaman mai amfani</string>
532532
<string name="notification_channel_user_session_description">Sanarwa da ke ɗauke da bayani game da zaman mai amfani na yanzu, kamar ranar da ake sa ran zaman ya ƙare</string>
533+
<string name="connect_last_synced">Aiki na ƙarshe: %s</string>
534+
<string name="connect_offline">Babu haɗi</string>
535+
<string name="connect_never">Ba taɓa</string>
533536
</resources>

app/res/values-hi/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,4 +532,7 @@ License.
532532
<string name="connect_job_info_view_opportunity">अवसर देखें</string>
533533
<string name="install_barcode_top">CommCare में आपका स्वागत है!</string>
534534
<string name="install_barcode_bottom">कृपया नीचे एक इंस्टॉलेशन विधि चुनें</string>
535+
<string name="connect_last_synced">अंतिम सिंक: %s</string>
536+
<string name="connect_offline">ऑफ़लाइन</string>
537+
<string name="connect_never">कभी नहीं</string>
535538
</resources>

app/res/values-lt/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,7 @@
191191
<string name="connect_job_info_view_opportunity">Peržiūrėti galimybę</string>
192192
<string name="connect_progress_warning_relearn_tasks_pending">Užbaikite paskirtas užduotis, kad galėtumėte toliau teikti paslaugas.</string>
193193
<string name="connect_progress_relearn_tasks_completed">Visos reikalingos užduotys atliktos. Galite tęsti pristatymo veiklą.</string>
194+
<string name="connect_last_synced">Paskutinė sinchronizacija: %s</string>
195+
<string name="connect_offline">Neprisijungęs</string>
196+
<string name="connect_never">Niekada</string>
194197
</resources>

app/res/values-no/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,7 @@
181181
<string name="connect_job_info_view_opportunity">Se mulighet</string>
182182
<string name="connect_progress_warning_relearn_tasks_pending">Fullfør tildelte oppgaver for å fortsette å levere tjenester.</string>
183183
<string name="connect_progress_relearn_tasks_completed">Alle nødvendige oppgaver er fullført. Du kan fortsette med leveringsaktiviteter.</string>
184+
<string name="connect_last_synced">Sist synkronisert: %s</string>
185+
<string name="connect_offline">Frakoblet</string>
186+
<string name="connect_never">Aldri</string>
184187
</resources>

app/res/values-pt/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,4 +541,7 @@
541541
<string name="connect_job_info_view_opportunity">Ver oportunidade</string>
542542
<string name="install_barcode_top">Bem-vindo ao CommCare!</string>
543543
<string name="install_barcode_bottom">Por favor, escolha um método de instalação abaixo</string>
544+
<string name="connect_last_synced">Última sincronização: %s</string>
545+
<string name="connect_offline">Offline</string>
546+
<string name="connect_never">Nunca</string>
544547
</resources>

0 commit comments

Comments
 (0)