From 47f3702ca9319de016b90be721a0816c1589bdfc Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Mon, 13 Nov 2023 19:32:11 +0800 Subject: [PATCH] fix: integration test on kanban (#3928) --- .../database_view/board/application/board_bloc.dart | 9 ++++----- .../database_view/board/presentation/board_page.dart | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/appflowy_flutter/lib/plugins/database_view/board/application/board_bloc.dart b/frontend/appflowy_flutter/lib/plugins/database_view/board/application/board_bloc.dart index 5a4ee76e6b..52cb0e7e77 100644 --- a/frontend/appflowy_flutter/lib/plugins/database_view/board/application/board_bloc.dart +++ b/frontend/appflowy_flutter/lib/plugins/database_view/board/application/board_bloc.dart @@ -6,7 +6,6 @@ import 'package:appflowy/plugins/database_view/application/field/field_info.dart import 'package:appflowy/plugins/database_view/application/group/group_service.dart'; import 'package:appflowy/plugins/database_view/application/row/row_service.dart'; import 'package:appflowy_board/appflowy_board.dart'; -import 'package:collection/collection.dart'; import 'package:dartz/dartz.dart'; import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; @@ -257,11 +256,11 @@ class BoardBloc extends Bloc { databaseController.databaseLayoutSetting?.board.hideUngroupedColumn ?? false; - FieldType? get groupingFieldType { - final fieldInfo = databaseController.fieldController.fieldInfos - .firstWhereOrNull((field) => field.isGroupField); + FieldType get groupingFieldType { + final fieldInfo = + databaseController.fieldController.getField(groupList.first.fieldId)!; - return fieldInfo?.fieldType; + return fieldInfo.fieldType; } void initializeGroups(List groups) { diff --git a/frontend/appflowy_flutter/lib/plugins/database_view/board/presentation/board_page.dart b/frontend/appflowy_flutter/lib/plugins/database_view/board/presentation/board_page.dart index 4bae94b30a..716dfde528 100644 --- a/frontend/appflowy_flutter/lib/plugins/database_view/board/presentation/board_page.dart +++ b/frontend/appflowy_flutter/lib/plugins/database_view/board/presentation/board_page.dart @@ -150,7 +150,7 @@ class _BoardContentState extends State { child: BlocBuilder( builder: (context, state) { final showCreateGroupButton = - context.read().groupingFieldType!.canCreateNewGroup; + context.read().groupingFieldType.canCreateNewGroup; return Padding( padding: const EdgeInsets.only(top: 8.0), child: AppFlowyBoard(