mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
* start * . * seeding connections * . * wip * wip: learning state * wip: notes section * wip: many * topics * chore: update schema * update package * update sidebar * update page section * feat: profile * fix: remove z index * fix: wrong type * add avatar * add avatar * wip * . * store page section key * remove atom page section * fix rerender * fix rerender * fix rerender * fix rerender * fix link * search light/dark mode * bubble menu ui * . * fix: remove unecessary code * chore: mark as old for old schema * chore: adapt new schema * fix: add topic schema but null for now * fix: add icon on personal link * fix: list item * fix: set url fetched when editing * fix: remove image * feat: add icon to link * feat: custom url zod validation * fix: metadata test * chore: update utils * fix: link * fix: url fetcher * . * . * fix: add link, section * chore: seeder * . * . * . * . * fix: change checkbox to learning state * fix: click outside editing form * feat: constant * chore: move to master folder * chore: adapt new schema * chore: cli for new schema * fix: new schema for dev seed * fix: seeding * update package * chore: forcegraph seed * bottombar * if isEdit delete icon * showCreate X button * . * options * chore: implement topic from public global group * chore: update learning state * fix: change implementation for outside click * chore: implement new form param * chore: update env example * feat: link form refs exception * new page button layout, link topic search fixed * chore: enable topic * chore: update seed * profile * chore: move framer motion package from root to web and add nuqs * chore: add LearningStateValue * chore: implement active state * profile * chore: use fancy switch and update const * feat: filter implementation * dropdown menu * . * sidebar topics * topic selected color * feat: topic detail * fix: collapsible page * pages - sorted by, layout, visible mode * . * . * . * topic status sidebar * topic button and count * fix: topic * page delete/topic buttons * search ui * selected topic for page * selected topic status sidebar * removed footer * update package * . --------- Co-authored-by: Nikita <github@nikiv.dev> Co-authored-by: marshennikovaolga <marshennikova@gmail.com> Co-authored-by: Kisuyo <ig.intr3st@gmail.com>
70 lines
2.8 KiB
TypeScript
70 lines
2.8 KiB
TypeScript
// Jazz schema for LA
|
||
// if field does not have `co.optional` it is required
|
||
// rule: list all required fields first, then optional fields
|
||
// rule: any field that is generated by AI, should be prefixed with `ai`, e.g. `aiSummary`
|
||
// TODO: move more fields from old edgedb schema to jazz (where it makes sense): https://github.com/learn-anything/explore/blob/main/archive/api/edgedb/dbschema/default-latest.esdl
|
||
// TODO: all instances of (unique) should be enforced by jazz itself, it means that only one instance with that name of field can exist
|
||
// sadly jazz does not allow enforcing that, so solutions for (unique) fields is: ignore duplicates or create a supporting look up structure (CoMap.Record from url to GlobalLink) and then I’ll let you know once the better way exists
|
||
// open issue about it: https://github.com/gardencmp/jazz/issues/44
|
||
// TODO: figure out how to do default values, e.g. `GlobalLink.protocol` should have default value `https` so we don't have to supply it every time in code..
|
||
// TODO: can jazz support vector fields? e.g. `GlobalLinkAiSummary.vectorContent`, would be nice to store website content as vector for semantic search
|
||
import { CoMap, co, Account, Profile } from "jazz-tools"
|
||
import { PersonalPageLists } from "./personal-page"
|
||
import { PersonalLinkLists } from "./personal-link"
|
||
import { ListOfTopics } from "./master/topic"
|
||
|
||
export class UserRoot extends CoMap {
|
||
name = co.string
|
||
username = co.string
|
||
avatar = co.optional.string
|
||
website = co.optional.string
|
||
bio = co.optional.string
|
||
is_public = co.optional.boolean
|
||
|
||
personalLinks = co.ref(PersonalLinkLists)
|
||
personalPages = co.ref(PersonalPageLists)
|
||
|
||
// not implemented yet
|
||
topicsWantToLearn = co.ref(ListOfTopics)
|
||
topicsLearning = co.ref(ListOfTopics)
|
||
topicsLearned = co.ref(ListOfTopics)
|
||
}
|
||
|
||
export class LaAccount extends Account {
|
||
profile = co.ref(Profile)
|
||
root = co.ref(UserRoot)
|
||
|
||
migrate(this: LaAccount, creationProps?: { name: string }) {
|
||
// since we dont have a custom AuthProvider yet.
|
||
// and still using the DemoAuth. the creationProps will only accept name.
|
||
// so just do default profile create provided by jazz-tools
|
||
super.migrate(creationProps)
|
||
|
||
if (!this._refs.root && creationProps) {
|
||
this.root = UserRoot.create(
|
||
{
|
||
name: creationProps.name,
|
||
username: creationProps.name,
|
||
avatar: "",
|
||
website: "",
|
||
bio: "",
|
||
is_public: false,
|
||
|
||
personalLinks: PersonalLinkLists.create([], { owner: this }),
|
||
personalPages: PersonalPageLists.create([], { owner: this }),
|
||
|
||
// not implemented yet
|
||
topicsWantToLearn: ListOfTopics.create([], { owner: this }),
|
||
topicsLearning: ListOfTopics.create([], { owner: this }),
|
||
topicsLearned: ListOfTopics.create([], { owner: this })
|
||
},
|
||
{ owner: this }
|
||
)
|
||
}
|
||
}
|
||
}
|
||
|
||
export * from "./master/topic"
|
||
export * from "./personal-link"
|
||
export * from "./personal-page"
|