Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0.4.0.1 to develop #337

Merged
merged 11 commits into from
Dec 9, 2024
Prev Previous commit
Next Next commit
fix snapshot test
Signed-off-by: Pablo Pajuelo Cabezas <pablo@dhis2.org>
Balcan committed Nov 22, 2024

Verified

This commit was signed with the committer’s verified signature.
Balcan Pablo
commit e211e9e465a9a7ba4e381fdffb5372250a2b993d
Original file line number Diff line number Diff line change
@@ -45,23 +45,37 @@ class InputDropDownSnapshotTest {
)
Title("Input Dropdown", textColor = TextColor.OnSurfaceVariant)

SubTitle("Basic Input Dropdown with < 7 inputs", textColor = TextColor.OnSurfaceVariant)
SubTitle(
"Basic Input Dropdown with < 7 inputs",
textColor = TextColor.OnSurfaceVariant
)
var selectedItem by remember { mutableStateOf<DropdownItem?>(null) }
val focusRequester = remember { FocusRequester() }

LaunchedEffect(Unit) {
focusRequester.requestFocus()
}

val sixOptions = options.take(6)

InputDropDown(
modifier = Modifier.focusRequester(focusRequester),
title = "Label",
state = InputShellState.FOCUSED,
dropdownItems = options.take(6),
itemCount = sixOptions.size,
fetchItem = { index ->
sixOptions[index]
},
onSearchOption = {

},
loadOptions = {

},
onResetButtonClicked = {
selectedItem = null
},
onItemSelected = {
onItemSelected = { _, it ->
selectedItem = it
},
selectedItem = selectedItem,
@@ -71,45 +85,79 @@ class InputDropDownSnapshotTest {
title = "Label - Parameter Style",
inputStyle = InputStyle.ParameterInputStyle(),
state = InputShellState.UNFOCUSED,
dropdownItems = options.take(6),
itemCount = sixOptions.size,
fetchItem = { index ->
sixOptions[index]
},
onSearchOption = {

},
loadOptions = {

},
onResetButtonClicked = {
selectedItem = null
},
onItemSelected = {
onItemSelected = { _, it ->
selectedItem = it
},
selectedItem = selectedItem,
)

Spacer(Modifier.size(Spacing.Spacing18))

SubTitle("Basic Input Dropdown with >= 7 inputs", textColor = TextColor.OnSurfaceVariant)
SubTitle(
"Basic Input Dropdown with >= 7 inputs",
textColor = TextColor.OnSurfaceVariant
)

var selectedItem4 by remember { mutableStateOf<DropdownItem?>(null) }
InputDropDown(
title = "Label",
state = InputShellState.UNFOCUSED,
dropdownItems = options,
itemCount = options.size,
fetchItem = { index ->
options[index]
},
onSearchOption = {

},
loadOptions = {

},
onResetButtonClicked = {
selectedItem4 = null
},
onItemSelected = {
onItemSelected = { _, it ->
selectedItem4 = it
},
selectedItem = selectedItem4,
)

Spacer(Modifier.size(Spacing.Spacing18))

SubTitle("Basic Input Dropdown with content ", textColor = TextColor.OnSurfaceVariant)
SubTitle(
"Basic Input Dropdown with content ",
textColor = TextColor.OnSurfaceVariant
)
var selectedItem1 by remember { mutableStateOf<DropdownItem?>(options[0]) }
InputDropDown(
title = "Label",
state = InputShellState.UNFOCUSED,
dropdownItems = options,
itemCount = options.size,
fetchItem = { index ->
options[index]
},
onSearchOption = {

},
loadOptions = {

},
onResetButtonClicked = {
selectedItem1 = null
},
onItemSelected = {
onItemSelected = { _, it ->
selectedItem1 = it
},
selectedItem = selectedItem1,
@@ -121,27 +169,48 @@ class InputDropDownSnapshotTest {
InputDropDown(
title = "Label",
state = InputShellState.ERROR,
dropdownItems = options,
itemCount = options.size,
fetchItem = { index ->
options[index]
},
onSearchOption = {

},
loadOptions = {

},
onResetButtonClicked = {
selectedItem2 = null
},
onItemSelected = {
onItemSelected = { _, it ->
selectedItem2 = it
},
selectedItem = selectedItem2,
)
Spacer(Modifier.size(Spacing.Spacing18))

SubTitle("Disabled Input Dropdown with content ", textColor = TextColor.OnSurfaceVariant)
SubTitle(
"Disabled Input Dropdown with content ",
textColor = TextColor.OnSurfaceVariant
)
var selectedItem3 by remember { mutableStateOf<DropdownItem?>(options[1]) }
InputDropDown(
title = "Label",
state = InputShellState.DISABLED,
dropdownItems = options,
itemCount = options.size,
fetchItem = { index ->
options[index]
},
onSearchOption = {

},
loadOptions = {

},
onResetButtonClicked = {
selectedItem3 = null
},
onItemSelected = {
onItemSelected = { _, it ->
selectedItem3 = it
},
selectedItem = selectedItem3,