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
18,584 changes: 11,868 additions & 6,716 deletions client/package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
"@types/puppeteer": "^5.4.7",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"cross-env": "^10.1.0",
"expect": "^27.5.1",
"jest-cucumber": "^4.5.0",
"puppeteer": "^24.30.0",
"ts-node": "^10.9.2",
"typescript": "^4.9.5"
},
"scripts": {
"start": "PORT=3004 react-scripts start",
"start": "cross-env PORT=3004 react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"test:cucumber": "npx cucumber-js --config cucumber.js",
Expand Down
175 changes: 174 additions & 1 deletion client/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -1192,4 +1192,177 @@ tbody tr:last-child td {
.evaluation-select option[value="MANA"] {
background-color: #fecaca;
color: #991b1b;
}
}

/* Success Message */
.success-message {
background-color: #e6fffa;
color: #2c7a7b;
border: 1px solid #81e6d9;
border-radius: 8px;
padding: 1rem;
margin-bottom: 1.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

/* Notification Section */
.notification-section {
background: white;
padding: 2rem;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
border: 1px solid #e2e8f0;
}

.notification-section h3 {
color: #2d3748;
margin-bottom: 1.5rem;
font-size: 1.8rem;
font-weight: 600;
}

.notification-section h4 {
color: #4a5568;
margin-bottom: 1rem;
font-size: 1.2rem;
font-weight: 600;
}

.notification-form {
display: flex;
flex-direction: column;
gap: 1.5rem;
margin-bottom: 2rem;
}

.notification-form .form-group {
margin-bottom: 0;
}

.notification-form select,
.notification-form input,
.notification-form textarea {
width: 100%;
padding: 0.75rem;
border: 2px solid #e2e8f0;
border-radius: 6px;
font-size: 1rem;
transition: all 0.2s ease;
background-color: #fff;
font-family: inherit;
}

.notification-form select:focus,
.notification-form input:focus,
.notification-form textarea:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.notification-form textarea {
resize: vertical;
min-height: 120px;
}

.student-checkbox-list {
max-height: 300px;
overflow-y: auto;
border: 2px solid #e2e8f0;
border-radius: 6px;
padding: 1rem;
background-color: #f7fafc;
}

.checkbox-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem;
margin-bottom: 0.5rem;
border-radius: 4px;
transition: background-color 0.2s ease;
}

.checkbox-item:hover {
background-color: #edf2f7;
}

.checkbox-item input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
}

.checkbox-item label {
cursor: pointer;
flex: 1;
margin: 0;
color: #2d3748;
font-weight: normal;
}

.submit-button {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 1rem 2rem;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.submit-button:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.submit-button:active:not(:disabled) {
transform: translateY(0);
}

.submit-button:disabled {
opacity: 0.6;
cursor: not-allowed;
}

.notification-info {
background-color: #ebf8ff;
border: 1px solid #bee3f8;
border-radius: 8px;
padding: 1.5rem;
margin-top: 2rem;
}

.notification-info h4 {
color: #2c5282;
margin-bottom: 1rem;
font-size: 1.1rem;
}

.notification-info ul {
list-style-position: inside;
color: #2d3748;
line-height: 1.8;
}

.notification-info li {
margin-bottom: 0.5rem;
}
31 changes: 30 additions & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import StudentForm from './components/StudentForm';
import Evaluations from './components/Evaluations';
import Classes from './components/Classes';
import './App.css';
import Notifications from './components/Notifications';

type TabType = 'students' | 'evaluations' | 'classes';
type TabType = 'students' | 'evaluations' | 'classes' | 'notifications';

const App: React.FC = () => {
const [students, setStudents] = useState<Student[]>([]);
Expand All @@ -19,6 +20,7 @@ const App: React.FC = () => {
const [error, setError] = useState<string>('');
const [editingStudent, setEditingStudent] = useState<Student | null>(null);
const [activeTab, setActiveTab] = useState<TabType>('students');
const [successMessage, setSuccessMessage] = useState<string>('');

const loadStudents = useCallback(async () => {
try {
Expand Down Expand Up @@ -109,6 +111,12 @@ const App: React.FC = () => {
setError(errorMessage);
};

const handleSuccess = (message: string) => {
setSuccessMessage(message);
setError('');
setTimeout(() => setSuccessMessage(''), 2000);
};

return (
<div className="App">
<header className="App-header">
Expand All @@ -123,6 +131,12 @@ const App: React.FC = () => {
</div>
)}

{successMessage && (
<div className="success-message">
<strong>Success:</strong> {successMessage}
</div>
)}

{/* Tab Navigation */}
<div className="tab-navigation">
<button
Expand All @@ -146,6 +160,14 @@ const App: React.FC = () => {
>
Classes
</button>

<button
className={`tab-button ${activeTab === 'notifications' ? 'active' : ''}`}
onClick={() => setActiveTab('notifications')}
>
Notifications
</button>

</div>

{/* Tab Content */}
Expand Down Expand Up @@ -215,6 +237,13 @@ const App: React.FC = () => {
onError={handleError}
/>
)}

{activeTab === 'notifications' && (
<Notifications
onError={handleError}
onSuccess={handleSuccess}
/>
)}
</div>
</main>
</div>
Expand Down
Loading