Skip to content

Commit

Permalink
remove asams from data store filters, set tab to nil and mappable to …
Browse files Browse the repository at this point in the history
…false
  • Loading branch information
danielbarela committed Sep 27, 2024
1 parent 7628546 commit 2b0a0a6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/mil/nga/msi/datasource/DataSource.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ enum class DataSource(
val route: Route? = null
) {
ASAM(
tab = Tab(AsamRoute.Main, "ASAMs"),
mappable = true,
tab = null,
mappable = false,
color = Color(0xFF000000),
icon = R.drawable.ic_asam_24dp,
label = "ASAM",
Expand Down
23 changes: 1 addition & 22 deletions app/src/main/java/mil/nga/msi/di/DataStoreModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class DataStoreModule {
)
.putAllMapped(
mapOf(
DataSource.ASAM.name to true,
DataSource.MODU.name to true,
DataSource.NAVIGATION_WARNING.name to true,
DataSource.LIGHT.name to true,
Expand All @@ -70,7 +69,6 @@ class DataStoreModule {
)
.addAllTabs(
listOf(
DataSource.ASAM,
DataSource.MODU,
DataSource.NAVIGATION_WARNING,
DataSource.LIGHT
Expand Down Expand Up @@ -120,26 +118,7 @@ class DataStoreModule {
companion object {
const val VERSION = 5

val filterDefaults = mapOf(
DataSource.ASAM.name to Filters.newBuilder()
.addFilters(
Filter.newBuilder()
.setParameter(
listOfNotNull(
AsamFilter.parameters.find { it.parameter == "date" }
).map {
FilterParameter.newBuilder()
.setName(it.parameter)
.setTitle(it.title)
.setType(it.type.name)
.build()
}.first()
)
.setValue("last 365 days")
.setComparator(ComparatorType.WITHIN.name)
)
.build()
)
val filterDefaults = emptyMap<String, Filters>().toMutableMap()

val sortDefaults = mapOf(
DataSource.ASAM.name to Sort.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ val dataStoreMigration_4_5 = object : DataMigration<UserPreferences> {
.clearNonTabs()
.addAllNonTabs(nonTabs)
.removeMapped(DataSource.ASAM.name)
.removeFilters(DataSource.ASAM.name)
.setVersion(5)
.build()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class MapFilterViewModel @Inject constructor(
)

private val filterableDataSources = listOf(
DataSource.ASAM,
DataSource.MODU,
DataSource.LIGHT,
DataSource.PORT,
Expand Down

0 comments on commit 2b0a0a6

Please sign in to comment.