Skip to content
Merged
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
8 changes: 4 additions & 4 deletions code/frontend/package-lock.json

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

2 changes: 1 addition & 1 deletion code/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"devDependencies": {
"@eslint/js": "^9.33.0",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^30.0.0",
Expand Down
5 changes: 3 additions & 2 deletions code/frontend/src/api/auth/login.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// src/api/auth/login.ts
// Centralized login request helper
// Copilot generated initial structure and logic
// Human refined error handling, types, and token management
// 40% AI-generated, 60% human refined

import { postJson, stripEnvelope } from '../http';

Expand All @@ -22,7 +25,6 @@ export async function login(
): Promise<{ token: string; raw: LoginResponseEnvelope }> {
// Normalize input
const trimmedEmail = (username || '').trim();
console.log('Attempting login with:', { email: trimmedEmail });

// IMPORTANT: ensure we never send stale tokens on the login call
try {
Expand Down Expand Up @@ -52,7 +54,6 @@ export async function login(
localStorage.setItem('jwt', token);
} catch {}

console.log('Login response data:', data);
return { token, raw: unwrapped };
} catch (error: any) {
console.error('Login error:', error);
Expand Down
11 changes: 0 additions & 11 deletions code/frontend/src/api/pages/myJobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export async function getMySaved(): Promise<SavedAppliedJob[]> {
const body = { size: 10, page: 0 };
const { data } = await postJson<any>('/jobs/saved/list', body);

console.log('getMySaved response data:', data);
return normalizeJobs(data);
}

Expand All @@ -61,7 +60,6 @@ export async function getMyApplied(): Promise<SavedAppliedJob[]> {
const body = { size: 10, page: 0 };
const { data } = await postJson<any>('/jobs/applied/list', body);

console.log('getMyApplied response data:', data);
return normalizeJobs(data);
}

Expand Down Expand Up @@ -95,8 +93,6 @@ export async function deleteSavedJob(id: string | number): Promise<void> {
uid: uid, // Include the user ID which is required by the backend
});

console.log('deleteSavedJob response:', response?.status, data);

// Check if the deletion was successful
const success =
data?.success ||
Expand All @@ -119,7 +115,6 @@ export async function deleteAppliedJob(id: string | number): Promise<void> {
jobIds: [jobId],
uid: uid, // Include the user ID which is required by the backend
};
console.log('deleteAppliedJob request body:', requestBody);

try {
// Use the specified endpoint /jobs/applied/delete with the correct request body format
Expand All @@ -128,8 +123,6 @@ export async function deleteAppliedJob(id: string | number): Promise<void> {
requestBody
);

console.log('deleteAppliedJob response:', response?.status, data);

// Check if the deletion was successful
const success =
data?.success ||
Expand Down Expand Up @@ -164,8 +157,6 @@ export async function deleteAllSaved(): Promise<void> {
uid, // Include the user ID which is required by the backend
});

console.log('deleteAllSaved response:', response?.status, data);

// Check if the deletion was successful
const success =
data?.success ||
Expand Down Expand Up @@ -193,8 +184,6 @@ export async function deleteAllApplied(): Promise<void> {
uid, // Include the user ID which is required by the backend
});

console.log('deleteAllApplied response:', response?.status, data);

// Check if the deletion was successful
const success =
data?.success ||
Expand Down
4 changes: 2 additions & 2 deletions code/frontend/src/api/savedAndApplied/savedAndApplied.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function buildSavedJobPayload(job: Job): SavedJobPayload {
export async function saveJob(job: Job): Promise<SaveJobResponse> {
const payload = buildSavedJobPayload(job);
const { data } = await postJson<SaveJobResponse>('/jobs/saved/save', payload);
console.log('Save job response data:', data);

return data;
}

Expand All @@ -136,6 +136,6 @@ export async function applyJob(job: Job): Promise<SaveJobResponse> {
'/jobs/applied/apply',
payload
);
console.log('Apply job response data:', data);

return data;
}
6 changes: 4 additions & 2 deletions code/frontend/src/components/asideAndToggler/Aside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export default function Aside({ myJobsView, onMyJobsViewChange }: AsideProps) {
role="group"
aria-label="Filters"
>
<Field />
<Type />
{/* Hide Field and Type components on MyJobs page */}
{!isMyJobs && <div className="fw-semibold mb-1">FILTERS</div>}
{!isMyJobs && <Field />}
{!isMyJobs && <Type />}
<button
type="button"
className={`${buttonClass} filter-button`}
Expand Down
15 changes: 10 additions & 5 deletions code/frontend/src/components/asideAndToggler/themeToggler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,28 @@ export default function ThemeToggler() {

return (
<div
className="w-100 d-flex justify-content-end"
onClick={toggle}
aria-label="Toggle color theme"
style={{
cursor: 'pointer',
width: 'fit-content',
float: 'right',
marginBottom: '1.5rem',
}}
>
{theme === 'light' ? (
<img
src={moonImage}
alt="Switch to dark mode"
style={{ width: '47px', height: '47px' }}
className="user-select-none me-3"
style={{ width: '40px', height: '40px' }}
className="user-select-none"
/>
) : (
<img
src={sunImage}
alt="Switch to light mode"
style={{ width: '47px', height: '47px' }}
className="user-select-none me-3"
style={{ width: '40px', height: '40px' }}
className="user-select-none"
/>
)}
</div>
Expand Down
25 changes: 25 additions & 0 deletions code/frontend/src/components/buttons/MyJobs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
AI-generated code: 0%
Human code: 100%
Framework-generated code: 0%
*/

.my-jobs-button {
padding: 8px 16px;
background-color: #0d6efd;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-weight: 500;
transition: background-color 0.2s;
}

.my-jobs-button:hover {
background-color: #0b5ed7;
}

.my-jobs-button:focus {
outline: none;
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}
19 changes: 16 additions & 3 deletions code/frontend/src/components/buttons/MyJobsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@
Framework-generated code: 0%
*/


import React from 'react';
import './MyJobs.css';

const MyJobsButton: React.FC = () => {
interface MyJobsButtonProps {
onClick?: () => void;
className?: string;
ariaLabel?: string;
}

const MyJobsButton: React.FC<MyJobsButtonProps> = ({
onClick,
className = '',
ariaLabel = 'Navigate to My Jobs page',
}) => {
return (
<button className="my-jobs-button">
<button
className={`my-jobs-button ${className}`.trim()}
onClick={onClick}
aria-label={ariaLabel}
>
My Jobs
</button>
);
Expand Down
1 change: 1 addition & 0 deletions code/frontend/src/components/headerAndFooter/Footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
text-align: center;
padding: 1rem;
color: #717273;
transition: background-color 0.3s ease;
}

/* Dark theme override */
Expand Down
7 changes: 6 additions & 1 deletion code/frontend/src/components/headerAndFooter/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
*/

import './Footer.css';
import { useTheme } from '../../theme/ThemeContext';

const Footer: React.FC = () => {
const currentYear = new Date().getFullYear();
const { theme } = useTheme();

return (
<div className="footer-container">
<div
className="footer-container"
style={{ backgroundColor: theme === 'light' ? 'white' : '#1A1A1A' }}
>
CS673OLFall25-Team2 | {currentYear} |{' '}
<span className="university-title">Boston University</span>
</div>
Expand Down
2 changes: 0 additions & 2 deletions code/frontend/src/components/jobsList/MyJobsViewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ const MyJobsViewList: React.FC<MyJobsViewListProps> = ({
const updatedJobs =
view === 'saved' ? await getMySaved() : await getMyApplied();

console.log(`Updated ${label} jobs list:`, updatedJobs);

// Check if the job was actually deleted
const jobStillExists = updatedJobs.some((job) => job.id === id);
if (jobStillExists) {
Expand Down
3 changes: 0 additions & 3 deletions code/frontend/src/components/jobsList/SavedJobApplyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ export default function SavedJobApplyButton({

// Add the alert to the container
container.appendChild(alertDiv);

// Log to confirm alert is triggered
console.log('Job applied successfully, showing alert');
} else {
throw new Error('Apply did not succeed');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const clearSavedAppliedJobs = (): string => {
localStorage.removeItem(SAVED_JOBS_KEY);
localStorage.removeItem(APPLIED_JOBS_KEY);

console.log('Cleared saved and applied jobs from localStorage');
return 'Cleared';
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ const LoginForm: React.FC<Props> = ({ onSubmit, showSubmitButton = false }) => {

try {
setLoading(true);
console.log('Login attempt with:', { email: values.username });
const { token, raw } = await loginRequest(
values.username.trim(),
values.password
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const RegisterForm: React.FC<Props> = ({

try {
setLoading(true);
console.log('Submitting registration with:', values);

const payload: RegisterPayload = {
name: values.name,
Expand All @@ -99,7 +98,6 @@ const RegisterForm: React.FC<Props> = ({
};

try {
console.log('Sending registration request with payload:', payload);
const result = await registerRequest(payload);
console.log('Registration successful:', result);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
AI-generated code: ~50%
- Tool: ChatGPT (link: https://chatgpt.com/share/68d43c9d-4d60-8006-a1a7-14ae49475a5a)
- Functions/classes: isRequired, isEmail utility functions suggested by AI
Human code (James Rose): ~50%
Human code: ~50%
- Adjustments: simplified regex validation, added doc comments, integration testing with forms
Framework-generated code: 0%
- (Plain TypeScript helpers, no framework generation)
Expand All @@ -14,4 +14,4 @@ export const isRequired = (v: string) => v.trim().length > 0;

// Simple regex check for email format
export const isEmail = (v: string) =>
/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v.trim());
/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v.trim());
Loading