Skip to content

Commit

Permalink
Commit with unresolved merge conflicts outside of kalium
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadJaara authored and github-actions[bot] committed Apr 16, 2024
1 parent 1486bba commit 452c23b
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 39 deletions.
79 changes: 41 additions & 38 deletions app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package com.wire.android.ui.debug

import android.content.Context
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
Expand All @@ -26,19 +25,12 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wire.android.BuildConfig
import com.wire.android.R
import com.wire.android.datastore.GlobalDataStore
import com.wire.android.di.CurrentAccount
import com.wire.android.migration.failure.UserMigrationStatus
import com.wire.android.model.Clickable
import com.wire.android.ui.common.RowItemTemplate
import com.wire.android.ui.common.WireDialog
Expand All @@ -53,26 +45,14 @@ import com.wire.android.ui.home.settings.SettingsItem
import com.wire.android.ui.theme.wireColorScheme
import com.wire.android.ui.theme.wireDimensions
import com.wire.android.ui.theme.wireTypography
import com.wire.android.util.getDependenciesVersion
import com.wire.android.util.getDeviceIdString
import com.wire.android.util.getGitBuildId
import com.wire.android.util.ui.PreviewMultipleThemes
import com.wire.kalium.logic.CoreFailure
import com.wire.kalium.logic.E2EIFailure
import com.wire.kalium.logic.data.user.UserId
import com.wire.kalium.logic.feature.debug.DisableEventProcessingUseCase
import com.wire.kalium.logic.feature.e2ei.CheckCrlRevocationListUseCase
import com.wire.kalium.logic.feature.e2ei.usecase.E2EIEnrollmentResult
import com.wire.kalium.logic.feature.keypackage.MLSKeyPackageCountResult
import com.wire.kalium.logic.feature.keypackage.MLSKeyPackageCountUseCase
import com.wire.kalium.logic.functional.Either
import com.wire.kalium.logic.functional.fold
import com.wire.kalium.logic.sync.periodic.UpdateApiVersionsScheduler
import com.wire.kalium.logic.sync.slow.RestartSlowSyncProcessForRecoveryUseCase
import dagger.hilt.android.lifecycle.HiltViewModel
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.collections.immutable.ImmutableMap
import kotlinx.collections.immutable.persistentMapOf
<<<<<<< HEAD
import kotlinx.collections.immutable.toImmutableMap
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -261,6 +241,8 @@ class DebugDataOptionsViewModel
//endregion
}
//endregion
=======
>>>>>>> 6510fa14a (feat: display avs and CC version on all builds (#2894))

@Composable
fun DebugDataOptions(
Expand All @@ -283,7 +265,8 @@ fun DebugDataOptions(
enrollE2EICertificate = viewModel::enrollE2EICertificate,
handleE2EIEnrollmentResult = viewModel::handleE2EIEnrollmentResult,
dismissCertificateDialog = viewModel::dismissCertificateDialog,
checkCrlRevocationList = viewModel::checkCrlRevocationList
checkCrlRevocationList = viewModel::checkCrlRevocationList,
dependenciesMap = viewModel.state.dependencies
)
}

Expand All @@ -302,7 +285,8 @@ fun DebugDataOptionsContent(
enrollE2EICertificate: () -> Unit,
handleE2EIEnrollmentResult: (Either<CoreFailure, E2EIEnrollmentResult>) -> Unit,
dismissCertificateDialog: () -> Unit,
checkCrlRevocationList: () -> Unit
checkCrlRevocationList: () -> Unit,
dependenciesMap: ImmutableMap<String, String?>
) {
Column {

Expand Down Expand Up @@ -337,6 +321,7 @@ fun DebugDataOptionsContent(
onClick = { onCopyText(state.commitish) }
)
)
DependenciesItem(dependenciesMap)
if (BuildConfig.PRIVATE_BUILD) {

SettingsItem(
Expand Down Expand Up @@ -399,7 +384,10 @@ fun DebugDataOptionsContent(
onDisableEventProcessingChange = onDisableEventProcessingChange,
onRestartSlowSyncForRecovery = onRestartSlowSyncForRecovery,
onForceUpdateApiVersions = onForceUpdateApiVersions,
<<<<<<< HEAD
dependenciesMap = state.dependencies,
=======
>>>>>>> 6510fa14a (feat: display avs and CC version on all builds (#2894))
checkCrlRevocationList = checkCrlRevocationList
)
}
Expand Down Expand Up @@ -569,7 +557,10 @@ private fun DebugToolsOptions(
onDisableEventProcessingChange: (Boolean) -> Unit,
onRestartSlowSyncForRecovery: () -> Unit,
onForceUpdateApiVersions: () -> Unit,
<<<<<<< HEAD
dependenciesMap: ImmutableMap<String, String?>,
=======
>>>>>>> 6510fa14a (feat: display avs and CC version on all builds (#2894))
checkCrlRevocationList: () -> Unit
) {
FolderHeader(stringResource(R.string.label_debug_tools_title))
Expand Down Expand Up @@ -641,20 +632,31 @@ private fun DebugToolsOptions(
)
}
)
RowItemTemplate(
modifier = Modifier.wrapContentWidth(),
title = {
Text(
style = MaterialTheme.wireTypography.body01,
color = MaterialTheme.wireColorScheme.onBackground,
text = prettyPrintMap(dependenciesMap),
modifier = Modifier.padding(start = dimensions().spacing8x)
)
}
)
}
}

/**
*
*/
@Composable
fun DependenciesItem(dependencies: ImmutableMap<String, String?>) {
val title = stringResource(id = R.string.item_dependencies_title)
val text = remember {
prettyPrintMap(dependencies, title)
}
RowItemTemplate(
modifier = Modifier.wrapContentWidth(),
title = {
Text(
style = MaterialTheme.wireTypography.body01,
color = MaterialTheme.wireColorScheme.onBackground,
text = text,
modifier = Modifier.padding(start = dimensions().spacing8x)
)
}
)
}

@Composable
private fun DisableEventProcessingSwitch(
isEnabled: Boolean = false,
Expand Down Expand Up @@ -685,8 +687,8 @@ private fun DisableEventProcessingSwitch(
}

@Stable
private fun prettyPrintMap(map: ImmutableMap<String, String?>): String = StringBuilder().apply {
append("Dependencies:\n")
private fun prettyPrintMap(map: Map<String, String?>, title: String): String = StringBuilder().apply {
append("$title\n")
map.forEach { (key, value) ->
append("$key: $value\n")
}
Expand Down Expand Up @@ -718,6 +720,7 @@ fun PreviewOtherDebugOptions() {
enrollE2EICertificate = {},
handleE2EIEnrollmentResult = {},
dismissCertificateDialog = {},
checkCrlRevocationList = {}
checkCrlRevocationList = {},
dependenciesMap = persistentMapOf()
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Wire
* Copyright (C) 2024 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.wire.android.ui.debug

import kotlinx.collections.immutable.ImmutableMap
import kotlinx.collections.immutable.persistentMapOf

data class DebugDataOptionsState(
val isEncryptedProteusStorageEnabled: Boolean = false,
val isEventProcessingDisabled: Boolean = false,
val keyPackagesCount: Int = 0,
val mslClientId: String = "null",
val mlsErrorMessage: String = "null",
val isManualMigrationAllowed: Boolean = false,
val debugId: String = "null",
val commitish: String = "null",
val certificate: String = "null",
val showCertificate: Boolean = false,
val startGettingE2EICertificate: Boolean = false,
val dependencies: ImmutableMap<String, String?> = persistentMapOf()
)
Loading

0 comments on commit 452c23b

Please sign in to comment.