File tree 6 files changed +19
-15
lines changed
androidTest/java/org/dhis2/usescases/datasets
main/java/org/dhis2/usescases/datasets/datasetInitial
commons/src/main/java/org/dhis2/commons/orgunitselector
form/src/main/java/org/dhis2/form/ui/provider/inputfield
6 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ internal class DataSetInitialRobot : BaseRobot() {
20
20
}
21
21
22
22
fun clickOnInputPeriod () {
23
- waitForView(withId(R .id.dataSetPeriodInputLayout), 5000 )
24
23
onView(withId(R .id.dataSetPeriodInputLayout)).perform(click())
25
24
}
26
25
Original file line number Diff line number Diff line change @@ -274,12 +274,8 @@ internal class DataSetTableRobot(
274
274
)
275
275
}
276
276
277
- @OptIn(ExperimentalTestApi ::class )
278
277
fun tapOnSaveButton () {
279
- composeTestRule.waitUntilExactlyOneExists(
280
- hasTestTag(SAVE_BUTTON_TAG ),
281
- timeoutMillis = 3000
282
- )
278
+ composeTestRule.waitForIdle()
283
279
composeTestRule.onNodeWithTag(SAVE_BUTTON_TAG ).performClick()
284
280
composeTestRule.waitForIdle()
285
281
}
Original file line number Diff line number Diff line change 18
18
import org .dhis2 .commons .Constants ;
19
19
import org .dhis2 .commons .extensions .CategoryOptionExtensionsKt ;
20
20
import org .dhis2 .commons .featureconfig .data .FeatureConfigRepository ;
21
- import org .dhis2 .commons .featureconfig .model .Feature ;
22
21
import org .dhis2 .commons .orgunitselector .OUTreeFragment ;
23
22
import org .dhis2 .commons .orgunitselector .OrgUnitSelectorScope ;
24
23
import org .dhis2 .commons .resources .DhisPeriodUtils ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import org.dhis2.commons.data.tuples.Pair
7
7
import org.dhis2.commons.extensions.inDateRange
8
8
import org.dhis2.commons.extensions.inOrgUnit
9
9
import org.dhis2.commons.schedulers.SchedulerProvider
10
+ import org.dhis2.mobile.commons.coroutine.CoroutineTracker
10
11
import org.hisp.dhis.android.core.category.CategoryOption
11
12
import org.hisp.dhis.android.core.organisationunit.OrganisationUnit
12
13
import org.hisp.dhis.android.core.period.PeriodType
@@ -65,6 +66,7 @@ class DataSetInitialPresenter(
65
66
}
66
67
67
68
override fun onCatOptionClick (catOptionUid : String ) {
69
+ CoroutineTracker .increment()
68
70
compositeDisposable.add(
69
71
dataSetInitialRepository.catCombo(catOptionUid)
70
72
.subscribeOn(schedulerProvider.io())
@@ -79,6 +81,7 @@ class DataSetInitialPresenter(
79
81
it.inOrgUnit(view.selectedOrgUnit?.uid())
80
82
},
81
83
)
84
+ CoroutineTracker .decrement()
82
85
},
83
86
Timber ::d,
84
87
),
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import kotlinx.coroutines.launch
22
22
import org.dhis2.commons.R
23
23
import org.dhis2.commons.dialogs.bottomsheet.bottomSheetInsets
24
24
import org.dhis2.commons.dialogs.bottomsheet.bottomSheetLowerPadding
25
+ import org.dhis2.mobile.commons.coroutine.CoroutineTracker
25
26
import org.hisp.dhis.android.core.organisationunit.OrganisationUnit
26
27
import org.hisp.dhis.mobile.ui.designsystem.component.OrgBottomSheet
27
28
import javax.inject.Inject
@@ -71,6 +72,7 @@ class OUTreeFragment : BottomSheetDialogFragment() {
71
72
}
72
73
73
74
fun build (): OUTreeFragment {
75
+ CoroutineTracker .increment()
74
76
return OUTreeFragment ().apply {
75
77
selectionCallback = selectionListener
76
78
model = ouTreeModel
@@ -79,6 +81,7 @@ class OUTreeFragment : BottomSheetDialogFragment() {
79
81
putParcelable(ARG_SCOPE , orgUnitScope)
80
82
putStringArrayList(ARG_PRE_SELECTED_OU , ArrayList (preselectedOrgUnits))
81
83
}
84
+ CoroutineTracker .decrement()
82
85
}
83
86
}
84
87
}
Original file line number Diff line number Diff line change @@ -53,14 +53,18 @@ internal fun ProvideRadioButtonInput(
53
53
isRequired = fieldUiModel.mandatory,
54
54
itemSelected = data.find { it.selected },
55
55
onItemChange = { item ->
56
- val selectedIndex = data.indexOf(item)
57
- intentHandler(
58
- FormIntent .OnSave (
59
- fieldUiModel.uid,
60
- codeList[selectedIndex],
61
- fieldUiModel.valueType,
62
- ),
63
- )
56
+ if (item != null ) {
57
+ val selectedIndex = data.indexOf(item)
58
+ intentHandler(
59
+ FormIntent .OnSave (
60
+ fieldUiModel.uid,
61
+ codeList[selectedIndex],
62
+ fieldUiModel.valueType,
63
+ ),
64
+ )
65
+ } else {
66
+ intentHandler(FormIntent .ClearValue (fieldUiModel.uid))
67
+ }
64
68
},
65
69
)
66
70
}
You can’t perform that action at this time.
0 commit comments