mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-10 18:57:02 +02:00
Tasks (#175)
* tasks * task input * fixed jazz things * create new task ui * feat: simple feature flag --------- Co-authored-by: marshennikovaolga <marshennikova@gmail.com> Co-authored-by: Aslam H <iupin5212@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import { CoMap, co, Account, Profile } from "jazz-tools"
|
||||
import { PersonalPageLists } from "./personal-page"
|
||||
import { PersonalLinkLists } from "./personal-link"
|
||||
import { ListOfTopics } from "./master/topic"
|
||||
import { ListOfTasks } from "./tasks"
|
||||
|
||||
declare module "jazz-tools" {
|
||||
interface Profile {
|
||||
@@ -32,6 +33,8 @@ export class UserRoot extends CoMap {
|
||||
topicsWantToLearn = co.ref(ListOfTopics)
|
||||
topicsLearning = co.ref(ListOfTopics)
|
||||
topicsLearned = co.ref(ListOfTopics)
|
||||
|
||||
tasks = co.ref(ListOfTasks)
|
||||
}
|
||||
|
||||
export class LaAccount extends Account {
|
||||
@@ -59,7 +62,9 @@ export class LaAccount extends Account {
|
||||
|
||||
topicsWantToLearn: ListOfTopics.create([], { owner: this }),
|
||||
topicsLearning: ListOfTopics.create([], { owner: this }),
|
||||
topicsLearned: ListOfTopics.create([], { owner: this })
|
||||
topicsLearned: ListOfTopics.create([], { owner: this }),
|
||||
|
||||
tasks: ListOfTasks.create([], { owner: this })
|
||||
},
|
||||
{ owner: this }
|
||||
)
|
||||
|
||||
12
web/lib/schema/tasks.ts
Normal file
12
web/lib/schema/tasks.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { co, CoList, CoMap, Encoders } from "jazz-tools"
|
||||
|
||||
export class Task extends CoMap {
|
||||
title = co.string
|
||||
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)
|
||||
}
|
||||
|
||||
export class ListOfTasks extends CoList.Of(co.ref(Task)) {}
|
||||
Reference in New Issue
Block a user