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
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
22,233 changes: 4,176 additions & 18,057 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 19 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@
"@fortawesome/react-fontawesome": "^0.2.0",
"@reduxjs/toolkit": "^1.9.5",
"@tanstack/react-table": "^8.9.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.29",
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"@types/react-redux": "^7.1.25",
"@types/react-router-dom": "^5.3.3",
"ajv": "^8.17.1",
"axios": "^1.4.0",
"bootstrap": "^5.3.3",
"bootstrap": "^5.3.8",
"chart.js": "^4.1.1",
"formik": "^2.2.9",
"jquery": "^3.7.1",
Expand All @@ -33,19 +29,19 @@
"react-icons": "^4.9.0",
"react-redux": "^8.0.5",
"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",
"web-vitals": "^2.1.4",
"yup": "^1.4.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"test": "vitest",
"test:ui": "vitest --ui",
"coverage": "vitest run --coverage"
},
"eslintConfig": {
"extends": [
Expand All @@ -66,12 +62,23 @@
]
},
"devDependencies": {
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/chart.js": "^2.9.41",
"@types/jquery": "^3.5.29",
"@types/jqueryui": "^1.12.21",
"@types/node": "^20.19.20",
"@types/react-bootstrap": "^0.32.32",
"@types/react-datepicker": "^4.10.0",
"@vitejs/plugin-react": "^4.7.0",
"jsdom": "^26.1.0",
"prettier": "^2.8.7",
"typescript": "^5.9.2"
"sass": "^1.93.2",
"typescript": "^5.9.2",
"vite": "^6.3.6",
"vite-plugin-svgr": "^4.5.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.2.4"
}
}
43 changes: 0 additions & 43 deletions public/index.html

This file was deleted.

20 changes: 12 additions & 8 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
import React from 'react'
import { describe, it, expect } from 'vitest'
import { screen } from '@testing-library/react'
import { renderWithProviders } from './test/test-utils'
import App from './App'

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
describe('App', () => {
it('renders without crashing', () => {
const { container } = renderWithProviders(<App />)
expect(container.firstChild).toBeTruthy()
})

})
14 changes: 12 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ 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 Duties from "pages/Duties/Duties";
import DutyEditor from "pages/Duties/DutyEditor";
function App() {
const router = createBrowserRouter([
{
Expand Down Expand Up @@ -192,11 +194,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 Expand Up @@ -226,6 +228,14 @@ function App() {
},
],
},
{
path: "duties",
element: <ProtectedRoute element={<Duties />} leastPrivilegeRole={ROLE.TA} />,
children: [
{ path: "new", element: <DutyEditor mode="create" /> },
{ path: "edit/:id", element: <DutyEditor mode="update" /> },
],
},
{
path: "administrator",
element: (
Expand Down
153 changes: 68 additions & 85 deletions src/custom.scss
Original file line number Diff line number Diff line change
@@ -1,89 +1,72 @@
// overwrite theme variables
@use "bootstrap/scss/bootstrap" with (
$primary: #0d6efd,
$secondary: #000000,
$success: #66ab57,
$info: #0dcaf0,
$warning: #ffc107,
$danger: #dc3545,
$light: #f8f9fa,
$dark: #212529,

// good-looking theme
$primary: #a4a366;
$secondary: #9ab6da;
$dark: #386086;
$light: #f2efee;
$success: #66ab57;
$info: #9ab6da;
$warning: #e49b1f;
$danger: #f00678;


// test theme
// test theme
// scss-docs-start theme-color-variables
$primary: #0d6efd;
//$secondary: #6C757DFF;
$secondary: #000000;
$success: #66ab57;
$info: #0dcaf0;
$warning: #ffc107;
$danger: #dc3545;
$light: #f8f9fa;
$dark: #212529;
$wolf-red: #a90201;
$smoke: #f5f5f5;
$grey: #212529;
$darkgrey: #2b2c2d;

$theme-colors: (
"primary": $primary,
"secondary": $secondary,
"success": $success,
"info": $info,
"warning": $warning,
"danger": $danger,
"light": $light,
"dark": $dark,
"wolf-red": $wolf-red,
"smoke": $smoke,
"grey": $grey,
"darkgrey": $darkgrey
$theme-colors: (
"primary": #0d6efd,
"secondary": #000000,
"success": #66ab57,
"info": #0dcaf0,
"warning": #ffc107,
"danger": #dc3545,
"light": #f8f9fa,
"dark": #212529,
"wolf-red": #a90201,
"smoke": #f5f5f5,
"grey": #212529,
"darkgrey": #2b2c2d
)
);
// Custom styles for the action buttons in the Etc tab

/* Custom styles for the action buttons in the Etc tab */
.assignment-actions {
display: flex;
flex-wrap: wrap;
gap: 10px; // This will create space between the buttons and the ETC tab line
justify-content: flex-start;
padding-top: 10px; // Add more space above the buttons if needed
}

.custom-tab-button {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid #ccc;
padding: 10px;
border-radius: 5px;
background-color: white;
text-decoration: none;
color: inherit;
font-size: 1rem;
cursor: pointer;
width: calc(100% / 3 - 10px); // Adjust the width depending on the number of buttons per row
height: 100px ;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);

.icon {
margin-bottom: 5px;
font-size: 1.5em;
}

&:hover {
background-color: #f8f9fa;
border-color: #adb5bd;
}
}

// Responsive adjustments
@media (max-width: 768px) {
.custom-tab-button {
width: calc(100% - 10px); // Full width on small screens
margin-bottom: 10px; // Space between stacked buttons
}
}
// import bootstrap styles at the bottom!
@import 'bootstrap/scss/bootstrap.scss';
display: flex;
flex-wrap: wrap;
gap: 10px; // This will create space between the buttons and the ETC tab line
justify-content: flex-start;
padding-top: 10px; // Add more space above the buttons if needed
}

.custom-tab-button {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid #ccc;
padding: 10px;
border-radius: 5px;
background-color: white;
text-decoration: none;
color: inherit;
font-size: 1rem;
cursor: pointer;
width: calc(100% / 3 - 10px); // Adjust the width depending on the number of buttons per row
height: 100px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);

.icon {
margin-bottom: 5px;
font-size: 1.5em;
}

&:hover {
background-color: #f8f9fa;
border-color: #adb5bd;
}
}

/* Responsive adjustments */
@media (max-width: 768px) {
.custom-tab-button {
width: calc(100% - 10px); // full width on small screens
margin-bottom: 10px; // spacing between stacked buttons
}
}
5 changes: 4 additions & 1 deletion src/layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Header: React.FC = () => {
>
<Navbar.Brand>
<img
src={`${process.env.PUBLIC_URL}/assets/images/wolf.png`}
src="/assets/images/wolf.png"
className="d-inline-block align-top"
alt="wolf"
height="40"
Expand Down Expand Up @@ -134,6 +134,9 @@ const Header: React.FC = () => {
<NavDropdown.Item as={Link} to="/edit-questionnaire">
Edit Questionnaire
</NavDropdown.Item>
<NavDropdown.Item as={Link} to="/duties">
Roles(Duties)
</NavDropdown.Item>
<NavDropdown.Divider />
<NavDropdown.Item as={Link} to="/impersonate">
Impersonate User
Expand Down
Loading