Commit 2c64bfbb authored by Harri Kirik's avatar Harri Kirik
Browse files

COVAPP-462: Update the infection confirmation success screen

parent 63a52bf9
...@@ -175,6 +175,7 @@ class DebugMenuFragment : MvvmFragment(), ViewBindingHolder<FragmentDebugBinding ...@@ -175,6 +175,7 @@ class DebugMenuFragment : MvvmFragment(), ViewBindingHolder<FragmentDebugBinding
buttonDebugStateContactNotification.setOnClickListener { notifier.createNewContactNotification(requireActivity(), -1) } buttonDebugStateContactNotification.setOnClickListener { notifier.createNewContactNotification(requireActivity(), -1) }
buttonDebugStatePreShareScreen.setOnClickListener { setupAndNavigateToPreShareScreen() } buttonDebugStatePreShareScreen.setOnClickListener { setupAndNavigateToPreShareScreen() }
buttonDebugStateShareScreenError.setOnClickListener { showShareDeniedErrorDialog() } buttonDebugStateShareScreenError.setOnClickListener { showShareDeniedErrorDialog() }
buttonDebugStateShareScreenSuccess.setOnClickListener { showShareSuccessScreen() }
buttonDebugStateOpenSettingsAndScrollToCrossCountry.setOnClickListener { openSettingsAndScrollToCrossCountry() } buttonDebugStateOpenSettingsAndScrollToCrossCountry.setOnClickListener { openSettingsAndScrollToCrossCountry() }
buttonDebugStateCrossCountryPopUp.setOnClickListener { openCrossCountryPopUp() } buttonDebugStateCrossCountryPopUp.setOnClickListener { openCrossCountryPopUp() }
} }
...@@ -282,6 +283,11 @@ class DebugMenuFragment : MvvmFragment(), ViewBindingHolder<FragmentDebugBinding ...@@ -282,6 +283,11 @@ class DebugMenuFragment : MvvmFragment(), ViewBindingHolder<FragmentDebugBinding
findNavController().navigate(DebugMenuFragmentDirections.crossCountryPopUp()) findNavController().navigate(DebugMenuFragmentDirections.crossCountryPopUp())
} }
private fun showShareSuccessScreen() {
// Navigate
findNavController().navigate(DebugMenuFragmentDirections.confirmInfectionResult(PatientPortalResult.DebugJustDone))
}
companion object { companion object {
private const val TAG_DIALOG_ERROR = "DebugFragment.TAG_DIALOG_ERROR" private const val TAG_DIALOG_ERROR = "DebugFragment.TAG_DIALOG_ERROR"
private const val TAG_DIALOG_SHARE_ERROR = "DebugFragment.TAG_DIALOG_SHARE_ERROR" private const val TAG_DIALOG_SHARE_ERROR = "DebugFragment.TAG_DIALOG_SHARE_ERROR"
......
...@@ -32,4 +32,14 @@ sealed class PatientPortalResult : Parcelable { ...@@ -32,4 +32,14 @@ sealed class PatientPortalResult : Parcelable {
return "PatientPortalResult.Error(exception=$exception)" return "PatientPortalResult.Error(exception=$exception)"
} }
} }
/**
* A debug option that allows to navigate directly to specific steps in the infection confirmation process.
*/
@Parcelize
object DebugJustDone : PatientPortalResult() {
override fun toString(): String {
return "PatientPortalResult.DebugJustDone()"
}
}
} }
...@@ -15,6 +15,7 @@ import org.dpppt.android.app.domain.usecase.infection.patientportal.PreparePatie ...@@ -15,6 +15,7 @@ import org.dpppt.android.app.domain.usecase.infection.patientportal.PreparePatie
import org.dpppt.android.app.domain.usecase.infection.request.DeleteConfirmInfectionRequestUseCase import org.dpppt.android.app.domain.usecase.infection.request.DeleteConfirmInfectionRequestUseCase
import org.dpppt.android.app.util.dispose import org.dpppt.android.app.util.dispose
import timber.log.Timber import timber.log.Timber
import java.lang.IllegalArgumentException
import javax.inject.Inject import javax.inject.Inject
class ConfirmInfectionPatientPortalViewModel @Inject constructor( class ConfirmInfectionPatientPortalViewModel @Inject constructor(
...@@ -74,6 +75,10 @@ class ConfirmInfectionPatientPortalViewModel @Inject constructor( ...@@ -74,6 +75,10 @@ class ConfirmInfectionPatientPortalViewModel @Inject constructor(
cleanupAndContinueWithTheResult(portalResult) cleanupAndContinueWithTheResult(portalResult)
true true
} }
is PatientPortalResult.DebugJustDone -> {
// Not supported here
throw IllegalArgumentException("The PatientPortalResult.DebugJustDone is not supported for this screen!")
}
}.exhaustive }.exhaustive
} }
......
...@@ -46,6 +46,7 @@ class ConfirmInfectionResultViewModel @Inject constructor( ...@@ -46,6 +46,7 @@ class ConfirmInfectionResultViewModel @Inject constructor(
PatientPortalResult.InProgress -> { PatientPortalResult.InProgress -> {
// No-op, will not happen here // No-op, will not happen here
} }
is PatientPortalResult.DebugJustDone -> onSendInfectedStatusSuccess()
}.exhaustive }.exhaustive
} }
......
...@@ -415,11 +415,25 @@ ...@@ -415,11 +415,25 @@
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/size_24" android:layout_marginBottom="@dimen/size_24"
android:text="@string/debug_state_show_share_screen_error" android:text="@string/debug_state_show_share_screen_error"
app:layout_constraintBottom_toTopOf="@id/buttonDebugStateOpenSettingsAndScrollToCrossCountry" app:layout_constraintBottom_toTopOf="@id/buttonDebugStateShareScreenSuccess"
app:layout_constraintEnd_toEndOf="@id/guideEndThird" app:layout_constraintEnd_toEndOf="@id/guideEndThird"
app:layout_constraintStart_toStartOf="@id/guideStartThird" app:layout_constraintStart_toStartOf="@id/guideStartThird"
app:layout_constraintTop_toBottomOf="@id/buttonDebugStatePreShareScreen" /> app:layout_constraintTop_toBottomOf="@id/buttonDebugStatePreShareScreen" />
<com.google.android.material.button.MaterialButton
android:id="@+id/buttonDebugStateShareScreenSuccess"
style="@style/AppTheme.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constrainedWidth="true"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/size_24"
android:text="@string/debug_state_show_share_screen_success"
app:layout_constraintBottom_toTopOf="@id/buttonDebugStateOpenSettingsAndScrollToCrossCountry"
app:layout_constraintEnd_toEndOf="@id/guideEndThird"
app:layout_constraintStart_toStartOf="@id/guideStartThird"
app:layout_constraintTop_toBottomOf="@id/buttonDebugStateShareScreenError" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/buttonDebugStateOpenSettingsAndScrollToCrossCountry" android:id="@+id/buttonDebugStateOpenSettingsAndScrollToCrossCountry"
style="@style/AppTheme.Button" style="@style/AppTheme.Button"
...@@ -432,7 +446,7 @@ ...@@ -432,7 +446,7 @@
app:layout_constraintBottom_toTopOf="@+id/buttonDebugStateCrossCountryPopUp" app:layout_constraintBottom_toTopOf="@+id/buttonDebugStateCrossCountryPopUp"
app:layout_constraintEnd_toEndOf="@id/guideEndThird" app:layout_constraintEnd_toEndOf="@id/guideEndThird"
app:layout_constraintStart_toStartOf="@id/guideStartThird" app:layout_constraintStart_toStartOf="@id/guideStartThird"
app:layout_constraintTop_toBottomOf="@id/buttonDebugStateShareScreenError" /> app:layout_constraintTop_toBottomOf="@id/buttonDebugStateShareScreenSuccess" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/buttonDebugStateCrossCountryPopUp" android:id="@+id/buttonDebugStateCrossCountryPopUp"
......
...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
<action <action
android:id="@+id/crossCountryPopUp" android:id="@+id/crossCountryPopUp"
app:destination="@id/crossCountryFragment" /> app:destination="@id/crossCountryFragment" />
</fragment> </fragment>
<fragment <fragment
......
...@@ -34,8 +34,10 @@ ...@@ -34,8 +34,10 @@
<string name="confirm_infection_date_header_title">"Jäid haigeks?"</string> <string name="confirm_infection_date_header_title">"Jäid haigeks?"</string>
<string name="confirm_infection_button_open_patient_portal">"Tuvastan patsiendiportaalis"</string> <string name="confirm_infection_button_open_patient_portal">"Tuvastan patsiendiportaalis"</string>
<string name="confirm_infection_complete_title">"Tehtud!"</string> <string name="confirm_infection_complete_title">"Tehtud!"</string>
<string name="confirm_infection_complete_message1">"Selleks, et tagada sinu anonüümsus, jõuavad teavitused lähikontaktsete telefonidesse viivitusega lähema 24 tunni jooksul."</string> <string name="confirm_infection_complete_message1">"Selleks, et tagada sinu anonüümsus, jõuavad teavitused lähikontaktsete telefonidesse lähema 24 tunni jooksul."</string>
<string name="confirm_infection_complete_message2">"Aitäh, et hoiad lähedasi."</string> <string name="confirm_infection_complete_message2">"Hoia ära võimalikke uusi nakatumisi ja teavita oma lähikontaktseid kindlasti ka ise.
Aitäh, et hoiad lähedasi."</string>
<string name="error_generic">"Midagi ebaõnnestus. Palun proovige uuesti."</string> <string name="error_generic">"Midagi ebaõnnestus. Palun proovige uuesti."</string>
<string name="error_confirm_infection_send_infected_status">"Nakkuskinnituse saatmine ebaõnnestus. Võtmeid ei õnnestunud edastada."</string> <string name="error_confirm_infection_send_infected_status">"Nakkuskinnituse saatmine ebaõnnestus. Võtmeid ei õnnestunud edastada."</string>
<string name="error_confirm_infection_date_missing">"Sisesta kuupäev teavituseks"</string> <string name="error_confirm_infection_date_missing">"Sisesta kuupäev teavituseks"</string>
...@@ -175,6 +177,7 @@ ...@@ -175,6 +177,7 @@
<string name="confirm_infection_pre_share_info_button">"Alustan jagamist"</string> <string name="confirm_infection_pre_share_info_button">"Alustan jagamist"</string>
<string name="share_denied_title">"Teavitamine ei õnnestunud"</string> <string name="share_denied_title">"Teavitamine ei õnnestunud"</string>
<string name="debug_state_show_share_screen_error">"Võtmete jagamise ekraani veateade"</string> <string name="debug_state_show_share_screen_error">"Võtmete jagamise ekraani veateade"</string>
<string name="debug_state_show_share_screen_success">"Eduka võtmete jagamise teade"</string>
<string name="share_denied_paragraph1">"Teavitamine ebaõnnestus, sest HOIA ei saanud sinu telefonilt anonüümsete koodide jagamise õigust. Loa andmiseks vajuta allpool “Teavitama” ja järgnevas aknas “Jaga”, “Отправить” või “Share” nupule."</string> <string name="share_denied_paragraph1">"Teavitamine ebaõnnestus, sest HOIA ei saanud sinu telefonilt anonüümsete koodide jagamise õigust. Loa andmiseks vajuta allpool “Teavitama” ja järgnevas aknas “Jaga”, “Отправить” või “Share” nupule."</string>
<string name="share_denied_button_notify">"Teavitama"</string> <string name="share_denied_button_notify">"Teavitama"</string>
<string name="share_denied_paragraph2">"Teavitamisest loobumiseks vajuta “Tagasi avalehele”."</string> <string name="share_denied_paragraph2">"Teavitamisest loobumiseks vajuta “Tagasi avalehele”."</string>
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
<string name="confirm_infection_date_header_title">"Заболели?"</string> <string name="confirm_infection_date_header_title">"Заболели?"</string>
<string name="confirm_infection_button_open_patient_portal">"Идентифицироваться на портале пациента"</string> <string name="confirm_infection_button_open_patient_portal">"Идентифицироваться на портале пациента"</string>
<string name="confirm_infection_complete_title">"Готово!"</string> <string name="confirm_infection_complete_title">"Готово!"</string>
<string name="confirm_infection_complete_message1">"Для того чтобы обеспечить Вашу анонимность, уведомления поступят на телефоны близких контактов с задержкой, в течение ближайших 24 часов."</string>
<string name="confirm_infection_complete_message2">"Спасибо, что заботитесь о близких."</string>
<string name="error_generic">"Произошла ошибка. Пожалуйста, попробуйте снова."</string> <string name="error_generic">"Произошла ошибка. Пожалуйста, попробуйте снова."</string>
<string name="error_confirm_infection_send_infected_status">"Отправка подтверждения о заражении не удалась. Не удалось отправить ключи."</string> <string name="error_confirm_infection_send_infected_status">"Отправка подтверждения о заражении не удалась. Не удалось отправить ключи."</string>
<string name="error_confirm_infection_date_missing">"Bведите дату для уведомления"</string> <string name="error_confirm_infection_date_missing">"Bведите дату для уведомления"</string>
......
...@@ -34,8 +34,10 @@ ...@@ -34,8 +34,10 @@
<string name="confirm_infection_date_header_title">"Fallen ill?"</string> <string name="confirm_infection_date_header_title">"Fallen ill?"</string>
<string name="confirm_infection_button_open_patient_portal">"Confirm via Patient Portal"</string> <string name="confirm_infection_button_open_patient_portal">"Confirm via Patient Portal"</string>
<string name="confirm_infection_complete_title">"Done!"</string> <string name="confirm_infection_complete_title">"Done!"</string>
<string name="confirm_infection_complete_message1">"In order to protect your anonymity, your close contacts will be notified within 24 hours, following a slight delay."</string> <string name="confirm_infection_complete_message1">"In order to protect your anonymity, your close contacts will be notified within 24 hours."</string>
<string name="confirm_infection_complete_message2">"Thank you for taking care of your loved ones!"</string> <string name="confirm_infection_complete_message2">"Hoia ära võimalikke uusi nakatumisi ja teavita oma lähikontaktseid kindlasti ka ise.
Aitäh, et hoiad lähedasi."</string>
<string name="error_generic">"Something went wrong. Please try again."</string> <string name="error_generic">"Something went wrong. Please try again."</string>
<string name="error_confirm_infection_send_infected_status">"Infection confirmation process failed. Unable to submit keys."</string> <string name="error_confirm_infection_send_infected_status">"Infection confirmation process failed. Unable to submit keys."</string>
<string name="error_confirm_infection_date_missing">"Enter a date to send the notifications"</string> <string name="error_confirm_infection_date_missing">"Enter a date to send the notifications"</string>
...@@ -175,6 +177,7 @@ ...@@ -175,6 +177,7 @@
<string name="confirm_infection_pre_share_info_button">"Begin sharing"</string> <string name="confirm_infection_pre_share_info_button">"Begin sharing"</string>
<string name="share_denied_title">"Notification failed"</string> <string name="share_denied_title">"Notification failed"</string>
<string name="debug_state_show_share_screen_error">"Share Screen error"</string> <string name="debug_state_show_share_screen_error">"Share Screen error"</string>
<string name="debug_state_show_share_screen_success">"Share Screen success"</string>
<string name="share_denied_paragraph1">"Notification failed, because HOIA did not get the permission from your phone to share the anonymous codes. To retry, please click “Notify” below and then click “Share”, “Jaga” or “Отправить” in the following dialog."</string> <string name="share_denied_paragraph1">"Notification failed, because HOIA did not get the permission from your phone to share the anonymous codes. To retry, please click “Notify” below and then click “Share”, “Jaga” or “Отправить” in the following dialog."</string>
<string name="share_denied_button_notify">"Notify"</string> <string name="share_denied_button_notify">"Notify"</string>
<string name="share_denied_paragraph2">"If you do not wish to send the notification, then click “back to home screen” below."</string> <string name="share_denied_paragraph2">"If you do not wish to send the notification, then click “back to home screen” below."</string>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment