Skip to content

Commit 92a751b

Browse files
authored
Merge pull request #1073 from AppFlowy-IO/feat/merge_release_0052
Feat/merge release 0052
2 parents 7e8ed1e + 589acd9 commit 92a751b

File tree

21 files changed

+182
-86
lines changed

21 files changed

+182
-86
lines changed

frontend/Makefile.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
2222
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
2323
CARGO_MAKE_CRATE_NAME = "dart-ffi"
2424
LIB_NAME = "dart_ffi"
25-
CURRENT_APP_VERSION = "0.0.5.1"
25+
CURRENT_APP_VERSION = "0.0.5.2"
2626
FEATURES = "flutter"
2727
PRODUCT_NAME = "AppFlowy"
2828
# CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html

frontend/app_flowy/lib/plugins/board/presentation/board_page.dart

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -187,35 +187,31 @@ class _BoardContentState extends State<BoardContent> {
187187
}
188188

189189
Widget _buildFooter(BuildContext context, AppFlowyGroupData columnData) {
190-
final boardCustomData = columnData.customData as BoardCustomData;
191-
final group = boardCustomData.group;
192-
193-
if (group.isDefault) {
194-
return const SizedBox();
195-
} else {
196-
return AppFlowyGroupFooter(
197-
icon: SizedBox(
198-
height: 20,
199-
width: 20,
200-
child: svgWidget(
201-
"home/add",
202-
color: context.read<AppTheme>().iconColor,
203-
),
204-
),
205-
title: FlowyText.medium(
206-
LocaleKeys.board_column_create_new_card.tr(),
207-
fontSize: 14,
208-
color: context.read<AppTheme>().textColor,
190+
// final boardCustomData = columnData.customData as BoardCustomData;
191+
// final group = boardCustomData.group;
192+
193+
return AppFlowyGroupFooter(
194+
icon: SizedBox(
195+
height: 20,
196+
width: 20,
197+
child: svgWidget(
198+
"home/add",
199+
color: context.read<AppTheme>().iconColor,
209200
),
210-
height: 50,
211-
margin: config.footerPadding,
212-
onAddButtonClick: () {
213-
context.read<BoardBloc>().add(
214-
BoardEvent.createBottomRow(columnData.id),
215-
);
216-
},
217-
);
218-
}
201+
),
202+
title: FlowyText.medium(
203+
LocaleKeys.board_column_create_new_card.tr(),
204+
fontSize: 14,
205+
color: context.read<AppTheme>().textColor,
206+
),
207+
height: 50,
208+
margin: config.footerPadding,
209+
onAddButtonClick: () {
210+
context.read<BoardBloc>().add(
211+
BoardEvent.createBottomRow(columnData.id),
212+
);
213+
},
214+
);
219215
}
220216

221217
Widget _buildCard(

frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_action_sheet.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:app_flowy/plugins/grid/application/row/row_action_sheet_bloc.dart';
2-
import 'package:app_flowy/workspace/presentation/widgets/dialogs.dart';
32
import 'package:easy_localization/easy_localization.dart';
43
import 'package:app_flowy/generated/locale_keys.g.dart';
54
import 'package:flowy_infra/image.dart';
@@ -151,14 +150,9 @@ extension _RowActionExtension on _RowAction {
151150
.add(const RowActionSheetEvent.duplicateRow());
152151
break;
153152
case _RowAction.delete:
154-
NavigatorAlertDialog(
155-
title: LocaleKeys.grid_field_deleteFieldPromptMessage.tr(),
156-
confirm: () {
157-
context
158-
.read<RowActionSheetBloc>()
159-
.add(const RowActionSheetEvent.deleteRow());
160-
},
161-
).show(context);
153+
context
154+
.read<RowActionSheetBloc>()
155+
.add(const RowActionSheetEvent.deleteRow());
162156

163157
break;
164158
}

frontend/rust-lib/flowy-folder/src/services/persistence/migration.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl FolderMigration {
7878

7979
let folder = FolderPad::new(workspaces, trash)?;
8080
KV::set_bool(&key, true);
81-
tracing::trace!("Run folder v1 migration");
81+
tracing::info!("Run folder v1 migration");
8282
Ok(Some(folder))
8383
}
8484

@@ -89,19 +89,18 @@ impl FolderMigration {
8989
}
9090
let _ = self.migration_folder_rev_struct(folder_id).await?;
9191
KV::set_bool(&key, true);
92-
tracing::trace!("Run folder v2 migration");
92+
// tracing::info!("Run folder v2 migration");
9393
Ok(())
9494
}
9595

96-
#[allow(dead_code)]
9796
pub async fn run_v3_migration(&self, folder_id: &FolderId) -> FlowyResult<()> {
9897
let key = migration_flag_key(&self.user_id, V3_MIGRATION);
9998
if KV::get_bool(&key) {
10099
return Ok(());
101100
}
102101
let _ = self.migration_folder_rev_struct(folder_id).await?;
103102
KV::set_bool(&key, true);
104-
tracing::trace!("Run folder v3 migration");
103+
tracing::info!("Run folder v3 migration");
105104
Ok(())
106105
}
107106

frontend/rust-lib/flowy-folder/src/services/persistence/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ impl FolderPersistence {
101101
}
102102

103103
let _ = migrations.run_v2_migration(folder_id).await?;
104-
105-
// let _ = migrations.run_v3_migration(folder_id).await?;
104+
let _ = migrations.run_v3_migration(folder_id).await?;
106105
Ok(())
107106
}
108107

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl GridBlockManager {
5757
Ok(self.get_block_editor(&block_id).await?)
5858
}
5959

60+
#[tracing::instrument(level = "trace", skip(self, start_row_id), err)]
6061
pub(crate) async fn create_row(&self, row_rev: RowRevision, start_row_id: Option<String>) -> FlowyResult<i32> {
6162
let block_id = row_rev.block_id.clone();
6263
let _ = self.persistence.insert(&row_rev.block_id, &row_rev.id)?;

frontend/rust-lib/flowy-grid/src/services/field/type_options/text_type_option/text_type_option.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ impl TypeOptionBuilder for RichTextTypeOptionBuilder {
2929
#[derive(Debug, Clone, Default, Serialize, Deserialize, ProtoBuf)]
3030
pub struct RichTextTypeOptionPB {
3131
#[pb(index = 1)]
32+
#[serde(default)]
3233
data: String, //It's not used yet
3334
}
3435
impl_type_option!(RichTextTypeOptionPB, FieldType::RichText);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ impl GridRevisionEditor {
420420

421421
pub async fn delete_row(&self, row_id: &str) -> FlowyResult<()> {
422422
let row_rev = self.block_manager.delete_row(row_id).await?;
423+
tracing::trace!("Did delete row:{:?}", row_rev);
423424
if let Some(row_rev) = row_rev {
424425
self.view_manager.did_delete_row(row_rev).await;
425426
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ impl GridViewRevisionEditor {
109109
}
110110
}
111111

112+
#[tracing::instrument(level = "trace", skip_all)]
112113
pub(crate) async fn did_delete_row(&self, row_rev: &RowRevision) {
113114
// Send the group notification if the current view has groups;
114115
let changesets = self
115116
.mut_group_controller(|group_controller, field_rev| group_controller.did_delete_row(row_rev, &field_rev))
116117
.await;
117118

118119
if let Some(changesets) = changesets {
120+
tracing::trace!("{:?}", changesets);
119121
for changeset in changesets {
120122
self.notify_did_update_group(changeset).await;
121123
}

frontend/rust-lib/flowy-grid/src/services/group/configuration.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,33 @@ where
9292
})
9393
}
9494

95+
pub(crate) fn get_default_group(&self) -> &Group {
96+
&self.default_group
97+
}
98+
99+
pub(crate) fn get_mut_default_group(&mut self) -> &mut Group {
100+
&mut self.default_group
101+
}
102+
95103
/// Returns the groups without the default group
96-
pub(crate) fn concrete_groups(&self) -> Vec<&Group> {
104+
pub(crate) fn groups(&self) -> Vec<&Group> {
97105
self.groups_map.values().collect()
98106
}
99107

100-
pub(crate) fn default_group(&self) -> &Group {
101-
&self.default_group
108+
pub(crate) fn get_mut_group(&mut self, group_id: &str) -> Option<&mut Group> {
109+
self.groups_map.get_mut(group_id)
110+
}
111+
112+
// Returns the index and group specified by the group_id
113+
pub(crate) fn get_group(&self, group_id: &str) -> Option<(usize, &Group)> {
114+
match (self.groups_map.get_index_of(group_id), self.groups_map.get(group_id)) {
115+
(Some(index), Some(group)) => Some((index, group)),
116+
_ => None,
117+
}
102118
}
103119

104120
/// Iterate mut the groups. The default group will be the last one that get mutated.
105-
pub(crate) fn iter_mut_groups(&mut self, mut each: impl FnMut(&mut Group)) {
121+
pub(crate) fn iter_mut_all_groups(&mut self, mut each: impl FnMut(&mut Group)) {
106122
self.groups_map.iter_mut().for_each(|(_, group)| {
107123
each(group);
108124
});
@@ -253,22 +269,6 @@ where
253269
Ok(())
254270
}
255271

256-
pub(crate) fn get_mut_default_group(&mut self) -> &mut Group {
257-
&mut self.default_group
258-
}
259-
260-
pub(crate) fn get_mut_group(&mut self, group_id: &str) -> Option<&mut Group> {
261-
self.groups_map.get_mut(group_id)
262-
}
263-
264-
// Returns the index and group specified by the group_id
265-
pub(crate) fn get_group(&self, group_id: &str) -> Option<(usize, &Group)> {
266-
match (self.groups_map.get_index_of(group_id), self.groups_map.get(group_id)) {
267-
(Some(index), Some(group)) => Some((index, group)),
268-
_ => None,
269-
}
270-
}
271-
272272
pub fn save_configuration(&self) -> FlowyResult<()> {
273273
let configuration = (&*self.configuration).clone();
274274
let writer = self.writer.clone();

0 commit comments

Comments
 (0)