diff --git a/app/build.gradle b/app/build.gradle index e8902fdd..6584b0d2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,8 +23,8 @@ android { testApplicationId "io.github.tests.wulkanowy" minSdkVersion 21 targetSdkVersion 32 - versionCode 113 - versionName "1.7.4" + versionCode 114 + versionName "1.7.5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" resValue "string", "app_name", "Wulkanowy" @@ -162,7 +162,7 @@ play { track = 'production' // releaseStatus = com.github.triplet.gradle.androidpublisher.ReleaseStatus.IN_PROGRESS // userFraction = 0.05d - updatePriority = 5 + updatePriority = 4 enabled.set(false) } @@ -186,7 +186,7 @@ ext { } dependencies { - implementation "io.github.wulkanowy:sdk:1.7.4" + implementation "io.github.wulkanowy:sdk:1.7.5" coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.8' diff --git a/app/src/main/java/io/github/wulkanowy/data/repositories/MailboxRepository.kt b/app/src/main/java/io/github/wulkanowy/data/repositories/MailboxRepository.kt index ad4f669e..c571937a 100644 --- a/app/src/main/java/io/github/wulkanowy/data/repositories/MailboxRepository.kt +++ b/app/src/main/java/io/github/wulkanowy/data/repositories/MailboxRepository.kt @@ -60,16 +60,18 @@ class MailboxRepository @Inject constructor( } private fun String.normalizeStudentName(): String { - return trim().split(" ").joinToString(" ") { part -> - part.lowercase().replaceFirstChar { it.uppercase() } - } + return trim().split(" ") + .filter { it.isNotBlank() } + .joinToString(" ") { part -> + part.lowercase().replaceFirstChar { it.uppercase() } + } } private fun String.getFirstAndLastPart(): String { val parts = normalizeStudentName().split(" ") val endParts = parts.filterIndexed { i, _ -> - i == 0 || parts.size == i - 1 + i == 0 || parts.size - 1 == i } return endParts.joinToString(" ") } diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewAttendanceNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewAttendanceNotification.kt index 49842c9a..99473a8e 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewAttendanceNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewAttendanceNotification.kt @@ -8,7 +8,6 @@ import io.github.wulkanowy.data.db.entities.Student import io.github.wulkanowy.data.pojos.GroupNotificationData import io.github.wulkanowy.data.pojos.NotificationData import io.github.wulkanowy.ui.modules.Destination -import io.github.wulkanowy.ui.modules.splash.SplashActivity import io.github.wulkanowy.utils.descriptionRes import io.github.wulkanowy.utils.getPlural import io.github.wulkanowy.utils.toFormattedString @@ -22,8 +21,9 @@ class NewAttendanceNotification @Inject constructor( suspend fun notify(items: List, student: Student) { val lines = items.filterNot { it.presence || it.name == "UNKNOWN" } .map { + val lesson = it.subject.ifBlank { "Lekcja ${it.number}" } val description = context.getString(it.descriptionRes) - "${it.date.toFormattedString("dd.MM")} - ${it.subject}: $description" + "${it.date.toFormattedString("dd.MM")} - $lesson: $description" } .ifEmpty { return } diff --git a/app/src/main/play/release-notes/pl-PL/default.txt b/app/src/main/play/release-notes/pl-PL/default.txt index 7fe3b709..064401ab 100644 --- a/app/src/main/play/release-notes/pl-PL/default.txt +++ b/app/src/main/play/release-notes/pl-PL/default.txt @@ -1,6 +1,7 @@ -Wersja 1.7.4 +Wersja 1.7.5 - naprawiliśmy kilka błędów w obsłudze nowego modułu wiadomości - naprawiliśmy wyświetlanie napisu "Brak ocen", jesli uczeń nie zdobył w danym semestrze jeszcze żadnych ocen +- naprawiliśmy logowanie do aplikacji rodzicom będącym jednocześnie nauczycielami Pełna lista zmian: https://github.com/wulkanowy/wulkanowy/releases diff --git a/app/src/test/java/io/github/wulkanowy/data/repositories/MailboxRepositoryTest.kt b/app/src/test/java/io/github/wulkanowy/data/repositories/MailboxRepositoryTest.kt index 300662f0..9198560f 100644 --- a/app/src/test/java/io/github/wulkanowy/data/repositories/MailboxRepositoryTest.kt +++ b/app/src/test/java/io/github/wulkanowy/data/repositories/MailboxRepositoryTest.kt @@ -91,6 +91,20 @@ class MailboxRepositoryTest { assertEquals(expectedMailbox, systemUnderTest.getMailbox(student)) } + @Test + fun `get mailbox for unique non-authorized student but with spaces`() = runTest { + val student = getStudentEntity( + userName = "Stanisław Kowalski", + studentName = "J** K*******", + ) + val expectedMailbox = getMailboxEntity("Jan Kowalski") + coEvery { mailboxDao.loadAll(any()) } returns listOf( + expectedMailbox, + ) + + assertEquals(expectedMailbox, systemUnderTest.getMailbox(student)) + } + @Test(expected = IllegalArgumentException::class) fun `get mailbox for not-unique non-authorized student`() = runTest { val student = getStudentEntity(