chore: add sub data type

This commit is contained in:
appflowy
2022-08-10 17:59:28 +08:00
parent 2b745bc41a
commit ad3e2f5725
29 changed files with 243 additions and 166 deletions

View File

@ -25,7 +25,7 @@ pub struct ViewTest {
impl ViewTest {
#[allow(dead_code)]
pub async fn new(sdk: &FlowySDKTest, data_type: ViewDataType, data: Vec<u8>) -> Self {
pub async fn new(sdk: &FlowySDKTest, data_type: ViewDataTypePB, data: Vec<u8>) -> Self {
let workspace = create_workspace(sdk, "Workspace", "").await;
open_workspace(sdk, &workspace.id).await;
let app = create_app(sdk, "App", "AppFlowy GitHub Project", &workspace.id).await;
@ -39,11 +39,11 @@ impl ViewTest {
}
pub async fn new_grid_view(sdk: &FlowySDKTest, data: Vec<u8>) -> Self {
Self::new(sdk, ViewDataType::Grid, data).await
Self::new(sdk, ViewDataTypePB::Database, data).await
}
pub async fn new_text_block_view(sdk: &FlowySDKTest) -> Self {
Self::new(sdk, ViewDataType::TextBlock, vec![]).await
Self::new(sdk, ViewDataTypePB::TextBlock, vec![]).await
}
}
@ -90,7 +90,7 @@ async fn create_app(sdk: &FlowySDKTest, name: &str, desc: &str, workspace_id: &s
app
}
async fn create_view(sdk: &FlowySDKTest, app_id: &str, data_type: ViewDataType, data: Vec<u8>) -> ViewPB {
async fn create_view(sdk: &FlowySDKTest, app_id: &str, data_type: ViewDataTypePB, data: Vec<u8>) -> ViewPB {
let request = CreateViewPayloadPB {
belong_to_id: app_id.to_string(),
name: "View A".to_string(),