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: filter orders (#1535)
Nathan.fooo72dc0b8f67d2
diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/filter/choicechip/select_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/filter/choicechip/select_option/select_option.dartindex 8f835a032d..b8a1849a41 100644--- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/filter/choicechip/select_option/select_option.dart+++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/filter/choicechip/select_option/select_option.dart@@ -167,3 +167,12 @@ class _SelectOptionFilterEditorState extends State<SelectOptionFilterEditor> {);}}++class _FilterPannel extends StatelessWidget {+ const _FilterPannel({Key? key}) : super(key: key);++ @override+ Widget build(BuildContext context) {+ return Container();+ }+}diff --git a/shared-lib/flowy-sync/src/client_grid/view_revision_pad.rs b/shared-lib/flowy-sync/src/client_grid/view_revision_pad.rsindex 37d76fbeec..afa9b5fc9a 100644--- a/shared-lib/flowy-sync/src/client_grid/view_revision_pad.rs+++ b/shared-lib/flowy-sync/src/client_grid/view_revision_pad.rs@@ -61,11 +61,7 @@ impl GridViewRevisionPad {}pub fn get_groups_by_field_revs(&self, field_revs: &[Arc<FieldRevision>]) -> Vec<Arc<GroupConfigurationRevision>> {- self.groups- .get_objects_by_field_revs(field_revs)- .into_values()- .flatten()- .collect()+ self.groups.get_objects_by_field_revs(field_revs)}pub fn get_all_groups(&self) -> Vec<Arc<GroupConfigurationRevision>> {@@ -131,11 +127,7 @@ impl GridViewRevisionPad {}pub fn get_all_filters(&self, field_revs: &[Arc<FieldRevision>]) -> Vec<Arc<FilterRevision>> {- self.filters- .get_objects_by_field_revs(field_revs)- .into_values()- .flatten()- .collect()+ self.filters.get_objects_by_field_revs(field_revs)}pub fn get_filters(&self, field_id: &str, field_type_rev: &FieldTypeRevision) -> Vec<Arc<FilterRevision>> {diff --git a/shared-lib/grid-rev-model/src/grid_setting_rev.rs b/shared-lib/grid-rev-model/src/grid_setting_rev.rsindex 305144f938..8e69f052ab 100644--- a/shared-lib/grid-rev-model/src/grid_setting_rev.rs+++ b/shared-lib/grid-rev-model/src/grid_setting_rev.rs@@ -83,9 +83,9 @@ where.cloned()}- pub fn get_objects_by_field_revs(&self, field_revs: &[Arc<FieldRevision>]) -> HashMap<String, Vec<Arc<T>>> {+ pub fn get_objects_by_field_revs(&self, field_revs: &[Arc<FieldRevision>]) -> Vec<Arc<T>> {// Get the objects according to the FieldType, so we need iterate the field_revs.- let objects_by_field_id = field_revs+ let objects = field_revs.iter().flat_map(|field_rev| {let field_type = &field_rev.ty;@@ -93,10 +93,11 @@ wherelet object_rev_map = self.inner.get(field_id)?;let objects: Vec<Arc<T>> = object_rev_map.get(field_type)?.clone();- Some((field_rev.id.clone(), objects))+ Some(objects)})- .collect::<HashMap<String, Vec<Arc<T>>>>();- objects_by_field_id+ .flatten()+ .collect::<Vec<Arc<T>>>();+ objects}pub fn get_all_objects(&self) -> Vec<Arc<T>> {