Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d9d390d
Implemented OCP and updated interfaces
SurajRKU Nov 1, 2024
6cbeeb9
Added Copying Animator and ISP
SurajRKU Nov 1, 2024
fcd3a75
Added dialog and updated method adhering to LSP
SurajRKU Nov 1, 2024
0349674
Filtered dropdown by institution and implemented SRP
SurajRKU Nov 1, 2024
906eb56
Added Onchnage to filter instructors and implemented an SRP method
SurajRKU Nov 1, 2024
49f2030
UI Fix for Instructor view and Add Course Button
SurajRKU Dec 1, 2024
cbd27e6
UI Fix for Action Icons
SurajRKU Dec 1, 2024
e6267e0
update assignment table with dummy data
masonhorne Nov 22, 2024
7cbfa44
adds functionality for course view to have a drop down of assignments
Dec 1, 2024
ac133d1
add course name to assignments table
masonhorne Dec 1, 2024
1cd8654
tests for course assignments functionality
masonhorne Dec 1, 2024
09abde4
small comment changes
Dec 2, 2024
aa7fafb
fix styling for container
masonhorne Oct 13, 2024
d0e4fcc
Merge pull request #8 from masonhorne/main2-temp
Alderheart Dec 2, 2024
ca0e71e
UI Fix for text fields prepopulation
SurajRKU Dec 2, 2024
328f982
UI fix for copy and delete modals
SurajRKU Dec 4, 2024
c573a91
added icons and buttons
Dec 4, 2024
478acd2
Merge pull request #9 from masonhorne/mjfeng-implement-buttons
Alderheart Dec 4, 2024
bcc617d
Finalized Comments
SurajRKU Dec 4, 2024
bbcda36
Merge branch 'pr70' into merge-ui-courses-view
sdalal11 Apr 22, 2025
c3aad5b
Merge branch 'pr76' into merge-ui-courses-view
sdalal11 Apr 22, 2025
0593a3c
Merged pr
sdalal11 Apr 22, 2025
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
42 changes: 37 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/assets/icons/copy-temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/icons/delete-temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/icons/edit-temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/icons/export-temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/Copy-icon-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/add-ta-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/assign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/delete-icon-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/edit-icon-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/paste.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/pencil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/remove.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion src/components/Form/FormSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IFormikFieldProps, IFormPropsWithOption } from "./interfaces";
* @author Ankur Mundra on May, 2023
*/

const FormSelect: React.FC<IFormPropsWithOption> = (props) => {
const FormSelect: React.FC<IFormPropsWithOption & { onChange?: (event: React.ChangeEvent<HTMLSelectElement>) => void }> = (props) => {
const {
as,
md,
Expand All @@ -21,6 +21,7 @@ const FormSelect: React.FC<IFormPropsWithOption> = (props) => {
tooltipPlacement,
disabled,
inputGroupPrepend,
onChange, // Add onChange to props to detect chnage in selected institutions.
} = props;

const displayLabel = tooltip ? (
Expand Down Expand Up @@ -48,6 +49,12 @@ const FormSelect: React.FC<IFormPropsWithOption> = (props) => {
disabled={disabled}
isInvalid={isInvalid}
feedback={form.errors[field.name]}
onChange={(event) => {
field.onChange(event); // Call Formik's onChange
if (onChange) {
onChange(event); // Call the passed onChange if provided
}
}}
>
{options.map((option) => {
return (
Expand Down
1 change: 1 addition & 0 deletions src/components/Form/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface IFormOption {

export interface IFormPropsWithOption extends IFormProps {
options: IFormOption[];
onChange?: (event: React.ChangeEvent<HTMLSelectElement>) => void;
}

export interface IFormikFieldProps {
Expand Down
11 changes: 10 additions & 1 deletion src/components/Table/GlobalFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,23 @@ import DebouncedInput from "./DebouncedInput";
interface FilterProps {
filterValue: string | number;
setFilterValue: (value: string | number) => void;
isDisabled?: boolean; // New optional prop to disable the filter
}

const GlobalFilter: React.FC<FilterProps> = ({ filterValue, setFilterValue }) => {
const GlobalFilter: React.FC<FilterProps> = ({
filterValue,
setFilterValue,
isDisabled = true, // Default to true for disabling
}) => {
const searchHandler = useCallback(
(value: string | number) => setFilterValue(value),
[setFilterValue]
);

if (isDisabled) {
return null; // Render nothing when disabled
}

return (
<DebouncedInput
onChange={searchHandler}
Expand Down
44 changes: 32 additions & 12 deletions src/pages/Assignments/Assignment.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Button, Col, Container, Row } from "react-bootstrap";
import { Outlet, useLocation, useNavigate } from "react-router-dom";
import { Row as TRow } from "@tanstack/react-table";
import Table from "components/Table/Table";
import useAPI from "hooks/useAPI";
import { useCallback, useEffect, useMemo, useState } from "react";
import { Button, Col, Container, Row } from "react-bootstrap";
import { BsFileText } from "react-icons/bs";
import { useDispatch, useSelector } from "react-redux";
import { Outlet, useLocation, useNavigate } from "react-router-dom";
import { alertActions } from "store/slices/alertSlice";
import { RootState } from "../../store/store";
import { IAssignmentResponse } from "../../utils/interfaces";
import { assignmentColumns as ASSIGNMENT_COLUMNS } from "./AssignmentColumns";
import { BsFileText } from "react-icons/bs";
import DeleteAssignment from "./AssignmentDelete";
import { IAssignmentResponse } from "../../utils/interfaces";
import { RootState } from "../../store/store";
import { Row as TRow } from "@tanstack/react-table";
import Table from "components/Table/Table";
import { alertActions } from "store/slices/alertSlice";
import useAPI from "hooks/useAPI";


const Assignments = () => {
Expand All @@ -31,6 +31,25 @@ const Assignments = () => {
data?: IAssignmentResponse;
}>({ visible: false });

/**
* At this moment the backend has deviated substantially from what the frontend
* assignment creator provides. However, the backend also does not accept an instructor_id
* when creating an assignment which is a required field so there is no way to create an
* assignment using the frontend. This function is a placeholder to generate fake assignments
* until the backend is updated to allow for the creation of assignments.
*/
const generateFakeAssignments = useCallback(() => {
return Array.from({ length: 10 + Math.floor(Math.random() * 10) }, (_, idx) => ({
id: idx + 1000,
name: "Fake Assignment " + (idx + 1),
description: "This is a fake assignment",
course_id: idx + 999,
created_at: new Date().toISOString(),
updated_at: new Date().toISOString(),
courseName: "Fake Course " + (idx + 1),
}));
}, []);


const fetchData = useCallback(async () => {
try {
Expand Down Expand Up @@ -58,9 +77,11 @@ const Assignments = () => {
const course = coursesResponse.data.find((c: any) => c.id === assignment.course_id);
return { ...assignment, courseName: course ? course.name : 'Unknown' };
});

const fakeAssignments = generateFakeAssignments();
mergedData = mergedData.concat(fakeAssignments);
}




// Error alert
useEffect(() => {
Expand Down Expand Up @@ -118,7 +139,6 @@ const Assignments = () => {
columns={tableColumns}
columnVisibility={{
id: false,

}}
/>
</Row>
Expand Down
Loading