feat: Implement localization for excludeFromBilling label in diary components
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 44s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 44s
This commit is contained in:
@@ -1932,7 +1932,7 @@ private fun DiaryListScreen(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
) {
|
||||
Text("Nicht abrechnen")
|
||||
Text(tr("diary.excludeFromBilling", "Nicht abrechnen"))
|
||||
Switch(
|
||||
checked = newDiaryExcludeFromBilling,
|
||||
onCheckedChange = { newDiaryExcludeFromBilling = it },
|
||||
@@ -2794,7 +2794,13 @@ private fun DiaryDetailScreen(
|
||||
initialStart = entry.trainingStart.orEmpty(),
|
||||
initialEnd = entry.trainingEnd.orEmpty(),
|
||||
initialExcludeFromBilling = entry.excludeFromBilling,
|
||||
excludeFromBillingLabel = tr("diary.excludeFromBilling", "Nicht abrechnen"),
|
||||
submitLabel = tr("common.save", "Speichern"),
|
||||
onExcludeFromBillingChange = { _, start, end, excludeFromBilling ->
|
||||
dependencies.applicationScope.launch {
|
||||
dependencies.diaryManager.updateTimes(clubId, entry.id, start, end, excludeFromBilling)
|
||||
}
|
||||
},
|
||||
onSubmit = { _, start, end, excludeFromBilling ->
|
||||
dependencies.applicationScope.launch {
|
||||
dependencies.diaryManager.updateTimes(clubId, entry.id, start, end, excludeFromBilling)
|
||||
@@ -6897,6 +6903,8 @@ private fun DeleteAccountDialog(
|
||||
@Composable
|
||||
private fun DiaryEditForm(
|
||||
submitLabel: String,
|
||||
excludeFromBillingLabel: String,
|
||||
onExcludeFromBillingChange: ((date: String, trainingStart: String?, trainingEnd: String?, excludeFromBilling: Boolean) -> Unit)? = null,
|
||||
onSubmit: (date: String, trainingStart: String?, trainingEnd: String?, excludeFromBilling: Boolean) -> Unit,
|
||||
initialDate: String = "",
|
||||
initialStart: String = "",
|
||||
@@ -6921,10 +6929,18 @@ private fun DiaryEditForm(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
) {
|
||||
Text("Nicht abrechnen")
|
||||
Text(excludeFromBillingLabel)
|
||||
Switch(
|
||||
checked = excludeFromBilling,
|
||||
onCheckedChange = { excludeFromBilling = it },
|
||||
onCheckedChange = {
|
||||
excludeFromBilling = it
|
||||
onExcludeFromBillingChange?.invoke(
|
||||
date,
|
||||
start.takeIf { value -> value.isNotBlank() },
|
||||
end.takeIf { value -> value.isNotBlank() },
|
||||
excludeFromBilling,
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
ErrorText(error)
|
||||
|
||||
Reference in New Issue
Block a user