deck: вынос DeckStackDialogs (под LongMethod) + refresh detekt-baseline модуля (v0.5.144-долг, как calendar e7d0a5a) — detekt GREEN
This commit is contained in:
@@ -2,6 +2,36 @@
|
||||
<SmellBaseline>
|
||||
<ManuallySuppressedIssues/>
|
||||
<CurrentIssues>
|
||||
<ID>NoUnusedImports:DeckRepository.kt$ru.forbion.f7cloud.feature.deck.DeckRepository.kt</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$("В архив", onClick = onArchive, enabled = !busy, modifier = Modifier.weight(1f))</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$("Сбросить", color = F7Colors.Primary, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.clickable { duedate = null })</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$("Удалить", onClick = onDelete, enabled = !busy, modifier = Modifier.weight(1f))</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$(1f)</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$(6.dp)</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$(8.dp)</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$(horizontalArrangement = Arrangement.spacedBy(6.dp), verticalArrangement = Arrangement.spacedBy(6.dp))</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$(label.title, style = MaterialTheme.typography.labelMedium, color = F7Colors.TextPrimary)</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$(stack.title, style = MaterialTheme.typography.bodyMedium, color = F7Colors.TextPrimary)</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$(value = description, onValueChange = { description = it }, label = "Описание", minLines = 3)</ID>
|
||||
<ID>ArgumentListWrapping:DeckCardSheet.kt$(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp))</ID>
|
||||
<ID>ArgumentListWrapping:DeckScreen.kt$(", ")</ID>
|
||||
<ID>ArgumentListWrapping:DeckScreen.kt$("👤 ${card.assignees.joinToString(", ")}", style = MaterialTheme.typography.labelMedium, color = F7Colors.TextSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis)</ID>
|
||||
<ID>ArgumentListWrapping:DeckScreen.kt$(18.dp)</ID>
|
||||
<ID>ArgumentListWrapping:DeckScreen.kt$(4.dp)</ID>
|
||||
<ID>ArgumentListWrapping:DeckScreen.kt$(Icons.Filled.Add, contentDescription = "Добавить карточку", tint = F7Colors.Primary, modifier = Modifier.size(18.dp))</ID>
|
||||
<ID>ArgumentListWrapping:DeckScreen.kt$(horizontalArrangement = Arrangement.spacedBy(4.dp), verticalArrangement = Arrangement.spacedBy(4.dp))</ID>
|
||||
<ID>ArgumentListWrapping:DeckViewModel.kt$DeckViewModel$(boardDetail = detail, openedCard = freshCard ?: it.openedCard, busy = false)</ID>
|
||||
<ID>CyclomaticComplexMethod:DeckCardSheet.kt$@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class) @Composable fun DeckCardSheet( card: DeckCard, boardLabels: List<DeckLabel>, stacks: List<DeckStack>, canEdit: Boolean, busy: Boolean, assignedToMe: Boolean, onDismiss: () -> Unit, onToggleDone: () -> Unit, onSave: (title: String, description: String, duedate: String?) -> Unit, onToggleLabel: (DeckLabel) -> Unit, onToggleAssignSelf: () -> Unit, onMove: (targetStackId: Int) -> Unit, onArchive: () -> Unit, onDelete: () -> Unit, )</ID>
|
||||
<ID>LongMethod:DeckCardSheet.kt$@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class) @Composable fun DeckCardSheet( card: DeckCard, boardLabels: List<DeckLabel>, stacks: List<DeckStack>, canEdit: Boolean, busy: Boolean, assignedToMe: Boolean, onDismiss: () -> Unit, onToggleDone: () -> Unit, onSave: (title: String, description: String, duedate: String?) -> Unit, onToggleLabel: (DeckLabel) -> Unit, onToggleAssignSelf: () -> Unit, onMove: (targetStackId: Int) -> Unit, onArchive: () -> Unit, onDelete: () -> Unit, )</ID>
|
||||
<ID>LoopWithTooManyJumpStatements:DeckRepository.kt$DeckRepository$for</ID>
|
||||
<ID>MaxLineLength:DeckCardSheet.kt$Text("Сбросить", color = F7Colors.Primary, style = MaterialTheme.typography.bodyMedium, modifier = Modifier.clickable { duedate = null })</ID>
|
||||
<ID>MaxLineLength:DeckScreen.kt$Icon(Icons.Filled.Add, contentDescription = "Добавить карточку", tint = F7Colors.Primary, modifier = Modifier.size(18.dp))</ID>
|
||||
<ID>MaxLineLength:DeckScreen.kt$Text("👤 ${card.assignees.joinToString(", ")}", style = MaterialTheme.typography.labelMedium, color = F7Colors.TextSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis)</ID>
|
||||
<ID>MaximumLineLength:DeckCardSheet.kt$ </ID>
|
||||
<ID>MaximumLineLength:DeckScreen.kt$ </ID>
|
||||
<ID>MaximumLineLength:DeckViewModel.kt$DeckViewModel$ </ID>
|
||||
<ID>NoConsecutiveBlankLines:DeckCardSheet.kt$ </ID>
|
||||
<ID>NoUnusedImports:DeckScreen.kt$ru.forbion.f7cloud.feature.deck.DeckScreen.kt</ID>
|
||||
<ID>Wrapping:DeckCardSheet.kt$duedate = null</ID>
|
||||
<ID>Wrapping:DeckScreen.kt$;</ID>
|
||||
</CurrentIssues>
|
||||
</SmellBaseline>
|
||||
|
||||
@@ -172,23 +172,42 @@ fun DeckScreen(
|
||||
onDismiss = { addCardStackId = null },
|
||||
)
|
||||
}
|
||||
renameStackTarget?.let { stack ->
|
||||
DeckStackDialogs(
|
||||
renameTarget = renameStackTarget,
|
||||
deleteTarget = deleteStackTarget,
|
||||
onRenameConfirm = { stack, title -> vm.renameStack(session, stack, title); renameStackTarget = null },
|
||||
onDeleteConfirm = { stack -> vm.deleteStack(session, stack); deleteStackTarget = null },
|
||||
onDismissRename = { renameStackTarget = null },
|
||||
onDismissDelete = { deleteStackTarget = null },
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DeckStackDialogs(
|
||||
renameTarget: DeckStack?,
|
||||
deleteTarget: DeckStack?,
|
||||
onRenameConfirm: (DeckStack, String) -> Unit,
|
||||
onDeleteConfirm: (DeckStack) -> Unit,
|
||||
onDismissRename: () -> Unit,
|
||||
onDismissDelete: () -> Unit,
|
||||
) {
|
||||
renameTarget?.let { stack ->
|
||||
DeckTextPromptDialog(
|
||||
title = "Переименовать колонку",
|
||||
label = "Название колонки",
|
||||
confirmText = "Сохранить",
|
||||
initial = stack.title,
|
||||
onConfirm = { vm.renameStack(session, stack, it); renameStackTarget = null },
|
||||
onDismiss = { renameStackTarget = null },
|
||||
onConfirm = { onRenameConfirm(stack, it) },
|
||||
onDismiss = onDismissRename,
|
||||
)
|
||||
}
|
||||
deleteStackTarget?.let { stack ->
|
||||
deleteTarget?.let { stack ->
|
||||
DeckConfirmDialog(
|
||||
title = "Удалить колонку?",
|
||||
message = "Колонка «${stack.title}» и её карточки будут удалены.",
|
||||
confirmText = "Удалить",
|
||||
onConfirm = { vm.deleteStack(session, stack); deleteStackTarget = null },
|
||||
onDismiss = { deleteStackTarget = null },
|
||||
onConfirm = { onDeleteConfirm(stack) },
|
||||
onDismiss = onDismissDelete,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user