Skip to content

Commit 39354ae

Browse files
committed
Merge branch 'main' into enable_ci_on_windows_linux_2
2 parents 3d3b2b3 + 351c891 commit 39354ae

File tree

399 files changed

+20620
-2719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

399 files changed

+20620
-2719
lines changed

frontend/Makefile.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
2626
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
2727
CARGO_MAKE_CRATE_NAME = "dart-ffi"
2828
LIB_NAME = "dart_ffi"
29-
APPFLOWY_VERSION = "0.8.8"
29+
APPFLOWY_VERSION = "0.8.9"
3030
FLUTTER_DESKTOP_FEATURES = "dart"
3131
PRODUCT_NAME = "AppFlowy"
3232
MACOSX_DEPLOYMENT_TARGET = "11.0"

frontend/appflowy_flutter/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ analyzer:
44
exclude:
55
- "**/*.g.dart"
66
- "**/*.freezed.dart"
7+
- "packages/**/*.dart"
78

89
linter:
910
rules:

frontend/appflowy_flutter/assets/translations/mr-IN.json

Lines changed: 3210 additions & 0 deletions
Large diffs are not rendered by default.

frontend/appflowy_flutter/integration_test/desktop/cloud/data_migration/anon_user_data_migration_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ void main() {
1515
cloudType: AuthenticatorType.appflowyCloudSelfHost,
1616
);
1717

18-
await tester.tapContinousAnotherWay();
1918
await tester.tapAnonymousSignInButton();
2019
await tester.expectToSeeHomePageWithGetStartedPage();
2120

frontend/appflowy_flutter/integration_test/desktop/database/database_field_settings_test.dart

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void main() {
1515
await tester.initializeAppFlowy();
1616
await tester.tapAnonymousSignInButton();
1717

18+
// create a database and add a linked database view
1819
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
1920
await tester.tapCreateLinkedDatabaseViewButton(DatabaseLayoutPB.Grid);
2021

@@ -29,6 +30,11 @@ void main() {
2930
await tester.tapHidePropertyButton();
3031
tester.noFieldWithName('New field 1');
3132

33+
// create another field, New field 1 to be hidden still
34+
await tester.tapNewPropertyButton();
35+
await tester.dismissFieldEditor();
36+
tester.noFieldWithName('New field 1');
37+
3238
// go back to inline database view, expect field to be shown
3339
await tester.tapTabBarLinkedViewByViewName('Untitled');
3440
tester.findFieldWithName('New field 1');
@@ -60,5 +66,40 @@ void main() {
6066
await tester.tapDatabaseSortButton();
6167
await tester.tapCreateSortByFieldType(FieldType.RichText, "New field 1");
6268
});
69+
70+
testWidgets('field cell width', (tester) async {
71+
await tester.initializeAppFlowy();
72+
await tester.tapAnonymousSignInButton();
73+
74+
// create a database and add a linked database view
75+
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
76+
await tester.tapCreateLinkedDatabaseViewButton(DatabaseLayoutPB.Grid);
77+
78+
// create a field
79+
await tester.scrollToRight(find.byType(GridPage));
80+
await tester.tapNewPropertyButton();
81+
await tester.renameField('New field 1');
82+
await tester.dismissFieldEditor();
83+
84+
// check the width of the field
85+
expect(tester.getFieldWidth('New field 1'), 150);
86+
87+
// change the width of the field
88+
await tester.changeFieldWidth('New field 1', 200);
89+
expect(tester.getFieldWidth('New field 1'), 205);
90+
91+
// create another field, New field 1 to be same width
92+
await tester.tapNewPropertyButton();
93+
await tester.dismissFieldEditor();
94+
expect(tester.getFieldWidth('New field 1'), 205);
95+
96+
// go back to inline database view, expect New field 1 to be 150px
97+
await tester.tapTabBarLinkedViewByViewName('Untitled');
98+
expect(tester.getFieldWidth('New field 1'), 150);
99+
100+
// go back to linked database view, expect New field 1 to be 205px
101+
await tester.tapTabBarLinkedViewByViewName('Grid');
102+
expect(tester.getFieldWidth('New field 1'), 205);
103+
});
63104
});
64105
}

frontend/appflowy_flutter/integration_test/desktop/document/document_copy_and_paste_test.dart

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import 'dart:async';
12
import 'dart:io';
23

34
import 'package:appflowy/generated/locale_keys.g.dart';
4-
import 'package:appflowy/plugins/document/presentation/editor_plugins/block_menu/block_menu_button.dart';
55
import 'package:appflowy/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dart';
66
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/custom_image_block_component/custom_image_block_component.dart';
77
import 'package:appflowy/plugins/document/presentation/editor_plugins/link_preview/custom_link_preview.dart';
8+
import 'package:appflowy/plugins/document/presentation/editor_plugins/link_preview/link_preview_menu.dart';
9+
import 'package:appflowy/plugins/document/presentation/editor_plugins/link_preview/paste_as/paste_as_menu.dart';
810
import 'package:appflowy/startup/startup.dart';
911
import 'package:appflowy_editor/appflowy_editor.dart';
1012
import 'package:appflowy_editor_plugins/appflowy_editor_plugins.dart';
@@ -320,8 +322,14 @@ void main() {
320322
(tester) async {
321323
const url = 'https://appflowy.io';
322324
await tester.pasteContent(plainText: url, (editorState) async {
325+
final pasteAsMenu = find.byType(PasteAsMenu);
326+
expect(pasteAsMenu, findsOneWidget);
327+
final bookmarkButton = find.text(
328+
LocaleKeys.document_plugins_linkPreview_typeSelection_bookmark.tr(),
329+
);
330+
await tester.tapButton(bookmarkButton);
323331
// the second one is the paragraph node
324-
expect(editorState.document.root.children.length, 2);
332+
expect(editorState.document.root.children.length, 1);
325333
final node = editorState.getNodeAtPath([0])!;
326334
expect(node.type, LinkPreviewBlockKeys.type);
327335
expect(node.attributes[LinkPreviewBlockKeys.url], url);
@@ -333,19 +341,19 @@ void main() {
333341
await tester.hoverOnWidget(
334342
find.byType(CustomLinkPreviewWidget),
335343
onHover: () async {
336-
final convertToLinkButton = find.byWidgetPredicate((widget) {
337-
return widget is MenuBlockButton &&
338-
widget.tooltip ==
339-
LocaleKeys.document_plugins_urlPreview_convertToLink.tr();
340-
});
344+
/// show menu
345+
final menu = find.byType(CustomLinkPreviewMenu);
346+
expect(menu, findsOneWidget);
347+
await tester.tapButton(menu);
348+
349+
final convertToLinkButton = find.text(
350+
LocaleKeys.document_plugins_linkPreview_linkPreviewMenu_toUrl.tr(),
351+
);
341352
expect(convertToLinkButton, findsOneWidget);
342-
await tester.tap(convertToLinkButton);
343-
await tester.pumpAndSettle();
353+
await tester.tapButton(convertToLinkButton);
344354
},
345355
);
346356

347-
await tester.pumpAndSettle();
348-
349357
final editorState = tester.editor.getCurrentEditorState();
350358
final textNode = editorState.getNodeAtPath([0])!;
351359
expect(textNode.type, ParagraphBlockKeys.type);
@@ -363,14 +371,20 @@ void main() {
363371
(tester) async {
364372
const url = 'https://appflowy.io';
365373
await tester.pasteContent(plainText: url, (editorState) async {
374+
final pasteAsMenu = find.byType(PasteAsMenu);
375+
expect(pasteAsMenu, findsOneWidget);
376+
final bookmarkButton = find.text(
377+
LocaleKeys.document_plugins_linkPreview_typeSelection_bookmark.tr(),
378+
);
379+
await tester.tapButton(bookmarkButton);
366380
// the second one is the paragraph node
367-
expect(editorState.document.root.children.length, 2);
381+
expect(editorState.document.root.children.length, 1);
368382
final node = editorState.getNodeAtPath([0])!;
369383
expect(node.type, LinkPreviewBlockKeys.type);
370384
expect(node.attributes[LinkPreviewBlockKeys.url], url);
371385
});
372386

373-
await tester.editor.tapLineOfEditorAt(0);
387+
374388
await tester.simulateKeyEvent(
375389
LogicalKeyboardKey.keyZ,
376390
isControlPressed:
@@ -521,7 +535,7 @@ void main() {
521535

522536
extension on WidgetTester {
523537
Future<void> pasteContent(
524-
void Function(EditorState editorState) test, {
538+
FutureOr<void> Function(EditorState editorState) test, {
525539
Future<void> Function(EditorState editorState)? beforeTest,
526540
String? plainText,
527541
String? html,
@@ -558,6 +572,6 @@ extension on WidgetTester {
558572
);
559573
await pumpAndSettle(const Duration(milliseconds: 1000));
560574

561-
test(editor.getCurrentEditorState());
575+
await test(editor.getCurrentEditorState());
562576
}
563577
}

0 commit comments

Comments
 (0)