feature/department-dropdown #32
@@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { DEPARTMENTS } from '../data/departments';
|
||||||
|
|
||||||
const s = {
|
const s = {
|
||||||
overlay: {
|
overlay: {
|
||||||
@@ -133,7 +134,12 @@ export default function EditEmployeeModal({ employee, onClose, onSaved }) {
|
|||||||
<div style={s.label}>Full Name</div>
|
<div style={s.label}>Full Name</div>
|
||||||
<input style={s.input} value={name} onChange={e => setName(e.target.value)} />
|
<input style={s.input} value={name} onChange={e => setName(e.target.value)} />
|
||||||
<div style={s.label}>Department</div>
|
<div style={s.label}>Department</div>
|
||||||
<input style={s.input} value={department} onChange={e => setDepartment(e.target.value)} placeholder="Optional" />
|
<select style={s.select} value={department} onChange={e => setDepartment(e.target.value)}>
|
||||||
|
<option value="">-- Select Department --</option>
|
||||||
|
{DEPARTMENTS.map(d => (
|
||||||
|
<option key={d} value={d}>{d}</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
<div style={s.label}>Supervisor</div>
|
<div style={s.label}>Supervisor</div>
|
||||||
<input style={s.input} value={supervisor} onChange={e => setSupervisor(e.target.value)} placeholder="Optional" />
|
<input style={s.input} value={supervisor} onChange={e => setSupervisor(e.target.value)} placeholder="Optional" />
|
||||||
<div style={s.row}>
|
<div style={s.row}>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import CpasBadge from './CpasBadge';
|
|||||||
import TierWarning from './TierWarning';
|
import TierWarning from './TierWarning';
|
||||||
import ViolationHistory from './ViolationHistory';
|
import ViolationHistory from './ViolationHistory';
|
||||||
import { useToast } from './ToastProvider';
|
import { useToast } from './ToastProvider';
|
||||||
|
import { DEPARTMENTS } from '../data/departments';
|
||||||
|
|
||||||
const s = {
|
const s = {
|
||||||
content: { padding: '32px 40px', background: '#111217', borderRadius: '10px', color: '#f8f9fa' },
|
content: { padding: '32px 40px', background: '#111217', borderRadius: '10px', color: '#f8f9fa' },
|
||||||
@@ -171,12 +172,21 @@ export default function ViolationForm() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<div style={s.grid}>
|
<div style={s.grid}>
|
||||||
{[['employeeName','Employee Name','text','John Doe'],['department','Department','text','Engineering'],['supervisor','Supervisor Name','text','Jane Smith'],['witnessName','Witness Name (Officer)','text','Officer Name']].map(([name,label,type,ph]) => (
|
{[['employeeName','Employee Name','John Doe'],['supervisor','Supervisor Name','Jane Smith'],['witnessName','Witness Name (Officer)','Officer Name']].map(([name,label,ph]) => (
|
||||||
<div key={name} style={s.item}>
|
<div key={name} style={s.item}>
|
||||||
<label style={s.label}>{label}:</label>
|
<label style={s.label}>{label}:</label>
|
||||||
<input style={s.input} type={type} name={name} value={form[name]} onChange={handleChange} placeholder={ph} />
|
<input style={s.input} type="text" name={name} value={form[name]} onChange={handleChange} placeholder={ph} />
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
<div style={s.item}>
|
||||||
|
<label style={s.label}>Department:</label>
|
||||||
|
<select style={s.input} name="department" value={form.department} onChange={handleChange}>
|
||||||
|
<option value="">-- Select Department --</option>
|
||||||
|
{DEPARTMENTS.map(d => (
|
||||||
|
<option key={d} value={d}>{d}</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
9
client/src/data/departments.js
Normal file
9
client/src/data/departments.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export const DEPARTMENTS = [
|
||||||
|
'Administrative',
|
||||||
|
'Business Development',
|
||||||
|
'Design and Content',
|
||||||
|
'Executive',
|
||||||
|
'Implementation and Support',
|
||||||
|
'Operations',
|
||||||
|
'Production',
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user