Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97f0eb56d5 |
@@ -33,8 +33,8 @@ android {
|
|||||||
applicationId = "pl.firmatpp.kierowca"
|
applicationId = "pl.firmatpp.kierowca"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 40
|
versionCode = 41
|
||||||
versionName = "1.0.39"
|
versionName = "1.0.40"
|
||||||
setProperty("archivesBaseName", "pl.firmatpp.kierowca")
|
setProperty("archivesBaseName", "pl.firmatpp.kierowca")
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|||||||
@@ -961,7 +961,7 @@ private fun LeaveRequestDetailScreen(
|
|||||||
) {
|
) {
|
||||||
Column(Modifier.padding(14.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
Column(Modifier.padding(14.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||||
Text(
|
Text(
|
||||||
"${event.action}${event.toStatus?.let { " · ${DriverLeaveRequestUiRules.statusLabel(it)}" } ?: ""}",
|
"${DriverLeaveRequestUiRules.eventActionLabel(event.action)}${event.toStatus?.let { " · ${DriverLeaveRequestUiRules.statusLabel(it)}" } ?: ""}",
|
||||||
color = TppColors.Ink,
|
color = TppColors.Ink,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,7 +19,20 @@ object DriverLeaveRequestUiRules {
|
|||||||
"cancel_requested" -> "Anulowanie do decyzji"
|
"cancel_requested" -> "Anulowanie do decyzji"
|
||||||
"cancelled" -> "Anulowany"
|
"cancelled" -> "Anulowany"
|
||||||
"revoked" -> "Cofnięto decyzję"
|
"revoked" -> "Cofnięto decyzję"
|
||||||
else -> status
|
else -> "Nieznany status"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun eventActionLabel(action: String): String =
|
||||||
|
when (action) {
|
||||||
|
"submitted" -> "Wniosek złożony"
|
||||||
|
"approved" -> "Wniosek zatwierdzony"
|
||||||
|
"rejected" -> "Wniosek odrzucony"
|
||||||
|
"revoked" -> "Decyzja cofnięta"
|
||||||
|
"cancelled_by_driver" -> "Wniosek anulowany przez kierowcę"
|
||||||
|
"cancellation_requested" -> "Kierowca poprosił o anulowanie"
|
||||||
|
"cancellation_approved" -> "Anulowanie zatwierdzone"
|
||||||
|
"cancellation_rejected" -> "Anulowanie odrzucone"
|
||||||
|
else -> "Aktualizacja wniosku"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun typeLabel(type: String): String =
|
fun typeLabel(type: String): String =
|
||||||
|
|||||||
@@ -17,8 +17,25 @@ class DriverLeaveRequestUiRulesTest {
|
|||||||
@Test
|
@Test
|
||||||
fun exposesPolishStatusLabels() {
|
fun exposesPolishStatusLabels() {
|
||||||
assertEquals("Oczekuje", DriverLeaveRequestUiRules.statusLabel("pending"))
|
assertEquals("Oczekuje", DriverLeaveRequestUiRules.statusLabel("pending"))
|
||||||
|
assertEquals("Zatwierdzony", DriverLeaveRequestUiRules.statusLabel("approved"))
|
||||||
|
assertEquals("Odrzucony", DriverLeaveRequestUiRules.statusLabel("rejected"))
|
||||||
assertEquals("Anulowanie do decyzji", DriverLeaveRequestUiRules.statusLabel("cancel_requested"))
|
assertEquals("Anulowanie do decyzji", DriverLeaveRequestUiRules.statusLabel("cancel_requested"))
|
||||||
|
assertEquals("Anulowany", DriverLeaveRequestUiRules.statusLabel("cancelled"))
|
||||||
assertEquals("Cofnięto decyzję", DriverLeaveRequestUiRules.statusLabel("revoked"))
|
assertEquals("Cofnięto decyzję", DriverLeaveRequestUiRules.statusLabel("revoked"))
|
||||||
|
assertEquals("Nieznany status", DriverLeaveRequestUiRules.statusLabel("some_raw_status"))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun exposesPolishEventActionLabels() {
|
||||||
|
assertEquals("Wniosek złożony", DriverLeaveRequestUiRules.eventActionLabel("submitted"))
|
||||||
|
assertEquals("Wniosek zatwierdzony", DriverLeaveRequestUiRules.eventActionLabel("approved"))
|
||||||
|
assertEquals("Wniosek odrzucony", DriverLeaveRequestUiRules.eventActionLabel("rejected"))
|
||||||
|
assertEquals("Decyzja cofnięta", DriverLeaveRequestUiRules.eventActionLabel("revoked"))
|
||||||
|
assertEquals("Wniosek anulowany przez kierowcę", DriverLeaveRequestUiRules.eventActionLabel("cancelled_by_driver"))
|
||||||
|
assertEquals("Kierowca poprosił o anulowanie", DriverLeaveRequestUiRules.eventActionLabel("cancellation_requested"))
|
||||||
|
assertEquals("Anulowanie zatwierdzone", DriverLeaveRequestUiRules.eventActionLabel("cancellation_approved"))
|
||||||
|
assertEquals("Anulowanie odrzucone", DriverLeaveRequestUiRules.eventActionLabel("cancellation_rejected"))
|
||||||
|
assertEquals("Aktualizacja wniosku", DriverLeaveRequestUiRules.eventActionLabel("some_raw_action"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user