Skip to content
This repository has been archived by the owner on Feb 21, 2025. It is now read-only.

Commit

Permalink
Merge pull request #74 from PRIME-TU-Delft/development/api
Browse files Browse the repository at this point in the history
Development/api
  • Loading branch information
Bluerberry authored Oct 29, 2024
2 parents 476b7ed + 71075dc commit a5f4d58
Show file tree
Hide file tree
Showing 162 changed files with 12,308 additions and 4,006 deletions.
27 changes: 12 additions & 15 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -88,8 +87,8 @@ model VerificationToken {
@@id([identifier, token])
}
// END AUTH STUFF

// END AUTH STUFF

model Program {
id Int @id @default(autoincrement())
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -155,19 +154,18 @@ model Graph {
subjects Subject[]
lectures Lecture[]
links GraphLink[]
// UI names
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}


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")
Expand All @@ -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?
Expand All @@ -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[]
}

Expand All @@ -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])
}
2 changes: 1 addition & 1 deletion src/lib/components/GraphSVG.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
78 changes: 0 additions & 78 deletions src/lib/components/Tabular.svelte

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/components/Tooltip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/lib/components/Validation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<script lang="ts">
// Internal imports
import { Severity, ValidationData } from '$scripts/entities'
import { Severity, ValidationData } from '$scripts/validation'
import { clickoutside } from '$scripts/clickoutside'
import { tooltip } from '$scripts/tooltip'
Expand All @@ -15,7 +15,7 @@
export let data: ValidationData
export let short: boolean = false
export let success: string = ''
export let goto_anchor: (tab: number, id: string) => void = () => {}
export let goto: (tab: number, id: string) => void = () => {}
// Variables
let all_visible: boolean = false
Expand Down Expand Up @@ -136,12 +136,12 @@
<img src={errorIcon} alt="" />
<span class="short"> {error.short} </span>

{#if error.tab !== undefined && error.anchor !== undefined}
{#if error.tab !== undefined && error.uuid !== undefined}
<span class="show">
(<button on:click={() => {
hide_errors()
if (error.tab !== undefined && error.anchor !== undefined)
goto_anchor(error.tab, error.anchor)
if (error.tab !== undefined && error.uuid !== undefined)
goto(error.tab, error.uuid)
}}> show </button>)
</span>
{/if}
Expand Down Expand Up @@ -176,12 +176,12 @@
<img src={warningIcon} alt="" />
<span class="short"> {warning.short} </span>

{#if warning.tab !== undefined && warning.anchor !== undefined}
{#if warning.tab !== undefined && warning.uuid !== undefined}
<span class="show">
(<button on:click={() => {
hide_warnings()
if (warning.tab !== undefined && warning.anchor !== undefined)
goto_anchor(warning.tab, warning.anchor)
if (warning.tab !== undefined && warning.uuid !== undefined)
goto(warning.tab, warning.uuid)
}}> show </button>)
</span>
{/if}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Internal imports
import { tooltip } from '$scripts/tooltip'
// Exports1
// Exports
export let src: string
export let description: string = ''
export let href: string | undefined = undefined
Expand Down Expand Up @@ -35,7 +35,7 @@
use:tooltip={description}
on:click
>
<img {src} alt="" class="icon" />
<img {src} alt={description} class="icon" />
</button>

{:else}
Expand Down
Loading

0 comments on commit a5f4d58

Please sign in to comment.