mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Integrate appflowy editor (#1040)
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use crate::script::{invalid_workspace_name_test_case, FolderScript::*, FolderTest};
|
||||
use flowy_folder::entities::view::ViewDataTypePB;
|
||||
use flowy_folder::entities::view::ViewDataFormatPB;
|
||||
use flowy_folder::entities::workspace::CreateWorkspacePayloadPB;
|
||||
use flowy_revision::disk::RevisionState;
|
||||
use flowy_test::{event_builder::*, FlowySDKTest};
|
||||
@ -133,12 +133,12 @@ async fn app_create_with_view() {
|
||||
CreateView {
|
||||
name: "View A".to_owned(),
|
||||
desc: "View A description".to_owned(),
|
||||
data_type: ViewDataTypePB::Text,
|
||||
data_type: ViewDataFormatPB::DeltaFormat,
|
||||
},
|
||||
CreateView {
|
||||
name: "Grid".to_owned(),
|
||||
desc: "Grid description".to_owned(),
|
||||
data_type: ViewDataTypePB::Database,
|
||||
data_type: ViewDataFormatPB::DatabaseFormat,
|
||||
},
|
||||
ReadApp(app.id),
|
||||
])
|
||||
@ -197,12 +197,12 @@ async fn view_delete_all() {
|
||||
CreateView {
|
||||
name: "View A".to_owned(),
|
||||
desc: "View A description".to_owned(),
|
||||
data_type: ViewDataTypePB::Text,
|
||||
data_type: ViewDataFormatPB::DeltaFormat,
|
||||
},
|
||||
CreateView {
|
||||
name: "Grid".to_owned(),
|
||||
desc: "Grid description".to_owned(),
|
||||
data_type: ViewDataTypePB::Database,
|
||||
data_type: ViewDataFormatPB::DatabaseFormat,
|
||||
},
|
||||
ReadApp(app.id.clone()),
|
||||
])
|
||||
@ -230,7 +230,7 @@ async fn view_delete_all_permanent() {
|
||||
CreateView {
|
||||
name: "View A".to_owned(),
|
||||
desc: "View A description".to_owned(),
|
||||
data_type: ViewDataTypePB::Text,
|
||||
data_type: ViewDataFormatPB::DeltaFormat,
|
||||
},
|
||||
ReadApp(app.id.clone()),
|
||||
])
|
||||
@ -329,7 +329,7 @@ async fn folder_sync_revision_with_new_view() {
|
||||
CreateView {
|
||||
name: view_name.clone(),
|
||||
desc: view_desc.clone(),
|
||||
data_type: ViewDataTypePB::Text,
|
||||
data_type: ViewDataFormatPB::DeltaFormat,
|
||||
},
|
||||
AssertCurrentRevId(3),
|
||||
AssertNextSyncRevId(Some(3)),
|
||||
|
@ -10,7 +10,7 @@ use flowy_folder::entities::{
|
||||
use flowy_folder::entities::{
|
||||
app::{AppPB, RepeatedAppPB},
|
||||
trash::TrashPB,
|
||||
view::{RepeatedViewPB, ViewDataTypePB, ViewPB},
|
||||
view::{RepeatedViewPB, ViewDataFormatPB, ViewPB},
|
||||
workspace::WorkspacePB,
|
||||
};
|
||||
use flowy_folder::event_map::FolderEvent::*;
|
||||
@ -52,7 +52,7 @@ pub enum FolderScript {
|
||||
CreateView {
|
||||
name: String,
|
||||
desc: String,
|
||||
data_type: ViewDataTypePB,
|
||||
data_type: ViewDataFormatPB,
|
||||
},
|
||||
AssertView(ViewPB),
|
||||
ReadView(String),
|
||||
@ -99,7 +99,7 @@ impl FolderTest {
|
||||
&app.id,
|
||||
"Folder View",
|
||||
"Folder test view",
|
||||
ViewDataTypePB::Text,
|
||||
ViewDataFormatPB::DeltaFormat,
|
||||
ViewLayoutTypePB::Document,
|
||||
)
|
||||
.await;
|
||||
@ -182,8 +182,9 @@ impl FolderTest {
|
||||
|
||||
FolderScript::CreateView { name, desc, data_type } => {
|
||||
let layout = match data_type {
|
||||
ViewDataTypePB::Text => ViewLayoutTypePB::Document,
|
||||
ViewDataTypePB::Database => ViewLayoutTypePB::Grid,
|
||||
ViewDataFormatPB::DeltaFormat => ViewLayoutTypePB::Document,
|
||||
ViewDataFormatPB::TreeFormat => ViewLayoutTypePB::Document,
|
||||
ViewDataFormatPB::DatabaseFormat => ViewLayoutTypePB::Grid,
|
||||
};
|
||||
let view = create_view(sdk, &self.app.id, &name, &desc, data_type, layout).await;
|
||||
self.view = view;
|
||||
@ -357,7 +358,7 @@ pub async fn create_view(
|
||||
app_id: &str,
|
||||
name: &str,
|
||||
desc: &str,
|
||||
data_type: ViewDataTypePB,
|
||||
data_type: ViewDataFormatPB,
|
||||
layout: ViewLayoutTypePB,
|
||||
) -> ViewPB {
|
||||
let request = CreateViewPayloadPB {
|
||||
@ -365,7 +366,7 @@ pub async fn create_view(
|
||||
name: name.to_string(),
|
||||
desc: desc.to_string(),
|
||||
thumbnail: None,
|
||||
data_type,
|
||||
data_format: data_type,
|
||||
layout,
|
||||
view_content_data: vec![],
|
||||
};
|
||||
|
Reference in New Issue
Block a user