diff --git a/app/src/androidTest/java/org/dhis2/usescases/searchte/SearchTETest.kt b/app/src/androidTest/java/org/dhis2/usescases/searchte/SearchTETest.kt index dafd39dbf4..88056d09ee 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/searchte/SearchTETest.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/searchte/SearchTETest.kt @@ -401,7 +401,6 @@ class SearchTETest : BaseTest() { checkFilterCounter(totalCount) checkCountAtFilter(enrollmentStatus, totalFilterCount) clickOnFilter() - checkTEIsAreOpen() } searchTeiRobot(composeTestRule) { diff --git a/app/src/androidTest/java/org/dhis2/usescases/searchte/robot/FilterRobot.kt b/app/src/androidTest/java/org/dhis2/usescases/searchte/robot/FilterRobot.kt index 8f583197b3..7ba5e7de9b 100644 --- a/app/src/androidTest/java/org/dhis2/usescases/searchte/robot/FilterRobot.kt +++ b/app/src/androidTest/java/org/dhis2/usescases/searchte/robot/FilterRobot.kt @@ -6,11 +6,9 @@ import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.contrib.PickerActions import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem -import androidx.test.espresso.matcher.ViewMatchers import androidx.test.espresso.matcher.ViewMatchers.hasDescendant import androidx.test.espresso.matcher.ViewMatchers.isDisplayed import androidx.test.espresso.matcher.ViewMatchers.withChild -import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.espresso.matcher.ViewMatchers.withParent import androidx.test.espresso.matcher.ViewMatchers.withText @@ -33,16 +31,6 @@ fun filterRobot(filterRobot: FilterRobot.() -> Unit) { class FilterRobot : BaseRobot() { - fun clickOnEnrollmentDateFilter() { - val tag = "DATE OF ENROLLMENT" - onView(allOf(withId(R.id.filterLayout), hasDescendant(withText(tag)))).perform(click()) - } - - fun clickOnTodayEnrollmentDate(){ - onView(allOf(withId(R.id.today), - withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))).perform(click()) - } - fun clickOnFilter() { onView(withId(R.id.search_filter_general)).perform(click()) } @@ -68,10 +56,6 @@ class FilterRobot : BaseRobot() { .perform(actionOnItem(hasDescendant(withText(filter)), clickChildViewWithId(R.id.filterArrow))) } - fun closeSearchForm() { - onView(withId(R.id.close_filter)).perform(click()) - } - fun clickOnSortByField(fieldFilter: String) { onView(withId(R.id.filterRecyclerLayout)) .perform(actionOnItem(hasDescendant(withText(fieldFilter)), clickChildViewWithId(R.id.sortingIcon))) @@ -102,11 +86,6 @@ class FilterRobot : BaseRobot() { .check(matches(allElementsWithHolderTypeHave(SearchTEViewHolder::class.java,hasDescendant(withText(R.string.event_open))))) } - fun checkEventsAreOverdue() { - onView(withId(R.id.scrollView)) - .check(matches(allOf(allElementsWithHolderTypeHave(SearchTEViewHolder::class.java,hasDescendant(withId(R.id.overdueIcon))), isDisplayed()))) - } - fun checkTEIWithOrgUnit(orgUnit: String) { onView(withId(R.id.scrollView)) .check(matches(allElementsWithHolderTypeHave(SearchTEViewHolder::class.java,hasDescendant(withText(orgUnit))))) diff --git a/app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/indicators/BaseIndicatorRepository.kt b/app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/indicators/BaseIndicatorRepository.kt index 623fd92494..4bf9a15242 100644 --- a/app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/indicators/BaseIndicatorRepository.kt +++ b/app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/indicators/BaseIndicatorRepository.kt @@ -52,8 +52,7 @@ abstract class BaseIndicatorRepository( null } Pair.create(indicator, indicatorValue ?: "") - }.filter { it.val1().isNotEmpty() } - .flatMap { + }.flatMap { getLegendColorForIndicator(it.val0(), it.val1()) }.map { IndicatorModel( diff --git a/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/mappers/GraphToIndicator.kt b/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/mappers/GraphToIndicator.kt index 11f725993a..7b3523d24c 100644 --- a/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/mappers/GraphToIndicator.kt +++ b/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/mappers/GraphToIndicator.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.unit.dp import dhis2.org.R import dhis2.org.analytics.charts.data.ChartType import dhis2.org.analytics.charts.data.Graph -import org.hisp.dhis.mobile.ui.designsystem.component.IndicatorInput +import org.hisp.dhis.mobile.ui.designsystem.component.Indicator import org.hisp.dhis.mobile.ui.designsystem.theme.DHIS2Theme import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor @@ -37,7 +37,7 @@ class GraphToIndicator { ) { series.forEach { val coordinate = it.coordinates.lastOrNull() - IndicatorInput( + Indicator( title = it.fieldName, content = it.coordinates.lastOrNull()?.textValue() ?: "", indicatorColor = if (coordinate?.legendValue?.color != null) { diff --git a/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/ui/IndicatorViewHolder.kt b/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/ui/IndicatorViewHolder.kt index b8ccc1d764..6093dc05ad 100644 --- a/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/ui/IndicatorViewHolder.kt +++ b/dhis_android_analytics/src/main/java/dhis2/org/analytics/charts/ui/IndicatorViewHolder.kt @@ -16,7 +16,7 @@ import androidx.recyclerview.widget.RecyclerView import dhis2.org.R import org.dhis2.commons.dialogs.CustomDialog import org.hisp.dhis.android.core.program.ProgramIndicator -import org.hisp.dhis.mobile.ui.designsystem.component.IndicatorInput +import org.hisp.dhis.mobile.ui.designsystem.component.Indicator import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor class IndicatorViewHolder( @@ -47,7 +47,7 @@ class IndicatorViewHolder( }, ), ) { - IndicatorInput( + Indicator( title = programIndicatorModel.label(), indicatorColor = if (!programIndicatorModel.color.isNullOrEmpty()) { Color(programIndicatorModel.color())