mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 15:18:32 -06:00
who knows how long i have not been pushing...
This commit is contained in:
@@ -6,5 +6,9 @@ temp/
|
|||||||
build.sh
|
build.sh
|
||||||
run.sh
|
run.sh
|
||||||
README.md
|
README.md
|
||||||
|
docker-compose.yml
|
||||||
|
Dockerfile
|
||||||
|
.next/
|
||||||
|
.pnpm-store/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ services:
|
|||||||
- ~/projects/faculty/1430/2024-fall-alex/modules:/app/storage/UX
|
- ~/projects/faculty/1430/2024-fall-alex/modules:/app/storage/UX
|
||||||
- ~/projects/faculty/4850_AdvancedFE/2024-fall-alex/modules:/app/storage/advanced_frontend
|
- ~/projects/faculty/4850_AdvancedFE/2024-fall-alex/modules:/app/storage/advanced_frontend
|
||||||
|
|
||||||
|
- ~/projects/faculty/1810/2024-spring-alex/modules_online:/app/storage/intro_to_web_online_old
|
||||||
- ~/projects/faculty/1810/2024-fall-alex/modules:/app/storage/intro_to_web_old
|
- ~/projects/faculty/1810/2024-fall-alex/modules:/app/storage/intro_to_web_old
|
||||||
- ~/projects/faculty/1810/2025-spring-alex/in-person:/app/storage/intro_to_web
|
- ~/projects/faculty/1810/2025-spring-alex/in-person:/app/storage/intro_to_web
|
||||||
- ~/projects/faculty/1810/2025-spring-alex/online:/app/storage/intro_to_web_online
|
- ~/projects/faculty/1810/2025-spring-alex/online:/app/storage/intro_to_web_online
|
||||||
|
|||||||
31
src/app/course/[courseName]/calendar/day/DayItemTooltip.tsx
Normal file
31
src/app/course/[courseName]/calendar/day/DayItemTooltip.tsx
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import { ReactNode } from "react";
|
||||||
|
import { createPortal } from "react-dom";
|
||||||
|
|
||||||
|
export const DayItemTooltip: React.FC<{
|
||||||
|
message: ReactNode;
|
||||||
|
targetRef: React.RefObject<HTMLAnchorElement | null>;
|
||||||
|
visible: boolean;
|
||||||
|
}> = ({ message, targetRef, visible }) => {
|
||||||
|
const rect = targetRef.current?.getBoundingClientRect();
|
||||||
|
|
||||||
|
return createPortal(
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
top: (rect?.bottom ?? 0) + window.scrollY + 10,
|
||||||
|
left: (rect?.left ?? 0) + window.scrollX + (rect?.width ?? 0) / 2,
|
||||||
|
}}
|
||||||
|
className={
|
||||||
|
" absolute -translate-x-1/2 " +
|
||||||
|
" bg-gray-800 text-white text-sm " +
|
||||||
|
" rounded py-1 px-2 " +
|
||||||
|
" transition-all duration-400 " +
|
||||||
|
" border border-slate-700 shadow-[0_0px_10px_0px] shadow-slate-500/50 " +
|
||||||
|
(visible ? " " : " hidden -z-50 ")
|
||||||
|
}
|
||||||
|
role="tooltip"
|
||||||
|
>
|
||||||
|
{message}
|
||||||
|
</div>,
|
||||||
|
document.body
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,15 +1,12 @@
|
|||||||
import { IModuleItem } from "@/models/local/IModuleItem";
|
import { IModuleItem } from "@/models/local/IModuleItem";
|
||||||
import { getModuleItemUrl } from "@/services/urlUtils";
|
import { getModuleItemUrl } from "@/services/urlUtils";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { ReactNode, useEffect, useRef, useState } from "react";
|
import { ReactNode, useRef, useState } from "react";
|
||||||
import { useCourseContext } from "../../context/courseContext";
|
import { useCourseContext } from "../../context/courseContext";
|
||||||
import {
|
import { DraggableItem } from "../../context/drag/draggingContext";
|
||||||
useDraggingContext,
|
|
||||||
DraggableItem,
|
|
||||||
} from "../../context/drag/draggingContext";
|
|
||||||
import { createPortal } from "react-dom";
|
|
||||||
import ClientOnly from "@/components/ClientOnly";
|
import ClientOnly from "@/components/ClientOnly";
|
||||||
import { useDragStyleContext } from "../../context/drag/dragStyleContext";
|
import { useDragStyleContext } from "../../context/drag/dragStyleContext";
|
||||||
|
import { DayItemTooltip } from "./DayItemTooltip";
|
||||||
|
|
||||||
export function ItemInDay({
|
export function ItemInDay({
|
||||||
type,
|
type,
|
||||||
@@ -53,8 +50,7 @@ export function ItemInDay({
|
|||||||
"draggableItem",
|
"draggableItem",
|
||||||
JSON.stringify(draggableItem)
|
JSON.stringify(draggableItem)
|
||||||
);
|
);
|
||||||
setIsDragging(true)
|
setIsDragging(true);
|
||||||
|
|
||||||
}}
|
}}
|
||||||
onMouseEnter={() => setTooltipVisible(true)}
|
onMouseEnter={() => setTooltipVisible(true)}
|
||||||
onMouseLeave={() => setTooltipVisible(false)}
|
onMouseLeave={() => setTooltipVisible(false)}
|
||||||
@@ -63,7 +59,7 @@ export function ItemInDay({
|
|||||||
{item.name}
|
{item.name}
|
||||||
</Link>
|
</Link>
|
||||||
<ClientOnly>
|
<ClientOnly>
|
||||||
<Tooltip
|
<DayItemTooltip
|
||||||
message={message}
|
message={message}
|
||||||
targetRef={linkRef}
|
targetRef={linkRef}
|
||||||
visible={tooltipVisible && status === "incomplete"}
|
visible={tooltipVisible && status === "incomplete"}
|
||||||
@@ -72,32 +68,3 @@ export function ItemInDay({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Tooltip: React.FC<{
|
|
||||||
message: ReactNode;
|
|
||||||
targetRef: React.RefObject<HTMLElement>;
|
|
||||||
visible: boolean;
|
|
||||||
}> = ({ message, targetRef, visible }) => {
|
|
||||||
const rect = targetRef.current?.getBoundingClientRect();
|
|
||||||
|
|
||||||
return createPortal(
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
top: (rect?.bottom ?? 0) + window.scrollY + 10,
|
|
||||||
left: (rect?.left ?? 0) + window.scrollX + (rect?.width ?? 0) / 2,
|
|
||||||
}}
|
|
||||||
className={
|
|
||||||
" absolute -translate-x-1/2 " +
|
|
||||||
" bg-gray-800 text-white text-sm " +
|
|
||||||
" rounded py-1 px-2 " +
|
|
||||||
" transition-all duration-400 " +
|
|
||||||
" border border-slate-700 shadow-[0_0px_10px_0px] shadow-slate-500/50 " +
|
|
||||||
(visible ? " " : " hidden -z-50 ")
|
|
||||||
}
|
|
||||||
role="tooltip"
|
|
||||||
>
|
|
||||||
{message}
|
|
||||||
</div>,
|
|
||||||
document.body
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -109,11 +109,12 @@ export const useUpdateAssignmentMutation = () => {
|
|||||||
previousModuleName,
|
previousModuleName,
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
if (moduleName !== previousModuleName)
|
if (moduleName !== previousModuleName) {
|
||||||
utils.assignment.getAllAssignments.invalidate({
|
utils.assignment.getAllAssignments.invalidate({
|
||||||
courseName,
|
courseName,
|
||||||
moduleName: previousModuleName,
|
moduleName: previousModuleName,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
utils.assignment.getAllAssignments.invalidate({ courseName, moduleName });
|
utils.assignment.getAllAssignments.invalidate({ courseName, moduleName });
|
||||||
utils.assignment.getAssignment.invalidate({
|
utils.assignment.getAssignment.invalidate({
|
||||||
courseName,
|
courseName,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { marked } from "marked";
|
import { marked } from "marked";
|
||||||
import * as DOMPurify from "isomorphic-dompurify";
|
import DOMPurify from "isomorphic-dompurify";
|
||||||
import { LocalCourseSettings } from "@/models/local/localCourseSettings";
|
import { LocalCourseSettings } from "@/models/local/localCourseSettings";
|
||||||
|
|
||||||
export function extractImageSources(htmlString: string) {
|
export function extractImageSources(htmlString: string) {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export const assignmentRouter = router({
|
|||||||
assignment.name !== previousAssignmentName ||
|
assignment.name !== previousAssignmentName ||
|
||||||
moduleName !== previousModuleName
|
moduleName !== previousModuleName
|
||||||
) {
|
) {
|
||||||
fileStorageService.assignments.delete({
|
await fileStorageService.assignments.delete({
|
||||||
courseName,
|
courseName,
|
||||||
moduleName: previousModuleName,
|
moduleName: previousModuleName,
|
||||||
assignmentName: previousAssignmentName,
|
assignmentName: previousAssignmentName,
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export const pageRouter = router({
|
|||||||
page.name !== previousPageName ||
|
page.name !== previousPageName ||
|
||||||
moduleName !== previousModuleName
|
moduleName !== previousModuleName
|
||||||
) {
|
) {
|
||||||
fileStorageService.pages.delete({
|
await fileStorageService.pages.delete({
|
||||||
courseName,
|
courseName,
|
||||||
moduleName: previousModuleName,
|
moduleName: previousModuleName,
|
||||||
pageName: previousPageName,
|
pageName: previousPageName,
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export const quizRouter = router({
|
|||||||
quiz.name !== previousQuizName ||
|
quiz.name !== previousQuizName ||
|
||||||
moduleName !== previousModuleName
|
moduleName !== previousModuleName
|
||||||
) {
|
) {
|
||||||
fileStorageService.quizzes.delete({
|
await fileStorageService.quizzes.delete({
|
||||||
courseName,
|
courseName,
|
||||||
moduleName: previousModuleName,
|
moduleName: previousModuleName,
|
||||||
quizName: previousQuizName,
|
quizName: previousQuizName,
|
||||||
|
|||||||
Reference in New Issue
Block a user