Richard Shiue a63a7ea611
feat: hidden kanban groups (#3907)
* feat: hide/unhide ui

* chore: implement collapsible side bar and adjust group header (#2)

* refactor: hidden columns into own file

* chore: adjust new group button position

* fix: flowy icon buton secondary color bleed

* chore: some UI adjustments

* fix: some regressions

* chore: proper group is_visible fetching

* chore: use a bloc to manage hidden groups

* fix: hiding groups not working

* chore: implement hidden group popups

* chore: proper ungrouped item column management

* chore: remove ungrouped items button

* chore: flowy hover build

* fix: clean up code

* test: integration tests

* fix: not null promise on null value

* fix: hide and unhide multiple groups

* chore: i18n and code review

* chore: missed review

* fix: rust-lib-test

* fix: dont completely remove flowyiconhovercolor

* chore: apply suggest

* fix: number of rows inside hidden groups not updating properly

* fix: hidden groups disappearing after collapse

* fix: hidden group title alignment

* fix: insert newly unhidden groups into the correct position

* chore: adjust padding all around

* feat: reorder hidden groups

* chore: adjust padding

* chore: collapse hidden groups section persist

* chore: no status group at beginning

* fix: hiding groups when grouping with other types

* chore: disable rename groups that arent supported

* chore: update appflowy board ref

* chore: better naming

* test: fix tests

---------

Co-authored-by: Mathias Mogensen <mathias@appflowy.io>
2023-11-13 16:14:31 +08:00

59 lines
1.7 KiB
Rust

use collab_database::views::DatabaseLayout;
use flowy_database2::services::setting::BoardLayoutSetting;
use flowy_database2::services::setting::CalendarLayoutSetting;
use crate::database::layout_test::script::DatabaseLayoutTest;
use crate::database::layout_test::script::LayoutScript::*;
#[tokio::test]
async fn board_layout_setting_test() {
let mut test = DatabaseLayoutTest::new_board().await;
let default_board_setting = BoardLayoutSetting::new();
let new_board_setting = BoardLayoutSetting {
hide_ungrouped_column: true,
..default_board_setting
};
let scripts = vec![
AssertBoardLayoutSetting {
expected: default_board_setting,
},
UpdateBoardLayoutSetting {
new_setting: new_board_setting.clone(),
},
AssertBoardLayoutSetting {
expected: new_board_setting,
},
];
test.run_scripts(scripts).await;
}
#[tokio::test]
async fn calendar_initial_layout_setting_test() {
let mut test = DatabaseLayoutTest::new_calendar().await;
let date_field = test.get_first_date_field().await;
let default_calendar_setting = CalendarLayoutSetting::new(date_field.id.clone());
let scripts = vec![AssertCalendarLayoutSetting {
expected: default_calendar_setting,
}];
test.run_scripts(scripts).await;
}
#[tokio::test]
async fn calendar_get_events_test() {
let mut test = DatabaseLayoutTest::new_calendar().await;
let scripts = vec![AssertDefaultAllCalendarEvents];
test.run_scripts(scripts).await;
}
#[tokio::test]
async fn grid_to_calendar_layout_test() {
let mut test = DatabaseLayoutTest::new_no_date_grid().await;
let scripts = vec![
UpdateDatabaseLayout {
layout: DatabaseLayout::Calendar,
},
AssertAllCalendarEventsCount { expected: 3 },
];
test.run_scripts(scripts).await;
}