Skip to content

Commit 6884e97

Browse files
committed
fix: group by field
1 parent cc6bf3c commit 6884e97

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

frontend/rust-lib/flowy-grid/src/entities/field_entities.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -465,19 +465,6 @@ pub struct FieldChangesetParams {
465465

466466
pub type_option_data: Option<Vec<u8>>,
467467
}
468-
469-
impl FieldChangesetParams {
470-
pub fn has_changes(&self) -> bool {
471-
self.name.is_some()
472-
|| self.desc.is_some()
473-
|| self.field_type.is_some()
474-
|| self.frozen.is_some()
475-
|| self.type_option_data.is_some()
476-
|| self.frozen.is_some()
477-
|| self.visibility.is_some()
478-
|| self.width.is_some()
479-
}
480-
}
481468
/// Certain field types have user-defined options such as color, date format, number format,
482469
/// or a list of values for a multi-select list. These options are defined within a specialization
483470
/// of the FieldTypeOption class.

frontend/rust-lib/flowy-grid/src/services/grid_editor.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ impl GridRevisionEditor {
109109
field_id: &str,
110110
type_option_data: Vec<u8>,
111111
) -> FlowyResult<()> {
112-
if type_option_data.is_empty() {
113-
return Ok(());
114-
}
115-
116112
let result = self.get_field_rev(field_id).await;
117113
if result.is_none() {
118114
tracing::warn!("Can't find the field with id: {}", field_id);
@@ -307,10 +303,6 @@ impl GridRevisionEditor {
307303
#[tracing::instrument(level = "debug", skip_all, err)]
308304
async fn update_field_rev(&self, params: FieldChangesetParams, field_type: FieldType) -> FlowyResult<()> {
309305
let mut is_type_option_changed = false;
310-
if !params.has_changes() {
311-
return Ok(());
312-
}
313-
314306
let _ = self
315307
.modify(|grid| {
316308
let changeset = grid.modify_field(&params.field_id, |field| {
@@ -334,11 +326,11 @@ impl GridRevisionEditor {
334326
}
335327
if let Some(type_option_data) = params.type_option_data {
336328
let deserializer = TypeOptionJsonDeserializer(field_type);
329+
is_type_option_changed = true;
337330
match deserializer.deserialize(type_option_data) {
338331
Ok(json_str) => {
339332
let field_type = field.ty;
340333
field.insert_type_option_str(&field_type, json_str);
341-
is_type_option_changed = true;
342334
}
343335
Err(err) => {
344336
tracing::error!("Deserialize data to type option json failed: {}", err);

0 commit comments

Comments
 (0)