From 6fd3f9c5f163c9e9cda7df5c55bc57293199686e Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 28 Mar 2024 18:07:48 +0100 Subject: [PATCH] Room directory : more cleanup and more tests --- .../impl/src/main/res/values/localazy.xml | 4 ++ .../impl/root/RoomDirectoryStateProvider.kt | 17 +++++- .../impl/root/RoomDirectoryView.kt | 44 ++++++++------- .../impl/src/main/res/values/localazy.xml | 5 ++ .../impl/search/RoomListSearchView.kt | 11 ++-- .../src/main/res/values/localazy.xml | 53 ++++++++++++++++++- tools/localazy/config.json | 6 +++ 7 files changed, 113 insertions(+), 27 deletions(-) create mode 100644 features/roomdirectory/impl/src/main/res/values/localazy.xml diff --git a/features/roomdetails/impl/src/main/res/values/localazy.xml b/features/roomdetails/impl/src/main/res/values/localazy.xml index cde723257f..b6bf76c440 100644 --- a/features/roomdetails/impl/src/main/res/values/localazy.xml +++ b/features/roomdetails/impl/src/main/res/values/localazy.xml @@ -29,7 +29,11 @@ "Demote" "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges." "Demote yourself?" + "%1$s (Pending)" "Edit Moderators" + "Admins" + "Moderators" + "Members" "You have unsaved changes." "Save changes?" "Add topic" diff --git a/features/roomdirectory/impl/src/main/kotlin/io/element/android/features/roomdirectory/impl/root/RoomDirectoryStateProvider.kt b/features/roomdirectory/impl/src/main/kotlin/io/element/android/features/roomdirectory/impl/root/RoomDirectoryStateProvider.kt index 3fa7877b6f..efb6624260 100644 --- a/features/roomdirectory/impl/src/main/kotlin/io/element/android/features/roomdirectory/impl/root/RoomDirectoryStateProvider.kt +++ b/features/roomdirectory/impl/src/main/kotlin/io/element/android/features/roomdirectory/impl/root/RoomDirectoryStateProvider.kt @@ -32,7 +32,22 @@ open class RoomDirectoryStateProvider : PreviewParameterProvider + + "Failed loading" + "Room directory" + diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/search/RoomListSearchView.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/search/RoomListSearchView.kt index 53528e0558..80657ed4fc 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/search/RoomListSearchView.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/search/RoomListSearchView.kt @@ -43,6 +43,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import io.element.android.compound.tokens.generated.CompoundIcons +import io.element.android.features.roomlist.impl.R import io.element.android.features.roomlist.impl.components.RoomSummaryRow import io.element.android.features.roomlist.impl.contentType import io.element.android.features.roomlist.impl.model.RoomListRoomSummary @@ -131,8 +132,8 @@ private fun RoomListSearchContent( val focusRequester = FocusRequester() TextField( modifier = Modifier - .fillMaxWidth() - .focusRequester(focusRequester), + .fillMaxWidth() + .focusRequester(focusRequester), value = filter, singleLine = true, onValueChange = { state.eventSink(RoomListSearchEvents.QueryChanged(it)) }, @@ -171,8 +172,8 @@ private fun RoomListSearchContent( ) { padding -> Column( modifier = Modifier - .padding(padding) - .consumeWindowInsets(padding) + .padding(padding) + .consumeWindowInsets(padding) ) { if (state.displayRoomDirectorySearch) { RoomDirectorySearchButton( @@ -206,7 +207,7 @@ private fun RoomDirectorySearchButton( modifier: Modifier = Modifier ) { Button( - text = "Browse all rooms", + text = stringResource(id = R.string.screen_roomlist_room_directory_button_title), leadingIcon = IconSource.Vector(CompoundIcons.ListBulleted()), onClick = onClick, modifier = modifier, diff --git a/libraries/ui-strings/src/main/res/values/localazy.xml b/libraries/ui-strings/src/main/res/values/localazy.xml index 97ddec4b3b..1bc20364ce 100644 --- a/libraries/ui-strings/src/main/res/values/localazy.xml +++ b/libraries/ui-strings/src/main/res/values/localazy.xml @@ -254,8 +254,6 @@ "Failed selecting media, please try again." "Failed processing media to upload, please try again." "Failed uploading media, please try again." - "Failed loading" - "Room directory" "Failed processing media to upload, please try again." "Could not retrieve user details" "Block" @@ -274,4 +272,55 @@ "Version: %1$s (%2$s)" "en" "en" + "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." + "Check that the application can show notifications." + "Check permissions" + "Get the name of the current provider." + "No push providers selected." + "Current push provider: %1$s." + "Current push provider" + "Ensure that the application has at least one push provider." + "No push providers found." + + "Found %1$d push provider: %2$s" + "Found %1$d push providers: %2$s" + + "Detect push providers" + "Check that the application can display notification." + "The notification has not been clicked." + "Cannot display the notification." + "The notification has been clicked!" + "Display notification" + "Please click on the notification to continue the test." + "Ensure that Firebase is available." + "Firebase is not available." + "Firebase is available." + "Check Firebase" + "Ensure that Firebase token is available." + "Firebase token is not known." + "Firebase token: %1$s." + "Check Firebase token" + "Ensure that the application is receiving push." + "Error: pusher has rejected the request." + "Error: %1$s." + "Error, cannot test push." + "Error, timeout waiting for push." + "Push loop back took %1$d ms." + "Test Push loop back" + "Ensure that UnifiedPush distributors are available." + "No push distributors found." + + "%1$d distributor found: %2$s." + "%1$d distributors found: %2$s." + + "Check UnifiedPush" diff --git a/tools/localazy/config.json b/tools/localazy/config.json index b3ad636c86..aaa1f6734b 100644 --- a/tools/localazy/config.json +++ b/tools/localazy/config.json @@ -197,6 +197,12 @@ "screen_app_lock_.*", "screen_signout_in_progress_dialog_content" ] + }, + { + "name" : ":features:roomdirectory:impl", + "includeRegex" : [ + "screen_room_directory_.*" + ] } ] }