Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: group by field (#1374)
Nathan.foooc8044a92d1c1
diff --git a/frontend/rust-lib/flowy-grid/src/entities/field_entities.rs b/frontend/rust-lib/flowy-grid/src/entities/field_entities.rsindex 3dd7a5723f..719a99990c 100644--- a/frontend/rust-lib/flowy-grid/src/entities/field_entities.rs+++ b/frontend/rust-lib/flowy-grid/src/entities/field_entities.rs@@ -465,19 +465,6 @@ pub struct FieldChangesetParams {pub type_option_data: Option<Vec<u8>>,}--impl FieldChangesetParams {- pub fn has_changes(&self) -> bool {- self.name.is_some()- || self.desc.is_some()- || self.field_type.is_some()- || self.frozen.is_some()- || self.type_option_data.is_some()- || self.frozen.is_some()- || self.visibility.is_some()- || self.width.is_some()- }-}/// Certain field types have user-defined options such as color, date format, number format,/// or a list of values for a multi-select list. These options are defined within a specialization/// of the FieldTypeOption class.diff --git a/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs b/frontend/rust-lib/flowy-grid/src/services/grid_editor.rsindex 20e7224c64..645a05f2eb 100644--- a/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs+++ b/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs@@ -109,10 +109,6 @@ impl GridRevisionEditor {field_id: &str,type_option_data: Vec<u8>,) -> FlowyResult<()> {- if type_option_data.is_empty() {- return Ok(());- }-let result = self.get_field_rev(field_id).await;if result.is_none() {tracing::warn!("Can't find the field with id: {}", field_id);@@ -307,10 +303,6 @@ impl GridRevisionEditor {#[tracing::instrument(level = "debug", skip_all, err)]async fn update_field_rev(&self, params: FieldChangesetParams, field_type: FieldType) -> FlowyResult<()> {let mut is_type_option_changed = false;- if !params.has_changes() {- return Ok(());- }-let _ = self.modify(|grid| {let changeset = grid.modify_field(¶ms.field_id, |field| {@@ -334,11 +326,11 @@ impl GridRevisionEditor {}if let Some(type_option_data) = params.type_option_data {let deserializer = TypeOptionJsonDeserializer(field_type);+ is_type_option_changed = true;match deserializer.deserialize(type_option_data) {Ok(json_str) => {let field_type = field.ty;field.insert_type_option_str(&field_type, json_str);- is_type_option_changed = true;}Err(err) => {tracing::error!("Deserialize data to type option json failed: {}", err);