From 7c34b325255009f642d343d741e125ef2beb8048 Mon Sep 17 00:00:00 2001
From: Rotimi Best
Date: Sat, 12 Aug 2023 18:46:35 +0100
Subject: [PATCH] CLASSROOMIO-T-105: Add try again + sentry replay
---
.gitignore | 3 +++
package.json | 1 +
.../Lesson/Materials/Video/LocalVideo.svelte | 17 ++++++++++-------
src/routes/+layout.svelte | 3 ++-
vite.config.ts | 8 ++++++--
5 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/.gitignore b/.gitignore
index ff64aabd..e607a698 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,6 @@ package-lock.json
# Local Netlify folder
.netlify
+
+# Sentry Auth Token
+.env.sentry-build-plugin
diff --git a/package.json b/package.json
index e8c924a3..c3598a3d 100644
--- a/package.json
+++ b/package.json
@@ -17,6 +17,7 @@
"@sentry/browser": "^7.61.0",
"@sentry/integrations": "^7.61.0",
"@sentry/tracing": "^7.61.0",
+ "@sentry/vite-plugin": "^2.6.2",
"@supabase/supabase-js": "^2.31.0",
"@sveltejs/adapter-auto": "^2.1.0",
"@sveltejs/adapter-netlify": "^2.0.8",
diff --git a/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte b/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte
index 97d0c0ee..b0cc7705 100644
--- a/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte
+++ b/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte
@@ -75,6 +75,11 @@
}
}
+ function tryAgain() {
+ formRes = null;
+ isLoaded = false;
+ }
+
$: isDoneUploading(formRes);
@@ -124,7 +129,7 @@
Sorry we video wasn’t uploaded. The file size is too big,
maximum size is 50 MB. Try again!
- fileInput?.click()} />
+
{:else if !formRes?.success}
@@ -134,14 +139,11 @@
Oops 😬, couldn’t upload video
- Sorry we video wasn’t uploaded, the file format isn’t supported.
Upload MP4, MOV and AVI
- files.
+ Sorry we video wasn’t uploaded, the file format isn’t supported or something went wrong on
+ the server.
Upload MP4, MOV and AVI files.
-
($uploadCourseVideoStore.isModalOpen = false)}
- />
+
{:else}
@@ -162,6 +164,7 @@
+ ($uploadCourseVideoStore.isModalOpen = false)} />
{/if}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 5c8f7c14..19d2ce5d 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -55,7 +55,8 @@
new Integrations.BrowserTracing(),
new CaptureConsole({
levels: ['error']
- })
+ }),
+ new Sentry.Replay()
],
environment: !dev ? 'production' : 'development',
// Set tracesSampleRate to 1.0 to capture 100%
diff --git a/vite.config.ts b/vite.config.ts
index 2e920e4a..e16df0ff 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,6 +1,10 @@
+import { sentryVitePlugin } from "@sentry/vite-plugin";
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
- plugins: [sveltekit()],
-});
+ plugins: [sveltekit(), sentryVitePlugin({
+ org: "the-next-greats",
+ project: "classroomio"
+ })],
+});
\ No newline at end of file