From 9447c3f71c37063b58ad29a12e98fd3ae1f5e9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manu=20Mu=C3=B1oz?= Date: Thu, 26 Dec 2024 16:38:40 +0100 Subject: [PATCH] fix: [ANDROAPP-6354] line listing filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manu Muñoz --- .../analytics/charts/bindings/LineListingExtensions.kt | 10 +++++----- .../dhis2/org/analytics/charts/data/GraphFilters.kt | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/bindings/LineListingExtensions.kt b/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/bindings/LineListingExtensions.kt index fbb4b006e5..a02757545e 100644 --- a/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/bindings/LineListingExtensions.kt +++ b/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/bindings/LineListingExtensions.kt @@ -18,19 +18,19 @@ fun TrackerLineListItem.withFilters( TrackerLineListItem.LastUpdatedBy -> this is TrackerLineListItem.EnrollmentDate -> this.copy( filters = this.filters + listOf( - DateFilter.Range(value, value), + DateFilter.Like(value), ), ) is TrackerLineListItem.EventDate -> this.copy( filters = this.filters + listOf( - DateFilter.Range(value, value), + DateFilter.Like(value), ), ) is TrackerLineListItem.ScheduledDate -> this.copy( filters = this.filters + listOf( - DateFilter.Range(value, value), + DateFilter.Like(value), ), ) @@ -42,13 +42,13 @@ fun TrackerLineListItem.withFilters( is TrackerLineListItem.IncidentDate -> this.copy( filters = this.filters + listOf( - DateFilter.Range(value, value), + DateFilter.Like(value), ), ) is TrackerLineListItem.LastUpdated -> this.copy( filters = this.filters + listOf( - DateFilter.Range(value, value), + DateFilter.Like(value), ), ) diff --git a/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/data/GraphFilters.kt b/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/data/GraphFilters.kt index 3d9ccb171f..a74a6659ac 100644 --- a/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/data/GraphFilters.kt +++ b/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/data/GraphFilters.kt @@ -41,9 +41,7 @@ sealed class GraphFilters { lineListFilters.isNotEmpty() || orgUnitsSelected.isNotEmpty() || periodToDisplaySelected.isNotEmpty() override fun count(): Int { - var count = 0 - if (hasFilters()) count++ - return count + return columnsWithFilters().size } override fun canDisplayChart(dataIsNotEmpty: Boolean): Boolean {