fix: align select-all behavior and board-detail docs with filters
This commit is contained in:
@@ -97,7 +97,11 @@ Kanbn4Droid is an unofficial app to connect to and manipulate data stored in sel
|
||||
- Pressing "Delete" in the modal dialog MUST show a second confirmation modal asking if the user is sure, with buttons for "Cancel" and "I'm sure".
|
||||
- Only on pressing "I'm sure" in the second confirmation modal dialog should a board delete request be sent to the API.
|
||||
- Long-pressing any of the buttons must show a tooltip with the button name.
|
||||
- The view has a floating + button that shows a modal dialog that allows creating a new card using the Kan.bn API.
|
||||
- The view has a floating + button that allows choosing between two options: "Add new list", "Add new card"
|
||||
- The Add new list option shows a modal dialog that asks for a list title. The modal dialog has two buttons at the bottom for "Cancel" and "Create"
|
||||
- The list is created using the Kan.bn API.
|
||||
- The new list is added at the end of the lists in the current board after the current last list.
|
||||
- The Add new card option shows a modal dialog for creating a new card using the Kan.bn API.
|
||||
- The new card is added to the top of the currently shown list.
|
||||
- The modal dialog has a field for the card's name. This field is mandatory
|
||||
- Below the card name field there is a markdown-enabled text area for an optional card description.
|
||||
|
||||
@@ -148,7 +148,7 @@ class BoardDetailViewModel(
|
||||
|
||||
fun selectAllOnCurrentPage() {
|
||||
val current = _uiState.value
|
||||
val pageCards = current.boardDetail
|
||||
val pageCards = current.filteredBoardDetail
|
||||
?.lists
|
||||
?.getOrNull(current.currentPageIndex)
|
||||
?.cards
|
||||
|
||||
@@ -66,6 +66,6 @@
|
||||
<string name="due_date">Due date</string>
|
||||
<string name="clear_due_date">Clear date</string>
|
||||
<string name="add_card_tags">Tags</string>
|
||||
<string name="add_card_tags_placeholder">Tag selector will be wired in the next task.</string>
|
||||
<string name="filter_tags_placeholder">Tag selector will be wired in the next task.</string>
|
||||
<string name="add_card_tags_placeholder">Select one or more tags.</string>
|
||||
<string name="filter_tags_placeholder">Select tags to include.</string>
|
||||
</resources>
|
||||
|
||||
@@ -51,6 +51,18 @@ class BoardDetailViewModelTest {
|
||||
assertEquals(setOf("card-1", "card-2", "card-3"), viewModel.uiState.value.selectedCardIds)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun selectAllWithActiveFilter_selectsOnlyVisibleCardsOnCurrentPage() = runTest {
|
||||
val viewModel = newLoadedViewModel(this, FakeBoardDetailDataSource(), detailWithFilterFixture())
|
||||
|
||||
viewModel.openFilterDialog()
|
||||
viewModel.updatePendingTagFilterIds(setOf("tag-b"))
|
||||
viewModel.applyFilterDialog()
|
||||
viewModel.selectAllOnCurrentPage()
|
||||
|
||||
assertEquals(setOf("card-2"), viewModel.uiState.value.selectedCardIds)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun backPressWithSelection_clearsSelectionAndReturnsTrue() = runTest {
|
||||
val viewModel = newLoadedViewModel(this, FakeBoardDetailDataSource(), detailWithTwoLists())
|
||||
|
||||
Reference in New Issue
Block a user