Skip to content

Commit 09ed377

Browse files
authored
Merge branch 'development' into Prem-UI-overlapping-issue
2 parents fbcca2e + 08a18d7 commit 09ed377

18 files changed

Lines changed: 4199 additions & 2691 deletions

package-lock.json

Lines changed: 1479 additions & 1838 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"react-toastify": "^5.3.1",
107107
"react-tooltip": "^4.5.1",
108108
"react-use-websocket": "^3.0.0",
109+
"react-window": "^1.8.11",
109110
"reactjs-popup": "^2.0.5",
110111
"reactstrap": "^8.10.1",
111112
"read-excel-file": "^5.5.3",

src/components/BMDashboard/WeeklyProjectSummary/PaidLaborCost/PaidLaborCost.module.css

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,22 @@
9090
}
9191

9292
.paid-labor-cost-date-range-input {
93-
display: flex;
94-
justify-content: space-between;
95-
align-items: center;
93+
/* display: flex; */
94+
/* justify-content: space-between; */
9695
margin-top: 3px;
97-
padding: 2px 4px;
98-
border: 1px solid #ddd;
96+
/* padding: 2px 4px; */
97+
/* border: 1px solid #ddd; */
98+
transition: border-color 0.2s;
99+
flex: 1;
100+
padding: 0.2rem 2.5rem 0.2rem 0.2rem;
101+
border: 1px solid #ccc;
99102
border-radius: 4px;
100-
background-color: white;
103+
background-color: #fff;
104+
display: flex;
105+
align-items: center;
106+
justify-content: center;
101107
cursor: pointer;
102-
transition: border-color 0.2s;
108+
font-size: 0 ninerem;
103109
}
104110

105111
.paid-labor-cost-date-range-input:hover {
@@ -386,7 +392,7 @@
386392
align-items: center;
387393
}
388394

389-
.paid-labor-cost-date-range-input {
395+
/* .paid-labor-cost-date-range-input {
390396
flex: 1;
391397
padding: 0.2rem 2.5rem 0.2rem 0.2rem;
392398
border: 1px solid #ccc;
@@ -397,7 +403,7 @@
397403
justify-content: center;
398404
cursor: pointer;
399405
font-size: 0 ninerem;
400-
}
406+
} */
401407

402408
.paid-labor-cost-info-wrapper {
403409
position: absolute;
@@ -518,6 +524,9 @@
518524
width: 100%;
519525
overflow-x: auto;
520526
background-color: var(--bg-color);
527+
scrollbar-width: thin;
528+
scrollbar-color: var(--button-bg) var(--card-shadow);
529+
521530
}
522531

523532
.paidLaborCostChartScrollWrapper::-webkit-scrollbar {
@@ -533,7 +542,7 @@
533542
border-radius: 3px;
534543
}
535544

536-
.paidLaborCostChartScrollWrapper {
545+
/* .paidLaborCostChartScrollWrapper {
537546
scrollbar-width: thin;
538547
scrollbar-color: var(--button-bg) var(--card-shadow);
539-
}
548+
} */

src/components/CommunityPortal/CPDashboard.jsx

Lines changed: 74 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,91 @@ import { useState, useEffect } from 'react';
22
import { Container, Row, Col, Card, CardBody, Button, Input } from 'reactstrap';
33
import styles from './CPDashboard.module.css';
44
import { FaCalendarAlt, FaMapMarkerAlt, FaUserAlt } from 'react-icons/fa';
5-
import { toast } from 'react-toastify';
5+
import { ENDPOINTS } from '../../utils/URL';
6+
import axios from 'axios';
67

78
export function CPDashboard() {
89
const [events, setEvents] = useState([]);
910
const [search, setSearch] = useState('');
10-
const [selectedDate, setSelectedDate] = useState('');
11-
const [dateError, setDateError] = useState('');
11+
const [isLoading, setIsLoading] = useState(false);
12+
const [error, setError] = useState(null);
13+
const [pagination, setPagination] = useState({
14+
currentPage: 1,
15+
totalPages: 5,
16+
total: 0,
17+
limit: 6,
18+
});
19+
20+
const FALLBACK_IMG =
21+
'https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=600&q=60';
22+
23+
const FixedRatioImage = ({ src, alt, fallback }) => (
24+
<div
25+
style={{
26+
width: '100%',
27+
aspectRatio: '4 / 3',
28+
overflow: 'hidden',
29+
background: '#f2f2f2',
30+
}}
31+
>
32+
<img
33+
src={src || fallback}
34+
alt={alt}
35+
loading="lazy"
36+
onError={e => {
37+
if (e.currentTarget.src !== fallback) e.currentTarget.src = fallback;
38+
}}
39+
style={{
40+
width: '100%',
41+
height: '100%',
42+
objectFit: 'cover',
43+
display: 'block',
44+
}}
45+
/>
46+
</div>
47+
);
1248

1349
useEffect(() => {
14-
const mockEvents = [
15-
{
16-
id: 1,
17-
title: 'PGSA Lunch Talks',
18-
date: 'Friday, December 6 at 12:00PM EST',
19-
location: 'Disque 919',
20-
organizer: 'Physics Graduate Student Association',
21-
image: 'https://via.placeholder.com/300',
22-
},
23-
{
24-
id: 2,
25-
title: 'Hot Chocolate/Bake Sale',
26-
date: 'Friday, December 6 at 12:00PM EST',
27-
location: 'G.C LeBow - Lobby Tabling Space 2',
28-
organizer: 'Kappa Phi Gamma, Sorority Inc.',
29-
image: 'https://via.placeholder.com/300',
30-
},
31-
{
32-
id: 3,
33-
title: 'Holiday Lunch',
34-
date: 'Friday, December 6 at 12:00PM EST',
35-
location: 'Hill Conference Room',
36-
organizer: 'Chemical and Biological Engineering Graduate Society',
37-
image: 'https://via.placeholder.com/300',
38-
},
39-
];
40-
setEvents(mockEvents);
50+
const fetchEvents = async () => {
51+
setIsLoading(true);
52+
53+
try {
54+
const response = await axios.get(ENDPOINTS.EVENTS);
55+
console.log('Fetched events:', response.data.events);
56+
setEvents(response.data.events);
57+
} catch (err) {
58+
console.error('Here', err);
59+
setError('Failed to load events');
60+
} finally {
61+
setIsLoading(false);
62+
}
63+
};
64+
65+
fetchEvents();
4166
}, []);
4267

43-
const handleDateChange = e => {
44-
const value = e.target.value;
45-
setSelectedDate(value);
68+
const formatDate = dateStr => {
69+
if (!dateStr) return 'Date TBD';
70+
const date = new Date(dateStr);
71+
return date.toLocaleString('en-US', {
72+
weekday: 'long',
73+
month: 'long',
74+
day: 'numeric',
75+
hour: 'numeric',
76+
minute: '2-digit',
77+
});
78+
};
4679

47-
const today = new Date();
48-
today.setHours(0, 0, 0, 0); // midnight today
80+
const filteredEvents = events.filter(event =>
81+
event.title?.toLowerCase().includes(search.toLowerCase()),
82+
);
4983

50-
const chosen = new Date(value);
84+
const totalPages = Math.ceil(filteredEvents.length / pagination.limit);
5185

52-
if (chosen < today) {
53-
toast.error('Past dates are not supported. Please select a future date.');
54-
setSelectedDate('');
55-
return;
56-
}
57-
};
86+
const displayedEvents = filteredEvents.slice(
87+
(pagination.currentPage - 1) * pagination.limit,
88+
pagination.currentPage * pagination.limit,
89+
);
5890

5991
return (
6092
<Container className={styles['dashboard-container']}>
@@ -70,17 +102,6 @@ export function CPDashboard() {
70102
className={styles['dashboard-search']}
71103
/>
72104
</div>
73-
{/* <Dropdown isOpen={dropdownOpen} toggle={toggleDropdown} className="community-dropdown">
74-
<DropdownToggle caret color="secondary">
75-
Community Portal
76-
</DropdownToggle>
77-
<DropdownMenu>
78-
<DropdownItem onClick={() => handleNavigation('/home')}>Home</DropdownItem>
79-
<DropdownItem onClick={() => handleNavigation('/events')}>Events</DropdownItem>
80-
<DropdownItem onClick={() => handleNavigation('/about')}>About Us</DropdownItem>
81-
<DropdownItem onClick={() => handleNavigation('/contact')}>Contact</DropdownItem>
82-
</DropdownMenu>
83-
</Dropdown> */}
84105
</div>
85106
</header>
86107

src/components/ExperienceDonutChart/ExperienceDonutChart.module.css

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,13 @@
219219
width: 100%;
220220
max-width: none; /* fill grid column, don't cap */
221221
padding: 0.6rem 0.75rem;
222-
text-align: left;
222+
/* text-align: left; */
223223

224224
/* prevent overflow on long role names / unbroken strings */
225225
overflow-wrap: anywhere;
226226
word-break: break-word;
227+
text-align: center;
228+
justify-content: center;
227229
}
228230

229231
.detail-item:hover,
@@ -244,15 +246,15 @@
244246
.detail-sub { display: none; } /* optional: hide to keep cards compact; show if you prefer */
245247
.detail-pct { grid-column: 4; margin-left: 0; font-weight: 800; color: #2563eb; }
246248

247-
.detail-item:hover,
249+
/* .detail-item:hover,
248250
.detail-item.active {
249251
background: #111827;
250252
border-color: #0b1220;
251253
box-shadow: 0 8px 18px rgba(2,6,23,.12);
252254
transform: translateY(-1px);
253-
}
254-
.detail-item:hover span,
255-
.detail-item.active span { color: #ffffff !important; }
255+
} */
256+
/* .detail-item:hover span,
257+
.detail-item.active span { color: #ffffff !important; } */
256258
.detail-item:hover .detail-pct,
257259
.detail-item.active .detail-pct { color: #93c5fd !important; } /* keep contrast on hover */
258260

@@ -312,7 +314,7 @@
312314
.pie-cell { transition: opacity .15s ease, filter .15s ease, transform .15s ease; cursor: pointer; }
313315
.pie-cell:hover { opacity: .9; filter: brightness(1.05); }
314316

315-
.detail-item { text-align: center; justify-content: center; }
317+
/* .detail-item { text-align: center; justify-content: center; } */
316318

317319

318320
/* ===================== Responsive tweaks ===================== */
@@ -357,6 +359,7 @@
357359
border-radius: 10px;
358360
box-shadow: 0 2px 8px rgba(2,6,23,0.06);
359361
background-clip: padding-box;
362+
transition: background-color .15s ease, border-color .15s ease, box-shadow .2s ease, transform .15s ease;
360363
}
361364

362365
/* Keep dark hover/active but ensure contrast is clear */
@@ -393,9 +396,9 @@
393396
}
394397

395398
/* Optional: smooth the state change */
396-
.chart-details .detail-item {
399+
/* .chart-details .detail-item {
397400
transition: background-color .15s ease, border-color .15s ease, box-shadow .2s ease, transform .15s ease;
398-
}
401+
} */
399402
/* ===================== DARK MODE (scoped to wrapper) ===================== */
400403

401404
/* Ensure every surface flips dark */

src/components/PermissionsManagement/PermissionsConst.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ export const permissionLabels = [
101101
description:
102102
'Gives the user permission to edit 4-digit team codes on profile page and weekly summaries report page.',
103103
},
104+
{
105+
label: 'Create, Edit and Delete Weekly Summaries Filter',
106+
key: 'manageSummariesFilters',
107+
description:
108+
'Gives the user permission to create, edit and delete the filter in weekly summaries report page.',
109+
},
104110
{
105111
label: 'See Job Analytics Reports',
106112
key: 'getJobReports',

0 commit comments

Comments
 (0)