Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
447639f
feat(assignments): add implementation for redesign of assignment part…
pulanski Dec 4, 2024
f3f6b03
Pulling in and merging the pull request
shubashwetha Apr 7, 2025
f4ca7ad
Merged the pull request 72
shubashwetha Apr 15, 2025
8a352a5
added api fetches to grab table data
mayamei1 Apr 19, 2025
d287d8d
added delete/edit api calls
mayamei1 Apr 19, 2025
0a4d27d
Changing the useParams() import
aryansharma2k2 Apr 20, 2025
31e7566
Removing redundant sliders and changing Save logic
aryansharma2k2 Apr 20, 2025
d7cd627
Removing showNotifications and handlePermissionsToggle
aryansharma2k2 Apr 20, 2025
523847a
Adding the edit user api call
aryansharma2k2 Apr 20, 2025
2b96959
Add user functionality implemented
aryansharma2k2 Apr 20, 2025
f4b8121
Teaching assistant feature to be added
aryansharma2k2 Apr 20, 2025
e650e5a
Added missing icon images
shubashwetha Apr 22, 2025
b67fc54
Made Quiz and Mentor available
shubashwetha Apr 22, 2025
0a5cc28
Added pagination components
shubashwetha Apr 22, 2025
40f1eb7
Revamped UI according to the design document
shubashwetha Apr 22, 2025
10504f1
Merge branch 'test-branch' into skalyan3
mayamei1 Apr 22, 2025
6d0c4bb
made filteredParticipants memoized
mayamei1 Apr 22, 2025
c6e2db9
Changed the casing
shubashwetha Apr 22, 2025
45b1f0a
Added relevant comments
shubashwetha Apr 22, 2025
3a18885
Adding comments
aryansharma2k2 Apr 22, 2025
3b61063
Removed cancel button to eliminate redundancy
shubashwetha Apr 22, 2025
41be07a
Merge branch 'skalyan3' of https://github.com/aryansharma2k2/reimplem…
shubashwetha Apr 22, 2025
537e7be
fixed adding user api call
mayamei1 Apr 22, 2025
9344fbd
fixed automatic updating of table
mayamei1 Apr 22, 2025
2b3eb31
removed updating of table when a modal closes
mayamei1 Apr 22, 2025
a5b7347
fixed editor only showing initially selected participant
mayamei1 Apr 22, 2025
745a997
Added information icon
shubashwetha Apr 23, 2025
fa73d92
Merge branch 'skalyan3' of https://github.com/aryansharma2k2/reimplem…
shubashwetha Apr 23, 2025
7c4876b
Merge branch 'skalyan3'
shubashwetha Apr 23, 2025
f970cec
updated table text format
mayamei1 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
787 changes: 440 additions & 347 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"axios": "^1.4.0",
"bootstrap": "^5.3.3",
"chart.js": "^4.1.1",
"recharts": "^2.0.0",
"formik": "^2.2.9",
"jquery": "^3.7.1",
"jwt-decode": "^3.1.2",
Expand All @@ -32,8 +31,10 @@
"react-i18next": "^14.1.0",
"react-icons": "^4.9.0",
"react-redux": "^8.0.5",
"react-router": "^6.28.0",
"react-router-dom": "^6.11.1",
"react-scripts": "^5.0.1",
"recharts": "^2.0.0",
"redux-persist": "^6.0.0",
"sass": "^1.62.1",
"save": "^2.9.0",
Expand Down
13,376 changes: 13,376 additions & 0 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Binary file added public/assets/images/Check-icon.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/Uncheck-icon.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.
32 changes: 16 additions & 16 deletions public/assets/images/favicon.svg
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/info.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.
Binary file modified public/favicon.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<title>Expertiza</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
2 changes: 1 addition & 1 deletion src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
// expect(linkElement).toBeInTheDocument();
});
19 changes: 4 additions & 15 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import ViewSubmissions from "pages/Assignments/ViewSubmissions";
import ViewScores from "pages/Assignments/ViewScores";
import ViewReports from "pages/Assignments/ViewReports";
import ViewDelayedJobs from "pages/Assignments/ViewDelayedJobs";
import AssignmentParticipants from "pages/AssignmentParticipants/AssignmentParticipants";
function App() {
const router = createBrowserRouter([
{
Expand Down Expand Up @@ -144,19 +145,7 @@ function App() {
},
{
path: "assignments/edit/:assignmentId/participants",
element: <Participants type="student_tasks" id={1} />,
children: [
{
path: "new",
element: <ParticipantEditor mode="create" type="assignments" />,
loader: loadParticipantDataRolesAndInstitutions,
},
{
path: "edit/:id",
element: <ParticipantEditor mode="update" type="assignments" />,
loader: loadParticipantDataRolesAndInstitutions,
},
],
element: <AssignmentParticipants assignmentProps={{ hasQuiz: true, hasMentor: true }} />,
},
{
path: "student_tasks/edit/:assignmentId/participants",
Expand Down Expand Up @@ -192,11 +181,11 @@ function App() {
},
{
path: "reviews",
element: <Reviews/>,
element: <Reviews />,
},
{
path: "email_the_author",
element: <Email_the_author/>,
element: <Email_the_author />,
},
// Fixed the missing comma and added an opening curly brace
{
Expand Down
Binary file added src/assets/delete_icon.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 src/assets/edit_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/Icon/Icon.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.icon-base {
display: inline-block;
object-fit: contain;
}
21 changes: 21 additions & 0 deletions src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import './Icon.css';

interface IconProps {
src: string; // Path to the PNG
alt: string; // Alt text for accessibility
size?: number; // Optional size (e.g., 24px by default)
className?: string; // Optional custom styles
}

export const Icon: React.FC<IconProps> = ({ src, alt, size = 24, className }) => {
return (
<img
src={src}
alt={alt}
width={size}
height={size}
className={`icon-base ${className}`}
/>
);
};
47 changes: 34 additions & 13 deletions src/components/Table/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ import { Col, Pagination as BPagination, Row } from "react-bootstrap";
import Input from "../Input";
import Select from "../Select";

/**
* @author Ankur Mundra on May, 2023
*/

interface PaginationProps {
nextPage: () => void;
previousPage: () => void;
canNextPage: () => boolean;
canPreviousPage: () => boolean;
setPageIndex: (pageIndex: number) => void;
setPageIndex: (updater: number | ((pageIndex: number) => number)) => void;
setPageSize: (pageSize: number) => void;
getPageCount: () => number;
getState: () => TableState;
Expand All @@ -30,6 +26,28 @@ const Pagination: React.FC<PaginationProps> = (props) => {
getPageCount,
getState,
} = props;

const totalPages = getPageCount();
const isPaginationDisabled = totalPages <= 1;

const handlePageSizeChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
const selectedValue = e.target.value;
const pageSize =
selectedValue === `${Number.MAX_SAFE_INTEGER}`
? Number.MAX_SAFE_INTEGER // Show all (effectively no pagination)
: Number(selectedValue);

setPageSize(pageSize);

// Reset to the first page when "Show All" is selected
if (pageSize === Number.MAX_SAFE_INTEGER) {
setPageIndex(0);
}
};

// Handle case when "Show All" is selected and pagination is disabled
if (isPaginationDisabled && getState().pagination.pageSize !== Number.MAX_SAFE_INTEGER) return null;

return (
<Row className="justify-content-center">
<Col xs="auto">
Expand All @@ -38,22 +56,19 @@ const Pagination: React.FC<PaginationProps> = (props) => {
<BPagination.Prev onClick={() => previousPage()} disabled={!canPreviousPage()} />
<BPagination.Next onClick={() => nextPage()} disabled={!canNextPage()} />
<BPagination.Last
onClick={() => setPageIndex(getPageCount() - 1)}
onClick={() => setPageIndex(totalPages - 1)}
disabled={!canNextPage()}
/>
</BPagination>
</Col>
{/*<Col xs="auto">*/}
{/* {`Page ${getState().pagination.pageIndex + 1} of ${getPageCount()}`}*/}
{/*</Col>*/}
<Col xs="auto">
<Input
id="columnFilter"
label="Go to page"
input={{
type: "number",
min: "1",
max: getPageCount(),
max: totalPages,
defaultValue: getState().pagination.pageIndex + 1,
onChange: (e: React.ChangeEvent<HTMLInputElement>) => {
const page = e.target.value ? Number(e.target.value) - 1 : 0;
Expand All @@ -69,16 +84,22 @@ const Pagination: React.FC<PaginationProps> = (props) => {
{ label: "Show 10", value: "10" },
{ label: "Show 25", value: "25" },
{ label: "Show 50", value: "50" },
{ label: "Show All", value: `${Number.MAX_SAFE_INTEGER}` }, // Add "Show All" with a large value
]}
input={{
value: getState().pagination.pageSize,
onChange: (e: React.ChangeEvent<HTMLSelectElement>) =>
setPageSize(Number(e.target.value)),
onChange: handlePageSizeChange, // Call the handlePageSizeChange function
}}
/>
</Col>
</Row>
);
};

export default Pagination;
const PaginationWrapper: React.FC<PaginationProps> = (props) => {
const totalPages = props.getPageCount();
if (totalPages <= 1 && props.getState().pagination.pageSize !== Number.MAX_SAFE_INTEGER) return null;
return <Pagination {...props} />;
};

export default PaginationWrapper;
2 changes: 1 addition & 1 deletion src/pages/Administrator/ManageUserTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { useLoaderData, useNavigate, useParams } from "react-router-dom";
import React, { useCallback, useMemo, useState } from "react";
import { IUserResponse } from "../../utils/interfaces";
import { Row as TRow } from "@tanstack/table-core/build/lib/types";
import { Row as TRow } from "@tanstack/react-table";
import { userColumns as USER_COLUMNS } from "../Users/userColumns";
import { Col, Container, Row } from "react-bootstrap";
import DeleteUser from "../Users/UserDelete";
Expand Down
Loading