mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 22:57:12 -04:00
feat: update view properties
This commit is contained in:
parent
23ccfa54b5
commit
74831964a6
17 changed files with 225 additions and 175 deletions
|
@ -17,9 +17,9 @@ extension SvgViewType on View {
|
||||||
|
|
||||||
String _imageNameForViewType(ViewType type) {
|
String _imageNameForViewType(ViewType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ViewType.QuillDocument:
|
case ViewType.RichText:
|
||||||
return "file_icon";
|
return "file_icon";
|
||||||
case ViewType.Kanban:
|
case ViewType.Plugin:
|
||||||
return "file_icon";
|
return "file_icon";
|
||||||
default:
|
default:
|
||||||
return "file_icon";
|
return "file_icon";
|
||||||
|
|
|
@ -6,9 +6,9 @@ import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
|
||||||
extension ToHomeStackContext on View {
|
extension ToHomeStackContext on View {
|
||||||
HomeStackContext stackContext() {
|
HomeStackContext stackContext() {
|
||||||
switch (viewType) {
|
switch (viewType) {
|
||||||
case ViewType.QuillDocument:
|
case ViewType.RichText:
|
||||||
return DocumentStackContext(view: this);
|
return DocumentStackContext(view: this);
|
||||||
case ViewType.Kanban:
|
case ViewType.Plugin:
|
||||||
return DocumentStackContext(view: this);
|
return DocumentStackContext(view: this);
|
||||||
default:
|
default:
|
||||||
return BlankStackContext();
|
return BlankStackContext();
|
||||||
|
@ -19,9 +19,9 @@ extension ToHomeStackContext on View {
|
||||||
extension ToHomeStackType on View {
|
extension ToHomeStackType on View {
|
||||||
HomeStackType stackType() {
|
HomeStackType stackType() {
|
||||||
switch (viewType) {
|
switch (viewType) {
|
||||||
case ViewType.QuillDocument:
|
case ViewType.RichText:
|
||||||
return HomeStackType.document;
|
return HomeStackType.document;
|
||||||
case ViewType.Kanban:
|
case ViewType.PlainText:
|
||||||
return HomeStackType.kanban;
|
return HomeStackType.kanban;
|
||||||
default:
|
default:
|
||||||
return HomeStackType.blank;
|
return HomeStackType.blank;
|
||||||
|
@ -32,9 +32,9 @@ extension ToHomeStackType on View {
|
||||||
extension ViewTypeExtension on ViewType {
|
extension ViewTypeExtension on ViewType {
|
||||||
String displayName() {
|
String displayName() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case ViewType.QuillDocument:
|
case ViewType.RichText:
|
||||||
return "Doc";
|
return "Doc";
|
||||||
case ViewType.Kanban:
|
case ViewType.Plugin:
|
||||||
return "Kanban";
|
return "Kanban";
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
|
@ -43,9 +43,9 @@ extension ViewTypeExtension on ViewType {
|
||||||
|
|
||||||
bool enable() {
|
bool enable() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case ViewType.QuillDocument:
|
case ViewType.RichText:
|
||||||
return true;
|
return true;
|
||||||
case ViewType.Kanban:
|
case ViewType.Plugin:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -20,7 +20,7 @@ class View extends $pb.GeneratedMessage {
|
||||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'belongToId')
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'belongToId')
|
||||||
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
||||||
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc')
|
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc')
|
||||||
..e<ViewType>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewType', $pb.PbFieldType.OE, defaultOrMaker: ViewType.Blank, valueOf: ViewType.valueOf, enumValues: ViewType.values)
|
..e<ViewType>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewType', $pb.PbFieldType.OE, defaultOrMaker: ViewType.RichText, valueOf: ViewType.valueOf, enumValues: ViewType.values)
|
||||||
..aInt64(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'version')
|
..aInt64(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'version')
|
||||||
..aOM<RepeatedView>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'belongings', subBuilder: RepeatedView.create)
|
..aOM<RepeatedView>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'belongings', subBuilder: RepeatedView.create)
|
||||||
..aInt64(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'modifiedTime')
|
..aInt64(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'modifiedTime')
|
||||||
|
@ -232,7 +232,8 @@ class CreateViewPayload extends $pb.GeneratedMessage {
|
||||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
||||||
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc')
|
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc')
|
||||||
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'thumbnail')
|
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'thumbnail')
|
||||||
..e<ViewType>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewType', $pb.PbFieldType.OE, defaultOrMaker: ViewType.Blank, valueOf: ViewType.valueOf, enumValues: ViewType.values)
|
..e<ViewType>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewType', $pb.PbFieldType.OE, defaultOrMaker: ViewType.RichText, valueOf: ViewType.valueOf, enumValues: ViewType.values)
|
||||||
|
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ext')
|
||||||
..hasRequiredFields = false
|
..hasRequiredFields = false
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -243,6 +244,7 @@ class CreateViewPayload extends $pb.GeneratedMessage {
|
||||||
$core.String? desc,
|
$core.String? desc,
|
||||||
$core.String? thumbnail,
|
$core.String? thumbnail,
|
||||||
ViewType? viewType,
|
ViewType? viewType,
|
||||||
|
$core.String? ext,
|
||||||
}) {
|
}) {
|
||||||
final _result = create();
|
final _result = create();
|
||||||
if (belongToId != null) {
|
if (belongToId != null) {
|
||||||
|
@ -260,6 +262,9 @@ class CreateViewPayload extends $pb.GeneratedMessage {
|
||||||
if (viewType != null) {
|
if (viewType != null) {
|
||||||
_result.viewType = viewType;
|
_result.viewType = viewType;
|
||||||
}
|
}
|
||||||
|
if (ext != null) {
|
||||||
|
_result.ext = ext;
|
||||||
|
}
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
factory CreateViewPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
factory CreateViewPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||||
|
@ -330,6 +335,15 @@ class CreateViewPayload extends $pb.GeneratedMessage {
|
||||||
$core.bool hasViewType() => $_has(4);
|
$core.bool hasViewType() => $_has(4);
|
||||||
@$pb.TagNumber(5)
|
@$pb.TagNumber(5)
|
||||||
void clearViewType() => clearField(5);
|
void clearViewType() => clearField(5);
|
||||||
|
|
||||||
|
@$pb.TagNumber(6)
|
||||||
|
$core.String get ext => $_getSZ(5);
|
||||||
|
@$pb.TagNumber(6)
|
||||||
|
set ext($core.String v) { $_setString(5, v); }
|
||||||
|
@$pb.TagNumber(6)
|
||||||
|
$core.bool hasExt() => $_has(5);
|
||||||
|
@$pb.TagNumber(6)
|
||||||
|
void clearExt() => clearField(6);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CreateViewParams extends $pb.GeneratedMessage {
|
class CreateViewParams extends $pb.GeneratedMessage {
|
||||||
|
@ -338,8 +352,8 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
||||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
|
||||||
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc')
|
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc')
|
||||||
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'thumbnail')
|
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'thumbnail')
|
||||||
..e<ViewType>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewType', $pb.PbFieldType.OE, defaultOrMaker: ViewType.Blank, valueOf: ViewType.valueOf, enumValues: ViewType.values)
|
..e<ViewType>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewType', $pb.PbFieldType.OE, defaultOrMaker: ViewType.RichText, valueOf: ViewType.valueOf, enumValues: ViewType.values)
|
||||||
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewData')
|
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'ext')
|
||||||
..aOS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewId')
|
..aOS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewId')
|
||||||
..hasRequiredFields = false
|
..hasRequiredFields = false
|
||||||
;
|
;
|
||||||
|
@ -351,7 +365,7 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
||||||
$core.String? desc,
|
$core.String? desc,
|
||||||
$core.String? thumbnail,
|
$core.String? thumbnail,
|
||||||
ViewType? viewType,
|
ViewType? viewType,
|
||||||
$core.String? viewData,
|
$core.String? ext,
|
||||||
$core.String? viewId,
|
$core.String? viewId,
|
||||||
}) {
|
}) {
|
||||||
final _result = create();
|
final _result = create();
|
||||||
|
@ -370,8 +384,8 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
||||||
if (viewType != null) {
|
if (viewType != null) {
|
||||||
_result.viewType = viewType;
|
_result.viewType = viewType;
|
||||||
}
|
}
|
||||||
if (viewData != null) {
|
if (ext != null) {
|
||||||
_result.viewData = viewData;
|
_result.ext = ext;
|
||||||
}
|
}
|
||||||
if (viewId != null) {
|
if (viewId != null) {
|
||||||
_result.viewId = viewId;
|
_result.viewId = viewId;
|
||||||
|
@ -445,13 +459,13 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
||||||
void clearViewType() => clearField(5);
|
void clearViewType() => clearField(5);
|
||||||
|
|
||||||
@$pb.TagNumber(6)
|
@$pb.TagNumber(6)
|
||||||
$core.String get viewData => $_getSZ(5);
|
$core.String get ext => $_getSZ(5);
|
||||||
@$pb.TagNumber(6)
|
@$pb.TagNumber(6)
|
||||||
set viewData($core.String v) { $_setString(5, v); }
|
set ext($core.String v) { $_setString(5, v); }
|
||||||
@$pb.TagNumber(6)
|
@$pb.TagNumber(6)
|
||||||
$core.bool hasViewData() => $_has(5);
|
$core.bool hasExt() => $_has(5);
|
||||||
@$pb.TagNumber(6)
|
@$pb.TagNumber(6)
|
||||||
void clearViewData() => clearField(6);
|
void clearExt() => clearField(6);
|
||||||
|
|
||||||
@$pb.TagNumber(7)
|
@$pb.TagNumber(7)
|
||||||
$core.String get viewId => $_getSZ(6);
|
$core.String get viewId => $_getSZ(6);
|
||||||
|
|
|
@ -10,14 +10,12 @@ import 'dart:core' as $core;
|
||||||
import 'package:protobuf/protobuf.dart' as $pb;
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
class ViewType extends $pb.ProtobufEnum {
|
class ViewType extends $pb.ProtobufEnum {
|
||||||
static const ViewType Blank = ViewType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Blank');
|
static const ViewType RichText = ViewType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'RichText');
|
||||||
static const ViewType QuillDocument = ViewType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'QuillDocument');
|
static const ViewType PlainText = ViewType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PlainText');
|
||||||
static const ViewType Kanban = ViewType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Kanban');
|
|
||||||
|
|
||||||
static const $core.List<ViewType> values = <ViewType> [
|
static const $core.List<ViewType> values = <ViewType> [
|
||||||
Blank,
|
RichText,
|
||||||
QuillDocument,
|
PlainText,
|
||||||
Kanban,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
static final $core.Map<$core.int, ViewType> _byValue = $pb.ProtobufEnum.initByValue(values);
|
static final $core.Map<$core.int, ViewType> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||||
|
|
|
@ -12,14 +12,13 @@ import 'dart:typed_data' as $typed_data;
|
||||||
const ViewType$json = const {
|
const ViewType$json = const {
|
||||||
'1': 'ViewType',
|
'1': 'ViewType',
|
||||||
'2': const [
|
'2': const [
|
||||||
const {'1': 'Blank', '2': 0},
|
const {'1': 'RichText', '2': 0},
|
||||||
const {'1': 'QuillDocument', '2': 1},
|
const {'1': 'PlainText', '2': 1},
|
||||||
const {'1': 'Kanban', '2': 2},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `ViewType`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
/// Descriptor for `ViewType`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||||
final $typed_data.Uint8List viewTypeDescriptor = $convert.base64Decode('CghWaWV3VHlwZRIJCgVCbGFuaxAAEhEKDVF1aWxsRG9jdW1lbnQQARIKCgZLYW5iYW4QAg==');
|
final $typed_data.Uint8List viewTypeDescriptor = $convert.base64Decode('CghWaWV3VHlwZRIMCghSaWNoVGV4dBAAEg0KCVBsYWluVGV4dBAB');
|
||||||
@$core.Deprecated('Use viewDescriptor instead')
|
@$core.Deprecated('Use viewDescriptor instead')
|
||||||
const View$json = const {
|
const View$json = const {
|
||||||
'1': 'View',
|
'1': 'View',
|
||||||
|
@ -57,6 +56,7 @@ const CreateViewPayload$json = const {
|
||||||
const {'1': 'desc', '3': 3, '4': 1, '5': 9, '10': 'desc'},
|
const {'1': 'desc', '3': 3, '4': 1, '5': 9, '10': 'desc'},
|
||||||
const {'1': 'thumbnail', '3': 4, '4': 1, '5': 9, '9': 0, '10': 'thumbnail'},
|
const {'1': 'thumbnail', '3': 4, '4': 1, '5': 9, '9': 0, '10': 'thumbnail'},
|
||||||
const {'1': 'view_type', '3': 5, '4': 1, '5': 14, '6': '.ViewType', '10': 'viewType'},
|
const {'1': 'view_type', '3': 5, '4': 1, '5': 14, '6': '.ViewType', '10': 'viewType'},
|
||||||
|
const {'1': 'ext', '3': 6, '4': 1, '5': 9, '10': 'ext'},
|
||||||
],
|
],
|
||||||
'8': const [
|
'8': const [
|
||||||
const {'1': 'one_of_thumbnail'},
|
const {'1': 'one_of_thumbnail'},
|
||||||
|
@ -64,7 +64,7 @@ const CreateViewPayload$json = const {
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `CreateViewPayload`. Decode as a `google.protobuf.DescriptorProto`.
|
/// Descriptor for `CreateViewPayload`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
final $typed_data.Uint8List createViewPayloadDescriptor = $convert.base64Decode('ChFDcmVhdGVWaWV3UGF5bG9hZBIgCgxiZWxvbmdfdG9faWQYASABKAlSCmJlbG9uZ1RvSWQSEgoEbmFtZRgCIAEoCVIEbmFtZRISCgRkZXNjGAMgASgJUgRkZXNjEh4KCXRodW1ibmFpbBgEIAEoCUgAUgl0aHVtYm5haWwSJgoJdmlld190eXBlGAUgASgOMgkuVmlld1R5cGVSCHZpZXdUeXBlQhIKEG9uZV9vZl90aHVtYm5haWw=');
|
final $typed_data.Uint8List createViewPayloadDescriptor = $convert.base64Decode('ChFDcmVhdGVWaWV3UGF5bG9hZBIgCgxiZWxvbmdfdG9faWQYASABKAlSCmJlbG9uZ1RvSWQSEgoEbmFtZRgCIAEoCVIEbmFtZRISCgRkZXNjGAMgASgJUgRkZXNjEh4KCXRodW1ibmFpbBgEIAEoCUgAUgl0aHVtYm5haWwSJgoJdmlld190eXBlGAUgASgOMgkuVmlld1R5cGVSCHZpZXdUeXBlEhAKA2V4dBgGIAEoCVIDZXh0QhIKEG9uZV9vZl90aHVtYm5haWw=');
|
||||||
@$core.Deprecated('Use createViewParamsDescriptor instead')
|
@$core.Deprecated('Use createViewParamsDescriptor instead')
|
||||||
const CreateViewParams$json = const {
|
const CreateViewParams$json = const {
|
||||||
'1': 'CreateViewParams',
|
'1': 'CreateViewParams',
|
||||||
|
@ -74,13 +74,13 @@ const CreateViewParams$json = const {
|
||||||
const {'1': 'desc', '3': 3, '4': 1, '5': 9, '10': 'desc'},
|
const {'1': 'desc', '3': 3, '4': 1, '5': 9, '10': 'desc'},
|
||||||
const {'1': 'thumbnail', '3': 4, '4': 1, '5': 9, '10': 'thumbnail'},
|
const {'1': 'thumbnail', '3': 4, '4': 1, '5': 9, '10': 'thumbnail'},
|
||||||
const {'1': 'view_type', '3': 5, '4': 1, '5': 14, '6': '.ViewType', '10': 'viewType'},
|
const {'1': 'view_type', '3': 5, '4': 1, '5': 14, '6': '.ViewType', '10': 'viewType'},
|
||||||
const {'1': 'view_data', '3': 6, '4': 1, '5': 9, '10': 'viewData'},
|
const {'1': 'ext', '3': 6, '4': 1, '5': 9, '10': 'ext'},
|
||||||
const {'1': 'view_id', '3': 7, '4': 1, '5': 9, '10': 'viewId'},
|
const {'1': 'view_id', '3': 7, '4': 1, '5': 9, '10': 'viewId'},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `CreateViewParams`. Decode as a `google.protobuf.DescriptorProto`.
|
/// Descriptor for `CreateViewParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
final $typed_data.Uint8List createViewParamsDescriptor = $convert.base64Decode('ChBDcmVhdGVWaWV3UGFyYW1zEiAKDGJlbG9uZ190b19pZBgBIAEoCVIKYmVsb25nVG9JZBISCgRuYW1lGAIgASgJUgRuYW1lEhIKBGRlc2MYAyABKAlSBGRlc2MSHAoJdGh1bWJuYWlsGAQgASgJUgl0aHVtYm5haWwSJgoJdmlld190eXBlGAUgASgOMgkuVmlld1R5cGVSCHZpZXdUeXBlEhsKCXZpZXdfZGF0YRgGIAEoCVIIdmlld0RhdGESFwoHdmlld19pZBgHIAEoCVIGdmlld0lk');
|
final $typed_data.Uint8List createViewParamsDescriptor = $convert.base64Decode('ChBDcmVhdGVWaWV3UGFyYW1zEiAKDGJlbG9uZ190b19pZBgBIAEoCVIKYmVsb25nVG9JZBISCgRuYW1lGAIgASgJUgRuYW1lEhIKBGRlc2MYAyABKAlSBGRlc2MSHAoJdGh1bWJuYWlsGAQgASgJUgl0aHVtYm5haWwSJgoJdmlld190eXBlGAUgASgOMgkuVmlld1R5cGVSCHZpZXdUeXBlEhAKA2V4dBgGIAEoCVIDZXh0EhcKB3ZpZXdfaWQYByABKAlSBnZpZXdJZA==');
|
||||||
@$core.Deprecated('Use viewIdDescriptor instead')
|
@$core.Deprecated('Use viewIdDescriptor instead')
|
||||||
const ViewId$json = const {
|
const ViewId$json = const {
|
||||||
'1': 'ViewId',
|
'1': 'ViewId',
|
||||||
|
|
|
@ -81,9 +81,10 @@ impl BlockManager {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn reset_with_revisions<T: AsRef<str>>(&self, doc_id: T, revisions: RepeatedRevision) -> FlowyResult<()> {
|
pub async fn create_block<T: AsRef<str>>(&self, doc_id: T, revisions: RepeatedRevision) -> FlowyResult<()> {
|
||||||
let doc_id = doc_id.as_ref().to_owned();
|
let doc_id = doc_id.as_ref().to_owned();
|
||||||
let db_pool = self.block_user.db_pool()?;
|
let db_pool = self.block_user.db_pool()?;
|
||||||
|
// Maybe we could save the block to disk without creating the RevisionManager
|
||||||
let rev_manager = self.make_rev_manager(&doc_id, db_pool)?;
|
let rev_manager = self.make_rev_manager(&doc_id, db_pool)?;
|
||||||
let _ = rev_manager.reset_object(revisions).await?;
|
let _ = rev_manager.reset_object(revisions).await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -8,6 +8,7 @@ use lazy_static::lazy_static;
|
||||||
use flowy_collaboration::{client_folder::FolderPad, entities::ws_data::ServerRevisionWSData};
|
use flowy_collaboration::{client_folder::FolderPad, entities::ws_data::ServerRevisionWSData};
|
||||||
use flowy_document::BlockManager;
|
use flowy_document::BlockManager;
|
||||||
|
|
||||||
|
use flowy_collaboration::entities::revision::{RepeatedRevision, Revision};
|
||||||
use std::{collections::HashMap, convert::TryInto, fmt::Formatter, sync::Arc};
|
use std::{collections::HashMap, convert::TryInto, fmt::Formatter, sync::Arc};
|
||||||
use tokio::sync::RwLock as TokioRwLock;
|
use tokio::sync::RwLock as TokioRwLock;
|
||||||
|
|
||||||
|
@ -201,9 +202,10 @@ impl DefaultFolderBuilder {
|
||||||
initial_delta().to_json()
|
initial_delta().to_json()
|
||||||
};
|
};
|
||||||
view_controller.set_latest_view(view);
|
view_controller.set_latest_view(view);
|
||||||
let _ = view_controller
|
let delta_data = Bytes::from(view_data);
|
||||||
.create_view_document_content(&view.id, view_data)
|
let repeated_revision: RepeatedRevision =
|
||||||
.await?;
|
Revision::initial_revision(user_id, &view.id, delta_data).into();
|
||||||
|
let _ = view_controller.create_view(&view.id, repeated_revision).await?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let folder = FolderPad::new(vec![workspace.clone()], vec![])?;
|
let folder = FolderPad::new(vec![workspace.clone()], vec![])?;
|
||||||
|
|
|
@ -127,9 +127,8 @@ pub(crate) struct ViewTable {
|
||||||
impl ViewTable {
|
impl ViewTable {
|
||||||
pub fn new(view: View) -> Self {
|
pub fn new(view: View) -> Self {
|
||||||
let view_type = match view.view_type {
|
let view_type = match view.view_type {
|
||||||
ViewType::Kanban => ViewTableType::Kanban,
|
ViewType::RichText => ViewTableType::RichText,
|
||||||
ViewType::QuillDocument => ViewTableType::QuillDocument,
|
ViewType::PlainText => ViewTableType::Text,
|
||||||
ViewType::Blank => ViewTableType::QuillDocument,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ViewTable {
|
ViewTable {
|
||||||
|
@ -151,8 +150,8 @@ impl ViewTable {
|
||||||
impl std::convert::From<ViewTable> for View {
|
impl std::convert::From<ViewTable> for View {
|
||||||
fn from(table: ViewTable) -> Self {
|
fn from(table: ViewTable) -> Self {
|
||||||
let view_type = match table.view_type {
|
let view_type = match table.view_type {
|
||||||
ViewTableType::QuillDocument => ViewType::QuillDocument,
|
ViewTableType::RichText => ViewType::RichText,
|
||||||
ViewTableType::Kanban => ViewType::Kanban,
|
ViewTableType::Text => ViewType::PlainText,
|
||||||
};
|
};
|
||||||
|
|
||||||
View {
|
View {
|
||||||
|
@ -217,24 +216,24 @@ impl ViewChangeset {
|
||||||
#[repr(i32)]
|
#[repr(i32)]
|
||||||
#[sql_type = "Integer"]
|
#[sql_type = "Integer"]
|
||||||
pub enum ViewTableType {
|
pub enum ViewTableType {
|
||||||
QuillDocument = 0,
|
RichText = 0,
|
||||||
Kanban = 1,
|
Text = 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::default::Default for ViewTableType {
|
impl std::default::Default for ViewTableType {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
ViewTableType::QuillDocument
|
ViewTableType::RichText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::convert::From<i32> for ViewTableType {
|
impl std::convert::From<i32> for ViewTableType {
|
||||||
fn from(value: i32) -> Self {
|
fn from(value: i32) -> Self {
|
||||||
match value {
|
match value {
|
||||||
0 => ViewTableType::QuillDocument,
|
0 => ViewTableType::RichText,
|
||||||
1 => ViewTableType::Kanban,
|
1 => ViewTableType::Text,
|
||||||
o => {
|
o => {
|
||||||
log::error!("Unsupported view type {}, fallback to ViewType::Docs", o);
|
log::error!("Unsupported view type {}, fallback to ViewType::Docs", o);
|
||||||
ViewTableType::QuillDocument
|
ViewTableType::Text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ use crate::{
|
||||||
use flowy_database::kv::KV;
|
use flowy_database::kv::KV;
|
||||||
use flowy_document::BlockManager;
|
use flowy_document::BlockManager;
|
||||||
use flowy_folder_data_model::entities::share::{ExportData, ExportParams};
|
use flowy_folder_data_model::entities::share::{ExportData, ExportParams};
|
||||||
|
use flowy_folder_data_model::entities::view::ViewType;
|
||||||
use lib_infra::uuid_string;
|
use lib_infra::uuid_string;
|
||||||
|
|
||||||
const LATEST_VIEW_ID: &str = "latest_view_id";
|
const LATEST_VIEW_ID: &str = "latest_view_id";
|
||||||
|
@ -61,43 +62,33 @@ impl ViewController {
|
||||||
|
|
||||||
#[tracing::instrument(level = "trace", skip(self, params), fields(name = %params.name), err)]
|
#[tracing::instrument(level = "trace", skip(self, params), fields(name = %params.name), err)]
|
||||||
pub(crate) async fn create_view_from_params(&self, params: CreateViewParams) -> Result<View, FlowyError> {
|
pub(crate) async fn create_view_from_params(&self, params: CreateViewParams) -> Result<View, FlowyError> {
|
||||||
let view_data = if params.view_data.is_empty() {
|
let view_data = if params.ext.is_empty() {
|
||||||
initial_delta_string()
|
initial_delta_string()
|
||||||
} else {
|
} else {
|
||||||
params.view_data.clone()
|
params.ext.clone()
|
||||||
};
|
};
|
||||||
|
|
||||||
let delta_data = Bytes::from(view_data);
|
let delta_data = Bytes::from(view_data);
|
||||||
let user_id = self.user.user_id()?;
|
let user_id = self.user.user_id()?;
|
||||||
let repeated_revision: RepeatedRevision =
|
let repeated_revision: RepeatedRevision =
|
||||||
Revision::initial_revision(&user_id, ¶ms.view_id, delta_data).into();
|
Revision::initial_revision(&user_id, ¶ms.view_id, delta_data).into();
|
||||||
let _ = self
|
let _ = self.create_view(¶ms.view_id, repeated_revision).await?;
|
||||||
.block_manager
|
|
||||||
.reset_with_revisions(¶ms.view_id, repeated_revision)
|
|
||||||
.await?;
|
|
||||||
let view = self.create_view_on_server(params).await?;
|
let view = self.create_view_on_server(params).await?;
|
||||||
let _ = self.create_view_on_local(view.clone()).await?;
|
let _ = self.create_view_on_local(view.clone()).await?;
|
||||||
|
|
||||||
Ok(view)
|
Ok(view)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "debug", skip(self, view_id, view_data), err)]
|
#[tracing::instrument(level = "debug", skip(self, view_id, view_type, repeated_revision), err)]
|
||||||
pub(crate) async fn create_view_document_content(
|
pub(crate) async fn create_view(
|
||||||
&self,
|
&self,
|
||||||
view_id: &str,
|
view_id: &str,
|
||||||
view_data: String,
|
repeated_revision: RepeatedRevision,
|
||||||
|
view_type: ViewType,
|
||||||
) -> Result<(), FlowyError> {
|
) -> Result<(), FlowyError> {
|
||||||
if view_data.is_empty() {
|
if repeated_revision.is_empty() {
|
||||||
return Err(FlowyError::internal().context("The content of the view should not be empty"));
|
return Err(FlowyError::internal().context("The content of the view should not be empty"));
|
||||||
}
|
}
|
||||||
|
let _ = self.block_manager.create_block(view_id, repeated_revision).await?;
|
||||||
let delta_data = Bytes::from(view_data);
|
|
||||||
let user_id = self.user.user_id()?;
|
|
||||||
let repeated_revision: RepeatedRevision = Revision::initial_revision(&user_id, view_id, delta_data).into();
|
|
||||||
let _ = self
|
|
||||||
.block_manager
|
|
||||||
.reset_with_revisions(view_id, repeated_revision)
|
|
||||||
.await?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +176,7 @@ impl ViewController {
|
||||||
desc: view.desc.clone(),
|
desc: view.desc.clone(),
|
||||||
thumbnail: "".to_owned(),
|
thumbnail: "".to_owned(),
|
||||||
view_type: view.view_type.clone(),
|
view_type: view.view_type.clone(),
|
||||||
view_data: document_json,
|
ext: document_json,
|
||||||
view_id: uuid_string(),
|
view_id: uuid_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -68,14 +68,7 @@ impl FolderTest {
|
||||||
let _ = sdk.init_user().await;
|
let _ = sdk.init_user().await;
|
||||||
let mut workspace = create_workspace(&sdk, "FolderWorkspace", "Folder test workspace").await;
|
let mut workspace = create_workspace(&sdk, "FolderWorkspace", "Folder test workspace").await;
|
||||||
let mut app = create_app(&sdk, &workspace.id, "Folder App", "Folder test app").await;
|
let mut app = create_app(&sdk, &workspace.id, "Folder App", "Folder test app").await;
|
||||||
let view = create_view(
|
let view = create_view(&sdk, &app.id, "Folder View", "Folder test view", ViewType::RichText).await;
|
||||||
&sdk,
|
|
||||||
&app.id,
|
|
||||||
"Folder View",
|
|
||||||
"Folder test view",
|
|
||||||
ViewType::QuillDocument,
|
|
||||||
)
|
|
||||||
.await;
|
|
||||||
app.belongings = RepeatedView {
|
app.belongings = RepeatedView {
|
||||||
items: vec![view.clone()],
|
items: vec![view.clone()],
|
||||||
};
|
};
|
||||||
|
@ -153,7 +146,7 @@ impl FolderTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
FolderScript::CreateView { name, desc } => {
|
FolderScript::CreateView { name, desc } => {
|
||||||
let view = create_view(sdk, &self.app.id, &name, &desc, ViewType::QuillDocument).await;
|
let view = create_view(sdk, &self.app.id, &name, &desc, ViewType::RichText).await;
|
||||||
self.view = view;
|
self.view = view;
|
||||||
}
|
}
|
||||||
FolderScript::AssertView(view) => {
|
FolderScript::AssertView(view) => {
|
||||||
|
|
|
@ -88,7 +88,7 @@ async fn create_view(sdk: &FlowySDKTest, app_id: &str) -> View {
|
||||||
name: "View A".to_string(),
|
name: "View A".to_string(),
|
||||||
desc: "".to_string(),
|
desc: "".to_string(),
|
||||||
thumbnail: Some("http://1.png".to_string()),
|
thumbnail: Some("http://1.png".to_string()),
|
||||||
view_type: ViewType::QuillDocument,
|
view_type: ViewType::RichText,
|
||||||
};
|
};
|
||||||
|
|
||||||
let view = FolderEventBuilder::new(sdk.clone())
|
let view = FolderEventBuilder::new(sdk.clone())
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
||||||
impl_def_and_def_mut,
|
impl_def_and_def_mut,
|
||||||
parser::{
|
parser::{
|
||||||
app::AppIdentify,
|
app::AppIdentify,
|
||||||
view::{ViewDesc, ViewIdentify, ViewName, ViewThumbnail},
|
view::{ViewDesc, ViewExtensionData, ViewIdentify, ViewName, ViewThumbnail},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||||
|
@ -66,26 +66,24 @@ impl std::convert::From<View> for Trash {
|
||||||
|
|
||||||
#[derive(Eq, PartialEq, Debug, ProtoBuf_Enum, Clone, Serialize)]
|
#[derive(Eq, PartialEq, Debug, ProtoBuf_Enum, Clone, Serialize)]
|
||||||
pub enum ViewType {
|
pub enum ViewType {
|
||||||
Blank = 0,
|
RichText = 0,
|
||||||
QuillDocument = 1,
|
PlainText = 1,
|
||||||
Kanban = 2,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::default::Default for ViewType {
|
impl std::default::Default for ViewType {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
ViewType::QuillDocument
|
ViewType::PlainText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::convert::From<i32> for ViewType {
|
impl std::convert::From<i32> for ViewType {
|
||||||
fn from(val: i32) -> Self {
|
fn from(val: i32) -> Self {
|
||||||
match val {
|
match val {
|
||||||
0 => ViewType::Blank,
|
0 => ViewType::RichText,
|
||||||
1 => ViewType::QuillDocument,
|
1 => ViewType::PlainText,
|
||||||
2 => ViewType::Kanban,
|
|
||||||
_ => {
|
_ => {
|
||||||
log::error!("Invalid view type: {}", val);
|
log::error!("Invalid view type: {}", val);
|
||||||
ViewType::Blank
|
ViewType::PlainText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,6 +105,9 @@ pub struct CreateViewPayload {
|
||||||
|
|
||||||
#[pb(index = 5)]
|
#[pb(index = 5)]
|
||||||
pub view_type: ViewType,
|
pub view_type: ViewType,
|
||||||
|
|
||||||
|
#[pb(index = 6)]
|
||||||
|
pub ext: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, ProtoBuf, Debug, Clone)]
|
#[derive(Default, ProtoBuf, Debug, Clone)]
|
||||||
|
@ -126,9 +127,8 @@ pub struct CreateViewParams {
|
||||||
#[pb(index = 5)]
|
#[pb(index = 5)]
|
||||||
pub view_type: ViewType,
|
pub view_type: ViewType,
|
||||||
|
|
||||||
// ViewType::Doc -> Delta string
|
|
||||||
#[pb(index = 6)]
|
#[pb(index = 6)]
|
||||||
pub view_data: String,
|
pub ext: String,
|
||||||
|
|
||||||
#[pb(index = 7)]
|
#[pb(index = 7)]
|
||||||
pub view_id: String,
|
pub view_id: String,
|
||||||
|
@ -141,7 +141,7 @@ impl CreateViewParams {
|
||||||
desc: String,
|
desc: String,
|
||||||
view_type: ViewType,
|
view_type: ViewType,
|
||||||
thumbnail: String,
|
thumbnail: String,
|
||||||
view_data: String,
|
ext: String,
|
||||||
view_id: String,
|
view_id: String,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
@ -150,7 +150,7 @@ impl CreateViewParams {
|
||||||
desc,
|
desc,
|
||||||
thumbnail,
|
thumbnail,
|
||||||
view_type,
|
view_type,
|
||||||
view_data,
|
ext,
|
||||||
view_id,
|
view_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,8 @@ impl TryInto<CreateViewParams> for CreateViewPayload {
|
||||||
fn try_into(self) -> Result<CreateViewParams, Self::Error> {
|
fn try_into(self) -> Result<CreateViewParams, Self::Error> {
|
||||||
let name = ViewName::parse(self.name)?.0;
|
let name = ViewName::parse(self.name)?.0;
|
||||||
let belong_to_id = AppIdentify::parse(self.belong_to_id)?.0;
|
let belong_to_id = AppIdentify::parse(self.belong_to_id)?.0;
|
||||||
let view_data = "".to_string();
|
|
||||||
let view_id = uuid::Uuid::new_v4().to_string();
|
let view_id = uuid::Uuid::new_v4().to_string();
|
||||||
|
let ext = ViewExtensionData::parse(self.ext)?.0;
|
||||||
let thumbnail = match self.thumbnail {
|
let thumbnail = match self.thumbnail {
|
||||||
None => "".to_string(),
|
None => "".to_string(),
|
||||||
Some(thumbnail) => ViewThumbnail::parse(thumbnail)?.0,
|
Some(thumbnail) => ViewThumbnail::parse(thumbnail)?.0,
|
||||||
|
@ -175,7 +175,7 @@ impl TryInto<CreateViewParams> for CreateViewPayload {
|
||||||
self.desc,
|
self.desc,
|
||||||
self.view_type,
|
self.view_type,
|
||||||
thumbnail,
|
thumbnail,
|
||||||
view_data,
|
ext,
|
||||||
view_id,
|
view_id,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -290,32 +290,27 @@ impl<'de> Deserialize<'de> for ViewType {
|
||||||
impl<'de> Visitor<'de> for ViewTypeVisitor {
|
impl<'de> Visitor<'de> for ViewTypeVisitor {
|
||||||
type Value = ViewType;
|
type Value = ViewType;
|
||||||
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
formatter.write_str("QuillDocument, Kanban, Blank")
|
formatter.write_str("Plugin, RichText")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
|
fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
|
||||||
where
|
where
|
||||||
E: de::Error,
|
E: de::Error,
|
||||||
{
|
{
|
||||||
let mut view_type = None;
|
let view_type;
|
||||||
match s {
|
match s {
|
||||||
"Doc" => {
|
"Doc" | "RichText" => {
|
||||||
view_type = Some(ViewType::QuillDocument);
|
// Rename ViewType::Doc to ViewType::RichText, So we need to migrate the ViewType manually.
|
||||||
|
view_type = ViewType::RichText;
|
||||||
}
|
}
|
||||||
"QuillDocument" => {
|
"Plugin" => {
|
||||||
view_type = Some(ViewType::QuillDocument);
|
view_type = ViewType::PlainText;
|
||||||
}
|
|
||||||
"Kanban" => {
|
|
||||||
view_type = Some(ViewType::Kanban);
|
|
||||||
}
|
|
||||||
"Blank" => {
|
|
||||||
view_type = Some(ViewType::Blank);
|
|
||||||
}
|
}
|
||||||
unknown => {
|
unknown => {
|
||||||
return Err(de::Error::invalid_value(Unexpected::Str(unknown), &self));
|
return Err(de::Error::invalid_value(Unexpected::Str(unknown), &self));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(view_type.unwrap())
|
Ok(view_type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
deserializer.deserialize_any(ViewTypeVisitor())
|
deserializer.deserialize_any(ViewTypeVisitor())
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
mod delta_data;
|
mod delta_data;
|
||||||
mod view_desc;
|
mod view_desc;
|
||||||
|
mod view_ext;
|
||||||
mod view_id;
|
mod view_id;
|
||||||
mod view_name;
|
mod view_name;
|
||||||
mod view_thumbnail;
|
mod view_thumbnail;
|
||||||
|
|
||||||
pub use delta_data::*;
|
pub use delta_data::*;
|
||||||
pub use view_desc::*;
|
pub use view_desc::*;
|
||||||
|
pub use view_ext::*;
|
||||||
pub use view_id::*;
|
pub use view_id::*;
|
||||||
pub use view_name::*;
|
pub use view_name::*;
|
||||||
pub use view_thumbnail::*;
|
pub use view_thumbnail::*;
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
use crate::errors::ErrorCode;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct ViewExtensionData(pub String);
|
||||||
|
|
||||||
|
impl ViewExtensionData {
|
||||||
|
pub fn parse(s: String) -> Result<ViewExtensionData, ErrorCode> {
|
||||||
|
Ok(Self(s))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AsRef<str> for ViewExtensionData {
|
||||||
|
fn as_ref(&self) -> &str {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
|
@ -162,7 +162,7 @@ impl View {
|
||||||
self.view_type
|
self.view_type
|
||||||
}
|
}
|
||||||
pub fn clear_view_type(&mut self) {
|
pub fn clear_view_type(&mut self) {
|
||||||
self.view_type = ViewType::Blank;
|
self.view_type = ViewType::RichText;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Param is passed by value, moved
|
// Param is passed by value, moved
|
||||||
|
@ -326,7 +326,7 @@ impl ::protobuf::Message for View {
|
||||||
if !self.desc.is_empty() {
|
if !self.desc.is_empty() {
|
||||||
my_size += ::protobuf::rt::string_size(4, &self.desc);
|
my_size += ::protobuf::rt::string_size(4, &self.desc);
|
||||||
}
|
}
|
||||||
if self.view_type != ViewType::Blank {
|
if self.view_type != ViewType::RichText {
|
||||||
my_size += ::protobuf::rt::enum_size(5, self.view_type);
|
my_size += ::protobuf::rt::enum_size(5, self.view_type);
|
||||||
}
|
}
|
||||||
if self.version != 0 {
|
if self.version != 0 {
|
||||||
|
@ -360,7 +360,7 @@ impl ::protobuf::Message for View {
|
||||||
if !self.desc.is_empty() {
|
if !self.desc.is_empty() {
|
||||||
os.write_string(4, &self.desc)?;
|
os.write_string(4, &self.desc)?;
|
||||||
}
|
}
|
||||||
if self.view_type != ViewType::Blank {
|
if self.view_type != ViewType::RichText {
|
||||||
os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
|
os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
|
||||||
}
|
}
|
||||||
if self.version != 0 {
|
if self.version != 0 {
|
||||||
|
@ -480,7 +480,7 @@ impl ::protobuf::Clear for View {
|
||||||
self.belong_to_id.clear();
|
self.belong_to_id.clear();
|
||||||
self.name.clear();
|
self.name.clear();
|
||||||
self.desc.clear();
|
self.desc.clear();
|
||||||
self.view_type = ViewType::Blank;
|
self.view_type = ViewType::RichText;
|
||||||
self.version = 0;
|
self.version = 0;
|
||||||
self.belongings.clear();
|
self.belongings.clear();
|
||||||
self.modified_time = 0;
|
self.modified_time = 0;
|
||||||
|
@ -674,6 +674,7 @@ pub struct CreateViewPayload {
|
||||||
pub name: ::std::string::String,
|
pub name: ::std::string::String,
|
||||||
pub desc: ::std::string::String,
|
pub desc: ::std::string::String,
|
||||||
pub view_type: ViewType,
|
pub view_type: ViewType,
|
||||||
|
pub ext: ::std::string::String,
|
||||||
// message oneof groups
|
// message oneof groups
|
||||||
pub one_of_thumbnail: ::std::option::Option<CreateViewPayload_oneof_one_of_thumbnail>,
|
pub one_of_thumbnail: ::std::option::Option<CreateViewPayload_oneof_one_of_thumbnail>,
|
||||||
// special fields
|
// special fields
|
||||||
|
@ -831,13 +832,39 @@ impl CreateViewPayload {
|
||||||
self.view_type
|
self.view_type
|
||||||
}
|
}
|
||||||
pub fn clear_view_type(&mut self) {
|
pub fn clear_view_type(&mut self) {
|
||||||
self.view_type = ViewType::Blank;
|
self.view_type = ViewType::RichText;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Param is passed by value, moved
|
// Param is passed by value, moved
|
||||||
pub fn set_view_type(&mut self, v: ViewType) {
|
pub fn set_view_type(&mut self, v: ViewType) {
|
||||||
self.view_type = v;
|
self.view_type = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// string ext = 6;
|
||||||
|
|
||||||
|
|
||||||
|
pub fn get_ext(&self) -> &str {
|
||||||
|
&self.ext
|
||||||
|
}
|
||||||
|
pub fn clear_ext(&mut self) {
|
||||||
|
self.ext.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Param is passed by value, moved
|
||||||
|
pub fn set_ext(&mut self, v: ::std::string::String) {
|
||||||
|
self.ext = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mutable pointer to the field.
|
||||||
|
// If field is not initialized, it is initialized with default value first.
|
||||||
|
pub fn mut_ext(&mut self) -> &mut ::std::string::String {
|
||||||
|
&mut self.ext
|
||||||
|
}
|
||||||
|
|
||||||
|
// Take field
|
||||||
|
pub fn take_ext(&mut self) -> ::std::string::String {
|
||||||
|
::std::mem::replace(&mut self.ext, ::std::string::String::new())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::protobuf::Message for CreateViewPayload {
|
impl ::protobuf::Message for CreateViewPayload {
|
||||||
|
@ -867,6 +894,9 @@ impl ::protobuf::Message for CreateViewPayload {
|
||||||
5 => {
|
5 => {
|
||||||
::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.view_type, 5, &mut self.unknown_fields)?
|
::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.view_type, 5, &mut self.unknown_fields)?
|
||||||
},
|
},
|
||||||
|
6 => {
|
||||||
|
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.ext)?;
|
||||||
|
},
|
||||||
_ => {
|
_ => {
|
||||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||||
},
|
},
|
||||||
|
@ -888,9 +918,12 @@ impl ::protobuf::Message for CreateViewPayload {
|
||||||
if !self.desc.is_empty() {
|
if !self.desc.is_empty() {
|
||||||
my_size += ::protobuf::rt::string_size(3, &self.desc);
|
my_size += ::protobuf::rt::string_size(3, &self.desc);
|
||||||
}
|
}
|
||||||
if self.view_type != ViewType::Blank {
|
if self.view_type != ViewType::RichText {
|
||||||
my_size += ::protobuf::rt::enum_size(5, self.view_type);
|
my_size += ::protobuf::rt::enum_size(5, self.view_type);
|
||||||
}
|
}
|
||||||
|
if !self.ext.is_empty() {
|
||||||
|
my_size += ::protobuf::rt::string_size(6, &self.ext);
|
||||||
|
}
|
||||||
if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
|
if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
|
||||||
match v {
|
match v {
|
||||||
&CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
|
&CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
|
||||||
|
@ -913,9 +946,12 @@ impl ::protobuf::Message for CreateViewPayload {
|
||||||
if !self.desc.is_empty() {
|
if !self.desc.is_empty() {
|
||||||
os.write_string(3, &self.desc)?;
|
os.write_string(3, &self.desc)?;
|
||||||
}
|
}
|
||||||
if self.view_type != ViewType::Blank {
|
if self.view_type != ViewType::RichText {
|
||||||
os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
|
os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
|
||||||
}
|
}
|
||||||
|
if !self.ext.is_empty() {
|
||||||
|
os.write_string(6, &self.ext)?;
|
||||||
|
}
|
||||||
if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
|
if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
|
||||||
match v {
|
match v {
|
||||||
&CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
|
&CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
|
||||||
|
@ -986,6 +1022,11 @@ impl ::protobuf::Message for CreateViewPayload {
|
||||||
|m: &CreateViewPayload| { &m.view_type },
|
|m: &CreateViewPayload| { &m.view_type },
|
||||||
|m: &mut CreateViewPayload| { &mut m.view_type },
|
|m: &mut CreateViewPayload| { &mut m.view_type },
|
||||||
));
|
));
|
||||||
|
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||||
|
"ext",
|
||||||
|
|m: &CreateViewPayload| { &m.ext },
|
||||||
|
|m: &mut CreateViewPayload| { &mut m.ext },
|
||||||
|
));
|
||||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewPayload>(
|
::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewPayload>(
|
||||||
"CreateViewPayload",
|
"CreateViewPayload",
|
||||||
fields,
|
fields,
|
||||||
|
@ -1006,7 +1047,8 @@ impl ::protobuf::Clear for CreateViewPayload {
|
||||||
self.name.clear();
|
self.name.clear();
|
||||||
self.desc.clear();
|
self.desc.clear();
|
||||||
self.one_of_thumbnail = ::std::option::Option::None;
|
self.one_of_thumbnail = ::std::option::Option::None;
|
||||||
self.view_type = ViewType::Blank;
|
self.view_type = ViewType::RichText;
|
||||||
|
self.ext.clear();
|
||||||
self.unknown_fields.clear();
|
self.unknown_fields.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1031,7 +1073,7 @@ pub struct CreateViewParams {
|
||||||
pub desc: ::std::string::String,
|
pub desc: ::std::string::String,
|
||||||
pub thumbnail: ::std::string::String,
|
pub thumbnail: ::std::string::String,
|
||||||
pub view_type: ViewType,
|
pub view_type: ViewType,
|
||||||
pub view_data: ::std::string::String,
|
pub ext: ::std::string::String,
|
||||||
pub view_id: ::std::string::String,
|
pub view_id: ::std::string::String,
|
||||||
// special fields
|
// special fields
|
||||||
pub unknown_fields: ::protobuf::UnknownFields,
|
pub unknown_fields: ::protobuf::UnknownFields,
|
||||||
|
@ -1160,7 +1202,7 @@ impl CreateViewParams {
|
||||||
self.view_type
|
self.view_type
|
||||||
}
|
}
|
||||||
pub fn clear_view_type(&mut self) {
|
pub fn clear_view_type(&mut self) {
|
||||||
self.view_type = ViewType::Blank;
|
self.view_type = ViewType::RichText;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Param is passed by value, moved
|
// Param is passed by value, moved
|
||||||
|
@ -1168,30 +1210,30 @@ impl CreateViewParams {
|
||||||
self.view_type = v;
|
self.view_type = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
// string view_data = 6;
|
// string ext = 6;
|
||||||
|
|
||||||
|
|
||||||
pub fn get_view_data(&self) -> &str {
|
pub fn get_ext(&self) -> &str {
|
||||||
&self.view_data
|
&self.ext
|
||||||
}
|
}
|
||||||
pub fn clear_view_data(&mut self) {
|
pub fn clear_ext(&mut self) {
|
||||||
self.view_data.clear();
|
self.ext.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Param is passed by value, moved
|
// Param is passed by value, moved
|
||||||
pub fn set_view_data(&mut self, v: ::std::string::String) {
|
pub fn set_ext(&mut self, v: ::std::string::String) {
|
||||||
self.view_data = v;
|
self.ext = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mutable pointer to the field.
|
// Mutable pointer to the field.
|
||||||
// If field is not initialized, it is initialized with default value first.
|
// If field is not initialized, it is initialized with default value first.
|
||||||
pub fn mut_view_data(&mut self) -> &mut ::std::string::String {
|
pub fn mut_ext(&mut self) -> &mut ::std::string::String {
|
||||||
&mut self.view_data
|
&mut self.ext
|
||||||
}
|
}
|
||||||
|
|
||||||
// Take field
|
// Take field
|
||||||
pub fn take_view_data(&mut self) -> ::std::string::String {
|
pub fn take_ext(&mut self) -> ::std::string::String {
|
||||||
::std::mem::replace(&mut self.view_data, ::std::string::String::new())
|
::std::mem::replace(&mut self.ext, ::std::string::String::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
// string view_id = 7;
|
// string view_id = 7;
|
||||||
|
@ -1246,7 +1288,7 @@ impl ::protobuf::Message for CreateViewParams {
|
||||||
::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.view_type, 5, &mut self.unknown_fields)?
|
::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.view_type, 5, &mut self.unknown_fields)?
|
||||||
},
|
},
|
||||||
6 => {
|
6 => {
|
||||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_data)?;
|
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.ext)?;
|
||||||
},
|
},
|
||||||
7 => {
|
7 => {
|
||||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
|
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
|
||||||
|
@ -1275,11 +1317,11 @@ impl ::protobuf::Message for CreateViewParams {
|
||||||
if !self.thumbnail.is_empty() {
|
if !self.thumbnail.is_empty() {
|
||||||
my_size += ::protobuf::rt::string_size(4, &self.thumbnail);
|
my_size += ::protobuf::rt::string_size(4, &self.thumbnail);
|
||||||
}
|
}
|
||||||
if self.view_type != ViewType::Blank {
|
if self.view_type != ViewType::RichText {
|
||||||
my_size += ::protobuf::rt::enum_size(5, self.view_type);
|
my_size += ::protobuf::rt::enum_size(5, self.view_type);
|
||||||
}
|
}
|
||||||
if !self.view_data.is_empty() {
|
if !self.ext.is_empty() {
|
||||||
my_size += ::protobuf::rt::string_size(6, &self.view_data);
|
my_size += ::protobuf::rt::string_size(6, &self.ext);
|
||||||
}
|
}
|
||||||
if !self.view_id.is_empty() {
|
if !self.view_id.is_empty() {
|
||||||
my_size += ::protobuf::rt::string_size(7, &self.view_id);
|
my_size += ::protobuf::rt::string_size(7, &self.view_id);
|
||||||
|
@ -1302,11 +1344,11 @@ impl ::protobuf::Message for CreateViewParams {
|
||||||
if !self.thumbnail.is_empty() {
|
if !self.thumbnail.is_empty() {
|
||||||
os.write_string(4, &self.thumbnail)?;
|
os.write_string(4, &self.thumbnail)?;
|
||||||
}
|
}
|
||||||
if self.view_type != ViewType::Blank {
|
if self.view_type != ViewType::RichText {
|
||||||
os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
|
os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
|
||||||
}
|
}
|
||||||
if !self.view_data.is_empty() {
|
if !self.ext.is_empty() {
|
||||||
os.write_string(6, &self.view_data)?;
|
os.write_string(6, &self.ext)?;
|
||||||
}
|
}
|
||||||
if !self.view_id.is_empty() {
|
if !self.view_id.is_empty() {
|
||||||
os.write_string(7, &self.view_id)?;
|
os.write_string(7, &self.view_id)?;
|
||||||
|
@ -1375,9 +1417,9 @@ impl ::protobuf::Message for CreateViewParams {
|
||||||
|m: &mut CreateViewParams| { &mut m.view_type },
|
|m: &mut CreateViewParams| { &mut m.view_type },
|
||||||
));
|
));
|
||||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||||
"view_data",
|
"ext",
|
||||||
|m: &CreateViewParams| { &m.view_data },
|
|m: &CreateViewParams| { &m.ext },
|
||||||
|m: &mut CreateViewParams| { &mut m.view_data },
|
|m: &mut CreateViewParams| { &mut m.ext },
|
||||||
));
|
));
|
||||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||||
"view_id",
|
"view_id",
|
||||||
|
@ -1404,8 +1446,8 @@ impl ::protobuf::Clear for CreateViewParams {
|
||||||
self.name.clear();
|
self.name.clear();
|
||||||
self.desc.clear();
|
self.desc.clear();
|
||||||
self.thumbnail.clear();
|
self.thumbnail.clear();
|
||||||
self.view_type = ViewType::Blank;
|
self.view_type = ViewType::RichText;
|
||||||
self.view_data.clear();
|
self.ext.clear();
|
||||||
self.view_id.clear();
|
self.view_id.clear();
|
||||||
self.unknown_fields.clear();
|
self.unknown_fields.clear();
|
||||||
}
|
}
|
||||||
|
@ -2548,9 +2590,8 @@ impl ::protobuf::reflect::ProtobufValue for UpdateViewParams {
|
||||||
|
|
||||||
#[derive(Clone,PartialEq,Eq,Debug,Hash)]
|
#[derive(Clone,PartialEq,Eq,Debug,Hash)]
|
||||||
pub enum ViewType {
|
pub enum ViewType {
|
||||||
Blank = 0,
|
RichText = 0,
|
||||||
QuillDocument = 1,
|
PlainText = 1,
|
||||||
Kanban = 2,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::protobuf::ProtobufEnum for ViewType {
|
impl ::protobuf::ProtobufEnum for ViewType {
|
||||||
|
@ -2560,18 +2601,16 @@ impl ::protobuf::ProtobufEnum for ViewType {
|
||||||
|
|
||||||
fn from_i32(value: i32) -> ::std::option::Option<ViewType> {
|
fn from_i32(value: i32) -> ::std::option::Option<ViewType> {
|
||||||
match value {
|
match value {
|
||||||
0 => ::std::option::Option::Some(ViewType::Blank),
|
0 => ::std::option::Option::Some(ViewType::RichText),
|
||||||
1 => ::std::option::Option::Some(ViewType::QuillDocument),
|
1 => ::std::option::Option::Some(ViewType::PlainText),
|
||||||
2 => ::std::option::Option::Some(ViewType::Kanban),
|
|
||||||
_ => ::std::option::Option::None
|
_ => ::std::option::Option::None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn values() -> &'static [Self] {
|
fn values() -> &'static [Self] {
|
||||||
static values: &'static [ViewType] = &[
|
static values: &'static [ViewType] = &[
|
||||||
ViewType::Blank,
|
ViewType::RichText,
|
||||||
ViewType::QuillDocument,
|
ViewType::PlainText,
|
||||||
ViewType::Kanban,
|
|
||||||
];
|
];
|
||||||
values
|
values
|
||||||
}
|
}
|
||||||
|
@ -2589,7 +2628,7 @@ impl ::std::marker::Copy for ViewType {
|
||||||
|
|
||||||
impl ::std::default::Default for ViewType {
|
impl ::std::default::Default for ViewType {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
ViewType::Blank
|
ViewType::RichText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2608,29 +2647,29 @@ static file_descriptor_proto_data: &'static [u8] = b"\
|
||||||
gings\x18\x07\x20\x01(\x0b2\r.RepeatedViewR\nbelongings\x12#\n\rmodified\
|
gings\x18\x07\x20\x01(\x0b2\r.RepeatedViewR\nbelongings\x12#\n\rmodified\
|
||||||
_time\x18\x08\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_time\x18\
|
_time\x18\x08\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_time\x18\
|
||||||
\t\x20\x01(\x03R\ncreateTime\"+\n\x0cRepeatedView\x12\x1b\n\x05items\x18\
|
\t\x20\x01(\x03R\ncreateTime\"+\n\x0cRepeatedView\x12\x1b\n\x05items\x18\
|
||||||
\x01\x20\x03(\x0b2\x05.ViewR\x05items\"\xb9\x01\n\x11CreateViewPayload\
|
\x01\x20\x03(\x0b2\x05.ViewR\x05items\"\xcb\x01\n\x11CreateViewPayload\
|
||||||
\x12\x20\n\x0cbelong_to_id\x18\x01\x20\x01(\tR\nbelongToId\x12\x12\n\x04\
|
\x12\x20\n\x0cbelong_to_id\x18\x01\x20\x01(\tR\nbelongToId\x12\x12\n\x04\
|
||||||
name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\
|
name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\
|
||||||
\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\0R\tthumbnail\x12&\n\t\
|
\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\0R\tthumbnail\x12&\n\t\
|
||||||
view_type\x18\x05\x20\x01(\x0e2\t.ViewTypeR\x08viewTypeB\x12\n\x10one_of\
|
view_type\x18\x05\x20\x01(\x0e2\t.ViewTypeR\x08viewType\x12\x10\n\x03ext\
|
||||||
_thumbnail\"\xd8\x01\n\x10CreateViewParams\x12\x20\n\x0cbelong_to_id\x18\
|
\x18\x06\x20\x01(\tR\x03extB\x12\n\x10one_of_thumbnail\"\xcd\x01\n\x10Cr\
|
||||||
\x01\x20\x01(\tR\nbelongToId\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04na\
|
eateViewParams\x12\x20\n\x0cbelong_to_id\x18\x01\x20\x01(\tR\nbelongToId\
|
||||||
me\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12\x1c\n\tthumbnail\
|
\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x03\
|
||||||
\x18\x04\x20\x01(\tR\tthumbnail\x12&\n\tview_type\x18\x05\x20\x01(\x0e2\
|
\x20\x01(\tR\x04desc\x12\x1c\n\tthumbnail\x18\x04\x20\x01(\tR\tthumbnail\
|
||||||
\t.ViewTypeR\x08viewType\x12\x1b\n\tview_data\x18\x06\x20\x01(\tR\x08vie\
|
\x12&\n\tview_type\x18\x05\x20\x01(\x0e2\t.ViewTypeR\x08viewType\x12\x10\
|
||||||
wData\x12\x17\n\x07view_id\x18\x07\x20\x01(\tR\x06viewId\"\x1e\n\x06View\
|
\n\x03ext\x18\x06\x20\x01(\tR\x03ext\x12\x17\n\x07view_id\x18\x07\x20\
|
||||||
Id\x12\x14\n\x05value\x18\x01\x20\x01(\tR\x05value\"&\n\x0eRepeatedViewI\
|
\x01(\tR\x06viewId\"\x1e\n\x06ViewId\x12\x14\n\x05value\x18\x01\x20\x01(\
|
||||||
d\x12\x14\n\x05items\x18\x01\x20\x03(\tR\x05items\"\xaa\x01\n\x11UpdateV\
|
\tR\x05value\"&\n\x0eRepeatedViewId\x12\x14\n\x05items\x18\x01\x20\x03(\
|
||||||
iewPayload\x12\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewId\x12\x14\n\
|
\tR\x05items\"\xaa\x01\n\x11UpdateViewPayload\x12\x17\n\x07view_id\x18\
|
||||||
\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x14\n\x04desc\x18\x03\x20\
|
\x01\x20\x01(\tR\x06viewId\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04n\
|
||||||
\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\x02R\tthu\
|
ame\x12\x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbn\
|
||||||
mbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\x12\n\x10one_of_thumbnai\
|
ail\x18\x04\x20\x01(\tH\x02R\tthumbnailB\r\n\x0bone_of_nameB\r\n\x0bone_\
|
||||||
l\"\xa9\x01\n\x10UpdateViewParams\x12\x17\n\x07view_id\x18\x01\x20\x01(\
|
of_descB\x12\n\x10one_of_thumbnail\"\xa9\x01\n\x10UpdateViewParams\x12\
|
||||||
\tR\x06viewId\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x14\n\
|
\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewId\x12\x14\n\x04name\x18\
|
||||||
\x04desc\x18\x03\x20\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\x04\
|
\x02\x20\x01(\tH\0R\x04name\x12\x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\
|
||||||
\x20\x01(\tH\x02R\tthumbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\
|
\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\x02R\tthumbnailB\r\n\
|
||||||
\x12\n\x10one_of_thumbnail*4\n\x08ViewType\x12\t\n\x05Blank\x10\0\x12\
|
\x0bone_of_nameB\r\n\x0bone_of_descB\x12\n\x10one_of_thumbnail*'\n\x08Vi\
|
||||||
\x11\n\rQuillDocument\x10\x01\x12\n\n\x06Kanban\x10\x02b\x06proto3\
|
ewType\x12\x0c\n\x08RichText\x10\0\x12\r\n\tPlainText\x10\x01b\x06proto3\
|
||||||
";
|
";
|
||||||
|
|
||||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||||
|
|
|
@ -20,6 +20,7 @@ message CreateViewPayload {
|
||||||
string desc = 3;
|
string desc = 3;
|
||||||
oneof one_of_thumbnail { string thumbnail = 4; };
|
oneof one_of_thumbnail { string thumbnail = 4; };
|
||||||
ViewType view_type = 5;
|
ViewType view_type = 5;
|
||||||
|
string ext = 6;
|
||||||
}
|
}
|
||||||
message CreateViewParams {
|
message CreateViewParams {
|
||||||
string belong_to_id = 1;
|
string belong_to_id = 1;
|
||||||
|
@ -27,7 +28,7 @@ message CreateViewParams {
|
||||||
string desc = 3;
|
string desc = 3;
|
||||||
string thumbnail = 4;
|
string thumbnail = 4;
|
||||||
ViewType view_type = 5;
|
ViewType view_type = 5;
|
||||||
string view_data = 6;
|
string ext = 6;
|
||||||
string view_id = 7;
|
string view_id = 7;
|
||||||
}
|
}
|
||||||
message ViewId {
|
message ViewId {
|
||||||
|
@ -49,7 +50,6 @@ message UpdateViewParams {
|
||||||
oneof one_of_thumbnail { string thumbnail = 4; };
|
oneof one_of_thumbnail { string thumbnail = 4; };
|
||||||
}
|
}
|
||||||
enum ViewType {
|
enum ViewType {
|
||||||
Blank = 0;
|
RichText = 0;
|
||||||
QuillDocument = 1;
|
PlainText = 1;
|
||||||
Kanban = 2;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ fn create_default_view(app_id: String, time: chrono::DateTime<Utc>) -> View {
|
||||||
let view_id = uuid::Uuid::new_v4();
|
let view_id = uuid::Uuid::new_v4();
|
||||||
let name = "Read me".to_string();
|
let name = "Read me".to_string();
|
||||||
let desc = "".to_string();
|
let desc = "".to_string();
|
||||||
let view_type = ViewType::QuillDocument;
|
let view_type = ViewType::RichText;
|
||||||
|
|
||||||
View {
|
View {
|
||||||
id: view_id.to_string(),
|
id: view_id.to_string(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue