,
}
macro_rules! into_cell_data {
($func_name:ident,$return_ty:ty) => {
#[allow(dead_code)]
pub fn $func_name(self) -> Option<$return_ty> {
- self.cell_data.unbox_or_none()
+ self.cell_data?.unbox_or_none()
}
};
}
diff --git a/frontend/rust-lib/flowy-database2/src/services/group/controller.rs b/frontend/rust-lib/flowy-database2/src/services/group/controller.rs
index a23b240eda..e484229931 100644
--- a/frontend/rust-lib/flowy-database2/src/services/group/controller.rs
+++ b/frontend/rust-lib/flowy-database2/src/services/group/controller.rs
@@ -254,6 +254,7 @@ where
continue;
}
}
+
match self.context.get_mut_no_status_group() {
None => {},
Some(no_status_group) => no_status_group.add_row((*row).clone()),
@@ -349,12 +350,12 @@ where
deleted_group: None,
row_changesets: vec![],
};
- let cell_rev = match context.row.cells.get(&self.grouping_field_id) {
- Some(cell_rev) => Some(cell_rev.clone()),
+ let cell = match context.row.cells.get(&self.grouping_field_id) {
+ Some(cell) => Some(cell.clone()),
None => self.placeholder_cell(),
};
- if let Some(cell) = cell_rev {
+ if let Some(cell) = cell {
let cell_bytes = get_cell_protobuf(&cell, context.field, None);
let cell_data = cell_bytes.parser::()?;
result.deleted_group = self.delete_group_when_move_row(context.row, &cell_data);
diff --git a/frontend/rust-lib/flowy-database2/src/services/group/controller_impls/select_option_controller/multi_select_controller.rs b/frontend/rust-lib/flowy-database2/src/services/group/controller_impls/select_option_controller/multi_select_controller.rs
index 091e51a21c..48f1c6f138 100644
--- a/frontend/rust-lib/flowy-database2/src/services/group/controller_impls/select_option_controller/multi_select_controller.rs
+++ b/frontend/rust-lib/flowy-database2/src/services/group/controller_impls/select_option_controller/multi_select_controller.rs
@@ -1,4 +1,4 @@
-use crate::entities::{GroupRowsNotificationPB, SelectOptionCellDataPB};
+use crate::entities::{FieldType, GroupRowsNotificationPB, SelectOptionCellDataPB};
use crate::services::cell::insert_select_option_cell;
use crate::services::field::{MultiSelectTypeOption, SelectOptionCellDataParser};
use crate::services::group::action::GroupCustomize;
@@ -10,7 +10,7 @@ use crate::services::group::{
move_group_row, remove_select_option_row, GeneratedGroups, GroupContext,
};
use collab_database::fields::Field;
-use collab_database::rows::{Cells, Row};
+use collab_database::rows::{new_cell_builder, Cell, Cells, Row};
use std::sync::Arc;
use serde::{Deserialize, Serialize};
@@ -39,6 +39,14 @@ impl GroupCustomize for MultiSelectGroupController {
.any(|option| option.id == content)
}
+ fn placeholder_cell(&self) -> Option