From 011a969a539de564c503a20f3ec5a4f10513d9d3 Mon Sep 17 00:00:00 2001 From: alt0 Date: Mon, 15 Aug 2022 17:17:49 +0800 Subject: [PATCH 1/2] fix: update get-started template --- apps/ligo-virgo/src/pages/workspace/Home.tsx | 6 +- .../templates/get-started-group1.json | 186 ++-------------- .../templates/get-started-group2.json | 200 ++++++++++++++++++ .../templates/template-factory.ts | 5 +- 4 files changed, 230 insertions(+), 167 deletions(-) create mode 100644 libs/datasource/db-service/src/services/editor-block/templates/get-started-group2.json diff --git a/apps/ligo-virgo/src/pages/workspace/Home.tsx b/apps/ligo-virgo/src/pages/workspace/Home.tsx index aa7f62cd4f..31de316209 100644 --- a/apps/ligo-virgo/src/pages/workspace/Home.tsx +++ b/apps/ligo-virgo/src/pages/workspace/Home.tsx @@ -23,7 +23,11 @@ export function WorkspaceHome() { user_initial_page_id, TemplateFactory.generatePageTemplateByGroupKeys({ name: '👋 Get Started with AFFINE', - groupKeys: ['getStartedGroup0', 'getStartedGroup1'], + groupKeys: [ + 'getStartedGroup0', + 'getStartedGroup1', + 'getStartedGroup2', + ], }) ); } diff --git a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json index b98c0e2fcb..6098cfbc8c 100644 --- a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json +++ b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json @@ -1,83 +1,14 @@ { "type": "group", - "properties": { - "recastCurrentViewId": "vwjI_O0J2CEsHyMW", - "metaProps": [ - { - "id": "bNjVwBq8YLxvmvr7", - "name": "Status#GVsG", - "type": "status", - "options": [ - { - "id": "wusZ8Qht8rsmFD1s", - "name": "No Started", - "color": "#AF1212", - "background": "#FFCECE", - "iconName": "status" - }, - { - "id": "qLJFK5bqYhW8NLtQ", - "name": "In Progress", - "color": "#896406", - "background": "#FFF5AB", - "iconName": "status" - }, - { - "id": "u0ZgY0sRCnqMkxzn", - "name": "Complete", - "color": "#05683D", - "background": "#C5FBE0", - "iconName": "status" - } - ] - }, - { - "id": "DfVMd-EXXO9-WZTO", - "type": "date", - "name": "Date#0neY", - "background": "#6880FF", - "color": "#fff", - "iconName": "date" - }, - { - "id": "UgQQiv9D-72nRyYy", - "type": "mention", - "name": "Mention#Recx", - "background": "#FFD568", - "color": "#FFFFFF", - "iconName": "collaborator" - }, - { - "id": "ICT1AlKCQkwYLjGs", - "type": "text", - "name": "Text#uObM", - "background": "#67dcaa", - "color": "#FFF", - "iconName": "text" - } - ], - "recastViews": [ - { - "id": "qJslh-HAKnf8gGV-", - "name": "Text", - "type": "page" - }, - { - "id": "vwjI_O0J2CEsHyMW", - "name": "Kanban", - "type": "kanban", - "groupBy": "bNjVwBq8YLxvmvr7" - } - ] - }, + "properties": {}, "blocks": [ { - "type": "text", + "type": "heading1", "properties": { "text": { "value": [ { - "text": "You can customize a Kanban to fit your workflow. Such as by adding/removing columns or changing Tag App labels." + "text": "Want to save changes?" } ] }, @@ -85,116 +16,41 @@ }, "blocks": [] }, - { - "type": "text", - "properties": { - "text": { - "value": [{ "text": "Add a Due Date to set a reminder" }] - }, - "recastValues": { - "bNjVwBq8YLxvmvr7": { - "id": "bNjVwBq8YLxvmvr7", - "type": "status", - "value": "wusZ8Qht8rsmFD1s" - }, - "DfVMd-EXXO9-WZTO": { - "id": "DfVMd-EXXO9-WZTO", - "type": "date", - "value": 1660233600000 - } - }, - "textStyle": {} - }, - "blocks": [] - }, - { - "type": "text", - "properties": { - "text": { - "value": [{ "text": "Type @ to mention people" }] - }, - "recastValues": { - "bNjVwBq8YLxvmvr7": { - "id": "bNjVwBq8YLxvmvr7", - "type": "status", - "value": "wusZ8Qht8rsmFD1s" - }, - "UgQQiv9D-72nRyYy": { - "id": "UgQQiv9D-72nRyYy", - "type": "mention", - "value": "AFFiNE" - } - }, - "textStyle": {} - }, - "blocks": [] - }, { "type": "todo", "properties": { "text": { "value": [ { - "text": "Check the box to complete the task!" + "text": "Your data is always stored locally first, and only stored where you want it." } ] - }, - "recastValues": { - "bNjVwBq8YLxvmvr7": { - "id": "bNjVwBq8YLxvmvr7", - "type": "status", - "value": "qLJFK5bqYhW8NLtQ" - } - }, - "textStyle": {}, - "collapsed": { "value": false } - }, - "blocks": [ - { - "type": "todo", - "properties": { - "text": { "value": [{ "text": "Check 01" }] }, - "textStyle": {}, - "collapsed": { "value": false }, - "checked": { "value": true } - }, - "blocks": [] - }, - { - "type": "todo", - "properties": { - "text": { "value": [{ "text": "Check 02" }] }, - "textStyle": {} - }, - "blocks": [] } - ] + } }, { - "type": "text", + "type": "todo", "properties": { "text": { "value": [ { - "text": "The GroupBy button allows you to customise how you want your data grouped just utilize your preferred Tag App settings" + "text": "So if you want to make changes, you can open a local folder via SYNC TO DISK (you should find the link at the top-right of the page). " } ] - }, - "recastValues": { - "bNjVwBq8YLxvmvr7": { - "id": "bNjVwBq8YLxvmvr7", - "type": "status", - "value": "u0ZgY0sRCnqMkxzn" - }, - "ICT1AlKCQkwYLjGs": { - "id": "ICT1AlKCQkwYLjGs", - "type": "text", - "value": "GroupBy others" - } - }, - "textStyle": {} - }, - "blocks": [] + } + } + }, + { + "type": "todo", + "properties": { + "text": { + "value": [ + { + "text": "Once you have opened a local folder any changes you make will be saved and stored locally on your device only." + } + ] + } + } } ] } diff --git a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group2.json b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group2.json new file mode 100644 index 0000000000..b98c0e2fcb --- /dev/null +++ b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group2.json @@ -0,0 +1,200 @@ +{ + "type": "group", + "properties": { + "recastCurrentViewId": "vwjI_O0J2CEsHyMW", + "metaProps": [ + { + "id": "bNjVwBq8YLxvmvr7", + "name": "Status#GVsG", + "type": "status", + "options": [ + { + "id": "wusZ8Qht8rsmFD1s", + "name": "No Started", + "color": "#AF1212", + "background": "#FFCECE", + "iconName": "status" + }, + { + "id": "qLJFK5bqYhW8NLtQ", + "name": "In Progress", + "color": "#896406", + "background": "#FFF5AB", + "iconName": "status" + }, + { + "id": "u0ZgY0sRCnqMkxzn", + "name": "Complete", + "color": "#05683D", + "background": "#C5FBE0", + "iconName": "status" + } + ] + }, + { + "id": "DfVMd-EXXO9-WZTO", + "type": "date", + "name": "Date#0neY", + "background": "#6880FF", + "color": "#fff", + "iconName": "date" + }, + { + "id": "UgQQiv9D-72nRyYy", + "type": "mention", + "name": "Mention#Recx", + "background": "#FFD568", + "color": "#FFFFFF", + "iconName": "collaborator" + }, + { + "id": "ICT1AlKCQkwYLjGs", + "type": "text", + "name": "Text#uObM", + "background": "#67dcaa", + "color": "#FFF", + "iconName": "text" + } + ], + "recastViews": [ + { + "id": "qJslh-HAKnf8gGV-", + "name": "Text", + "type": "page" + }, + { + "id": "vwjI_O0J2CEsHyMW", + "name": "Kanban", + "type": "kanban", + "groupBy": "bNjVwBq8YLxvmvr7" + } + ] + }, + "blocks": [ + { + "type": "text", + "properties": { + "text": { + "value": [ + { + "text": "You can customize a Kanban to fit your workflow. Such as by adding/removing columns or changing Tag App labels." + } + ] + }, + "textStyle": {} + }, + "blocks": [] + }, + { + "type": "text", + "properties": { + "text": { + "value": [{ "text": "Add a Due Date to set a reminder" }] + }, + "recastValues": { + "bNjVwBq8YLxvmvr7": { + "id": "bNjVwBq8YLxvmvr7", + "type": "status", + "value": "wusZ8Qht8rsmFD1s" + }, + "DfVMd-EXXO9-WZTO": { + "id": "DfVMd-EXXO9-WZTO", + "type": "date", + "value": 1660233600000 + } + }, + "textStyle": {} + }, + "blocks": [] + }, + { + "type": "text", + "properties": { + "text": { + "value": [{ "text": "Type @ to mention people" }] + }, + "recastValues": { + "bNjVwBq8YLxvmvr7": { + "id": "bNjVwBq8YLxvmvr7", + "type": "status", + "value": "wusZ8Qht8rsmFD1s" + }, + "UgQQiv9D-72nRyYy": { + "id": "UgQQiv9D-72nRyYy", + "type": "mention", + "value": "AFFiNE" + } + }, + "textStyle": {} + }, + "blocks": [] + }, + { + "type": "todo", + "properties": { + "text": { + "value": [ + { + "text": "Check the box to complete the task!" + } + ] + }, + "recastValues": { + "bNjVwBq8YLxvmvr7": { + "id": "bNjVwBq8YLxvmvr7", + "type": "status", + "value": "qLJFK5bqYhW8NLtQ" + } + }, + "textStyle": {}, + "collapsed": { "value": false } + }, + "blocks": [ + { + "type": "todo", + "properties": { + "text": { "value": [{ "text": "Check 01" }] }, + "textStyle": {}, + "collapsed": { "value": false }, + "checked": { "value": true } + }, + "blocks": [] + }, + { + "type": "todo", + "properties": { + "text": { "value": [{ "text": "Check 02" }] }, + "textStyle": {} + }, + "blocks": [] + } + ] + }, + { + "type": "text", + "properties": { + "text": { + "value": [ + { + "text": "The GroupBy button allows you to customise how you want your data grouped just utilize your preferred Tag App settings" + } + ] + }, + "recastValues": { + "bNjVwBq8YLxvmvr7": { + "id": "bNjVwBq8YLxvmvr7", + "type": "status", + "value": "u0ZgY0sRCnqMkxzn" + }, + "ICT1AlKCQkwYLjGs": { + "id": "ICT1AlKCQkwYLjGs", + "type": "text", + "value": "GroupBy others" + } + }, + "textStyle": {} + }, + "blocks": [] + } + ] +} diff --git a/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts b/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts index 9acbaf17ed..6c8d5a5643 100644 --- a/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts +++ b/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts @@ -2,6 +2,7 @@ import blogTemplate from './blog.json'; import emptyTemplate from './empty.json'; import getStartedGroup0 from './get-started-group0.json'; import getStartedGroup1 from './get-started-group1.json'; +import getStartedGroup2 from './get-started-group2.json'; import gridTemplate from './grid.json'; import todoTemplate from './todo.json'; import { Template, TemplateMeta } from './types'; @@ -12,7 +13,8 @@ export type GroupTemplateKeys = | 'empty' | 'grid' | 'getStartedGroup0' - | 'getStartedGroup1'; + | 'getStartedGroup1' + | 'getStartedGroup2'; type GroupTemplateMap = Record; const groupTemplateMap = { empty: emptyTemplate, @@ -21,6 +23,7 @@ const groupTemplateMap = { grid: gridTemplate, getStartedGroup0, getStartedGroup1, + getStartedGroup2, } as GroupTemplateMap; const defaultTemplateList: Array = [ From 95424fa11476f35b2ee0e9686c0a847620df17cf Mon Sep 17 00:00:00 2001 From: alt0 Date: Mon, 15 Aug 2022 17:27:53 +0800 Subject: [PATCH 2/2] fix: update get-started template(automatically) --- .../src/services/editor-block/templates/get-started-group1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json index 6098cfbc8c..354f85eb46 100644 --- a/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json +++ b/libs/datasource/db-service/src/services/editor-block/templates/get-started-group1.json @@ -46,7 +46,7 @@ "text": { "value": [ { - "text": "Once you have opened a local folder any changes you make will be saved and stored locally on your device only." + "text": "Once you have opened a local folder any changes you make will be saved automatically and stored locally on your device only." } ] }