Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ class FormRepositoryImpl
stage: String,
dl: String,
) = withContext(Dispatchers.IO) {
d2.programModule().programTrackedEntityAttributes()
.byProgram().eq("")
.bySearchable().isTrue
.byDisplayInList().isTrue
.blockingGet()


d2.programModule().programStageDataElements()
.byProgramStage().eq(stage)
.byDataElement().eq(dl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ fun AttendanceScreen(
viewModel.setAttendance(
index,
ou,
tei ,
tei,
student.selectedEnrollment.uid().orEmpty(),
value,
reasonOfAbsence,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,8 @@ data class InfoCard(
val isStaff: Boolean = false,
) {
fun hasData(): Boolean {
return if (isStaff) {
academicYear.isNotEmpty() &&
orgUnitName.isNotEmpty()
} else {
grade.isNotEmpty() && section.isNotEmpty() && academicYear.isNotEmpty() &&
orgUnitName.isNotEmpty()
}
return academicYear.isNotEmpty() &&
orgUnitName.isNotEmpty()
}
}

Expand Down
15 changes: 3 additions & 12 deletions emis/src/main/java/org/saudigitus/emis/ui/home/HomeUiState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,17 @@ data class HomeUiState(
val modules: List<Module> = emptyList(),
) {
val isNull: Boolean
get() = academicYear == null && school == null && grade == null && section == null

val isStaffFiltersNotNull: Boolean
get() = key == Constants.STAFF && academicYear != null && school != null
get() = academicYear == null && school == null

val isStaff: Boolean
get() = key == Constants.STAFF

val options: List<String>
get() = if (key == Constants.STAFF && academicYear != null && school != null) {
listOf(
get() = if (academicYear != null && school != null) {
listOfNotNull(
academicYear.code,
grade?.code,
section?.code,
).mapNotNull { it }
} else if (!isNull) {
listOf(
"${academicYear?.code}",
"${grade?.code}",
"${section?.code}",
)
} else {
emptyList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ class HomeViewModel

private fun getTeis() {
viewModelScope.launch {
if (!viewModelState.value.isNull || viewModelState.value.isStaffFiltersNotNull) {
val dataElements = listOf(
if (!viewModelState.value.isNull) {
val dataElements = listOfNotNull(
registration.value?.academicYear,
registration.value?.grade,
registration.value?.section,
).mapNotNull { it }
)

repository.getTeisBy(
ou = "${viewModelState.value.school?.uid}",
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kotlin = '2.0.20'
hilt = '2.47'
androidxNavigation = "2.6.0"
androidxHiltNavigation = "1.0.0"
semis = "1.0.0"
semis = "1.4.1"

jacoco = '0.8.10'
designSystem = "0.4.0.1"
Expand Down