diff --git a/front/app/_editor/course/[courseid]/lecture/[lectureid]/edit/page.tsx b/front/app/_editor/course/[courseid]/lecture/[lectureid]/edit/page.tsx index a10cb3b8..6dde926d 100644 --- a/front/app/_editor/course/[courseid]/lecture/[lectureid]/edit/page.tsx +++ b/front/app/_editor/course/[courseid]/lecture/[lectureid]/edit/page.tsx @@ -8,7 +8,7 @@ import { getLecture } from "@services/courses/lectures"; import AuthProvider from "@components/Security/AuthProvider"; import EditorWrapper from "@components/Editor/EditorWrapper"; import useSWR, { mutate } from "swr"; -import { getAPIUrl } from "@services/config"; +import { getAPIUrl } from "@services/config/config"; import { swrFetcher } from "@services/utils/requests"; diff --git a/front/app/_orgs/[orgslug]/(withmenu)/activity/page.tsx b/front/app/_orgs/[orgslug]/(withmenu)/activity/page.tsx index 5a9707f3..83561c96 100644 --- a/front/app/_orgs/[orgslug]/(withmenu)/activity/page.tsx +++ b/front/app/_orgs/[orgslug]/(withmenu)/activity/page.tsx @@ -1,5 +1,5 @@ "use client"; -import { getAPIUrl, getBackendUrl } from "@services/config"; +import { getAPIUrl, getBackendUrl } from "@services/config/config"; import { swrFetcher } from "@services/utils/requests"; import React from "react"; import { styled } from "styled-components"; diff --git a/front/app/_orgs/[orgslug]/(withmenu)/collections/new/page.tsx b/front/app/_orgs/[orgslug]/(withmenu)/collections/new/page.tsx index 7e766919..da1f8355 100644 --- a/front/app/_orgs/[orgslug]/(withmenu)/collections/new/page.tsx +++ b/front/app/_orgs/[orgslug]/(withmenu)/collections/new/page.tsx @@ -2,11 +2,11 @@ import { useRouter } from "next/navigation"; import React from "react"; import { Title } from "@components/UI/Elements/Styles/Title"; -import { createCollection } from "@services/collections"; +import { createCollection } from "@services/courses/collections"; import useSWR from "swr"; -import { getAPIUrl } from "@services/config"; +import { getAPIUrl } from "@services/config/config"; import { swrFetcher } from "@services/utils/requests"; -import { getOrganizationContextInfo } from "@services/orgs"; +import { getOrganizationContextInfo } from "@services/organizations/orgs"; function NewCollection(params : any) { const orgslug = params.params.orgslug; diff --git a/front/app/_orgs/[orgslug]/(withmenu)/collections/page.tsx b/front/app/_orgs/[orgslug]/(withmenu)/collections/page.tsx index f2c11b26..c74dd467 100644 --- a/front/app/_orgs/[orgslug]/(withmenu)/collections/page.tsx +++ b/front/app/_orgs/[orgslug]/(withmenu)/collections/page.tsx @@ -3,8 +3,8 @@ import Link from "next/link"; import React from "react"; import styled from "styled-components"; import { Title } from "@components/UI/Elements/Styles/Title"; -import { deleteCollection } from "@services/collections"; -import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config"; +import { deleteCollection } from "@services/courses/collections"; +import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config/config"; import { swrFetcher } from "@services/utils/requests"; import useSWR, { mutate } from "swr"; diff --git a/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/edit/page.tsx b/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/edit/page.tsx index ebf1fd6b..f1d7f8a7 100644 --- a/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/edit/page.tsx +++ b/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/edit/page.tsx @@ -13,7 +13,7 @@ import { useRouter } from "next/navigation"; import NewChapterModal from "@components/Modals/CourseEdit/NewChapter"; import NewLectureModal from "@components/Modals/CourseEdit/NewLecture"; import { createLecture, createFileLecture } from "@services/courses/lectures"; -import { getOrganizationContextInfo } from "@services/orgs"; +import { getOrganizationContextInfo } from "@services/organizations/orgs"; function CourseEdit(params: any) { const router = useRouter(); diff --git a/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/lecture/[lectureid]/page.tsx b/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/lecture/[lectureid]/page.tsx index d66a3ec3..868205a3 100644 --- a/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/lecture/[lectureid]/page.tsx +++ b/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/lecture/[lectureid]/page.tsx @@ -4,7 +4,7 @@ import Link from "next/link"; import React, { useMemo } from "react"; import Layout from "@components/UI/Layout"; import { getLecture } from "@services/courses/lectures"; -import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config"; +import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config/config"; import Canva from "@components/LectureViews/DynamicCanva/DynamicCanva"; import styled from "styled-components"; import { getCourse } from "@services/courses/courses"; diff --git a/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/page.tsx b/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/page.tsx index c76d2974..f81fdb8c 100644 --- a/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/page.tsx +++ b/front/app/_orgs/[orgslug]/(withmenu)/course/[courseid]/page.tsx @@ -4,7 +4,7 @@ import { closeActivity, createActivity } from "@services/courses/activity"; import Link from "next/link"; import React from "react"; import styled from "styled-components"; -import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config"; +import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config/config"; import useSWR, { mutate } from "swr"; import { swrFetcher } from "@services/utils/requests"; diff --git a/front/app/_orgs/[orgslug]/(withmenu)/courses/new/page.tsx b/front/app/_orgs/[orgslug]/(withmenu)/courses/new/page.tsx index 8acc5a8a..435bbb24 100644 --- a/front/app/_orgs/[orgslug]/(withmenu)/courses/new/page.tsx +++ b/front/app/_orgs/[orgslug]/(withmenu)/courses/new/page.tsx @@ -5,8 +5,8 @@ import { Header } from "@components/UI/Header"; import Layout from "@components/UI/Layout"; import { Title } from "@components/UI/Elements/Styles/Title"; import { createNewCourse } from "@services/courses/courses"; -import { getOrganizationContextInfo } from "@services/orgs"; -import { getUriWithOrg } from "@services/config"; +import { getOrganizationContextInfo } from "@services/organizations/orgs"; +import { getUriWithOrg } from "@services/config/config"; const NewCoursePage = (params: any) => { const router = useRouter(); diff --git a/front/app/_orgs/[orgslug]/(withmenu)/courses/page.tsx b/front/app/_orgs/[orgslug]/(withmenu)/courses/page.tsx index b661d16f..ae143509 100644 --- a/front/app/_orgs/[orgslug]/(withmenu)/courses/page.tsx +++ b/front/app/_orgs/[orgslug]/(withmenu)/courses/page.tsx @@ -4,7 +4,7 @@ import { useRouter } from "next/navigation"; import React from "react"; import styled from "styled-components"; import { Title } from "@components/UI/Elements/Styles/Title"; -import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config"; +import { getAPIUrl, getBackendUrl, getUriWithOrg } from "@services/config/config"; import { deleteCourseFromBackend } from "@services/courses/courses"; import useSWR, { mutate } from "swr"; import { swrFetcher } from "@services/utils/requests"; diff --git a/front/app/_orgs/[orgslug]/page.tsx b/front/app/_orgs/[orgslug]/page.tsx index a613b7c8..15c70bda 100644 --- a/front/app/_orgs/[orgslug]/page.tsx +++ b/front/app/_orgs/[orgslug]/page.tsx @@ -1,6 +1,6 @@ "use client"; import { Title } from "@components/UI/Elements/Styles/Title"; -import { getUriWithOrg } from "@services/config"; +import { getUriWithOrg } from "@services/config/config"; import Link from "next/link"; import { usePathname } from "next/navigation"; diff --git a/front/app/_orgs/[orgslug]/settings/organization/general/page.tsx b/front/app/_orgs/[orgslug]/settings/organization/general/page.tsx index a415096b..4ecd1249 100644 --- a/front/app/_orgs/[orgslug]/settings/organization/general/page.tsx +++ b/front/app/_orgs/[orgslug]/settings/organization/general/page.tsx @@ -2,7 +2,7 @@ import React from 'react' import useSWR, { mutate } from "swr"; import { swrFetcher } from "@services/utils/requests"; -import { getAPIUrl } from '@services/config'; +import { getAPIUrl } from '@services/config/config'; import { Field, Form, Formik } from 'formik'; import { updateOrganization } from '@services/settings/org'; diff --git a/front/app/organizations/new/page.tsx b/front/app/organizations/new/page.tsx index ece50646..a645e3d8 100644 --- a/front/app/organizations/new/page.tsx +++ b/front/app/organizations/new/page.tsx @@ -2,7 +2,7 @@ import React from "react"; import Layout from "../../../components/UI/Layout"; import { Title } from "../../../components/UI/Elements/Styles/Title"; -import { createNewOrganization } from "../../../services/orgs"; +import { createNewOrganization } from "../../../services/organizations/orgs"; const Organizations = () => { const [name, setName] = React.useState(""); diff --git a/front/app/organizations/page.tsx b/front/app/organizations/page.tsx index 544f7c52..93ef7e4d 100644 --- a/front/app/organizations/page.tsx +++ b/front/app/organizations/page.tsx @@ -3,10 +3,10 @@ import Link from "next/link"; import React from "react"; import Layout from "../../components/UI/Layout"; import { Title } from "../../components/UI/Elements/Styles/Title"; -import { deleteOrganizationFromBackend } from "@services/orgs"; +import { deleteOrganizationFromBackend } from "@services/organizations/orgs"; import useSWR, { mutate } from "swr"; import { swrFetcher } from "@services/utils/requests"; -import { getAPIUrl, getUriWithOrg } from "@services/config"; +import { getAPIUrl, getUriWithOrg } from "@services/config/config"; const Organizations = () => { const { data : organizations , error } = useSWR(`${getAPIUrl()}orgs/user/page/1/limit/10`, swrFetcher) diff --git a/front/components/Drags/Lecture.tsx b/front/components/Drags/Lecture.tsx index 513b686a..ffb805df 100644 --- a/front/components/Drags/Lecture.tsx +++ b/front/components/Drags/Lecture.tsx @@ -3,7 +3,7 @@ import React from "react"; import { Draggable } from "react-beautiful-dnd"; import { EyeOpenIcon, Pencil2Icon } from '@radix-ui/react-icons' import styled from "styled-components"; -import { getUriWithOrg } from "@services/config"; +import { getUriWithOrg } from "@services/config/config"; function Lecture(props: any) { diff --git a/front/components/Editor/Editor.tsx b/front/components/Editor/Editor.tsx index 4bf794d5..e8945cdc 100644 --- a/front/components/Editor/Editor.tsx +++ b/front/components/Editor/Editor.tsx @@ -9,7 +9,7 @@ import { ToolbarButtons } from "./Toolbar/ToolbarButtons"; import { motion, AnimatePresence } from "framer-motion"; import Image from "next/legacy/image"; import styled from "styled-components"; -import { getBackendUrl } from "../../services/config"; +import { getBackendUrl } from "@services/config/config"; import { SlashIcon } from "@radix-ui/react-icons"; import Avvvatars from "avvvatars-react"; // extensions diff --git a/front/components/Editor/Extensions/Image/ImageBlock.ts b/front/components/Editor/Extensions/Image/ImageBlock.ts index 143c9076..2301b5f3 100644 --- a/front/components/Editor/Extensions/Image/ImageBlock.ts +++ b/front/components/Editor/Extensions/Image/ImageBlock.ts @@ -11,7 +11,7 @@ export default Node.create({ addAttributes() { return { - fileObject: { + blockObject: { default: null, }, }; diff --git a/front/components/Editor/Extensions/Image/ImageBlockComponent.tsx b/front/components/Editor/Extensions/Image/ImageBlockComponent.tsx index 950d4740..c3088977 100644 --- a/front/components/Editor/Extensions/Image/ImageBlockComponent.tsx +++ b/front/components/Editor/Extensions/Image/ImageBlockComponent.tsx @@ -2,13 +2,13 @@ import { NodeViewWrapper } from "@tiptap/react"; import React from "react"; import styled from "styled-components"; import { AlertCircle, AlertTriangle, Image, ImagePlus, Info } from "lucide-react"; -import { getImageFile, uploadNewImageFile } from "../../../../services/files/images"; -import { getBackendUrl } from "../../../../services/config"; +import { getImageFile, uploadNewImageFile } from "../../../../services/blocks/Image/images"; +import { getBackendUrl } from "../../../../services/config/config"; function ImageBlockComponent(props: any) { const [image, setImage] = React.useState(null); const [isLoading, setIsLoading] = React.useState(false); - const [fileObject, setfileObject] = React.useState(props.node.attrs.fileObject); + const [blockObject, setblockObject] = React.useState(props.node.attrs.blockObject); const handleImageChange = (event: React.ChangeEvent) => { setImage(event.target.files[0]); @@ -19,15 +19,15 @@ function ImageBlockComponent(props: any) { setIsLoading(true); let object = await uploadNewImageFile(image, props.extension.options.lecture.lecture_id); setIsLoading(false); - setfileObject(object); + setblockObject(object); props.updateAttributes({ - fileObject: object, + blockObject: object, }); }; return ( - {!fileObject && ( + {!blockObject && (
@@ -38,11 +38,11 @@ function ImageBlockComponent(props: any) { )} - {fileObject && ( + {blockObject && ( diff --git a/front/components/Editor/Extensions/PDF/PDFBlock.ts b/front/components/Editor/Extensions/PDF/PDFBlock.ts index d329b79e..36fa3fde 100644 --- a/front/components/Editor/Extensions/PDF/PDFBlock.ts +++ b/front/components/Editor/Extensions/PDF/PDFBlock.ts @@ -11,7 +11,7 @@ export default Node.create({ addAttributes() { return { - fileObject: { + blockObject: { default: null, }, }; diff --git a/front/components/Editor/Extensions/PDF/PDFBlockComponent.tsx b/front/components/Editor/Extensions/PDF/PDFBlockComponent.tsx index 57099699..2ecc8cbc 100644 --- a/front/components/Editor/Extensions/PDF/PDFBlockComponent.tsx +++ b/front/components/Editor/Extensions/PDF/PDFBlockComponent.tsx @@ -2,13 +2,13 @@ import { NodeViewWrapper } from "@tiptap/react"; import React from "react"; import styled from "styled-components"; import { AlertCircle, AlertTriangle, FileText, Image, ImagePlus, Info } from "lucide-react"; -import { getPDFFile, uploadNewPDFFile } from "../../../../services/files/documents"; -import { getBackendUrl } from "../../../../services/config"; +import { getPDFFile, uploadNewPDFFile } from "../../../../services/blocks/Pdf/pdf"; +import { getBackendUrl } from "../../../../services/config/config"; function PDFBlockComponent(props: any) { const [pdf, setPDF] = React.useState(null); const [isLoading, setIsLoading] = React.useState(false); - const [fileObject, setfileObject] = React.useState(props.node.attrs.fileObject); + const [blockObject, setblockObject] = React.useState(props.node.attrs.blockObject); const handlePDFChange = (event: React.ChangeEvent) => { setPDF(event.target.files[0]); @@ -19,15 +19,15 @@ function PDFBlockComponent(props: any) { setIsLoading(true); let object = await uploadNewPDFFile(pdf, props.extension.options.lecture.lecture_id); setIsLoading(false); - setfileObject(object); + setblockObject(object); props.updateAttributes({ - fileObject: object, + blockObject: object, }); }; return ( - {!fileObject && ( + {!blockObject && (
@@ -38,11 +38,11 @@ function PDFBlockComponent(props: any) { )} - {fileObject && ( + {blockObject && (