Fix grade stats loading issues (#266)

This commit is contained in:
Mikołaj Pich
2019-03-07 13:08:59 +01:00
committed by Rafał Borcz
parent 1b7db4bfbb
commit 4f0021919c
8 changed files with 13 additions and 9 deletions

View File

@ -26,7 +26,7 @@ class MessageRemote @Inject constructor(private val api: Api) {
sender = it.sender.orEmpty(),
senderId = it.senderId ?: 0,
recipient = it.recipient.orEmpty(),
recipientId = it.recipientId,
recipientId = 0,
subject = it.subject.trim(),
date = it.date?.toLocalDateTime() ?: now(),
folderId = it.folderId,
@ -50,7 +50,7 @@ class MessageRemote @Inject constructor(private val api: Api) {
recipients = recipients.map {
ApiRecipient(
id = it.realId,
realName = it.realName,
name = it.realName,
loginId = it.loginId,
reportingUnitId = it.unitId,
role = it.role,

View File

@ -17,12 +17,12 @@ class RecipientRemote @Inject constructor(private val api: Api) {
Recipient(
studentId = api.studentId,
name = it.name,
realName = it.realName,
realName = it.name,
realId = it.id,
hash = it.hash,
loginId = it.loginId,
role = it.role,
unitId = it.reportingUnitId
unitId = it.reportingUnitId ?: 0
)
}
}

View File

@ -130,6 +130,7 @@ class GradeStatisticsFragment : BaseSessionFragment(), GradeStatisticsView, Grad
override fun showSubjects(show: Boolean) {
gradeStatisticsSubjectsContainer.visibility = if (show) View.VISIBLE else View.INVISIBLE
gradeStatisticsTypeSwitch.visibility = if (show) View.VISIBLE else View.INVISIBLE
}
override fun clearView() {

View File

@ -74,6 +74,7 @@ class GradeStatisticsPresenter @Inject constructor(
fun onTypeChange(isSemester: Boolean) {
Timber.i("Select attendance stats semester: $isSemester")
disposable.clear()
view?.run {
showContent(false)
showProgress(true)