diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f8e84ca..62238db 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -13,21 +13,20 @@ datasource db { url = env("DATABASE_URL") } - // START AUTH STUFF + enum UserRole { USER ADMIN } enum ProgramRole { - WRITE + EDITOR ADMIN } enum CourseRole { - READ - WRITE + EDITOR ADMIN } @@ -88,8 +87,8 @@ model VerificationToken { @@id([identifier, token]) } -// END AUTH STUFF +// END AUTH STUFF model Program { id Int @id @default(autoincrement()) @@ -105,7 +104,7 @@ model Program { model ProgramUser { userId String programId Int - role ProgramRole @default(WRITE) + role ProgramRole @default(EDITOR) user User @relation(fields: [userId], references: [id], onDelete: Cascade) program Program @relation(fields: [programId], references: [id], onDelete: Cascade) @@ -117,7 +116,7 @@ model ProgramUser { model CourseUser { userId String courseId Int - role CourseRole @default(READ) + role CourseRole @default(EDITOR) user User @relation(fields: [userId], references: [id], onDelete: Cascade) course Course @relation(fields: [courseId], references: [id], onDelete: Cascade) @@ -155,7 +154,6 @@ model Graph { subjects Subject[] lectures Lecture[] links GraphLink[] - // UI names createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } @@ -163,11 +161,11 @@ model Graph { model Domain { id Int @id @default(autoincrement()) - name String? + name String @default("") x Int @default(0) y Int @default(0) style String? - graph Graph @relation(fields: [graphId], references: [id]) + graph Graph @relation(fields: [graphId], references: [id], onDelete: Cascade) graphId Int subjects Subject[] parentDomains Domain[] @relation("DomainRelation") @@ -177,11 +175,11 @@ model Domain { model Subject { id Int @id @default(autoincrement()) - name String? + name String @default("") x Int @default(0) y Int @default(0) style String? - graph Graph @relation(fields: [graphId], references: [id]) + graph Graph @relation(fields: [graphId], references: [id], onDelete: Cascade) graphId Int domain Domain? @relation(fields: [domainId], references: [id]) domainId Int? @@ -206,9 +204,9 @@ model SubjectLecture { model Lecture { id Int @id @default(autoincrement()) - graph Graph @relation(fields: [graphId], references: [id]) + graph Graph @relation(fields: [graphId], references: [id], onDelete: Cascade) graphId Int - name String? + name String @default("") subjects SubjectLecture[] } @@ -218,7 +216,6 @@ model GraphLink { name String courseId Int graphId Int? - course Course @relation(fields: [courseId], references: [id], onDelete: Cascade) graph Graph? @relation(fields: [graphId], references: [id]) } diff --git a/src/lib/components/GraphSVG.svelte b/src/lib/components/GraphSVG.svelte index d363f75..451b484 100644 --- a/src/lib/components/GraphSVG.svelte +++ b/src/lib/components/GraphSVG.svelte @@ -7,7 +7,7 @@ import { graph } from '$stores' // Components - import Dropdown from './Dropdown.svelte' + import Dropdown from './forms/Dropdown.svelte' // Assets import zoomInIcon from '$assets/zoom-in-icon.svg' diff --git a/src/lib/components/Tabular.svelte b/src/lib/components/Tabular.svelte deleted file mode 100644 index 93a3c01..0000000 --- a/src/lib/components/Tabular.svelte +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - -
-
- {#each tabs as tab, index} - - {/each} - -
-
- - -
- - - - - - diff --git a/src/lib/components/Tooltip.svelte b/src/lib/components/Tooltip.svelte index 9c5e124..b7bde6c 100644 --- a/src/lib/components/Tooltip.svelte +++ b/src/lib/components/Tooltip.svelte @@ -33,7 +33,7 @@ .tooltip position: absolute translate: -50% calc(-100% - 10px) - z-index: 9999 + z-index: 9998 width: max-content padding: 0 $input-thick-padding diff --git a/src/lib/components/Validation.svelte b/src/lib/components/Validation.svelte index 3bf35d6..95b54b4 100644 --- a/src/lib/components/Validation.svelte +++ b/src/lib/components/Validation.svelte @@ -2,7 +2,7 @@ @@ -52,43 +68,51 @@