Skip to content

Commit

Permalink
Merge pull request #243 from sora-xor/sn-2892/sn-2916
Browse files Browse the repository at this point in the history
Sn 2892/sn 2916
  • Loading branch information
arvifox authored Oct 20, 2023
2 parents a4dd7d3 + 6404f20 commit 6d39b5b
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 6 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ dependencies {
implementation project(":feature_blockexplorer_impl")
implementation project(":feature_sora_card_api")
implementation project(":feature_sora_card_impl")
implementation project(":feature_ecosystem_api")
implementation project(":feature_ecosystem_impl")
implementation project(":sorasubstrate")
implementation project(":soracrypro")
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ buildscript {
compose : '1.5.3',
composeCompiler : '1.5.3',
composeConstraintLayout: '1.1.0-alpha05',
uiCore : '0.2.9',
uiCore : '0.2.10',
soraCard : '0.1.57',
lazySodium : '5.0.2',
jna : '5.8.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import androidx.compose.ui.unit.dp
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.constraintlayout.compose.Dimension
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.BleachedButton
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
Expand Down Expand Up @@ -90,6 +91,7 @@ fun BasicBannerCard(
val (card, image) = createRefs()
CardContent(
modifier = Modifier
.testTagAsId("StartInviting")
.constrainAs(card) {
top.linkTo(parent.top)
start.linkTo(parent.start)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.PACKAGE_ID
import jp.co.soramitsu.ui_core.component.toolbar.Action
import jp.co.soramitsu.ui_core.component.toolbar.BasicToolbarState
import jp.co.soramitsu.ui_core.component.toolbar.SoramitsuToolbar
Expand Down Expand Up @@ -110,9 +111,13 @@ fun Toolbar(
backgroundColor = backgroundColor,
tint = tintColor,
onNavigate = onNavClick,
onNavigateTestTag = "$PACKAGE_ID:id/OnNavigate",
onAction = onActionClick,
onActionTestTag = "$PACKAGE_ID:id/OnAction",
onMenuItemClicked = onMenuItemClick,
onMenuItemClickedTestTag = "$PACKAGE_ID:id/OnMenuItem",
onSearch = onSearch,
onSearchTestTag = "$PACKAGE_ID:id/OnSearch",
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ import androidx.compose.ui.semantics.testTagsAsResourceId
import jp.co.soramitsu.common.util.BuildUtils
import jp.co.soramitsu.common.util.DebounceClickHandler

const val PACKAGE_ID = "jp.co.soramitsu.sora.develop"

@OptIn(ExperimentalComposeUiApi::class)
@SuppressLint("ModifierFactoryUnreferencedReceiver")
fun Modifier.testTagAsId(tag: String): Modifier {
Expand All @@ -61,7 +63,7 @@ fun Modifier.testTagAsId(tag: String): Modifier {
.semantics {
testTagsAsResourceId = true
}
.testTag("jp.co.soramitsu.sora.develop:id/$tag")
.testTag("$PACKAGE_ID:id/$tag")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class DebugMenuFragment : SoraBaseFragment<DebugMenuViewModel>() {
val dm = remember {
activity?.getSize()
}

val pushState = NewHistoryEventsWorker.getInfo(requireContext()).observeAsState().value
val pushEnabled =
(pushState != null) && (pushState.size > 0) && ((pushState[0].state == WorkInfo.State.RUNNING) || (pushState[0].state == WorkInfo.State.ENQUEUED))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.TextButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
Expand Down Expand Up @@ -136,6 +137,7 @@ fun ReferralAvailableInvitationsCard(

FilledButton(
modifier = Modifier
.testTagAsId("GetMoreInvitations")
.padding(top = Dimens.x1)
.fillMaxWidth(),
text = stringResource(R.string.referral_get_more_invitation_button_title),
Expand All @@ -147,6 +149,7 @@ fun ReferralAvailableInvitationsCard(
if (state.invitationsCount > 0) {
TextButton(
modifier = Modifier
.testTagAsId("UnbondXor")
.padding(top = Dimens.x1)
.fillMaxWidth(),
text = stringResource(id = R.string.referral_unbond_button_title),
Expand All @@ -166,7 +169,10 @@ fun PreviewReferralAvailableInvitationsCard() {
state = ReferralInvitationsCardState(
"Available invitations",
5,
WrappedTextState(title = "Invitations Link", text = "polkaswap.io/#/referral/cnVyaue39dssBc2bReZycusLdys3vbeoz2irRF8BbwVcdCNmm"),
WrappedTextState(
title = "Invitations Link",
text = "polkaswap.io/#/referral/cnVyaue39dssBc2bReZycusLdys3vbeoz2irRF8BbwVcdCNmm"
),
"0.0008 XOR",
referrals = ReferralsCardState()
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import androidx.compose.ui.unit.dp
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.presentation.compose.components.DetailsItemNetworkFee
import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.common.view.WarningTextCard
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.LoaderWrapper
Expand Down Expand Up @@ -152,6 +153,7 @@ fun ReferralBondXor(
) { modifier, elevation ->
FilledButton(
modifier = modifier
.testTagAsId("BondXor")
.fillMaxWidth(),
size = Size.Large,
order = Order.PRIMARY,
Expand Down Expand Up @@ -241,6 +243,7 @@ fun ReferralUnbondXor(
) { modifier, elevation ->
FilledButton(
modifier = modifier
.testTagAsId("UnbondXor")
.fillMaxWidth(),
size = Size.Large,
order = Order.PRIMARY,
Expand Down Expand Up @@ -289,7 +292,9 @@ fun InvitationsEnterField(
tint = MaterialTheme.customColors.fgSecondary,
)
TextField(
modifier = Modifier.weight(1f),
modifier = Modifier
.testTagAsId("InvitationsInput")
.weight(1f),
value = count.toString(),
onValueChange = {
onCountChange.invoke(it.toIntOrNull() ?: 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.TonalButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
Expand Down Expand Up @@ -71,6 +72,7 @@ internal fun ReferralButtons(

TonalButton(
modifier = Modifier
.testTagAsId("BottomButton")
.padding(top = Dimens.x1)
.fillMaxWidth(),
text = stringResource(bottomButtonText),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.LoaderWrapper
import jp.co.soramitsu.ui_core.component.button.properties.Order
Expand Down Expand Up @@ -89,6 +90,7 @@ fun ReferrerInput(

InputText(
modifier = Modifier
.testTagAsId("LinkAddressInput")
.background(MaterialTheme.customColors.bgSurface)
.fillMaxWidth()
.wrapContentHeight(),
Expand All @@ -109,6 +111,7 @@ fun ReferrerInput(
) { modifier, elevation ->
FilledButton(
modifier = modifier
.testTagAsId("Activate")
.fillMaxWidth()
.padding(top = Dimens.x3),
size = Size.Large,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.TonalButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
import jp.co.soramitsu.ui_core.component.button.properties.Size
Expand Down Expand Up @@ -81,6 +82,7 @@ fun YourReferrerCard(
} else {
TonalButton(
modifier = Modifier
.testTagAsId("EnterReferrersLink")
.fillMaxWidth(),
text = stringResource(R.string.referral_enter_link_title),
onClick = onEnterReferrersLink,
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ include ':feature_polkaswap_impl'
include ':feature_assets_api'
include ':feature_assets_impl'

include ':feature_ecosystem_api'
include ':feature_ecosystem_impl'

include ':android-foundation'
Expand Down

0 comments on commit 6d39b5b

Please sign in to comment.