1
- use crate :: {
2
- Config , ConfigAI , ConfigGeneral , ConfigNotification , ExtensionMapping , ExtensionWidget ,
3
- ExtensionWidgetKind ,
4
- } ;
1
+ use crate :: { Config , ConfigAI , ConfigGeneral , ConfigNotification } ;
5
2
6
3
use super :: {
7
4
Calendar , ChatGroup , ChatMessage , ChatMessageRole , Event , Human , Organization , Platform ,
8
5
Session , Tag , UserDatabase ,
9
6
} ;
10
7
11
- const EDITOR_BASICS_MD : & str = include_str ! ( "../assets/editor-basics.md" ) ;
12
- const KEYBOARD_SHORTCUTS_MD : & str = include_str ! ( "../assets/keyboard-shortcuts.md" ) ;
13
8
const ONBOARDING_RAW_HTML : & str = include_str ! ( "../assets/onboarding-raw.html" ) ;
14
9
const THANK_YOU_MD : & str = include_str ! ( "../assets/thank-you.md" ) ;
15
10
@@ -42,12 +37,6 @@ pub async fn onboarding(db: &UserDatabase, user_id: impl Into<String>) -> Result
42
37
linkedin_username : Some ( "yujong1ee" . to_string ( ) ) ,
43
38
} ;
44
39
45
- let onboarding_org = Organization {
46
- id : uuid:: Uuid :: new_v4 ( ) . to_string ( ) ,
47
- name : "Dunder Mifflin" . to_string ( ) ,
48
- description : None ,
49
- } ;
50
-
51
40
let default_calendar = Calendar {
52
41
id : uuid:: Uuid :: new_v4 ( ) . to_string ( ) ,
53
42
user_id : user_id. clone ( ) ,
@@ -85,32 +74,6 @@ pub async fn onboarding(db: &UserDatabase, user_id: impl Into<String>) -> Result
85
74
words : vec ! [ ] ,
86
75
} ;
87
76
88
- let keyboard_shortcuts_session = Session {
89
- id : uuid:: Uuid :: new_v4 ( ) . to_string ( ) ,
90
- user_id : user_id. clone ( ) ,
91
- title : "Keyboard Shortcuts" . to_string ( ) ,
92
- created_at : chrono:: Utc :: now ( ) ,
93
- visited_at : chrono:: Utc :: now ( ) ,
94
- calendar_event_id : None ,
95
- raw_memo_html : hypr_buffer:: opinionated_md_to_html ( KEYBOARD_SHORTCUTS_MD ) . unwrap ( ) ,
96
- enhanced_memo_html : None ,
97
- conversations : vec ! [ ] ,
98
- words : vec ! [ ] ,
99
- } ;
100
-
101
- let editor_basics_session = Session {
102
- id : uuid:: Uuid :: new_v4 ( ) . to_string ( ) ,
103
- user_id : user_id. clone ( ) ,
104
- title : "Editor Basics" . to_string ( ) ,
105
- created_at : chrono:: Utc :: now ( ) ,
106
- visited_at : chrono:: Utc :: now ( ) ,
107
- calendar_event_id : None ,
108
- raw_memo_html : hypr_buffer:: opinionated_md_to_html ( EDITOR_BASICS_MD ) . unwrap ( ) ,
109
- enhanced_memo_html : None ,
110
- conversations : vec ! [ ] ,
111
- words : vec ! [ ] ,
112
- } ;
113
-
114
77
let onboarding_session = Session {
115
78
id : onboarding_session_id,
116
79
user_id : user_id. clone ( ) ,
@@ -127,16 +90,11 @@ pub async fn onboarding(db: &UserDatabase, user_id: impl Into<String>) -> Result
127
90
let _ = db. upsert_calendar ( default_calendar) . await ?;
128
91
let _ = db. upsert_event ( onboarding_event) . await ?;
129
92
130
- for session in [
131
- & thank_you_session,
132
- & keyboard_shortcuts_session,
133
- & editor_basics_session,
134
- & onboarding_session,
135
- ] {
93
+ for session in [ & thank_you_session, & onboarding_session] {
136
94
let _ = db. upsert_session ( session. clone ( ) ) . await ?;
137
95
}
138
96
139
- for org in [ onboarding_org , fastrepl_org] {
97
+ for org in [ fastrepl_org] {
140
98
let _ = db. upsert_organization ( org) . await ?;
141
99
}
142
100
@@ -145,30 +103,13 @@ pub async fn onboarding(db: &UserDatabase, user_id: impl Into<String>) -> Result
145
103
}
146
104
147
105
for participant in [ & fastrepl_john, & fastrepl_yujong] {
148
- db. session_add_participant ( & editor_basics_session. id , & participant. id )
149
- . await ?;
150
- db. session_add_participant ( & keyboard_shortcuts_session. id , & participant. id )
151
- . await ?;
152
106
db. session_add_participant ( & thank_you_session. id , & participant. id )
153
107
. await ?;
154
108
}
155
109
156
110
db. session_add_participant ( & onboarding_session. id , & fastrepl_john. id )
157
111
. await ?;
158
112
159
- db. upsert_extension_mapping ( ExtensionMapping {
160
- id : uuid:: Uuid :: new_v4 ( ) . to_string ( ) ,
161
- user_id : user_id. clone ( ) ,
162
- extension_id : "@hypr/extension-transcript" . to_string ( ) ,
163
- config : serde_json:: Value :: from ( r#"{}"# ) ,
164
- widgets : vec ! [ ExtensionWidget {
165
- kind: ExtensionWidgetKind :: TwoByTwo ,
166
- group: "transcript-default" . to_string( ) ,
167
- position: None ,
168
- } ] ,
169
- } )
170
- . await ?;
171
-
172
113
db. set_config ( Config {
173
114
id : uuid:: Uuid :: new_v4 ( ) . to_string ( ) ,
174
115
user_id : user_id. clone ( ) ,
0 commit comments