Skip to content

Commit 5c13b32

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/theme
2 parents 8137769 + b0ab4ef commit 5c13b32

File tree

87 files changed

+1820
-897
lines changed

Some content is hidden

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

87 files changed

+1820
-897
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Release Notes
22

3+
## Version 0.0.5.1 - 09/14/2022
4+
5+
New features
6+
- Enable deleting a field in board
7+
- Fix some bugs
8+
9+
10+
## Version 0.0.5 - 09/08/2022
11+
New Features - Kanban Board like Notion and Trello beta
12+
Boards are the best way to manage projects & tasks. Use them to group your databases by select, multiselect, and checkbox.
13+
14+
<p align="left"><img src="https://user-images.githubusercontent.com/12026239/190055984-6efa2d7a-ee38-4551-859e-ee56388e1859.gif" width="1000px" /></p>
15+
16+
- Set up columns that represent a specific phase of the project cycle and use cards to represent each project / task
17+
- Drag and drop a card from one phase / column to another phase / column
18+
- Update database properties in the Board view by clicking on a property and making edits on the card
19+
20+
### Other Features & Improvements
21+
- Settings allow users to change avatars
22+
- Click and drag the right edge to resize your sidebar
23+
- And many user interface improvements (link)
24+
325
## Version 0.0.5 - beta.2 - beta.1 - 09/01/2022
426

527
New features

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"
25+
CURRENT_APP_VERSION = "0.0.5.1"
2626
FEATURES = "flutter"
2727
PRODUCT_NAME = "AppFlowy"
2828
# CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html

frontend/app_flowy/assets/translations/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@
191191
"optionTitle": "Options",
192192
"addOption": "Add option",
193193
"editProperty": "Edit property",
194-
"newColumn": "New column"
194+
"newColumn": "New column",
195+
"deleteFieldPromptMessage": "Are you sure? This property will be deleted"
195196
},
196197
"row": {
197198
"duplicate": "Duplicate",

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,13 @@ class _BoardContentState extends State<BoardContent> {
287287
);
288288
}
289289

290-
void _openCard(String gridId, GridFieldController fieldController,
291-
RowPB rowPB, GridRowCache rowCache, BuildContext context) {
290+
void _openCard(
291+
String gridId,
292+
GridFieldController fieldController,
293+
RowPB rowPB,
294+
GridRowCache rowCache,
295+
BuildContext context,
296+
) {
292297
final rowInfo = RowInfo(
293298
gridId: gridId,
294299
fields: UnmodifiableListView(fieldController.fieldContexts),

frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_setting.dart

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import 'package:app_flowy/generated/locale_keys.g.dart';
22
import 'package:app_flowy/plugins/board/application/toolbar/board_setting_bloc.dart';
33
import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
44
import 'package:app_flowy/plugins/grid/presentation/layout/sizes.dart';
5+
import 'package:app_flowy/plugins/grid/presentation/widgets/toolbar/grid_group.dart';
56
import 'package:app_flowy/plugins/grid/presentation/widgets/toolbar/grid_property.dart';
7+
import 'package:appflowy_popover/popover.dart';
68
import 'package:easy_localization/easy_localization.dart';
79
import 'package:flowy_infra/image.dart';
810
import 'package:flowy_infra/theme.dart';
9-
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
1011
import 'package:flowy_infra_ui/style_widget/button.dart';
1112
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
1213
import 'package:flowy_infra_ui/style_widget/text.dart';
@@ -141,10 +142,12 @@ extension _GridSettingExtension on BoardSettingAction {
141142
}
142143

143144
class BoardSettingListPopover extends StatefulWidget {
145+
final PopoverController popoverController;
144146
final BoardSettingContext settingContext;
145147

146148
const BoardSettingListPopover({
147149
Key? key,
150+
required this.popoverController,
148151
required this.settingContext,
149152
}) : super(key: key);
150153

@@ -153,36 +156,33 @@ class BoardSettingListPopover extends StatefulWidget {
153156
}
154157

155158
class _BoardSettingListPopoverState extends State<BoardSettingListPopover> {
156-
bool _showGridPropertyList = false;
159+
BoardSettingAction? _action;
157160

158161
@override
159162
Widget build(BuildContext context) {
160-
if (_showGridPropertyList) {
161-
return OverlayContainer(
162-
constraints: BoxConstraints.loose(const Size(260, 400)),
163-
child: GridPropertyList(
164-
gridId: widget.settingContext.viewId,
165-
fieldController: widget.settingContext.fieldController,
166-
),
167-
);
163+
if (_action != null) {
164+
switch (_action!) {
165+
case BoardSettingAction.groups:
166+
return GridGroupList(
167+
viewId: widget.settingContext.viewId,
168+
fieldController: widget.settingContext.fieldController,
169+
onDismissed: () {
170+
widget.popoverController.close();
171+
},
172+
);
173+
case BoardSettingAction.properties:
174+
return GridPropertyList(
175+
gridId: widget.settingContext.viewId,
176+
fieldController: widget.settingContext.fieldController,
177+
);
178+
}
168179
}
169180

170-
return OverlayContainer(
171-
constraints: BoxConstraints.loose(const Size(140, 400)),
172-
child: BoardSettingList(
173-
settingContext: widget.settingContext,
174-
onAction: (action, settingContext) {
175-
switch (action) {
176-
case BoardSettingAction.groups:
177-
break;
178-
case BoardSettingAction.properties:
179-
setState(() {
180-
_showGridPropertyList = true;
181-
});
182-
break;
183-
}
184-
},
185-
),
181+
return BoardSettingList(
182+
settingContext: widget.settingContext,
183+
onAction: (action, settingContext) {
184+
setState(() => _action = action);
185+
},
186186
);
187187
}
188188
}

frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_toolbar.dart

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
22
import 'package:appflowy_popover/popover.dart';
33
import 'package:flowy_infra/image.dart';
44
import 'package:flowy_infra/theme.dart';
5+
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
56
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
67
import 'package:flutter/widgets.dart';
78
import 'package:provider/provider.dart';
@@ -40,15 +41,30 @@ class BoardToolbar extends StatelessWidget {
4041
}
4142
}
4243

43-
class _SettingButton extends StatelessWidget {
44+
class _SettingButton extends StatefulWidget {
4445
final BoardSettingContext settingContext;
4546
const _SettingButton({required this.settingContext, Key? key})
4647
: super(key: key);
4748

49+
@override
50+
State<_SettingButton> createState() => _SettingButtonState();
51+
}
52+
53+
class _SettingButtonState extends State<_SettingButton> {
54+
late PopoverController popoverController;
55+
56+
@override
57+
void initState() {
58+
popoverController = PopoverController();
59+
super.initState();
60+
}
61+
4862
@override
4963
Widget build(BuildContext context) {
5064
final theme = context.read<AppTheme>();
51-
return Popover(
65+
return AppFlowyStylePopover(
66+
controller: popoverController,
67+
constraints: BoxConstraints.loose(const Size(260, 400)),
5268
triggerActions: PopoverTriggerActionFlags.click,
5369
child: FlowyIconButton(
5470
hoverColor: theme.hover,
@@ -61,7 +77,8 @@ class _SettingButton extends StatelessWidget {
6177
),
6278
popupBuilder: (BuildContext popoverContext) {
6379
return BoardSettingListPopover(
64-
settingContext: settingContext,
80+
settingContext: widget.settingContext,
81+
popoverController: popoverController,
6582
);
6683
},
6784
);

frontend/app_flowy/lib/plugins/doc/application/doc_bloc.dart

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
9090
final result = await service.openDocument(docId: view.id);
9191
result.fold(
9292
(block) {
93-
document = _decodeJsonToDocument(block.deltaStr);
93+
document = _decodeJsonToDocument(block.snapshot);
9494
_subscription = document.changes.listen((event) {
9595
final delta = event.item2;
9696
final documentDelta = document.toDelta();
@@ -115,16 +115,12 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
115115
void _composeDelta(Delta composedDelta, Delta documentDelta) async {
116116
final json = jsonEncode(composedDelta.toJson());
117117
Log.debug("doc_id: $view.id - Send json: $json");
118-
final result = await service.composeDelta(docId: view.id, data: json);
119-
120-
result.fold((rustDoc) {
121-
// final json = utf8.decode(doc.data);
122-
final rustDelta = Delta.fromJson(jsonDecode(rustDoc.deltaStr));
123-
if (documentDelta != rustDelta) {
124-
Log.error("Receive : $rustDelta");
125-
Log.error("Expected : $documentDelta");
126-
}
127-
}, (r) => null);
118+
final result = await service.applyEdit(docId: view.id, data: json);
119+
120+
result.fold(
121+
(_) {},
122+
(r) => Log.error(r),
123+
);
128124
}
129125

130126
Document _decodeJsonToDocument(String data) {

frontend/app_flowy/lib/plugins/doc/application/doc_service.dart

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,28 @@ import 'package:flowy_sdk/dispatch/dispatch.dart';
44
import 'package:flowy_sdk/protobuf/flowy-folder/view.pb.dart';
55
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
66
import 'package:flowy_sdk/protobuf/flowy-sync/text_block.pb.dart';
7+
import 'package:flowy_sdk/protobuf/flowy-text-block/entities.pb.dart';
78

89
class DocumentService {
9-
Future<Either<TextBlockDeltaPB, FlowyError>> openDocument({
10+
Future<Either<TextBlockPB, FlowyError>> openDocument({
1011
required String docId,
1112
}) async {
1213
await FolderEventSetLatestView(ViewIdPB(value: docId)).send();
1314

1415
final payload = TextBlockIdPB(value: docId);
15-
return TextBlockEventGetBlockData(payload).send();
16+
return TextBlockEventGetTextBlock(payload).send();
1617
}
1718

18-
Future<Either<TextBlockDeltaPB, FlowyError>> composeDelta({required String docId, required String data}) {
19-
final payload = TextBlockDeltaPB.create()
20-
..blockId = docId
21-
..deltaStr = data;
22-
return TextBlockEventApplyDelta(payload).send();
19+
Future<Either<Unit, FlowyError>> applyEdit({
20+
required String docId,
21+
required String data,
22+
String operations = "",
23+
}) {
24+
final payload = EditPayloadPB.create()
25+
..textBlockId = docId
26+
..operations = operations
27+
..delta = data;
28+
return TextBlockEventApplyEdit(payload).send();
2329
}
2430

2531
Future<Either<Unit, FlowyError>> closeDocument({required String docId}) {

frontend/app_flowy/lib/plugins/doc/document.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ class DocumentShareButton extends StatelessWidget {
186186
'Exported to: ${LocaleKeys.notifications_export_path.tr()}');
187187
break;
188188
case ShareAction.copyLink:
189-
FlowyAlertDialog(title: LocaleKeys.shareAction_workInProgress.tr())
189+
NavigatorAlertDialog(
190+
title: LocaleKeys.shareAction_workInProgress.tr())
190191
.show(context);
191192
break;
192193
}

frontend/app_flowy/lib/plugins/doc/presentation/toolbar/link_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class FlowyLinkStyleButtonState extends State<FlowyLinkStyleButton> {
8484
value = values.first;
8585
}
8686

87-
TextFieldDialog(
87+
NavigatorTextFieldDialog(
8888
title: 'URL',
8989
value: value,
9090
confirm: (newValue) {

0 commit comments

Comments
 (0)