diff --git a/Cargo.lock b/Cargo.lock index dcbec97b3..79cfc2641 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2240,7 +2240,7 @@ dependencies = [ [[package]] name = "collab" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5" dependencies = [ "anyhow", "arc-swap", @@ -2265,7 +2265,7 @@ dependencies = [ [[package]] name = "collab-database" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5" dependencies = [ "anyhow", "async-trait", @@ -2304,7 +2304,7 @@ dependencies = [ [[package]] name = "collab-document" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5" dependencies = [ "anyhow", "arc-swap", @@ -2325,7 +2325,7 @@ dependencies = [ [[package]] name = "collab-entity" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5" dependencies = [ "anyhow", "bytes", @@ -2345,7 +2345,7 @@ dependencies = [ [[package]] name = "collab-folder" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5" dependencies = [ "anyhow", "arc-swap", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "collab-importer" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5" dependencies = [ "anyhow", "async-recursion", @@ -2470,7 +2470,7 @@ dependencies = [ [[package]] name = "collab-user" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5" dependencies = [ "anyhow", "collab", diff --git a/Cargo.toml b/Cargo.toml index 174388103..6d3ff641a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -305,13 +305,13 @@ debug = true [patch.crates-io] # It's diffcult to resovle different version with the same crate used in AppFlowy Frontend and the Client-API crate. # So using patch to workaround this issue. -collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" } -collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" } -collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" } -collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" } -collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" } -collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" } -collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" } +collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" } +collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" } +collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" } +collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" } +collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" } +collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" } +collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" } [features] history = [] diff --git a/libs/workspace-template/src/hierarchy_builder.rs b/libs/workspace-template/src/hierarchy_builder.rs index 78bda25cc..e71366f7f 100644 --- a/libs/workspace-template/src/hierarchy_builder.rs +++ b/libs/workspace-template/src/hierarchy_builder.rs @@ -44,7 +44,6 @@ pub struct ViewBuilder { parent_view_id: String, view_id: String, name: String, - desc: String, layout: ViewLayout, child_views: Vec, is_favorite: bool, @@ -59,7 +58,6 @@ impl ViewBuilder { parent_view_id, view_id: gen_view_id().to_string(), name: Default::default(), - desc: Default::default(), layout: ViewLayout::Document, child_views: vec![], is_favorite: false, @@ -87,11 +85,6 @@ impl ViewBuilder { self } - pub fn with_desc(mut self, desc: &str) -> Self { - self.desc = desc.to_string(); - self - } - pub fn with_icon(mut self, icon: &str) -> Self { self.icon = Some(ViewIcon { ty: IconType::Emoji, @@ -122,7 +115,6 @@ impl ViewBuilder { id: self.view_id, parent_view_id: self.parent_view_id, name: self.name, - desc: self.desc, created_at: timestamp(), is_favorite: self.is_favorite, layout: self.layout, diff --git a/src/biz/workspace/page_view.rs b/src/biz/workspace/page_view.rs index cd181e24a..063fad8b9 100644 --- a/src/biz/workspace/page_view.rs +++ b/src/biz/workspace/page_view.rs @@ -165,8 +165,12 @@ async fn get_page_collab_data_for_database( ), ) })?; - let db_body = DatabaseBody::from_collab(&db_collab, Arc::new(NoPersistenceDatabaseCollabService)) - .ok_or_else(|| AppError::RecordNotFound("no database body found".to_string()))?; + let db_body = DatabaseBody::from_collab( + &db_collab, + Arc::new(NoPersistenceDatabaseCollabService), + None, + ) + .ok_or_else(|| AppError::RecordNotFound("no database body found".to_string()))?; let inline_view_id = { let txn = db_collab.transact(); db_body.get_inline_view_id(&txn) diff --git a/src/biz/workspace/publish_dup.rs b/src/biz/workspace/publish_dup.rs index 0d973a0d0..025b41320 100644 --- a/src/biz/workspace/publish_dup.rs +++ b/src/biz/workspace/publish_dup.rs @@ -726,9 +726,12 @@ impl PublishCollabDuplicator { ) -> Result<(String, String, bool), AppError> { // collab of database let mut db_collab = collab_from_doc_state(published_db.database_collab.clone(), "")?; - let db_body = - DatabaseBody::from_collab(&db_collab, Arc::new(NoPersistenceDatabaseCollabService)) - .ok_or_else(|| AppError::RecordNotFound("no database body found".to_string()))?; + let db_body = DatabaseBody::from_collab( + &db_collab, + Arc::new(NoPersistenceDatabaseCollabService), + None, + ) + .ok_or_else(|| AppError::RecordNotFound("no database body found".to_string()))?; let pub_db_id = db_body.get_database_id(&db_collab.context.transact()); // check if the database is already duplicated @@ -1115,7 +1118,6 @@ impl PublishCollabDuplicator { id: new_view_id, parent_view_id: "".to_string(), // to be filled by caller name: view_info.name.clone(), - desc: "".to_string(), // unable to get from metadata children: RepeatedViewIdentifier { items: vec![] }, // fill in while iterating children created_at: self.ts_now, is_favorite: false, diff --git a/tests/workspace/publish.rs b/tests/workspace/publish.rs index 7c0c4e844..9b3ffed7e 100644 --- a/tests/workspace/publish.rs +++ b/tests/workspace/publish.rs @@ -1313,6 +1313,7 @@ async fn duplicate_to_workspace_db_with_relation() { let rel_col_db_body = DatabaseBody::from_collab( &db_with_rel_col_collab, Arc::new(NoPersistenceDatabaseCollabService), + None, ) .unwrap(); let txn = db_with_rel_col_collab.transact(); @@ -1387,9 +1388,12 @@ async fn duplicate_to_workspace_db_row_with_doc() { .get_db_collab_from_view(&workspace_id_2, &db_with_row_doc.view_id) .await; - let db_body = - DatabaseBody::from_collab(&db_collab, Arc::new(NoPersistenceDatabaseCollabService)) - .unwrap(); + let db_body = DatabaseBody::from_collab( + &db_collab, + Arc::new(NoPersistenceDatabaseCollabService), + None, + ) + .unwrap(); // check that doc exists and can be fetched let first_row_id = &db_body.views.get_all_views(&db_collab.transact())[0].row_orders[0].id; @@ -1472,6 +1476,7 @@ async fn duplicate_to_workspace_db_rel_self() { let db_rel_self_body = DatabaseBody::from_collab( &db_rel_self_collab, Arc::new(NoPersistenceDatabaseCollabService), + None, ) .unwrap(); let database_id = db_rel_self_body.get_database_id(&txn);