Merge pull request #6682 from element-hq/feature/bma/customMasScheme
Add a way to tweak MAS url.
This commit is contained in:
commit
2f45ca8835
41 changed files with 656 additions and 17 deletions
|
|
@ -26,6 +26,7 @@ import dev.zacsweers.metro.Assisted
|
|||
import dev.zacsweers.metro.AssistedInject
|
||||
import io.element.android.annotations.ContributesNode
|
||||
import io.element.android.compound.theme.ElementTheme
|
||||
import io.element.android.features.enterprise.api.SessionEnterpriseService
|
||||
import io.element.android.features.linknewdevice.api.LinkNewDeviceEntryPoint
|
||||
import io.element.android.features.linknewdevice.impl.screens.confirmation.CodeConfirmationNode
|
||||
import io.element.android.features.linknewdevice.impl.screens.desktop.DesktopNoticeNode
|
||||
|
|
@ -65,6 +66,7 @@ class LinkNewDeviceFlowNode(
|
|||
private val sessionCoroutineScope: CoroutineScope,
|
||||
private val linkNewMobileHandler: LinkNewMobileHandler,
|
||||
private val linkNewDesktopHandler: LinkNewDesktopHandler,
|
||||
private val sessionEnterpriseService: SessionEnterpriseService,
|
||||
) : BaseFlowNode<LinkNewDeviceFlowNode.NavTarget>(
|
||||
backstack = BackStack(
|
||||
initialElement = NavTarget.Root,
|
||||
|
|
@ -298,8 +300,12 @@ class LinkNewDeviceFlowNode(
|
|||
}
|
||||
}
|
||||
|
||||
private fun navigateToBrowser(url: String) {
|
||||
activity?.openUrlInChromeCustomTab(null, darkTheme, url)
|
||||
private suspend fun navigateToBrowser(url: String) {
|
||||
activity?.openUrlInChromeCustomTab(
|
||||
session = null,
|
||||
darkTheme = darkTheme,
|
||||
url = sessionEnterpriseService.tweakMasUrl(url),
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
|||
import com.bumble.appyx.core.modality.BuildContext
|
||||
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.features.enterprise.test.FakeSessionEnterpriseService
|
||||
import io.element.android.features.linknewdevice.api.LinkNewDeviceEntryPoint
|
||||
import io.element.android.libraries.matrix.test.FakeMatrixClient
|
||||
import io.element.android.tests.testutils.lambda.lambdaError
|
||||
|
|
@ -37,6 +38,7 @@ class DefaultLinkNewDeviceEntryPointTest {
|
|||
sessionCoroutineScope = backgroundScope,
|
||||
linkNewMobileHandler = LinkNewMobileHandler(client),
|
||||
linkNewDesktopHandler = LinkNewDesktopHandler(client),
|
||||
sessionEnterpriseService = FakeSessionEnterpriseService(),
|
||||
)
|
||||
}
|
||||
val callback: LinkNewDeviceEntryPoint.Callback = object : LinkNewDeviceEntryPoint.Callback {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue