Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/public/sw.js

Large diffs are not rendered by default.

252 changes: 0 additions & 252 deletions frontend/src/app/students/(config)/add-new/page.tsx

This file was deleted.

9 changes: 5 additions & 4 deletions frontend/src/app/students/(monitoring)/attendance/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
"use client";
import React, { useState, useEffect } from "react";
import SliderView from "@/components/studentsMonitoring/sliderOptionView";
Expand All @@ -18,15 +19,15 @@ export default function Attendance() {
const configData = JSON.parse(localStorage.getItem("configData") || "{}");
const attendanceConfig = configData?.attendance?.selectedButtons || [];
const studentData = localStorage.getItem("studentsData");

if (studentData) {
const parsedData = JSON.parse(studentData);
const studentsArray = Array.isArray(parsedData.alumnos) ? parsedData.alumnos : [];
setStudentList(studentsArray);
} else {
setStudentList(null);
}

setSelectedDays(attendanceConfig);
setMounted(true);
}, []);
Expand Down Expand Up @@ -60,15 +61,15 @@ export default function Attendance() {

return (
<div>
<SliderView onMonthChange={handleMonthChange} />
<SliderView onMonthChange={handleMonthChange} onCuatrimestreChange={handleMonthChange} />
<div className="relative mt-4">
<div className="flex gap-4 pb-2">
{days.map(({ dayName, formattedDate, day }, index) => (
<div key={index} className="inline-block">
<button
type="button"
className={`min-w-[170px] min-h-8 text-black border-2 border-black font-semibold text-sm px-4 rounded-md filter drop-shadow-[4px_4px_0px_#000000] ${colors[index % colors.length]}`}
data-date={formattedDate}
data-date={formattedDate}
>
{`${dayName} ${day.toString().padStart(2, "0")}/${(monthIndex + 1).toString().padStart(2, "0")}`}
</button>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/students/(monitoring)/attitudinal/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export default function Attitudinal() {
const daysOfWeek = ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"];
const colors = ["bg-pink-300", "bg-yellow-100", "bg-green-200", "bg-cyan-200"];
const months = [
"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio",
"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio",
"Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
];

useEffect(() => {
const configData = JSON.parse(localStorage.getItem("configData") || "{}");
const attendanceConfig = configData?.attendance?.selectedButtons || [];
const studentData = localStorage.getItem("studentsData");

if (studentData) {
const parsedData = JSON.parse(studentData);
const studentsArray = Array.isArray(parsedData.alumnos) ? parsedData.alumnos : [];
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function Attitudinal() {

return (
<div>
<SliderView onMonthChange={handleMonthChange} />
<SliderView onMonthChange={handleMonthChange} onCuatrimestreChange={() => { }} />
<div className="relative mt-4">
<div className="flex gap-4 pb-2">
{selectedButton === "Diario" && days.map((day, index) => (
Expand Down Expand Up @@ -156,7 +156,7 @@ export default function Attitudinal() {
type="button"
className={`min-w-[170px] min-h-8 text-black border-2 border-black font-semibold text-sm px-4 rounded-md filter drop-shadow-[4px_4px_0px_#000000] ${colors[index % colors.length]}`}
>
{cuatrimestre}
{cuatrimestre}
</button>
{studentList && studentList.length > 0 && (
<div className="w-[170px] my-2 mt-10 flex flex-col gap-3">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/students/(monitoring)/exam/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function Exam() {
return (
<div>
<div>
<SliderView onCuatrimestreChange={handleQuarterChange} />
<SliderView onCuatrimestreChange={handleQuarterChange} onMonthChange={() => { }} />
</div>

<div className="flex gap-4 mt-4 flex-wrap">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/students/(monitoring)/homework/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function Homework() {
return (
<div>
<div>
<SliderView onCuatrimestreChange={handleQuarterChange} />
<SliderView onCuatrimestreChange={handleQuarterChange} onMonthChange={() => { }} />
</div>

<div className="flex gap-4 mt-4 flex-wrap">
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/components/multiStepForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ interface Props {
onlyPlanification?: boolean;
subjectIdFromProps?: number;
periodFromProps?: PeriodFromAction;
onlyStudents?: number;
courseIdFromParams?: number;
}

export default function MultiStepForm({ onlyPlanification, subjectIdFromProps, periodFromProps }: Props) {
const [activeTab, setActiveTab] = useState(onlyPlanification ? 2 : 0);
export default function MultiStepForm({ onlyPlanification, subjectIdFromProps, periodFromProps, onlyStudents, courseIdFromParams }: Props) {
const [activeTab, setActiveTab] = useState(onlyStudents ? 1 : onlyPlanification ? 2 : 0);
const [contentList, setContentList] = useState<Content[]>([])
const [courseId, setCourseId] = useState<number | null>(null);
const [planificationStep, setPlanificationStep] = useState<number>(1);
Expand All @@ -24,7 +26,7 @@ export default function MultiStepForm({ onlyPlanification, subjectIdFromProps, p

const formElements = [
<AddCourseForm setCourseId={setCourseId} setSubjectId={setSubjectId} setActiveTab={setActiveTab} key={0} setPeriod={setPeriod} />,
<AddStudentForm courseId={courseId} setActiveTab={setActiveTab} key={1} />,
<AddStudentForm courseId={courseId ?? Number(courseIdFromParams)} setActiveTab={setActiveTab} key={1} onlyStudents={onlyStudents ? true : false} />,
<AddPlanification setActiveTab={setActiveTab} contentList={contentList} setContentList={setContentList} key={2} planificationStep={planificationStep} setPlanificationStep={setPlanificationStep} subjectId={subjectId} setCurrentPlanification={setCurrentPlanification} />,
<AddToCalendar contentList={contentList} key={3} planificationStep={planificationStep} period={period} currentPlanification={currentPlanification} />
];
Expand Down
Loading