Skip to content

Commit

Permalink
Update create/edit Case address fields and messages
Browse files Browse the repository at this point in the history
  • Loading branch information
hueachilles committed Aug 29, 2023
1 parent 839bc17 commit e126055
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ plugins {

android {
defaultConfig {
val buildVersion = 136
val buildVersion = 139
applicationId = "com.crisiscleanup"
versionCode = buildVersion
versionName = "0.2.${buildVersion - 129}"
versionName = "0.5.${buildVersion - 136}"

// Custom test runner to set up Hilt dependency graph
testInstrumentationRunner = "com.crisiscleanup.core.testing.CrisisCleanupTestRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,18 @@ class LocationInputData(
if (streetAddress.isBlank()) {
translationKeys.add("caseForm.address_required")
}
if (zipCode.isBlank()) {
translationKeys.add("caseForm.postal_code_required")
if (city.isBlank()) {
translationKeys.add("caseForm.city_required")
}
if (county.isBlank()) {
translationKeys.add("caseForm.county_required")
}
if (city.isBlank()) {
translationKeys.add("caseForm.city_required")
}
if (state.isBlank()) {
translationKeys.add("caseForm.state_required")
}
if (zipCode.isBlank()) {
translationKeys.add("caseForm.postal_code_required")
}

val message = translationKeys.joinToString("\n") { translator(it) }
return Pair(isAddressError, message)
Expand All @@ -131,8 +131,8 @@ class LocationInputData(
return false
}

if (zipCode.isBlank()) {
zipCodeError = translator("caseForm.postal_code_required")
if (city.isBlank()) {
cityError = translator("caseForm.city_required")
return false
}

Expand All @@ -141,13 +141,13 @@ class LocationInputData(
return false
}

if (city.isBlank()) {
cityError = translator("caseForm.city_required")
if (state.isBlank()) {
stateError = translator("caseForm.state_required")
return false
}

if (state.isBlank()) {
stateError = translator("caseForm.state_required")
if (zipCode.isBlank()) {
zipCodeError = translator("caseForm.postal_code_required")
return false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ private fun ColumnScope.FullEditView(
val sliderScrollToSectionItem = sectionSliderState.sliderScrollToSectionItem
val sliderScrollToSection = sectionSliderState.sliderScrollToSection
val editPropertyData = remember(viewModel) { { sliderScrollToSectionItem(0, 2) } }
// TODO Review this item index is correct
val editLocation = remember(viewModel) { { sliderScrollToSectionItem(0, 3) } }
val editLocationAddress = remember(viewModel) { { sliderScrollToSectionItem(0, 4) } }
val editFormData = remember(viewModel) { { index: Int -> sliderScrollToSection(index) } }
Expand Down

0 comments on commit e126055

Please sign in to comment.