mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-18 22:46:57 +00:00

* chore: enable calendar view * chore: update database group listener * refactor: remove board data controller * refactor: remove group backend service * refactor: remove calendar controller * chore: create default calendar setting * chore: send calednar setting notifications * refactor: rename the card in kanban board, prepare to reuse in calendar * refactor: support custom card cell * chore: return calendar events * refactor: remove groupId in card, make card more generic * chore: display cell * chore: display three cards in calendar * chore: create calendar card * refactor: create row with data * chore: support create event * ci: fix tauri build * chore: disable create calendar
43 lines
1.3 KiB
Dart
43 lines
1.3 KiB
Dart
import 'package:dartz/dartz.dart';
|
|
import 'package:appflowy_backend/dispatch/dispatch.dart';
|
|
|
|
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
|
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
|
|
import 'package:appflowy_backend/protobuf/flowy-document/entities.pb.dart';
|
|
|
|
class DocumentService {
|
|
Future<Either<DocumentDataPB, FlowyError>> openDocument({
|
|
required ViewPB view,
|
|
}) async {
|
|
await FolderEventSetLatestView(ViewIdPB(value: view.id)).send();
|
|
|
|
final payload = OpenDocumentPayloadPB()
|
|
..documentId = view.id
|
|
..version = DocumentVersionPB.V1;
|
|
// switch (view.dataFormat) {
|
|
// case ViewDataFormatPB.DeltaFormat:
|
|
// payload.documentVersion = DocumentVersionPB.V0;
|
|
// break;
|
|
// default:
|
|
// break;
|
|
// }
|
|
|
|
return DocumentEventGetDocument(payload).send();
|
|
}
|
|
|
|
Future<Either<Unit, FlowyError>> applyEdit({
|
|
required String docId,
|
|
required String operations,
|
|
}) {
|
|
final payload = EditPayloadPB.create()
|
|
..docId = docId
|
|
..operations = operations;
|
|
return DocumentEventApplyEdit(payload).send();
|
|
}
|
|
|
|
Future<Either<Unit, FlowyError>> closeDocument({required String docId}) {
|
|
final payload = ViewIdPB(value: docId);
|
|
return FolderEventCloseView(payload).send();
|
|
}
|
|
}
|