From c43d0790dcc8a1797f5176289c268c63f99935c3 Mon Sep 17 00:00:00 2001 From: appflowy Date: Thu, 25 Aug 2022 14:58:08 +0800 Subject: [PATCH] chore: enable create board --- CHANGELOG.md | 10 ++++++++++ frontend/app_flowy/lib/plugins/board/board.dart | 2 +- .../card/board_select_option_cell.dart | 3 +-- .../plugins/board/presentation/card/define.dart | 2 +- .../selection_type_option/select_option.rs | 9 +++++++++ frontend/rust-lib/flowy-grid/src/util.rs | 15 ++++++++++++--- 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ee49d36f3..94b4766806 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Release Notes +## Version 0.0.5 - beta.1 - 2022-08-25 + +New features +- Board-view database + - Group by single select + - drag and drop cards + - insert / delete cards + + + ## Version 0.0.4 - 2022-06-06 - Drag to adjust the width of a column - Upgrade to Flutter 3.0 diff --git a/frontend/app_flowy/lib/plugins/board/board.dart b/frontend/app_flowy/lib/plugins/board/board.dart index c55d7f2e17..213cc8bc3c 100644 --- a/frontend/app_flowy/lib/plugins/board/board.dart +++ b/frontend/app_flowy/lib/plugins/board/board.dart @@ -31,7 +31,7 @@ class BoardPluginBuilder implements PluginBuilder { class BoardPluginConfig implements PluginConfig { @override - bool get creatable => false; + bool get creatable => true; } class BoardPlugin extends Plugin { diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart index 6cba08c636..e10eda4cec 100644 --- a/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart +++ b/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart @@ -45,8 +45,7 @@ class _BoardSelectOptionCellState extends State { ) .toList(); return Padding( - padding: - EdgeInsets.symmetric(vertical: BoardSizes.cardCellVPadding), + padding: EdgeInsets.only(top: BoardSizes.cardCellVPadding), child: Align( alignment: Alignment.centerLeft, child: AbsorbPointer( diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/define.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/define.dart index c2cff2ee0f..5fc55743db 100644 --- a/frontend/app_flowy/lib/plugins/board/presentation/card/define.dart +++ b/frontend/app_flowy/lib/plugins/board/presentation/card/define.dart @@ -1,3 +1,3 @@ class BoardSizes { - static double get cardCellVPadding => 4; + static double get cardCellVPadding => 6; } diff --git a/frontend/rust-lib/flowy-grid/src/services/field/type_options/selection_type_option/select_option.rs b/frontend/rust-lib/flowy-grid/src/services/field/type_options/selection_type_option/select_option.rs index 13da2e8359..9270f73684 100644 --- a/frontend/rust-lib/flowy-grid/src/services/field/type_options/selection_type_option/select_option.rs +++ b/frontend/rust-lib/flowy-grid/src/services/field/type_options/selection_type_option/select_option.rs @@ -157,6 +157,9 @@ pub fn select_option_color_from_index(index: usize) -> SelectOptionColorPB { pub struct SelectOptionIds(Vec); impl SelectOptionIds { + pub fn new() -> Self { + Self(vec![]) + } pub fn into_inner(self) -> Vec { self.0 } @@ -181,6 +184,12 @@ impl std::convert::From for SelectOptionIds { } } +impl ToString for SelectOptionIds { + fn to_string(&self) -> String { + self.0.join(SELECTION_IDS_SEPARATOR) + } +} + impl std::convert::From> for SelectOptionIds { fn from(s: Option) -> Self { match s { diff --git a/frontend/rust-lib/flowy-grid/src/util.rs b/frontend/rust-lib/flowy-grid/src/util.rs index 128c42ae04..65f6440c1f 100644 --- a/frontend/rust-lib/flowy-grid/src/util.rs +++ b/frontend/rust-lib/flowy-grid/src/util.rs @@ -86,7 +86,10 @@ pub fn make_default_board() -> BuildGridContext { } 1 => { row_builder.insert_text_cell(&text_field_id, "Learn French".to_string()); - row_builder.insert_select_option_cell(&multi_select_field_id, travel_option.id.clone()); + let mut options = SelectOptionIds::new(); + options.push(fun_option.id.clone()); + options.push(travel_option.id.clone()); + row_builder.insert_select_option_cell(&multi_select_field_id, options.to_string()); } 2 => { @@ -114,7 +117,10 @@ pub fn make_default_board() -> BuildGridContext { 2 => { row_builder.insert_text_cell(&text_field_id, "Write atomic essays ".to_string()); - row_builder.insert_select_option_cell(&multi_select_field_id, fun_option.id.clone()); + let mut options = SelectOptionIds::new(); + options.push(fun_option.id.clone()); + options.push(work_option.id.clone()); + row_builder.insert_select_option_cell(&multi_select_field_id, options.to_string()); } _ => {} } @@ -132,7 +138,10 @@ pub fn make_default_board() -> BuildGridContext { } 1 => { row_builder.insert_text_cell(&text_field_id, "Visit Chicago".to_string()); - row_builder.insert_select_option_cell(&multi_select_field_id, travel_option.id.clone()); + let mut options = SelectOptionIds::new(); + options.push(travel_option.id.clone()); + options.push(fun_option.id.clone()); + row_builder.insert_select_option_cell(&multi_select_field_id, options.to_string()); } _ => {}