Skip to content

Commit 5294d77

Browse files
committed
Merge branch 'main' into feat/wrap-appflowy-style-popover
2 parents 41b8551 + 733b7e1 commit 5294d77

File tree

32 files changed

+412
-155
lines changed

32 files changed

+412
-155
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 & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ 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';
@@ -141,10 +143,12 @@ extension _GridSettingExtension on BoardSettingAction {
141143
}
142144

143145
class BoardSettingListPopover extends StatefulWidget {
146+
final PopoverController popoverController;
144147
final BoardSettingContext settingContext;
145148

146149
const BoardSettingListPopover({
147150
Key? key,
151+
required this.popoverController,
148152
required this.settingContext,
149153
}) : super(key: key);
150154

@@ -153,36 +157,33 @@ class BoardSettingListPopover extends StatefulWidget {
153157
}
154158

155159
class _BoardSettingListPopoverState extends State<BoardSettingListPopover> {
156-
bool _showGridPropertyList = false;
160+
BoardSettingAction? _action;
157161

158162
@override
159163
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-
);
164+
if (_action != null) {
165+
switch (_action!) {
166+
case BoardSettingAction.groups:
167+
return GridGroupList(
168+
viewId: widget.settingContext.viewId,
169+
fieldController: widget.settingContext.fieldController,
170+
onDismissed: () {
171+
widget.popoverController.close();
172+
},
173+
);
174+
case BoardSettingAction.properties:
175+
return GridPropertyList(
176+
gridId: widget.settingContext.viewId,
177+
fieldController: widget.settingContext.fieldController,
178+
);
179+
}
168180
}
169181

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-
),
182+
return BoardSettingList(
183+
settingContext: widget.settingContext,
184+
onAction: (action, settingContext) {
185+
setState(() => _action = action);
186+
},
186187
);
187188
}
188189
}

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/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) {

frontend/app_flowy/lib/plugins/grid/application/field/field_editor_bloc.dart

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flowy_sdk/protobuf/flowy-grid/field_entities.pb.dart';
22
import 'package:flutter_bloc/flutter_bloc.dart';
33
import 'dart:async';
44
import 'package:dartz/dartz.dart';
5+
import 'field_service.dart';
56
import 'type_option/type_option_context.dart';
67
import 'package:freezed_annotation/freezed_annotation.dart';
78

@@ -15,10 +16,11 @@ class FieldEditorBloc extends Bloc<FieldEditorEvent, FieldEditorState> {
1516
FieldEditorBloc({
1617
required String gridId,
1718
required String fieldName,
19+
required bool isGroupField,
1820
required IFieldTypeOptionLoader loader,
1921
}) : dataController =
2022
TypeOptionDataController(gridId: gridId, loader: loader),
21-
super(FieldEditorState.initial(gridId, fieldName)) {
23+
super(FieldEditorState.initial(gridId, fieldName, isGroupField)) {
2224
on<FieldEditorEvent>(
2325
(event, emit) async {
2426
await event.when(
@@ -35,7 +37,23 @@ class FieldEditorBloc extends Bloc<FieldEditorEvent, FieldEditorState> {
3537
emit(state.copyWith(name: name));
3638
},
3739
didReceiveFieldChanged: (FieldPB field) {
38-
emit(state.copyWith(field: Some(field), name: field.name));
40+
emit(state.copyWith(
41+
field: Some(field),
42+
name: field.name,
43+
canDelete: field.isPrimary,
44+
));
45+
},
46+
deleteField: () {
47+
state.field.fold(
48+
() => null,
49+
(field) {
50+
final fieldService = FieldService(
51+
gridId: gridId,
52+
fieldId: field.id,
53+
);
54+
fieldService.deleteField();
55+
},
56+
);
3957
},
4058
);
4159
},
@@ -52,6 +70,7 @@ class FieldEditorBloc extends Bloc<FieldEditorEvent, FieldEditorState> {
5270
class FieldEditorEvent with _$FieldEditorEvent {
5371
const factory FieldEditorEvent.initial() = _InitialField;
5472
const factory FieldEditorEvent.updateName(String name) = _UpdateName;
73+
const factory FieldEditorEvent.deleteField() = _DeleteField;
5574
const factory FieldEditorEvent.didReceiveFieldChanged(FieldPB field) =
5675
_DidReceiveFieldChanged;
5776
}
@@ -63,16 +82,21 @@ class FieldEditorState with _$FieldEditorState {
6382
required String errorText,
6483
required String name,
6584
required Option<FieldPB> field,
85+
required bool canDelete,
86+
required bool isGroupField,
6687
}) = _FieldEditorState;
6788

6889
factory FieldEditorState.initial(
6990
String gridId,
7091
String fieldName,
92+
bool isGroupField,
7193
) =>
7294
FieldEditorState(
7395
gridId: gridId,
7496
errorText: '',
7597
field: none(),
98+
canDelete: false,
7699
name: fieldName,
100+
isGroupField: isGroupField,
77101
);
78102
}

frontend/app_flowy/lib/plugins/grid/application/row/row_detail_bloc.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:app_flowy/plugins/grid/application/cell/cell_service/cell_service.dart';
2+
import 'package:app_flowy/plugins/grid/application/field/field_service.dart';
23
import 'package:flutter_bloc/flutter_bloc.dart';
34
import 'package:freezed_annotation/freezed_annotation.dart';
45
import 'dart:async';
@@ -24,6 +25,13 @@ class RowDetailBloc extends Bloc<RowDetailEvent, RowDetailState> {
2425
didReceiveCellDatas: (_DidReceiveCellDatas value) {
2526
emit(state.copyWith(gridCells: value.gridCells));
2627
},
28+
deleteField: (_DeleteField value) {
29+
final fieldService = FieldService(
30+
gridId: dataController.rowInfo.gridId,
31+
fieldId: value.fieldId,
32+
);
33+
fieldService.deleteField();
34+
},
2735
);
2836
},
2937
);
@@ -49,6 +57,7 @@ class RowDetailBloc extends Bloc<RowDetailEvent, RowDetailState> {
4957
@freezed
5058
class RowDetailEvent with _$RowDetailEvent {
5159
const factory RowDetailEvent.initial() = _Initial;
60+
const factory RowDetailEvent.deleteField(String fieldId) = _DeleteField;
5261
const factory RowDetailEvent.didReceiveCellDatas(
5362
List<GridCellIdentifier> gridCells) = _DidReceiveCellDatas;
5463
}

0 commit comments

Comments
 (0)