Skip to content

Commit c884bf5

Browse files
Merge pull request #269 from COS301-SE-2024/stable
Stable
2 parents e62f65b + 1485cd1 commit c884bf5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1846
-951
lines changed

.github/codecov.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ignore:
2+
- '**/*.svelte'
3+
- '**/*.config.js'
4+
- '**/*.config.ts'
5+
- '**/*.d.ts'
6+
- '**/database/schemas/*.ts'

.github/workflows/deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 18.17.0
17+
- uses: oven-sh/setup-bun@v1
18+
with:
19+
bun-version: latest
1420
- name: Install Vercel CLI
1521
run: npm install --global vercel@latest
1622
- name: Pull Vercel Environment Information

src/bun.lockb

4.79 KB
Binary file not shown.

src/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"type": "module",
6666
"dependencies": {
6767
"@dimforge/rapier3d-compat": "^0.14.0",
68+
"@google/model-viewer": "^3.5.0",
6869
"@lucia-auth/adapter-mongodb": "^1.0.3",
6970
"@node-rs/argon2": "^1.8.3",
7071
"@sendgrid/mail": "^8.1.3",
@@ -85,6 +86,7 @@
8586
"axios": "^1.7.2",
8687
"bcrypt": "^5.1.1",
8788
"canvas-confetti": "^1.9.3",
89+
"csv-parse": "^5.5.6",
8890
"date-fns": "^4.1.0",
8991
"mongodb": "^6.8.0",
9092
"mongoose": "^8.4.5",

src/src/app.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
<title>ClassConnect</title>
66
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
77
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<!-- Loads <model-viewer> for modern browsers: -->
9+
<script
10+
type="module"
11+
src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"
12+
></script>
13+
<!-- Loads <model-viewer> for old browsers like IE11: -->
14+
<script
15+
nomodule
16+
src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"
17+
></script>
818
%sveltekit.head%
919
</head>
1020
<body data-sveltekit-preload-data="hover" class="bg-white dark:bg-gray-700">

src/src/lib/components/annotations/3dAnnotations.svelte

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@
8585
annotations[text] = { position, text, labelDiv, sprite };
8686
}
8787
88-
export function removeAnnotation(text: string) {
88+
function removeAnnotation(text: string) {
8989
const annotation = annotations[text];
90-
if (annotation) {
91-
document.body.removeChild(annotation.labelDiv);
90+
console.log('Removing annotation', annotation.labelDiv);
91+
if (annotation && annotation.labelDiv.parentNode) {
92+
console.log('Removing annotation', annotation.labelDiv);
93+
annotation.labelDiv.remove();
9294
scene.remove(annotation.sprite);
9395
delete annotations[text];
9496
}
@@ -135,6 +137,12 @@
135137
}
136138
window.addEventListener('click', onMouseClick);
137139
window.addEventListener('beforeunload', handleBeforeUnload);
140+
141+
document.addEventListener('removeAllAnnotations', () => {
142+
Object.keys(annotations).forEach((text) => {
143+
removeAnnotation(text);
144+
});
145+
});
138146
return () => {
139147
window.removeEventListener('beforeunload', handleBeforeUnload);
140148
window.removeEventListener('click', onMouseClick);
@@ -153,7 +161,7 @@
153161
raycaster = new THREE.Raycaster();
154162
mouse = new THREE.Vector2();
155163
156-
const ambientLight = new THREE.AmbientLight(0x404040);
164+
const ambientLight = new THREE.AmbientLight(0xffffff, 0.9);
157165
scene.add(ambientLight);
158166
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.5);
159167
directionalLight.position.set(1, 1, 1).normalize();
@@ -179,6 +187,7 @@
179187
}
180188
181189
function removeAllAnnotations() {
190+
console.log('removeAllAnnotations called');
182191
Object.keys(annotations).forEach((text) => {
183192
removeAnnotation(text);
184193
});
@@ -187,9 +196,6 @@
187196
function handleModelSelection(file_path: string) {
188197
removeAllAnnotations();
189198
loadModel(file_path);
190-
const url = new URL(window.location.href);
191-
url.searchParams.set('model', file_path);
192-
window.history.pushState({}, '', url);
193199
}
194200
195201
function animate() {

src/src/lib/components/common/Navbar.svelte

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
77
const navLinks = {
88
admin: [
9-
{ name: 'Dashboard', href: '/dashboard' },
109
{ name: 'Announcements', href: '/announcements' },
1110
{ name: 'Organisation', href: '/organisation' },
1211
{ name: 'Workspaces', href: '/workspaces' },
@@ -19,7 +18,6 @@
1918
{ name: 'Announcements', href: '/announcements' }
2019
],
2120
student: [
22-
{ name: 'Dashboard', href: '/dashboard' },
2321
{ name: 'Workspaces', href: '/workspaces' },
2422
{ name: 'Announcements', href: '/announcements' },
2523
{ name: 'Grades', href: '/grades' }

src/src/lib/components/forms/interactive/Notes.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
<Toaster />
6666

67-
<main class="container mx-auto p-4">
67+
<main class="container mx-auto p-4 dark:bg-gray-700">
6868
<div class="p-2 md:px-5 md:py-2">
6969
<form method="POST" action="?/editContent" use:enhance={save}>
7070
<div class="grid grid-cols-12 gap-6">

0 commit comments

Comments
 (0)