Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5a07b9f
created a new page StudentTasks under student role and added a basic …
prathyu99 Apr 17, 2024
e01eee6
Added link to navigate to new Student Task Detail page
prathyu99 Apr 19, 2024
111ba6a
added checkbox for publishing rights
prathyu99 Apr 19, 2024
2ad4e8d
added css for links
prathyu99 Apr 19, 2024
15c58c6
Adding Student Tasks Box
soubhi Apr 23, 2024
5c3de2c
Merge pull request #1 from prathyu99/apiAndLayout
soubhi Apr 23, 2024
544b071
Modifying code to fetch data from dummy data
soubhi Apr 23, 2024
8a628a4
Merge pull request #2 from prathyu99/apiAndLayout
soubhi Apr 23, 2024
80b463c
added icon i which displays text on hover
prathyu99 Apr 24, 2024
ab936ac
added css to adjust the layout
prathyu99 Apr 24, 2024
5e372f0
Modifying Revisions component and adding remaining days functionality
soubhi Apr 24, 2024
5c40ef2
Merge branch 'main' into apiAndLayout
soubhi Apr 24, 2024
ca8ac62
Merge pull request #3 from prathyu99/apiAndLayout
soubhi Apr 24, 2024
1257334
added comments to the code and resolved merge conflicts
prathyu99 Apr 24, 2024
25f8ad2
added comments to the code studenttasks
prathyu99 Apr 24, 2024
19f3409
Merge branch 'main' into main
soubhi Apr 24, 2024
7c1a434
added space in student task box, changed the hover text for publishin…
prathyu99 Apr 29, 2024
a779945
Merge remote-tracking branch 'origin/main'
prathyu99 Apr 29, 2024
e6cccb7
added space in student task box, changed the hover text for publishin…
prathyu99 Apr 29, 2024
8bf0c02
removed an unnecessary change
prathyu99 Apr 29, 2024
66d950b
Merge branch 'expertiza:main' into main
prathyu99 Jan 28, 2025
906dcb1
Merge branch 'main' into pr-52
Mar 13, 2025
af7256f
Merge remote-tracking branch 'origin' into pr-52
Mar 14, 2025
53383c4
Commented out the overwritten table style within StudentTasks.module.css
Mar 14, 2025
d14f465
Change the Student Task table using the Table component
cnayak99 Mar 15, 2025
4f6c0df
Change the Student Task table using the Table component
cnayak99 Mar 15, 2025
b0505b8
Start feature: Add info icon with pop-out comment placeholder
Mar 16, 2025
2871438
Update pop-out comments in Assignment table
Mar 18, 2025
f9327b7
Merge pull request #24 from Jing27540/feature/info-icon-popout
Jing27540 Mar 18, 2025
39e1593
Finished the reimplementation of Course Assignment View.
Mar 18, 2025
e7284a6
Reimplementing the Student Task view.
Mar 18, 2025
8201d5e
Finished to enable add info icon with the Heading
Mar 20, 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
Binary file added public/assets/icons/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Questionnaire from "pages/EditQuestionnaire/Questionnaire";
import Courses from "pages/Courses/Course";
import CourseEditor from "pages/Courses/CourseEditor";
import { loadCourseInstructorDataAndInstitutions } from "pages/Courses/CourseUtil";
import StudentTasks from "./pages/StudentTasks/StudentTasks";
import TA from "pages/TA/TA";
import TAEditor from "pages/TA/TAEditor";
import { loadTAs } from "pages/TA/TAUtil";
Expand Down Expand Up @@ -59,6 +60,10 @@ function App() {
path: "edit-questionnaire",
element: <ProtectedRoute element={<Questionnaire />} />,
},
{
path: "student_tasks",
element: <ProtectedRoute element={<StudentTasks />} leastPrivilegeRole={ROLE.STUDENT} />,
},
{
path: "assignments/edit/:id/createteams",
element: <CreateTeams />,
Expand Down Expand Up @@ -297,4 +302,4 @@ function App() {
return <RouterProvider router={router} />;
}

export default App;
export default App;
11 changes: 9 additions & 2 deletions src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Table: React.FC<TableProps> = ({
tableSize = { span: 12, offset: 0 },
renderSubComponent,
getRowCanExpand,
disableGlobalFilter = false, // // Disable the Global Search
disableGlobalFilter = false, // Disable the Global Search
}) => {
const [rowSelection, setRowSelection] = useState({});
const [sorting, setSorting] = useState<SortingState>([]);
Expand Down Expand Up @@ -200,6 +200,13 @@ const Table: React.FC<TableProps> = ({
}}
>
{flexRender(header.column.columnDef.header, header.getContext())}
{header.column.columnDef.comment ? (
<img
src="assets/icons/info.png"
alt="Review Grade"
title={header.column.columnDef.comment}
/>
) : null}
{{
asc: " 🔼",
desc: " 🔽",
Expand Down Expand Up @@ -255,4 +262,4 @@ const Table: React.FC<TableProps> = ({
);
};

export default Table;
export default Table;
5 changes: 1 addition & 4 deletions src/pages/Assignments/AssignmentColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ export const assignmentColumns = (handleEdit: Fn, handleDelete: Fn) => [
columnHelper.accessor("name", {
header: "Name",
}),
columnHelper.accessor("courseName", {
header: "Course Name",
}),
columnHelper.accessor("created_at", {
header: "Creation Date",
}),
Expand Down Expand Up @@ -41,4 +38,4 @@ export const assignmentColumns = (handleEdit: Fn, handleDelete: Fn) => [
</>
),
}),
];
];
1 change: 0 additions & 1 deletion src/pages/Courses/Course.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ const Courses = () => {
created_at: formatDate(item.created_at),
updated_at: formatDate(item.updated_at),
}));

return (
<>
<Outlet />
Expand Down
48 changes: 16 additions & 32 deletions src/pages/Courses/CourseAssignments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Row as TRow } from "@tanstack/react-table";
import Table from "components/Table/Table";
import React from "react";
import { assignmentColumns as getBaseAssignmentColumns } from "../Assignments/AssignmentColumns";
import { capitalizeFirstWord, formatDate } from "utils/dataFormatter";

interface ActionHandler {
icon: string;
Expand Down Expand Up @@ -99,22 +100,18 @@ const CourseAssignments: React.FC<CourseAssignmentsProps> = ({ courseId, courseN
},
];

// TODO: update it with actual api calls to get assignment list
const generateFakeAssignments = () => {
const numAssignments = 3 + Math.floor(Math.random() * 3);
return Array.from({ length: numAssignments }, (_, idx) => ({
id: parseInt(`${courseId}${idx}`),
name: `Assignment ${idx + 1} for ${courseName}`,
courseName: courseName,
name: `Assignment ${idx + 1}`,
description: "This is a fake assignment",
created_at: new Date(Date.now() - Math.random() * 10000000000).toISOString(),
updated_at: new Date().toISOString(),
}));
};

const capitalizeSentence = (str: string) => {
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
};

const getAssignmentColumns = (actions: ActionHandler[]) => {
const baseColumns = getBaseAssignmentColumns(
() => {},
Expand Down Expand Up @@ -144,35 +141,22 @@ const CourseAssignments: React.FC<CourseAssignmentsProps> = ({ courseId, courseN
return [...baseColumns, actionsColumn];
};

// Helper function to format the dates
const formatDate = (dateString: string): string => {
const date = new Date(dateString);
const options: Intl.DateTimeFormatOptions = {
month: 'short',
day: 'numeric',
year: 'numeric',
hour: 'numeric',
minute: 'numeric',
hour12: true
};
return date.toLocaleString('en-US', options);
};


const assignments = generateFakeAssignments();
const columns = getAssignmentColumns(actionHandlers);

// Remove the 'Course Name' column from column definitions to hide it.
const filteredColumns = columns.filter((col) => col.header !== "Course Name");
// Remove 'courseName' field from assignment data to hide it and Format date fields.
const filteredAssignments = assignments.map(
({ name, courseName, created_at, updated_at, ...rest }) => ({
...rest,
name: capitalizeSentence(name),
created_at: formatDate(created_at), // Format 'created_at' date
updated_at: formatDate(updated_at), // Format 'updated_at' date
})
);
// Format all heading data fields.
const filteredColumns = columns.map(({ header, ...rest }) => ({
...rest,
header: capitalizeFirstWord(header as string),
}));

// Format some assignment data fields.
const filteredAssignments = assignments.map(({ name, created_at, updated_at, ...rest }) => ({
...rest,
name: capitalizeFirstWord(name),
created_at: formatDate(created_at), // Format 'created_at' date
updated_at: formatDate(updated_at), // Format 'updated_at' date
}));

return (
<div className="px-4 py-2 bg-light">
Expand Down
15 changes: 15 additions & 0 deletions src/pages/StudentTasks/StudentTaskDetail.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import { useParams } from 'react-router-dom';

const StudentTaskDetail: React.FC = () => {
const { id } = useParams(); // To grab the ID from the URL

return (
<div>
<h2>Assignment Title: {id}</h2>
{/* Details about the assignment could be fetched and displayed here */}
</div>
);
};

export default StudentTaskDetail;
179 changes: 179 additions & 0 deletions src/pages/StudentTasks/StudentTasks.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
/* Base container styling */
.container {
font-family: Arial, sans-serif;
margin: 20px;
}

/* Header 1 styling */
h1 {
text-align: left;
padding-top: 5px;
padding-left: 15px;
margin-bottom: 0px;
padding-bottom: 0px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
}

/* Table base styling */
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}

/* Table, th, and td shared border styling */
table,
th,
td {
border: 1px solid #ddd;
}

/* Table header styling */
th {
background-color: #f8f8f8;
color: #333;
text-align: left;
padding: 8px;
}

/* Table data cell styling */
td {
padding: 8px;
text-align: left;
}

/* First child of th and td border styling */
th:first-child,
td:first-child {
border-left: none;
}

/* Last child of th and td border styling */
th:last-child,
td:last-child {
border-right: none;
}

/* Table row striping for even rows */
tr:nth-child(even) {
background-color: #f2f2f2;
}

/* Badge info icon and publishing rights checkbox styling */
.badge-info-icon,
.publishing-rights-checkbox {
cursor: pointer;
margin-left: 5px;
}

/* Checked state styling for publishing rights checkbox */
.publishing-rights-checkbox:checked {
accent-color: #009688;
}

/* Table header row font styling */
thead tr {
font-weight: bold;
}

/* Status indicator icons styling */
.status-indicator {
color: #009688;
margin-left: 5px;
}

/* Disabled state styling for checkboxes */
input[type="checkbox"][disabled] {
opacity: 0.6;
cursor: not-allowed;
}

/* Information icon styling in table */
.info-icon {
font-style: normal;
color: #017bff;
cursor: help;
}

/* Side information section styling */
.side-info {
color: #333;
padding: 10px 0;
}

/* Number styling in side information section */
.side-info .number {
font-weight: bold;
color: #d9534f; /* Red color for the number badge */
}

/* Page layout styling */
.pageLayout {
display: flex;
margin: 16px;
}

/* Sidebar styling */
.sidebar {
width: 250px;
margin-right: 20px;
padding-top: 20px;
}

/* Main content area styling */
.mainContent {
flex-grow: 1;
overflow: hidden;
}

/* Header below pageLayout styling */
.header {
margin-bottom: 20px;
}

/* Tasks table styling */
.tasksTable {
width: 100%;
}

/* Page assignments styling */
.assignments-page {
font-family: 'Arial', sans-serif;
}

/* Title in assignments page styling */
.assignments-title {
color: #333;
text-align: left;
padding: 20px;
font-size: 24px;
}

/* Footer section styling */
.footer {
display: flex;
justify-content: center;
padding: 20px 0;
}

/* Footer link styling */
.footerLink {
margin: 0 10px;
color: #986633;
text-decoration: none;
}

/* Footer link hover styling */
.footerLink:hover {
color: #000000;
text-decoration: underline;
}

/* Center checkbox in table data cell styling */
.centerCheckbox {
text-align: center;
vertical-align: middle;
}
Loading