From 2b0a0a67caaee61be676772e1a4a0fdd215e9aad Mon Sep 17 00:00:00 2001 From: Daniel Barela Date: Fri, 27 Sep 2024 11:43:02 -0600 Subject: [PATCH] remove asams from data store filters, set tab to nil and mappable to false --- .../java/mil/nga/msi/datasource/DataSource.kt | 4 ++-- .../java/mil/nga/msi/di/DataStoreModule.kt | 23 +------------------ .../datastore/DataStoreMigration_4_5.kt | 1 + .../msi/ui/map/filter/MapFilterViewModel.kt | 1 - 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/mil/nga/msi/datasource/DataSource.kt b/app/src/main/java/mil/nga/msi/datasource/DataSource.kt index 0e3b319c..e0ba5e71 100644 --- a/app/src/main/java/mil/nga/msi/datasource/DataSource.kt +++ b/app/src/main/java/mil/nga/msi/datasource/DataSource.kt @@ -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", diff --git a/app/src/main/java/mil/nga/msi/di/DataStoreModule.kt b/app/src/main/java/mil/nga/msi/di/DataStoreModule.kt index 5ebe43eb..b1290d9e 100644 --- a/app/src/main/java/mil/nga/msi/di/DataStoreModule.kt +++ b/app/src/main/java/mil/nga/msi/di/DataStoreModule.kt @@ -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, @@ -70,7 +69,6 @@ class DataStoreModule { ) .addAllTabs( listOf( - DataSource.ASAM, DataSource.MODU, DataSource.NAVIGATION_WARNING, DataSource.LIGHT @@ -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().toMutableMap() val sortDefaults = mapOf( DataSource.ASAM.name to Sort.newBuilder() diff --git a/app/src/main/java/mil/nga/msi/di/migrations/datastore/DataStoreMigration_4_5.kt b/app/src/main/java/mil/nga/msi/di/migrations/datastore/DataStoreMigration_4_5.kt index 76ad0787..67045cac 100644 --- a/app/src/main/java/mil/nga/msi/di/migrations/datastore/DataStoreMigration_4_5.kt +++ b/app/src/main/java/mil/nga/msi/di/migrations/datastore/DataStoreMigration_4_5.kt @@ -22,6 +22,7 @@ val dataStoreMigration_4_5 = object : DataMigration { .clearNonTabs() .addAllNonTabs(nonTabs) .removeMapped(DataSource.ASAM.name) + .removeFilters(DataSource.ASAM.name) .setVersion(5) .build() } diff --git a/app/src/main/java/mil/nga/msi/ui/map/filter/MapFilterViewModel.kt b/app/src/main/java/mil/nga/msi/ui/map/filter/MapFilterViewModel.kt index 28fc5d68..37edc2ad 100644 --- a/app/src/main/java/mil/nga/msi/ui/map/filter/MapFilterViewModel.kt +++ b/app/src/main/java/mil/nga/msi/ui/map/filter/MapFilterViewModel.kt @@ -21,7 +21,6 @@ class MapFilterViewModel @Inject constructor( ) private val filterableDataSources = listOf( - DataSource.ASAM, DataSource.MODU, DataSource.LIGHT, DataSource.PORT,