Merge branch 'develop' into feature/fga/update_rust_sdk_0.2.25
This commit is contained in:
commit
8783a923d0
27 changed files with 256 additions and 165 deletions
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package io.element.android.features.preferences.impl.developer.tracing
|
||||
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
|
|
@ -48,6 +49,7 @@ import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
|||
import io.element.android.libraries.designsystem.theme.aliasScreenTitle
|
||||
import io.element.android.libraries.designsystem.theme.components.DropdownMenu
|
||||
import io.element.android.libraries.designsystem.theme.components.DropdownMenuItem
|
||||
import io.element.android.libraries.designsystem.theme.components.HorizontalDivider
|
||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
import io.element.android.libraries.designsystem.theme.components.IconButton
|
||||
import io.element.android.libraries.designsystem.theme.components.ListItem
|
||||
|
|
@ -124,15 +126,17 @@ fun ConfigureTracingView(
|
|||
.consumeWindowInsets(it)
|
||||
.verticalScroll(state = rememberScrollState())
|
||||
) {
|
||||
CrateListContent(state)
|
||||
ListItem(
|
||||
headlineContent = {
|
||||
Text(
|
||||
text = "Kill and restart the app for the change to take effect.",
|
||||
modifier = Modifier.clickable { Runtime.getRuntime().exit(0) },
|
||||
text = "Tap here to kill the app and apply the changes. You'll have to re-open the app manually.",
|
||||
style = ElementTheme.typography.fontHeadingSmMedium,
|
||||
)
|
||||
},
|
||||
)
|
||||
HorizontalDivider()
|
||||
CrateListContent(state)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,14 +18,13 @@ package io.element.android.features.preferences.impl.developer.tracing
|
|||
|
||||
import io.element.android.libraries.matrix.api.tracing.LogLevel
|
||||
import io.element.android.libraries.matrix.api.tracing.Target
|
||||
import io.element.android.libraries.matrix.api.tracing.TracingFilterConfigurations
|
||||
import io.element.android.libraries.matrix.api.tracing.TracingFilterConfiguration
|
||||
import javax.inject.Inject
|
||||
|
||||
class TargetLogLevelMapBuilder @Inject constructor(
|
||||
private val tracingConfigurationStore: TracingConfigurationStore,
|
||||
private val defaultConfig: TracingFilterConfiguration,
|
||||
) {
|
||||
private val defaultConfig = TracingFilterConfigurations.debug
|
||||
|
||||
fun getDefaultMap(): Map<Target, LogLevel> {
|
||||
return Target.entries.associateWith { target ->
|
||||
defaultConfig.getLogLevel(target)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import app.cash.turbine.test
|
|||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.libraries.matrix.api.tracing.LogLevel
|
||||
import io.element.android.libraries.matrix.api.tracing.Target
|
||||
import io.element.android.libraries.matrix.api.tracing.TracingFilterConfigurations
|
||||
import io.element.android.tests.testutils.WarmUpRule
|
||||
import io.element.android.tests.testutils.waitForPredicate
|
||||
import kotlinx.coroutines.test.runTest
|
||||
|
|
@ -37,7 +38,7 @@ class ConfigureTracingPresenterTest {
|
|||
val store = InMemoryTracingConfigurationStore()
|
||||
val presenter = ConfigureTracingPresenter(
|
||||
store,
|
||||
TargetLogLevelMapBuilder(store),
|
||||
TargetLogLevelMapBuilder(store, TracingFilterConfigurations.debug),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -54,7 +55,7 @@ class ConfigureTracingPresenterTest {
|
|||
store.givenLogLevel(LogLevel.ERROR)
|
||||
val presenter = ConfigureTracingPresenter(
|
||||
store,
|
||||
TargetLogLevelMapBuilder(store),
|
||||
TargetLogLevelMapBuilder(store, TracingFilterConfigurations.debug),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -70,7 +71,7 @@ class ConfigureTracingPresenterTest {
|
|||
val store = InMemoryTracingConfigurationStore()
|
||||
val presenter = ConfigureTracingPresenter(
|
||||
store,
|
||||
TargetLogLevelMapBuilder(store),
|
||||
TargetLogLevelMapBuilder(store, TracingFilterConfigurations.debug),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -89,7 +90,7 @@ class ConfigureTracingPresenterTest {
|
|||
val store = InMemoryTracingConfigurationStore()
|
||||
val presenter = ConfigureTracingPresenter(
|
||||
store,
|
||||
TargetLogLevelMapBuilder(store),
|
||||
TargetLogLevelMapBuilder(store, TracingFilterConfigurations.debug),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import androidx.compose.foundation.layout.Spacer
|
|||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
|
|
@ -28,6 +29,8 @@ import androidx.compose.runtime.setValue
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalFocusManager
|
||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.text.input.KeyboardCapitalization
|
||||
|
|
@ -51,6 +54,7 @@ import io.element.android.libraries.designsystem.preview.debugPlaceholderBackgro
|
|||
import io.element.android.libraries.designsystem.theme.components.Button
|
||||
import io.element.android.libraries.designsystem.theme.components.OutlinedTextField
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.designsystem.theme.components.onTabOrEnterKeyFocusNext
|
||||
import io.element.android.libraries.ui.strings.CommonStrings
|
||||
|
||||
@Composable
|
||||
|
|
@ -68,6 +72,7 @@ fun BugReportView(
|
|||
title = stringResource(id = CommonStrings.common_report_a_problem),
|
||||
onBackClick = onBackClick
|
||||
) {
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
val isFormEnabled = state.sending !is AsyncAction.Loading
|
||||
var descriptionFieldState by textFieldState(
|
||||
stateValue = state.formState.description
|
||||
|
|
@ -76,7 +81,8 @@ fun BugReportView(
|
|||
PreferenceRow {
|
||||
OutlinedTextField(
|
||||
value = descriptionFieldState,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
.onTabOrEnterKeyFocusNext(LocalFocusManager.current),
|
||||
enabled = isFormEnabled,
|
||||
label = {
|
||||
Text(text = stringResource(id = R.string.screen_bug_report_editor_placeholder))
|
||||
|
|
@ -91,8 +97,11 @@ fun BugReportView(
|
|||
keyboardOptions = KeyboardOptions(
|
||||
capitalization = KeyboardCapitalization.Sentences,
|
||||
keyboardType = KeyboardType.Text,
|
||||
imeAction = ImeAction.Next
|
||||
imeAction = ImeAction.Next,
|
||||
),
|
||||
keyboardActions = KeyboardActions(onNext = {
|
||||
keyboardController?.hide()
|
||||
}),
|
||||
minLines = 3,
|
||||
isError = state.isDescriptionInError,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue