From 6fdba7506f3373a1ea642a91e531d60efc94c016 Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Fri, 20 Sep 2024 11:34:47 -0600 Subject: [PATCH] restructuring file storage service --- nextjs/src/app/layout.tsx | 18 +- nextjs/src/app/newCourse/NewCourseForm.tsx | 1 + nextjs/src/app/page.tsx | 2 +- nextjs/src/components/form/SelectInput.tsx | 3 + nextjs/src/hooks/canvas/canvasHooks.ts | 15 +- nextjs/src/services/canvas/canvasService.ts | 19 +- .../src/services/canvas/canvasServiceUtils.ts | 9 +- .../fileStorage/fileStorageService.ts | 229 +----------------- .../fileStorage/moduleFileStorageService.ts | 24 ++ .../fileStorage/pageFileStorageService.ts | 68 ++++++ .../fileStorage/quizFileStorageService.ts | 58 +++++ .../fileStorage/settingsFileStorageService.ts | 56 +++++ .../fileStorage/utils/fileSystemUtils.ts | 27 +++ 13 files changed, 276 insertions(+), 253 deletions(-) diff --git a/nextjs/src/app/layout.tsx b/nextjs/src/app/layout.tsx index bcc07e4..96306dc 100644 --- a/nextjs/src/app/layout.tsx +++ b/nextjs/src/app/layout.tsx @@ -24,15 +24,15 @@ export default async function RootLayout({ -
- - - - - {children} - - - +
+ + + + + {children} + + +
diff --git a/nextjs/src/app/newCourse/NewCourseForm.tsx b/nextjs/src/app/newCourse/NewCourseForm.tsx index 65f6c08..af7a1ac 100644 --- a/nextjs/src/app/newCourse/NewCourseForm.tsx +++ b/nextjs/src/app/newCourse/NewCourseForm.tsx @@ -155,6 +155,7 @@ function OtherSettings({ label={"Storage Folder"} options={emptyDirectories} getOptionName={(d) => d} + emptyOptionText="--- add a new folder to your docker compose to add more folders ---" />
New folders will not be created automatically, you are expected to mount diff --git a/nextjs/src/app/page.tsx b/nextjs/src/app/page.tsx index 559507f..958aded 100644 --- a/nextjs/src/app/page.tsx +++ b/nextjs/src/app/page.tsx @@ -3,7 +3,7 @@ import AddNewCourse from "./newCourse/AddNewCourse"; export default async function Home() { return ( -
+

diff --git a/nextjs/src/components/form/SelectInput.tsx b/nextjs/src/components/form/SelectInput.tsx index a3beabf..ec4d17b 100644 --- a/nextjs/src/components/form/SelectInput.tsx +++ b/nextjs/src/components/form/SelectInput.tsx @@ -4,12 +4,14 @@ export default function SelectInput({ label, options, getOptionName, + emptyOptionText, }: { value: T | undefined; setValue: (newValue: T | undefined) => void; label: string; options: T[]; getOptionName: (item: T) => string; + emptyOptionText?: string; }) { return (