mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-20 15:31:30 +02:00
Q & A + journal (#174)
* tasks * task input * community route * added thread and list for community QA * answers thread * journal sidebar section * journal calendar * fix: stuff * fix: stuff * fix: stuff * chore: disable comunitty toggle * fix: typo import header --------- Co-authored-by: marshennikovaolga <marshennikova@gmail.com> Co-authored-by: Aslam H <iupin5212@gmail.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import { PersonalPageLists } from "./personal-page"
|
||||
import { PersonalLinkLists } from "./personal-link"
|
||||
import { ListOfTopics } from "./master/topic"
|
||||
import { ListOfTasks } from "./tasks"
|
||||
import { JournalEntryLists } from "./journal"
|
||||
|
||||
declare module "jazz-tools" {
|
||||
interface Profile {
|
||||
@@ -35,6 +36,7 @@ export class UserRoot extends CoMap {
|
||||
topicsLearned = co.ref(ListOfTopics)
|
||||
|
||||
tasks = co.ref(ListOfTasks)
|
||||
journalEntries = co.ref(JournalEntryLists)
|
||||
}
|
||||
|
||||
export class LaAccount extends Account {
|
||||
@@ -64,7 +66,8 @@ export class LaAccount extends Account {
|
||||
topicsLearning: ListOfTopics.create([], { owner: this }),
|
||||
topicsLearned: ListOfTopics.create([], { owner: this }),
|
||||
|
||||
tasks: ListOfTasks.create([], { owner: this })
|
||||
tasks: ListOfTasks.create([], { owner: this }),
|
||||
journalEntries: JournalEntryLists.create([], { owner: this })
|
||||
},
|
||||
{ owner: this }
|
||||
)
|
||||
|
||||
11
web/lib/schema/journal.ts
Normal file
11
web/lib/schema/journal.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { co, CoList, CoMap, Encoders } from "jazz-tools"
|
||||
|
||||
export class JournalEntry extends CoMap {
|
||||
title = co.string
|
||||
content = co.json()
|
||||
date = co.encoded(Encoders.Date)
|
||||
createdAt = co.encoded(Encoders.Date)
|
||||
updatedAt = co.encoded(Encoders.Date)
|
||||
}
|
||||
|
||||
export class JournalEntryLists extends CoList.Of(co.ref(JournalEntry)) {}
|
||||
@@ -5,8 +5,7 @@ export class Task extends CoMap {
|
||||
description = co.optional.string
|
||||
status = co.literal("todo", "in_progress", "done")
|
||||
createdAt = co.encoded(Encoders.Date)
|
||||
// updatedAt = co.encoded(Encoders.Date)
|
||||
completedAt = co.optional.encoded(Encoders.Date)
|
||||
updatedAt = co.encoded(Encoders.Date)
|
||||
}
|
||||
|
||||
export class ListOfTasks extends CoList.Of(co.ref(Task)) {}
|
||||
|
||||
@@ -46,6 +46,14 @@ export function isTextInput(element: Element): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
export function calendarFormatDate(date: Date): string {
|
||||
return date.toLocaleDateString("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric"
|
||||
})
|
||||
}
|
||||
|
||||
export * from "./urls"
|
||||
export * from "./slug"
|
||||
export * from "./keyboard"
|
||||
|
||||
Reference in New Issue
Block a user