From cb435c523b5cf74cc149fbd740c559d5b45b1c7a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 2 Apr 2024 18:03:39 +0200 Subject: [PATCH] Create dedicated module for notification troubleshoot. --- features/preferences/impl/build.gradle.kts | 1 + .../preferences/impl/PreferencesFlowNode.kt | 12 +++- .../src/main/res/values-be/translations.xml | 8 --- .../src/main/res/values-cs/translations.xml | 8 --- .../src/main/res/values-de/translations.xml | 8 --- .../src/main/res/values-fr/translations.xml | 8 --- .../src/main/res/values-hu/translations.xml | 8 --- .../src/main/res/values-in/translations.xml | 8 --- .../src/main/res/values-ru/translations.xml | 8 --- .../src/main/res/values-sk/translations.xml | 8 --- .../impl/src/main/res/values/localazy.xml | 8 --- libraries/permissions/impl/build.gradle.kts | 1 + ...ficationTroubleshootCheckPermissionTest.kt | 6 +- ...tionTroubleshootCheckPermissionTestTest.kt | 1 - libraries/push/impl/build.gradle.kts | 1 + .../troubleshoot/CurrentPushProviderTest.kt | 6 +- .../impl/troubleshoot/NotificationTest.kt | 6 +- .../impl/troubleshoot/PushLoopbackTest.kt | 6 +- .../impl/troubleshoot/PushProvidersTest.kt | 6 +- .../CurrentPushProviderTestTest.kt | 2 +- .../impl/troubleshoot/NotificationTestTest.kt | 2 +- .../impl/troubleshoot/PushLoopbackTestTest.kt | 2 +- .../troubleshoot/PushProvidersTestTest.kt | 2 +- .../pushproviders/firebase/build.gradle.kts | 1 + .../troubleshoot/FirebaseAvailabilityTest.kt | 8 +-- .../troubleshoot/FirebaseTokenTest.kt | 8 +-- .../FirebaseAvailabilityTestTest.kt | 2 +- .../troubleshoot/FirebaseTokenTestTest.kt | 2 +- .../unifiedpush/build.gradle.kts | 1 + .../troubleshoot/UnifiedPushTest.kt | 8 +-- .../troubleshoot/UnifiedPushTestTest.kt | 2 +- libraries/troubleshoot/api/build.gradle.kts | 28 +++++++++ .../api/NotificationTroubleShootEntryPoint.kt | 35 +++++++++++ .../api/test}/NotificationTroubleshootTest.kt | 2 +- .../NotificationTroubleshootTestDelegate.kt | 2 +- .../NotificationTroubleshootTestState.kt | 2 +- .../troubleshoot/api/test}/TestFilterData.kt | 2 +- libraries/troubleshoot/impl/build.gradle.kts | 58 +++++++++++++++++++ ...faultNotificationTroubleShootEntryPoint.kt | 44 ++++++++++++++ .../impl}/TroubleshootNotificationsEvents.kt | 2 +- .../impl}/TroubleshootNotificationsNode.kt | 12 +++- .../TroubleshootNotificationsPresenter.kt | 2 +- .../impl}/TroubleshootNotificationsState.kt | 2 +- .../TroubleshootNotificationsStateProvider.kt | 4 +- .../impl}/TroubleshootNotificationsView.kt | 7 +-- .../impl}/TroubleshootTestSuite.kt | 8 +-- .../impl}/TroubleshootTestSuiteState.kt | 4 +- .../src/main/res/values-be/translations.xml | 11 ++++ .../src/main/res/values-cs/translations.xml | 11 ++++ .../src/main/res/values-de/translations.xml | 11 ++++ .../src/main/res/values-fr/translations.xml | 11 ++++ .../src/main/res/values-hu/translations.xml | 11 ++++ .../src/main/res/values-ru/translations.xml | 11 ++++ .../src/main/res/values-sk/translations.xml | 11 ++++ .../impl/src/main/res/values/localazy.xml | 11 ++++ .../impl}/FakeNotificationTroubleshootTest.kt | 6 +- ...TroubleshootNotificationsPresenterTests.kt | 8 +-- .../TroubleshootNotificationsViewTest.kt | 14 ++++- .../kotlin/extension/DependencyHandleScope.kt | 1 + tools/localazy/config.json | 7 ++- 60 files changed, 355 insertions(+), 141 deletions(-) create mode 100644 libraries/troubleshoot/api/build.gradle.kts create mode 100644 libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/NotificationTroubleShootEntryPoint.kt rename libraries/{core/src/main/kotlin/io/element/android/libraries/core/notifications => troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test}/NotificationTroubleshootTest.kt (94%) rename libraries/{core/src/main/kotlin/io/element/android/libraries/core/notifications => troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test}/NotificationTroubleshootTestDelegate.kt (97%) rename libraries/{core/src/main/kotlin/io/element/android/libraries/core/notifications => troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test}/NotificationTroubleshootTestState.kt (94%) rename libraries/{core/src/main/kotlin/io/element/android/libraries/core/notifications => troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test}/TestFilterData.kt (91%) create mode 100644 libraries/troubleshoot/impl/build.gradle.kts create mode 100644 libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/DefaultNotificationTroubleShootEntryPoint.kt rename {features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootNotificationsEvents.kt (91%) rename {features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootNotificationsNode.kt (82%) rename {features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootNotificationsPresenter.kt (96%) rename {features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootNotificationsState.kt (91%) rename {features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootNotificationsStateProvider.kt (96%) rename {features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootNotificationsView.kt (96%) rename {features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootTestSuite.kt (93%) rename {features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootTestSuiteState.kt (83%) create mode 100644 libraries/troubleshoot/impl/src/main/res/values-be/translations.xml create mode 100644 libraries/troubleshoot/impl/src/main/res/values-cs/translations.xml create mode 100644 libraries/troubleshoot/impl/src/main/res/values-de/translations.xml create mode 100644 libraries/troubleshoot/impl/src/main/res/values-fr/translations.xml create mode 100644 libraries/troubleshoot/impl/src/main/res/values-hu/translations.xml create mode 100644 libraries/troubleshoot/impl/src/main/res/values-ru/translations.xml create mode 100644 libraries/troubleshoot/impl/src/main/res/values-sk/translations.xml create mode 100644 libraries/troubleshoot/impl/src/main/res/values/localazy.xml rename {features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl}/FakeNotificationTroubleshootTest.kt (91%) rename {features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootNotificationsPresenterTests.kt (94%) rename {features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot => libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl}/TroubleshootNotificationsViewTest.kt (91%) diff --git a/features/preferences/impl/build.gradle.kts b/features/preferences/impl/build.gradle.kts index 415f0e36b4..edfb275f17 100644 --- a/features/preferences/impl/build.gradle.kts +++ b/features/preferences/impl/build.gradle.kts @@ -49,6 +49,7 @@ dependencies { implementation(projects.libraries.pushstore.api) implementation(projects.libraries.indicator.api) implementation(projects.libraries.preferences.api) + implementation(projects.libraries.troubleshoot.api) implementation(projects.libraries.testtags) implementation(projects.libraries.uiStrings) implementation(projects.libraries.matrixui) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt index 5f57ad8b5e..1dc5f650fd 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/PreferencesFlowNode.kt @@ -24,6 +24,7 @@ import com.bumble.appyx.core.node.Node import com.bumble.appyx.core.plugin.Plugin import com.bumble.appyx.core.plugin.plugins import com.bumble.appyx.navmodel.backstack.BackStack +import com.bumble.appyx.navmodel.backstack.operation.pop import com.bumble.appyx.navmodel.backstack.operation.push import dagger.assisted.Assisted import dagger.assisted.AssistedInject @@ -39,7 +40,6 @@ import io.element.android.features.preferences.impl.developer.DeveloperSettingsN import io.element.android.features.preferences.impl.developer.tracing.ConfigureTracingNode import io.element.android.features.preferences.impl.notifications.NotificationSettingsNode import io.element.android.features.preferences.impl.notifications.edit.EditDefaultNotificationSettingNode -import io.element.android.features.preferences.impl.notifications.troubleshoot.TroubleshootNotificationsNode import io.element.android.features.preferences.impl.root.PreferencesRootNode import io.element.android.features.preferences.impl.user.editprofile.EditUserProfileNode import io.element.android.libraries.architecture.BackstackView @@ -48,6 +48,7 @@ import io.element.android.libraries.architecture.createNode import io.element.android.libraries.di.SessionScope import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.matrix.api.user.MatrixUser +import io.element.android.libraries.troubleshoot.api.NotificationTroubleShootEntryPoint import kotlinx.parcelize.Parcelize @ContributesNode(SessionScope::class) @@ -55,6 +56,7 @@ class PreferencesFlowNode @AssistedInject constructor( @Assisted buildContext: BuildContext, @Assisted plugins: List, private val lockScreenEntryPoint: LockScreenEntryPoint, + private val notificationTroubleShootEntryPoint: NotificationTroubleShootEntryPoint, private val logoutEntryPoint: LogoutEntryPoint, ) : BaseFlowNode( backstack = BackStack( @@ -189,7 +191,13 @@ class PreferencesFlowNode @AssistedInject constructor( createNode(buildContext, listOf(notificationSettingsCallback)) } NavTarget.TroubleshootNotifications -> { - createNode(buildContext) + notificationTroubleShootEntryPoint.nodeBuilder(this, buildContext) + .callback(object : NotificationTroubleShootEntryPoint.Callback { + override fun onDone() { + backstack.pop() + } + }) + .build() } is NavTarget.EditDefaultNotificationSetting -> { val callback = object : EditDefaultNotificationSettingNode.Callback { diff --git a/features/preferences/impl/src/main/res/values-be/translations.xml b/features/preferences/impl/src/main/res/values-be/translations.xml index 0a8e477f7f..450a47ce61 100644 --- a/features/preferences/impl/src/main/res/values-be/translations.xml +++ b/features/preferences/impl/src/main/res/values-be/translations.xml @@ -51,12 +51,4 @@ "Апавяшчэнні" "Выпраўленне непаладак" "Выпраўленне непаладак з апавяшчэннямі" - "Запусціць тэсты" - "Запусціце тэсты яшчэ раз" - "Некаторыя тэсты не ўдаліся. Калі ласка, праглядзіце дэталі." - "Запусціце тэсты, каб выявіць праблемы ў вашай канфігурацыі, з-за якіх апавяшчэння могуць паводзіць сябе не так, як чакалася." - "Спроба выпраўлення" - "Усе тэсты паспяхова пройдзены." - "Выпраўленне непаладак з апавяшчэннямі" - "Некаторыя тэсты патрабуюць вашай увагі. Калі ласка, праглядзіце дэталі." diff --git a/features/preferences/impl/src/main/res/values-cs/translations.xml b/features/preferences/impl/src/main/res/values-cs/translations.xml index a2a3cc5955..60bc4b2b3e 100644 --- a/features/preferences/impl/src/main/res/values-cs/translations.xml +++ b/features/preferences/impl/src/main/res/values-cs/translations.xml @@ -53,12 +53,4 @@ Pokud budete pokračovat, některá nastavení se mohou změnit." "Oznámení" "Odstraňování problémů" "Odstraňování problémů s upozorněními" - "Spustit testy" - "Spustit testy znovu" - "Některé testy selhaly. Zkontrolujte prosím podrobnosti." - "Spusťte testy, abyste zjistili jakýkoli problém ve vaší konfiguraci, který může způsobit, že se oznámení nebudou chovat podle očekávání." - "Pokus o opravu" - "Všechny testy proběhly úspěšně." - "Odstraňování problémů s upozorněními" - "Některé testy vyžadují vaši pozornost. Zkontrolujte prosím podrobnosti." diff --git a/features/preferences/impl/src/main/res/values-de/translations.xml b/features/preferences/impl/src/main/res/values-de/translations.xml index 04a27f9db6..65b4923452 100644 --- a/features/preferences/impl/src/main/res/values-de/translations.xml +++ b/features/preferences/impl/src/main/res/values-de/translations.xml @@ -51,12 +51,4 @@ Wenn du fortfährst, können sich einige deiner Einstellungen ändern." "Benachrichtigungen" "Fehlerbehebung" "Fehlerbehebung für Benachrichtigungen" - "Tests durchführen" - "Tests erneut durchführen" - "Einige Tests sind fehlgeschlagen. Bitte überprüfe die Details." - "Führe die Tests durch, um Probleme zu erkennen, die dazu führen können, dass sich die Benachrichtigungen nicht wie erwartet verhalten." - "Versuche das Problem zu beheben" - "Alle Tests wurden erfolgreich bestanden." - "Fehlerbehebung für Benachrichtigungen" - "Einige Tests erfordern deine Aufmerksamkeit. Bitte überprüfe die Details." diff --git a/features/preferences/impl/src/main/res/values-fr/translations.xml b/features/preferences/impl/src/main/res/values-fr/translations.xml index 426c475d4c..9c415fea2d 100644 --- a/features/preferences/impl/src/main/res/values-fr/translations.xml +++ b/features/preferences/impl/src/main/res/values-fr/translations.xml @@ -51,12 +51,4 @@ Si vous continuez, il est possible que certains de vos paramètres soient modifi "Notifications" "Dépannage" "Résoudre les problèmes liés aux notifications" - "Exécuter les tests" - "Relancer les tests" - "Certains tests ont échoué. Veuillez vérifier les détails." - "Exécuter les tests pour détecter tout problème dans votre configuration susceptible de provoquer un dysfonctionnement des notifications." - "Tenter de corriger" - "Tous les tests ont réussi." - "Dépanner les notifications" - "Certains tests nécessitent votre attention. Veuillez vérifier les détails." diff --git a/features/preferences/impl/src/main/res/values-hu/translations.xml b/features/preferences/impl/src/main/res/values-hu/translations.xml index 3574b49e6e..841695edcf 100644 --- a/features/preferences/impl/src/main/res/values-hu/translations.xml +++ b/features/preferences/impl/src/main/res/values-hu/translations.xml @@ -51,12 +51,4 @@ Ha folytatja, egyes beállítások megváltozhatnak." "Értesítések" "Hibaelhárítás" "Értesítések hibaelhárítása" - "Tesztek futtatása" - "Tesztek újbóli futtatása" - "Egyes tesztek sikertelenek voltak. Ellenőrizze a részleteket." - "A tesztek futtatása, hogy észlelje a konfigurációban felmerülő olyan problémákat, amelyek miatt az értesítések nem az elvárt módon viselkednek." - "Kísérlet a javításra" - "Minden teszt sikeresen lezajlott." - "Értesítések hibaelhárítása" - "Egyes tesztek a figyelmét igénylik. Ellenőrizze a részleteket." diff --git a/features/preferences/impl/src/main/res/values-in/translations.xml b/features/preferences/impl/src/main/res/values-in/translations.xml index 13ac802d4d..8bca603eeb 100644 --- a/features/preferences/impl/src/main/res/values-in/translations.xml +++ b/features/preferences/impl/src/main/res/values-in/translations.xml @@ -53,12 +53,4 @@ Jika Anda melanjutkan, beberapa pengaturan Anda dapat berubah." "Notifikasi" "Pemecahan masalah" "Pecahkan masalah notifikasi" - "Jalankan tes" - "Jalankan tes lagi" - "Beberapa tes gagal. Silakan periksa detailnya." - "Jalankan pengujian untuk mendeteksi masalah apa pun dalam konfigurasi Anda yang mungkin membuat notifikasi tidak berperilaku seperti yang diharapkan." - "Mencoba untuk memperbaiki" - "Semua tes berhasil dilalui." - "Pecahkan masalah notifikasi" - "Beberapa tes membutuhkan perhatian Anda. Silakan periksa detailnya." diff --git a/features/preferences/impl/src/main/res/values-ru/translations.xml b/features/preferences/impl/src/main/res/values-ru/translations.xml index ca18672e97..3b24cf8c80 100644 --- a/features/preferences/impl/src/main/res/values-ru/translations.xml +++ b/features/preferences/impl/src/main/res/values-ru/translations.xml @@ -51,12 +51,4 @@ "Уведомления" "Устранение неполадок" "Уведомления об устранении неполадок" - "Выполнение тестов" - "Повторное выполнение тестов" - "Некоторые тесты провалились. Пожалуйста, проверьте детали." - "Выполните тесты, чтобы обнаружить любую проблему в конфигурации, из-за которой уведомления могут работать не так, как ожидалось." - "Попытка исправить" - "Все тесты прошли успешно." - "Уведомления об устранении неполадок" - "Некоторые тесты требуют вашего внимания. Пожалуйста, проверьте детали." diff --git a/features/preferences/impl/src/main/res/values-sk/translations.xml b/features/preferences/impl/src/main/res/values-sk/translations.xml index 12289b46f4..f382d0ab6f 100644 --- a/features/preferences/impl/src/main/res/values-sk/translations.xml +++ b/features/preferences/impl/src/main/res/values-sk/translations.xml @@ -53,12 +53,4 @@ Ak budete pokračovať, niektoré z vašich nastavení sa môžu zmeniť.""Oznámenia" "Riešenie problémov" "Oznámenia riešení problémov" - "Spustiť testy" - "Spustiť testy znova" - "Niektoré testy zlyhali. Skontrolujte prosím podrobnosti." - "Spustite testy, aby ste zistili akýkoľvek problém vo vašej konfigurácii, ktorý môže spôsobiť, že sa upozornenia nebudú správať podľa očakávania." - "Pokus o opravu" - "Všetky testy prebehli úspešne." - "Oznámenia riešení problémov" - "Niektoré testy si vyžadujú vašu pozornosť. Prosím skontrolujte podrobnosti." diff --git a/features/preferences/impl/src/main/res/values/localazy.xml b/features/preferences/impl/src/main/res/values/localazy.xml index b0e78e0d9e..56a5c0ba03 100644 --- a/features/preferences/impl/src/main/res/values/localazy.xml +++ b/features/preferences/impl/src/main/res/values/localazy.xml @@ -51,12 +51,4 @@ If you proceed, some of your settings may change." "Notifications" "Troubleshoot" "Troubleshoot notifications" - "Run tests" - "Run tests again" - "Some tests failed. Please check the details." - "Run the tests to detect any issue in your configuration that may make notifications not behave as expected." - "Attempt to fix" - "All tests passed successfully." - "Troubleshoot notifications" - "Some tests require your attention. Please check the details." diff --git a/libraries/permissions/impl/build.gradle.kts b/libraries/permissions/impl/build.gradle.kts index 82904bc750..7b80ef0d4f 100644 --- a/libraries/permissions/impl/build.gradle.kts +++ b/libraries/permissions/impl/build.gradle.kts @@ -46,6 +46,7 @@ dependencies { implementation(projects.libraries.architecture) implementation(projects.libraries.matrix.api) implementation(projects.libraries.matrixui) + implementation(projects.libraries.troubleshoot.api) implementation(projects.libraries.designsystem) implementation(projects.libraries.uiStrings) implementation(projects.services.toolbox.api) diff --git a/libraries/permissions/impl/src/main/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTest.kt b/libraries/permissions/impl/src/main/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTest.kt index 903b5cd2c4..7e916c37b5 100644 --- a/libraries/permissions/impl/src/main/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTest.kt +++ b/libraries/permissions/impl/src/main/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTest.kt @@ -19,13 +19,13 @@ package io.element.android.libraries.permissions.impl.troubleshoot import android.Manifest import android.os.Build import com.squareup.anvil.annotations.ContributesMultibinding -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.di.AppScope import io.element.android.libraries.permissions.api.PermissionStateProvider import io.element.android.libraries.permissions.impl.R import io.element.android.libraries.permissions.impl.action.PermissionActions +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestDelegate +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.api.sdk.BuildVersionSdkIntProvider import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope diff --git a/libraries/permissions/impl/src/test/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTestTest.kt b/libraries/permissions/impl/src/test/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTestTest.kt index c17e61f5e7..df0214b08d 100644 --- a/libraries/permissions/impl/src/test/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTestTest.kt +++ b/libraries/permissions/impl/src/test/kotlin/io/element/android/libraries/permissions/impl/troubleshoot/NotificationTroubleshootCheckPermissionTestTest.kt @@ -19,7 +19,6 @@ package io.element.android.libraries.permissions.impl.troubleshoot import android.os.Build import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.permissions.impl.FakePermissionStateProvider import io.element.android.libraries.permissions.impl.action.FakePermissionActions import io.element.android.services.toolbox.test.sdk.FakeBuildVersionSdkIntProvider diff --git a/libraries/push/impl/build.gradle.kts b/libraries/push/impl/build.gradle.kts index f16f7f23f0..ee528a4ae7 100644 --- a/libraries/push/impl/build.gradle.kts +++ b/libraries/push/impl/build.gradle.kts @@ -53,6 +53,7 @@ dependencies { implementation(projects.libraries.matrix.api) implementation(projects.libraries.matrixui) implementation(projects.libraries.uiStrings) + implementation(projects.libraries.troubleshoot.api) api(projects.libraries.pushproviders.api) api(projects.libraries.pushstore.api) api(projects.libraries.push.api) diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTest.kt index 7a819b3d93..3e7fe1ae59 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTest.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTest.kt @@ -17,12 +17,12 @@ package io.element.android.libraries.push.impl.troubleshoot import com.squareup.anvil.annotations.ContributesMultibinding -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.di.AppScope import io.element.android.libraries.push.api.GetCurrentPushProvider import io.element.android.libraries.push.impl.R +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestDelegate +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTest.kt index 26b7161fca..8de8304c2d 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTest.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTest.kt @@ -17,13 +17,13 @@ package io.element.android.libraries.push.impl.troubleshoot import com.squareup.anvil.annotations.ContributesMultibinding -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.di.AppScope import io.element.android.libraries.push.impl.R import io.element.android.libraries.push.impl.notifications.NotificationDisplayer import io.element.android.libraries.push.impl.notifications.factories.NotificationCreator +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestDelegate +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTest.kt index 861554bef8..42a6394fc9 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTest.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTest.kt @@ -17,13 +17,13 @@ package io.element.android.libraries.push.impl.troubleshoot import com.squareup.anvil.annotations.ContributesMultibinding -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.di.AppScope import io.element.android.libraries.push.api.PushService import io.element.android.libraries.push.api.gateway.PushGatewayFailure import io.element.android.libraries.push.impl.R +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestDelegate +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.api.strings.StringProvider import io.element.android.services.toolbox.api.systemclock.SystemClock import kotlinx.coroutines.CompletableDeferred diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt index df6d220396..190cf8fe98 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt @@ -17,12 +17,12 @@ package io.element.android.libraries.push.impl.troubleshoot import com.squareup.anvil.annotations.ContributesMultibinding -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.di.AppScope import io.element.android.libraries.push.impl.R import io.element.android.libraries.pushproviders.api.PushProvider +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestDelegate +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTestTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTestTest.kt index ea8de71222..7f7beb9d9b 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTestTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/CurrentPushProviderTestTest.kt @@ -18,8 +18,8 @@ package io.element.android.libraries.push.impl.troubleshoot import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.push.test.FakeGetCurrentPushProvider +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTestTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTestTest.kt index a900d50b1f..1351117527 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTestTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/NotificationTestTest.kt @@ -18,9 +18,9 @@ package io.element.android.libraries.push.impl.troubleshoot import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.push.impl.notifications.fake.MockkNotificationCreator import io.element.android.libraries.push.impl.notifications.fake.MockkNotificationDisplayer +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTestTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTestTest.kt index 01fe2b9847..2c1363af78 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTestTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushLoopbackTestTest.kt @@ -18,11 +18,11 @@ package io.element.android.libraries.push.impl.troubleshoot import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.matrix.test.AN_EXCEPTION import io.element.android.libraries.matrix.test.A_FAILURE_REASON import io.element.android.libraries.push.api.gateway.PushGatewayFailure import io.element.android.libraries.push.test.FakePushService +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.test.strings.FakeStringProvider import io.element.android.services.toolbox.test.systemclock.FakeSystemClock import kotlinx.coroutines.launch diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt index cf7f750403..e58a490715 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt @@ -18,8 +18,8 @@ package io.element.android.libraries.push.impl.troubleshoot import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.pushproviders.test.FakePushProvider +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest diff --git a/libraries/pushproviders/firebase/build.gradle.kts b/libraries/pushproviders/firebase/build.gradle.kts index de19420923..6e36b92a09 100644 --- a/libraries/pushproviders/firebase/build.gradle.kts +++ b/libraries/pushproviders/firebase/build.gradle.kts @@ -41,6 +41,7 @@ dependencies { implementation(projects.libraries.di) implementation(projects.libraries.matrix.api) implementation(projects.libraries.uiStrings) + implementation(projects.libraries.troubleshoot.api) implementation(projects.services.toolbox.api) implementation(projects.libraries.pushstore.api) diff --git a/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTest.kt b/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTest.kt index 64a5bad67f..6cca3d21af 100644 --- a/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTest.kt +++ b/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTest.kt @@ -17,14 +17,14 @@ package io.element.android.libraries.pushproviders.firebase.troubleshoot import com.squareup.anvil.annotations.ContributesMultibinding -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState -import io.element.android.libraries.core.notifications.TestFilterData import io.element.android.libraries.di.AppScope import io.element.android.libraries.pushproviders.firebase.FirebaseConfig import io.element.android.libraries.pushproviders.firebase.IsPlayServiceAvailable import io.element.android.libraries.pushproviders.firebase.R +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestDelegate +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState +import io.element.android.libraries.troubleshoot.api.test.TestFilterData import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow diff --git a/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTest.kt b/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTest.kt index b2164cda32..a465ca3a7b 100644 --- a/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTest.kt +++ b/libraries/pushproviders/firebase/src/main/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTest.kt @@ -17,15 +17,15 @@ package io.element.android.libraries.pushproviders.firebase.troubleshoot import com.squareup.anvil.annotations.ContributesMultibinding -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState -import io.element.android.libraries.core.notifications.TestFilterData import io.element.android.libraries.di.AppScope import io.element.android.libraries.pushproviders.firebase.FirebaseConfig import io.element.android.libraries.pushproviders.firebase.FirebaseStore import io.element.android.libraries.pushproviders.firebase.FirebaseTroubleshooter import io.element.android.libraries.pushproviders.firebase.R +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestDelegate +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState +import io.element.android.libraries.troubleshoot.api.test.TestFilterData import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow diff --git a/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTestTest.kt b/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTestTest.kt index 0c742fa567..6f1a3da7cb 100644 --- a/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTestTest.kt +++ b/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseAvailabilityTestTest.kt @@ -18,8 +18,8 @@ package io.element.android.libraries.pushproviders.firebase.troubleshoot import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.pushproviders.firebase.IsPlayServiceAvailable +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest diff --git a/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTestTest.kt b/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTestTest.kt index b76e6861fc..2d8de62ad9 100644 --- a/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTestTest.kt +++ b/libraries/pushproviders/firebase/src/test/kotlin/io/element/android/libraries/pushproviders/firebase/troubleshoot/FirebaseTokenTestTest.kt @@ -18,9 +18,9 @@ package io.element.android.libraries.pushproviders.firebase.troubleshoot import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.pushproviders.firebase.FakeFirebaseTroubleshooter import io.element.android.libraries.pushproviders.firebase.InMemoryFirebaseStore +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest diff --git a/libraries/pushproviders/unifiedpush/build.gradle.kts b/libraries/pushproviders/unifiedpush/build.gradle.kts index 190c63d350..d5dcc9727d 100644 --- a/libraries/pushproviders/unifiedpush/build.gradle.kts +++ b/libraries/pushproviders/unifiedpush/build.gradle.kts @@ -33,6 +33,7 @@ dependencies { implementation(projects.libraries.core) implementation(projects.libraries.matrix.api) implementation(projects.libraries.uiStrings) + api(projects.libraries.troubleshoot.api) implementation(projects.libraries.pushstore.api) implementation(projects.libraries.pushproviders.api) diff --git a/libraries/pushproviders/unifiedpush/src/main/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTest.kt b/libraries/pushproviders/unifiedpush/src/main/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTest.kt index ec3b95e437..77a2347429 100644 --- a/libraries/pushproviders/unifiedpush/src/main/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTest.kt +++ b/libraries/pushproviders/unifiedpush/src/main/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTest.kt @@ -17,14 +17,14 @@ package io.element.android.libraries.pushproviders.unifiedpush.troubleshoot import com.squareup.anvil.annotations.ContributesMultibinding -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestDelegate -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState -import io.element.android.libraries.core.notifications.TestFilterData import io.element.android.libraries.di.AppScope import io.element.android.libraries.pushproviders.unifiedpush.R import io.element.android.libraries.pushproviders.unifiedpush.UnifiedPushConfig import io.element.android.libraries.pushproviders.unifiedpush.UnifiedPushDistributorProvider +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestDelegate +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState +import io.element.android.libraries.troubleshoot.api.test.TestFilterData import io.element.android.services.toolbox.api.strings.StringProvider import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow diff --git a/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTestTest.kt b/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTestTest.kt index 29301515cd..117e8b7457 100644 --- a/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTestTest.kt +++ b/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/troubleshoot/UnifiedPushTestTest.kt @@ -18,8 +18,8 @@ package io.element.android.libraries.pushproviders.unifiedpush.troubleshoot import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.pushproviders.api.Distributor +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.toolbox.test.strings.FakeStringProvider import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest diff --git a/libraries/troubleshoot/api/build.gradle.kts b/libraries/troubleshoot/api/build.gradle.kts new file mode 100644 index 0000000000..5ac917fd0b --- /dev/null +++ b/libraries/troubleshoot/api/build.gradle.kts @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("io.element.android-library") +} + +android { + namespace = "io.element.android.libraries.troubleshoot.api" +} + +dependencies { + implementation(projects.libraries.architecture) + implementation(libs.androidx.corektx) + implementation(libs.coroutines.core) +} diff --git a/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/NotificationTroubleShootEntryPoint.kt b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/NotificationTroubleShootEntryPoint.kt new file mode 100644 index 0000000000..6e4e1c39e3 --- /dev/null +++ b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/NotificationTroubleShootEntryPoint.kt @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.troubleshoot.api + +import com.bumble.appyx.core.modality.BuildContext +import com.bumble.appyx.core.node.Node +import com.bumble.appyx.core.plugin.Plugin +import io.element.android.libraries.architecture.FeatureEntryPoint + +interface NotificationTroubleShootEntryPoint : FeatureEntryPoint { + fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder + + interface NodeBuilder { + fun callback(callback: Callback): NodeBuilder + fun build(): Node + } + + interface Callback : Plugin { + fun onDone() + } +} diff --git a/libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/NotificationTroubleshootTest.kt b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/NotificationTroubleshootTest.kt similarity index 94% rename from libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/NotificationTroubleshootTest.kt rename to libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/NotificationTroubleshootTest.kt index 7af0b85ffb..69073925fb 100644 --- a/libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/NotificationTroubleshootTest.kt +++ b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/NotificationTroubleshootTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.libraries.core.notifications +package io.element.android.libraries.troubleshoot.api.test import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.StateFlow diff --git a/libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/NotificationTroubleshootTestDelegate.kt b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/NotificationTroubleshootTestDelegate.kt similarity index 97% rename from libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/NotificationTroubleshootTestDelegate.kt rename to libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/NotificationTroubleshootTestDelegate.kt index 88aaae7281..da36de8ee7 100644 --- a/libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/NotificationTroubleshootTestDelegate.kt +++ b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/NotificationTroubleshootTestDelegate.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.libraries.core.notifications +package io.element.android.libraries.troubleshoot.api.test import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow diff --git a/libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/NotificationTroubleshootTestState.kt b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/NotificationTroubleshootTestState.kt similarity index 94% rename from libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/NotificationTroubleshootTestState.kt rename to libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/NotificationTroubleshootTestState.kt index 9657be4b3b..1429916bcc 100644 --- a/libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/NotificationTroubleshootTestState.kt +++ b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/NotificationTroubleshootTestState.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.libraries.core.notifications +package io.element.android.libraries.troubleshoot.api.test data class NotificationTroubleshootTestState( val name: String, diff --git a/libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/TestFilterData.kt b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/TestFilterData.kt similarity index 91% rename from libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/TestFilterData.kt rename to libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/TestFilterData.kt index e22fefb7f1..77f633363d 100644 --- a/libraries/core/src/main/kotlin/io/element/android/libraries/core/notifications/TestFilterData.kt +++ b/libraries/troubleshoot/api/src/main/kotlin/io/element/android/libraries/troubleshoot/api/test/TestFilterData.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.libraries.core.notifications +package io.element.android.libraries.troubleshoot.api.test data class TestFilterData( val currentPushProviderName: String?, diff --git a/libraries/troubleshoot/impl/build.gradle.kts b/libraries/troubleshoot/impl/build.gradle.kts new file mode 100644 index 0000000000..b5a0a9012d --- /dev/null +++ b/libraries/troubleshoot/impl/build.gradle.kts @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("io.element.android-compose-library") + alias(libs.plugins.anvil) + alias(libs.plugins.kotlin.serialization) +} + +android { + namespace = "io.element.android.libraries.troubleshoot.impl" + + testOptions { + unitTests { + isIncludeAndroidResources = true + } + } +} + +anvil { + generateDaggerFactories.set(true) +} + +dependencies { + implementation(projects.anvilannotations) + anvil(projects.anvilcodegen) + implementation(libs.dagger) + implementation(projects.libraries.architecture) + implementation(projects.libraries.designsystem) + implementation(projects.libraries.di) + api(projects.libraries.troubleshoot.api) + api(projects.libraries.push.api) + implementation(projects.services.analytics.api) + + testImplementation(libs.test.junit) + testImplementation(libs.test.robolectric) + testImplementation(libs.molecule.runtime) + testImplementation(libs.test.truth) + testImplementation(libs.test.turbine) + testImplementation(libs.coroutines.test) + testImplementation(projects.services.analytics.test) + testImplementation(projects.tests.testutils) + testImplementation(projects.libraries.push.test) + testImplementation(libs.androidx.compose.ui.test.junit) + testReleaseImplementation(libs.androidx.compose.ui.test.manifest) +} diff --git a/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/DefaultNotificationTroubleShootEntryPoint.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/DefaultNotificationTroubleShootEntryPoint.kt new file mode 100644 index 0000000000..81c0cdaf00 --- /dev/null +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/DefaultNotificationTroubleShootEntryPoint.kt @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.troubleshoot.impl + +import com.bumble.appyx.core.modality.BuildContext +import com.bumble.appyx.core.node.Node +import com.bumble.appyx.core.plugin.Plugin +import com.squareup.anvil.annotations.ContributesBinding +import io.element.android.libraries.architecture.createNode +import io.element.android.libraries.di.AppScope +import io.element.android.libraries.troubleshoot.api.NotificationTroubleShootEntryPoint +import javax.inject.Inject + +@ContributesBinding(AppScope::class) +class DefaultNotificationTroubleShootEntryPoint @Inject constructor() : NotificationTroubleShootEntryPoint { + override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NotificationTroubleShootEntryPoint.NodeBuilder { + val plugins = ArrayList() + + return object : NotificationTroubleShootEntryPoint.NodeBuilder { + override fun callback(callback: NotificationTroubleShootEntryPoint.Callback): NotificationTroubleShootEntryPoint.NodeBuilder { + plugins += callback + return this + } + + override fun build(): Node { + return parentNode.createNode(buildContext, plugins) + } + } + } +} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsEvents.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsEvents.kt similarity index 91% rename from features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsEvents.kt rename to libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsEvents.kt index a6b361de13..f2398e3b78 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsEvents.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsEvents.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl sealed interface TroubleshootNotificationsEvents { data object StartTests : TroubleshootNotificationsEvents diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsNode.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsNode.kt similarity index 82% rename from features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsNode.kt rename to libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsNode.kt index a662e94db8..96404d6d8c 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsNode.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsNode.kt @@ -14,18 +14,20 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.bumble.appyx.core.modality.BuildContext import com.bumble.appyx.core.node.Node import com.bumble.appyx.core.plugin.Plugin +import com.bumble.appyx.core.plugin.plugins import dagger.assisted.Assisted import dagger.assisted.AssistedInject import im.vector.app.features.analytics.plan.MobileScreen import io.element.android.anvilannotations.ContributesNode import io.element.android.libraries.di.SessionScope +import io.element.android.libraries.troubleshoot.api.NotificationTroubleShootEntryPoint import io.element.android.services.analytics.api.ScreenTracker @ContributesNode(SessionScope::class) @@ -35,13 +37,19 @@ class TroubleshootNotificationsNode @AssistedInject constructor( private val presenter: TroubleshootNotificationsPresenter, private val screenTracker: ScreenTracker, ) : Node(buildContext, plugins = plugins) { + private fun onDone() { + plugins().forEach { + it.onDone() + } + } + @Composable override fun View(modifier: Modifier) { screenTracker.TrackScreen(MobileScreen.ScreenName.NotificationTroubleshoot) val state = presenter.present() TroubleshootNotificationsView( state = state, - onBackPressed = ::navigateUp, + onBackPressed = ::onDone, modifier = modifier, ) } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsPresenter.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsPresenter.kt similarity index 96% rename from features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsPresenter.kt rename to libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsPresenter.kt index 1ccbf86ce9..a730199fac 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsPresenter.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsPresenter.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsState.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsState.kt similarity index 91% rename from features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsState.kt rename to libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsState.kt index 55032b2fe9..4ff7c2c04c 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsState.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsState.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl data class TroubleshootNotificationsState( val testSuiteState: TroubleshootTestSuiteState, diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsStateProvider.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsStateProvider.kt similarity index 96% rename from features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsStateProvider.kt rename to libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsStateProvider.kt index 316bd72ad7..f2d49a82a0 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsStateProvider.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsStateProvider.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl import androidx.compose.ui.tooling.preview.PreviewParameterProvider -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import kotlinx.collections.immutable.toImmutableList open class TroubleshootNotificationsStateProvider : PreviewParameterProvider { diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsView.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt similarity index 96% rename from features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsView.kt rename to libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt index 08d56e5bd0..8b2ba843be 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsView.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.size @@ -27,10 +27,7 @@ import androidx.compose.ui.unit.dp import androidx.lifecycle.Lifecycle import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons -import io.element.android.features.preferences.impl.R import io.element.android.libraries.architecture.AsyncAction -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState.Status import io.element.android.libraries.designsystem.components.list.ListItemContent import io.element.android.libraries.designsystem.components.preferences.PreferencePage import io.element.android.libraries.designsystem.preview.ElementPreview @@ -41,6 +38,8 @@ import io.element.android.libraries.designsystem.theme.components.Icon import io.element.android.libraries.designsystem.theme.components.ListItem import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.utils.OnLifecycleEvent +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState.Status @Composable fun TroubleshootNotificationsView( diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootTestSuite.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootTestSuite.kt similarity index 93% rename from features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootTestSuite.kt rename to libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootTestSuite.kt index 361cf1601f..1c5fbbc3e3 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootTestSuite.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootTestSuite.kt @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl import im.vector.app.features.analytics.plan.NotificationTroubleshoot import io.element.android.libraries.architecture.AsyncAction -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState -import io.element.android.libraries.core.notifications.TestFilterData import io.element.android.libraries.push.api.GetCurrentPushProvider +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState +import io.element.android.libraries.troubleshoot.api.test.TestFilterData import io.element.android.services.analytics.api.AnalyticsService import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.CoroutineScope diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootTestSuiteState.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootTestSuiteState.kt similarity index 83% rename from features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootTestSuiteState.kt rename to libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootTestSuiteState.kt index e516b65109..32e71ff9a5 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootTestSuiteState.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootTestSuiteState.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl import io.element.android.libraries.architecture.AsyncAction -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import kotlinx.collections.immutable.ImmutableList data class TroubleshootTestSuiteState( diff --git a/libraries/troubleshoot/impl/src/main/res/values-be/translations.xml b/libraries/troubleshoot/impl/src/main/res/values-be/translations.xml new file mode 100644 index 0000000000..905b9e89b6 --- /dev/null +++ b/libraries/troubleshoot/impl/src/main/res/values-be/translations.xml @@ -0,0 +1,11 @@ + + + "Запусціць тэсты" + "Запусціце тэсты яшчэ раз" + "Некаторыя тэсты не ўдаліся. Калі ласка, праглядзіце дэталі." + "Запусціце тэсты, каб выявіць праблемы ў вашай канфігурацыі, з-за якіх апавяшчэння могуць паводзіць сябе не так, як чакалася." + "Спроба выпраўлення" + "Усе тэсты паспяхова пройдзены." + "Выпраўленне непаладак з апавяшчэннямі" + "Некаторыя тэсты патрабуюць вашай увагі. Калі ласка, праглядзіце дэталі." + diff --git a/libraries/troubleshoot/impl/src/main/res/values-cs/translations.xml b/libraries/troubleshoot/impl/src/main/res/values-cs/translations.xml new file mode 100644 index 0000000000..17e47cf56f --- /dev/null +++ b/libraries/troubleshoot/impl/src/main/res/values-cs/translations.xml @@ -0,0 +1,11 @@ + + + "Spustit testy" + "Spustit testy znovu" + "Některé testy selhaly. Zkontrolujte prosím podrobnosti." + "Spusťte testy, abyste zjistili jakýkoli problém ve vaší konfiguraci, který může způsobit, že se oznámení nebudou chovat podle očekávání." + "Pokus o opravu" + "Všechny testy proběhly úspěšně." + "Odstraňování problémů s upozorněními" + "Některé testy vyžadují vaši pozornost. Zkontrolujte prosím podrobnosti." + diff --git a/libraries/troubleshoot/impl/src/main/res/values-de/translations.xml b/libraries/troubleshoot/impl/src/main/res/values-de/translations.xml new file mode 100644 index 0000000000..98b8c579a9 --- /dev/null +++ b/libraries/troubleshoot/impl/src/main/res/values-de/translations.xml @@ -0,0 +1,11 @@ + + + "Tests durchführen" + "Tests erneut durchführen" + "Einige Tests sind fehlgeschlagen. Bitte überprüfe die Details." + "Führe die Tests durch, um Probleme zu erkennen, die dazu führen können, dass sich die Benachrichtigungen nicht wie erwartet verhalten." + "Versuche das Problem zu beheben" + "Alle Tests wurden erfolgreich bestanden." + "Fehlerbehebung für Benachrichtigungen" + "Einige Tests erfordern deine Aufmerksamkeit. Bitte überprüfe die Details." + diff --git a/libraries/troubleshoot/impl/src/main/res/values-fr/translations.xml b/libraries/troubleshoot/impl/src/main/res/values-fr/translations.xml new file mode 100644 index 0000000000..497b3e3b56 --- /dev/null +++ b/libraries/troubleshoot/impl/src/main/res/values-fr/translations.xml @@ -0,0 +1,11 @@ + + + "Exécuter les tests" + "Relancer les tests" + "Certains tests ont échoué. Veuillez vérifier les détails." + "Exécuter les tests pour détecter tout problème dans votre configuration susceptible de provoquer un dysfonctionnement des notifications." + "Tenter de corriger" + "Tous les tests ont réussi." + "Dépanner les notifications" + "Certains tests nécessitent votre attention. Veuillez vérifier les détails." + diff --git a/libraries/troubleshoot/impl/src/main/res/values-hu/translations.xml b/libraries/troubleshoot/impl/src/main/res/values-hu/translations.xml new file mode 100644 index 0000000000..211b1f4a1d --- /dev/null +++ b/libraries/troubleshoot/impl/src/main/res/values-hu/translations.xml @@ -0,0 +1,11 @@ + + + "Tesztek futtatása" + "Tesztek újbóli futtatása" + "Egyes tesztek sikertelenek voltak. Ellenőrizze a részleteket." + "A tesztek futtatása, hogy észlelje a konfigurációban felmerülő olyan problémákat, amelyek miatt az értesítések nem az elvárt módon viselkednek." + "Kísérlet a javításra" + "Minden teszt sikeresen lezajlott." + "Értesítések hibaelhárítása" + "Egyes tesztek a figyelmét igénylik. Ellenőrizze a részleteket." + diff --git a/libraries/troubleshoot/impl/src/main/res/values-ru/translations.xml b/libraries/troubleshoot/impl/src/main/res/values-ru/translations.xml new file mode 100644 index 0000000000..943652fc86 --- /dev/null +++ b/libraries/troubleshoot/impl/src/main/res/values-ru/translations.xml @@ -0,0 +1,11 @@ + + + "Выполнение тестов" + "Повторное выполнение тестов" + "Некоторые тесты провалились. Пожалуйста, проверьте детали." + "Выполните тесты, чтобы обнаружить любую проблему в конфигурации, из-за которой уведомления могут работать не так, как ожидалось." + "Попытка исправить" + "Все тесты прошли успешно." + "Уведомления об устранении неполадок" + "Некоторые тесты требуют вашего внимания. Пожалуйста, проверьте детали." + diff --git a/libraries/troubleshoot/impl/src/main/res/values-sk/translations.xml b/libraries/troubleshoot/impl/src/main/res/values-sk/translations.xml new file mode 100644 index 0000000000..3b7a08c2f0 --- /dev/null +++ b/libraries/troubleshoot/impl/src/main/res/values-sk/translations.xml @@ -0,0 +1,11 @@ + + + "Spustiť testy" + "Spustiť testy znova" + "Niektoré testy zlyhali. Skontrolujte prosím podrobnosti." + "Spustite testy, aby ste zistili akýkoľvek problém vo vašej konfigurácii, ktorý môže spôsobiť, že sa upozornenia nebudú správať podľa očakávania." + "Pokus o opravu" + "Všetky testy prebehli úspešne." + "Oznámenia riešení problémov" + "Niektoré testy si vyžadujú vašu pozornosť. Prosím skontrolujte podrobnosti." + diff --git a/libraries/troubleshoot/impl/src/main/res/values/localazy.xml b/libraries/troubleshoot/impl/src/main/res/values/localazy.xml new file mode 100644 index 0000000000..eee100d711 --- /dev/null +++ b/libraries/troubleshoot/impl/src/main/res/values/localazy.xml @@ -0,0 +1,11 @@ + + + "Run tests" + "Run tests again" + "Some tests failed. Please check the details." + "Run the tests to detect any issue in your configuration that may make notifications not behave as expected." + "Attempt to fix" + "All tests passed successfully." + "Troubleshoot notifications" + "Some tests require your attention. Please check the details." + diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/FakeNotificationTroubleshootTest.kt b/libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/FakeNotificationTroubleshootTest.kt similarity index 91% rename from features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/FakeNotificationTroubleshootTest.kt rename to libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/FakeNotificationTroubleshootTest.kt index 361c59cae7..90b8a988bb 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/FakeNotificationTroubleshootTest.kt +++ b/libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/FakeNotificationTroubleshootTest.kt @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsPresenterTests.kt b/libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsPresenterTests.kt similarity index 94% rename from features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsPresenterTests.kt rename to libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsPresenterTests.kt index 686aac2e56..25082b63c4 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsPresenterTests.kt +++ b/libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsPresenterTests.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 New Vector Ltd + * Copyright (c) 2024 New Vector Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +14,16 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl import app.cash.molecule.RecompositionMode import app.cash.molecule.moleculeFlow import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.libraries.architecture.AsyncAction -import io.element.android.libraries.core.notifications.NotificationTroubleshootTest -import io.element.android.libraries.core.notifications.NotificationTroubleshootTestState import io.element.android.libraries.push.test.FakeGetCurrentPushProvider +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTest +import io.element.android.libraries.troubleshoot.api.test.NotificationTroubleshootTestState import io.element.android.services.analytics.test.FakeAnalyticsService import kotlinx.coroutines.test.runTest import org.junit.Test diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsViewTest.kt b/libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsViewTest.kt similarity index 91% rename from features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsViewTest.kt rename to libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsViewTest.kt index af2b37d7c0..5acd0e5635 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/troubleshoot/TroubleshootNotificationsViewTest.kt +++ b/libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsViewTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.element.android.features.preferences.impl.notifications.troubleshoot +package io.element.android.libraries.troubleshoot.impl import androidx.activity.ComponentActivity import androidx.compose.ui.test.junit4.AndroidComposeTestRule @@ -69,7 +69,11 @@ class TroubleshootNotificationsViewTest { val eventsRecorder = EventsRecorder() rule.setTroubleshootNotificationsView( aTroubleshootNotificationsState( - tests = listOf(aTroubleshootTestStateFailure(hasQuickFix = false)), + tests = listOf( + aTroubleshootTestStateFailure( + hasQuickFix = false + ) + ), eventSink = eventsRecorder ), ) @@ -88,7 +92,11 @@ class TroubleshootNotificationsViewTest { val eventsRecorder = EventsRecorder() rule.setTroubleshootNotificationsView( aTroubleshootNotificationsState( - tests = listOf(aTroubleshootTestStateFailure(hasQuickFix = true)), + tests = listOf( + aTroubleshootTestStateFailure( + hasQuickFix = true + ) + ), eventSink = eventsRecorder ), ) diff --git a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt index cc254511bd..395f690d0e 100644 --- a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt +++ b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt @@ -114,6 +114,7 @@ fun DependencyHandlerScope.allLibrariesImpl() { implementation(project(":libraries:voicerecorder:impl")) implementation(project(":libraries:mediaplayer:impl")) implementation(project(":libraries:mediaviewer:impl")) + implementation(project(":libraries:troubleshoot:impl")) } fun DependencyHandlerScope.allServicesImpl() { diff --git a/tools/localazy/config.json b/tools/localazy/config.json index 603c04b55c..d63ede5638 100644 --- a/tools/localazy/config.json +++ b/tools/localazy/config.json @@ -205,7 +205,12 @@ "screen_edit_profile_.*", "screen_notification_settings_.*", "screen_blocked_users_.*", - "troubleshoot_notifications_entry_point_.*", + "troubleshoot_notifications_entry_point_.*" + ] + }, + { + "name" : ":libraries:troubleshoot:impl", + "includeRegex" : [ "troubleshoot_notifications_screen_.*" ] },