From cf1bae3ccbbcd66935f1203803be9f8e93a593f3 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 3 Sep 2024 09:02:27 +0800 Subject: [PATCH] chore: update getting_started icon and remove empty paragraph (#778) * chore: update getting_started icon and remove empty paragraph * fix: get_user_default_workspace test --- libs/workspace-template/assets/mobile_guide.json | 1 - .../workspace-template/src/document/getting_started.rs | 10 +++++----- tests/workspace/default_user_workspace.rs | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/libs/workspace-template/assets/mobile_guide.json b/libs/workspace-template/assets/mobile_guide.json index 8aeff8c0a..e42a4c2c5 100644 --- a/libs/workspace-template/assets/mobile_guide.json +++ b/libs/workspace-template/assets/mobile_guide.json @@ -5,7 +5,6 @@ "type": "heading", "data": { "level": 3, "delta": [{ "insert": "Adding content" }] } }, - { "type": "paragraph", "data": { "delta": [] } }, { "type": "todo_list", "data": { diff --git a/libs/workspace-template/src/document/getting_started.rs b/libs/workspace-template/src/document/getting_started.rs index e368b6465..636f028cb 100644 --- a/libs/workspace-template/src/document/getting_started.rs +++ b/libs/workspace-template/src/document/getting_started.rs @@ -24,7 +24,7 @@ use crate::{gen_view_id, TemplateData, TemplateObjectId, WorkspaceTemplate}; // |-- Getting started (document) // |-- Desktop guide (document) // |-- Mobile guide (document) -// |-- To-Dos (board) +// |-- To-dos (board) // |-- Shared (space) // |-- ... (empty) // Note: Update the folder structure above if you changed the code below @@ -195,7 +195,7 @@ impl GettingStartedTemplate { // getting started view let mut view_builder = view_builder .with_name("Getting started") - .with_icon("⭐️") + .with_icon("🌟") .with_extra(r#"{"font_layout":"normal","line_height_layout":"normal","cover":{"type":"gradient","value":"appflowy_them_color_gradient4"},"font":null}"#) .with_view_id(getting_started_view_uuid); @@ -272,8 +272,8 @@ impl WorkspaceTemplate for GettingStartedTemplate { let mut builder = workspace_view_builder.write().await; - // Create general space with 2 built-in views: Getting started, To-Dos - // The Getting started view is a document view, and the To-Dos view is a board view + // Create general space with 2 built-in views: Getting started, To-dos + // The Getting started view is a document view, and the To-dos view is a board view // The Getting started view contains 2 sub views: Desktop guide, Mobile guide builder .with_view_builder(|view_builder| async { @@ -301,7 +301,7 @@ impl WorkspaceTemplate for GettingStartedTemplate { let child_view_builder = child_view_builder .with_layout(ViewLayout::Board) .with_view_id(todos_view_uuid.clone()) - .with_name("To-Dos") + .with_name("To-dos") .with_icon("✅"); child_view_builder.build() } diff --git a/tests/workspace/default_user_workspace.rs b/tests/workspace/default_user_workspace.rs index 07c7e1ee5..ee4b34c51 100644 --- a/tests/workspace/default_user_workspace.rs +++ b/tests/workspace/default_user_workspace.rs @@ -33,7 +33,7 @@ async fn get_document_collab_from_remote( // |-- Getting started (document) // |-- Desktop guide (document) // |-- Mobile guide (document) -// |-- To-Dos (board) +// |-- To-dos (board) // |-- Shared (space) // |-- ... (empty) #[tokio::test] @@ -75,7 +75,7 @@ async fn get_user_default_workspace_test() { getting_started_view.icon, Some(ViewIcon { ty: IconType::Emoji, - value: "⭐️".to_string() + value: "🌟".to_string() }) ); @@ -121,13 +121,13 @@ async fn get_user_default_workspace_test() { ) .await; let mobile_guide_document_data = mobile_guide_document.get_document_data().unwrap(); - assert_eq!(mobile_guide_document_data.blocks.len(), 34); + assert_eq!(mobile_guide_document_data.blocks.len(), 33); } // the second view is the to-dos board, and contains 0 sub views { let to_dos_view = general_space_views[1].clone(); - assert_eq!(to_dos_view.name, "To-Dos"); + assert_eq!(to_dos_view.name, "To-dos"); assert_eq!(to_dos_view.layout, ViewLayout::Board); assert_eq!( to_dos_view.icon,