Skip to content

Commit

Permalink
Fixed Build & Detekt Errors (openMF#1715)
Browse files Browse the repository at this point in the history
  • Loading branch information
niyajali authored Jul 31, 2024
1 parent c71b4ee commit bac1001
Show file tree
Hide file tree
Showing 143 changed files with 868 additions and 512 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/master_dev_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ jobs:
- name: Change gradlew Permission
run: chmod +x gradlew

- name: Check Dependency Guard
id: dependencyguard_verify
continue-on-error: true
run: ./gradlew dependencyGuard

- name: Prevent updating Dependency Guard baselines if this is a fork
id: checkfork_dependencyguard
continue-on-error: false
if: steps.dependencyguard_verify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
run: |
echo "::error::Dependency Guard failed, please update baselines with: ./gradlew dependencyGuardBaseline" && exit 1
# Build App
- name: Build with Gradle
run: ./gradlew assemble
Expand Down
2 changes: 1 addition & 1 deletion config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ style:
UselessCallOnNotNull:
active: true
UtilityClassWithPublicConstructor:
active: true
active: false
VarCouldBeVal:
active: true
WildcardImport:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Parcelable
import com.mifospay.core.model.entity.accounts.savings.TransferDetail
import kotlinx.parcelize.Parcelize

@Suppress("MaxLineLength")
@Parcelize
data class Transaction(
var transactionId: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.mifospay.core.designsystem.theme.LocalTintTheme
import org.mifospay.core.designsystem.theme.MifosTheme

@Composable
Expand Down Expand Up @@ -133,7 +132,7 @@ fun EmptyContentScreenDrawableImagePreview() {
title = "No data found",
subTitle = "Please check you connection or try again",
iconTint = MaterialTheme.colorScheme.primary,
iconDrawable = R.drawable.baseline_info_outline_24
iconDrawable = R.drawable.core_ui_baseline_info_outline_24
)
}
}
Expand Down
9 changes: 5 additions & 4 deletions core/ui/src/main/kotlin/org/mifospay/core/ui/HeadingTitile.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.mifos.mobilewallet.mifospay.ui
package org.mifospay.core.ui

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material3.Icon
Expand All @@ -11,7 +13,6 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
Expand Down
17 changes: 10 additions & 7 deletions core/ui/src/main/kotlin/org/mifospay/core/ui/OtpTextField.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package org.mifos.mobilewallet.mifospay.ui
package org.mifospay.core.ui

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
Expand All @@ -14,7 +19,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextRange
Expand All @@ -25,7 +29,6 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp

@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun OtpTextField(
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -116,7 +119,7 @@ fun CharView(

@Preview
@Composable
fun prviewOtpTextField() {
fun PreviewOtpTextField() {
OtpTextField(
realOtp = "1234",
otpCount = 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ fun TransactionItemScreen(
.padding(top = 2.dp),
painter = painterResource(
id = when (transaction.transactionType) {
com.mifospay.core.model.domain.TransactionType.DEBIT -> R.drawable.money_out
com.mifospay.core.model.domain.TransactionType.CREDIT -> R.drawable.money_in
else -> R.drawable.money_in
com.mifospay.core.model.domain.TransactionType.DEBIT -> R.drawable.core_ui_money_out
com.mifospay.core.model.domain.TransactionType.CREDIT -> R.drawable.core_ui_money_in
else -> R.drawable.core_ui_money_in
}
),
contentDescription = null,
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.mifospay.core.model.domain.BankAccountDetails
import org.mifospay.core.designsystem.component.MifosCard
import org.mifospay.core.designsystem.theme.mifosText
import org.mifospay.core.designsystem.theme.styleMedium16sp

@Composable
fun AccountsItem(
Expand All @@ -38,7 +35,7 @@ fun AccountsItem(
.padding(top = 16.dp)
) {
Icon(
painter = painterResource(id = R.drawable.ic_bank),
painter = painterResource(id = R.drawable.feature_accounts_ic_bank),
contentDescription = null,
modifier = Modifier
.align(Alignment.CenterVertically)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ fun AccountScreen(
AccountsUiState.Error -> {
EmptyContentScreen(
modifier = Modifier,
title = stringResource(id = R.string.error_oops),
subTitle = stringResource(id = R.string.unexpected_error_subtitle),
title = stringResource(id = R.string.feature_accounts_error_oops),
subTitle = stringResource(id = R.string.feature_accounts_unexpected_error_subtitle),
iconTint = MaterialTheme.colorScheme.onSurface,
iconImageVector = Icons.Rounded.Info
)
Expand All @@ -95,7 +95,7 @@ fun AccountScreen(
) {
item {
Text(
text = stringResource(id = R.string.linked_bank_account),
text = stringResource(id = R.string.feature_accounts_linked_bank_account),
fontSize = 16.sp,
color = MaterialTheme.colorScheme.primary,
modifier = Modifier.padding(top = 48.dp, start = 24.dp)
Expand Down Expand Up @@ -123,8 +123,8 @@ fun AccountScreen(
AddCardChip(
modifier = Modifier.align(Alignment.Center),
onAddBtn = onAddAccount,
text = R.string.add_account,
btnText = R.string.add_cards
text = R.string.feature_accounts_add_account,
btnText = R.string.feature_accounts_add_cards
)
}
}
Expand All @@ -133,12 +133,10 @@ fun AccountScreen(

AccountsUiState.Loading -> {
MfLoadingWheel(
contentDesc = stringResource(R.string.loading),
contentDesc = stringResource(R.string.feature_accounts_loading),
backgroundColor = MaterialTheme.colorScheme.surface
)
}

else -> {}
}
}
PullRefreshIndicator(
Expand All @@ -158,12 +156,12 @@ fun NoLinkedAccountsScreen(onAddBtn: () -> Unit) {
Column(
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(text = stringResource(R.string.no_linked_bank_accounts))
Text(text = stringResource(R.string.feature_accounts_no_linked_bank_accounts))
AddCardChip(
modifier = Modifier,
onAddBtn = onAddBtn,
text = R.string.add_account,
btnText = R.string.add_cards
text = R.string.feature_accounts_add_account,
btnText = R.string.feature_accounts_add_cards
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
Expand Down Expand Up @@ -64,13 +63,13 @@ fun ChooseSimDialogSheetContent(onSimSelected: (Int) -> Unit) {
.padding(8.dp)
) {
Text(
text = stringResource(id = R.string.verify_mobile_number),
text = stringResource(id = R.string.feature_accounts_verify_mobile_number),
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface
)
Spacer(modifier = Modifier.height(16.dp))
Text(
text = stringResource(id = R.string.confirm_mobile_number_message),
text = stringResource(id = R.string.feature_accounts_confirm_mobile_number_message),
style = MaterialTheme.typography.bodySmall.copy(
textAlign = TextAlign.Center
),
Expand All @@ -79,7 +78,7 @@ fun ChooseSimDialogSheetContent(onSimSelected: (Int) -> Unit) {
Spacer(modifier = Modifier.height(16.dp))
Text(
modifier = Modifier.padding(horizontal = 24.dp),
text = stringResource(id = R.string.bank_account_mobile_verification_conditions),
text = stringResource(id = R.string.feature_accounts_bank_account_mobile_verification_conditions),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurface
)
Expand All @@ -96,7 +95,7 @@ fun ChooseSimDialogSheetContent(onSimSelected: (Int) -> Unit) {
)

Spacer(modifier = Modifier.width(24.dp))
Text(text = stringResource(id = R.string.or),
Text(text = stringResource(id = R.string.feature_accounts_or),
color = MaterialTheme.colorScheme.onSurface)
Spacer(modifier = Modifier.width(24.dp))
SimCard(
Expand All @@ -107,7 +106,7 @@ fun ChooseSimDialogSheetContent(onSimSelected: (Int) -> Unit) {
}
Spacer(modifier = Modifier.height(16.dp))
Text(
text = stringResource(id = R.string.regular_charges_will_apply),
text = stringResource(id = R.string.feature_accounts_regular_charges_will_apply),
color = MaterialTheme.colorScheme.onSurface,
style = MaterialTheme.typography.bodySmall
)
Expand All @@ -119,15 +118,15 @@ fun ChooseSimDialogSheetContent(onSimSelected: (Int) -> Unit) {
if (selectedSim == -1) {
Toast.makeText(
context,
context.getString(R.string.choose_a_sim),
context.getString(R.string.feature_accounts_choose_a_sim),
Toast.LENGTH_SHORT
).show()
} else {
onSimSelected(selectedSim)
}
}
) {
Text(text = stringResource(id = R.string.confirm))
Text(text = stringResource(id = R.string.feature_accounts_confirm))
}
Spacer(modifier = Modifier.height(24.dp))
}
Expand All @@ -139,8 +138,8 @@ fun SimCard(
) {
val drawable: Painter = painterResource(
id = if (isSelected) {
R.drawable.sim_card_selected
} else R.drawable.sim_card_unselected
R.drawable.feature_accounts_sim_card_selected
} else R.drawable.feature_accounts_sim_card_unselected
)
Image(painter = drawable,
contentDescription = "SIM Card $simNumber",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fun BankAccountDetailScreen(
navigateBack: () -> Unit
) {
Column(modifier = Modifier.fillMaxSize()) {
MifosTopBar(topBarTitle = R.string.bank_account_details) { navigateBack.invoke() }
MifosTopBar(topBarTitle = R.string.feature_accounts_bank_account_details) { navigateBack.invoke() }
Column(
modifier = Modifier
.padding(20.dp)
Expand All @@ -70,27 +70,27 @@ fun BankAccountDetailScreen(
) {
BankAccountDetailRows(
modifier = Modifier.fillMaxWidth(),
detail = R.string.bank_name,
detail = R.string.feature_accounts_bank_name,
detailValue = bankName
)
BankAccountDetailRows(
modifier = Modifier.fillMaxWidth().padding(top = 10.dp),
detail = R.string.ac_holder_name,
detail = R.string.feature_accounts_ac_holder_name,
detailValue = accountHolderName
)
BankAccountDetailRows(
modifier = Modifier.fillMaxWidth().padding(top = 10.dp),
detail = R.string.branch_name,
detail = R.string.feature_accounts_branch_name,
detailValue = branchName
)
BankAccountDetailRows(
modifier = Modifier.fillMaxWidth().padding(top = 10.dp),
detail = R.string.ifsc,
detail = R.string.feature_accounts_ifsc,
detailValue = ifsc
)
BankAccountDetailRows(
modifier = Modifier.fillMaxWidth().padding(top = 10.dp),
detail = R.string.type,
detail = R.string.feature_accounts_type,
detailValue = type
)
}
Expand All @@ -101,14 +101,14 @@ fun BankAccountDetailScreen(
) {

BankAccountDetailButton(
btnText = R.string.setup_upi,
btnText = R.string.feature_accounts_setup_upi,
onClick = { onSetupUpiPin.invoke() },
isUpiEnabled = !isUpiEnabled,
hasTrailingIcon = false
)

BankAccountDetailButton(
btnText = R.string.delete_bank,
btnText = R.string.feature_accounts_delete_bank,
onClick = {},
isUpiEnabled = !isUpiEnabled
)
Expand All @@ -118,13 +118,13 @@ fun BankAccountDetailScreen(
modifier = Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(20.dp)
) {
BankAccountDetailButton(
btnText = R.string.change_upi_pin,
btnText = R.string.feature_accounts_change_upi_pin,
onClick = { onChangeUpiPin.invoke() },
isUpiEnabled = isUpiEnabled,
modifier = Modifier.fillMaxWidth()
)
BankAccountDetailButton(
btnText = R.string.forgot_upi_pin,
btnText = R.string.feature_accounts_forgot_upi_pin,
onClick = { onForgotUpiPin.invoke() },
isUpiEnabled = isUpiEnabled,
modifier = Modifier.fillMaxWidth()
Expand Down
Loading

0 comments on commit bac1001

Please sign in to comment.