Remove deprecated CSV files and update experiment seeding scripts

- Deleted unused CSV files: 'meyer experiments.csv' and 'phase_2_experimental_run_sheet.csv'.
- Updated SQL seed scripts to reflect changes in experiment data structure and ensure consistency with the latest experiment parameters.
- Enhanced user role assignments in the seed data to include 'conductor' alongside 'data recorder'.
- Adjusted experiment seeding logic to align with the corrected data from the CSV files.
This commit is contained in:
salirezav
2025-09-28 21:10:50 -04:00
parent 853cec1b13
commit e675423258
28 changed files with 3068 additions and 1457 deletions

View File

@@ -671,7 +671,7 @@ function ScheduleExperiment({ user, onBack }: { user: User; onBack: () => void }
// Soaking marker
events.push({
id: `${scheduled.repetitionId}-soaking`,
title: `Exp ${experiment.experiment_number} Rep ${repetition.repetition_number}`,
title: `💧 Soaking - Exp ${experiment.experiment_number} Rep ${repetition.repetition_number}`,
start: scheduled.soakingStart,
end: new Date(scheduled.soakingStart.getTime() + 30 * 60000), // 30 minute duration for visibility
resource: 'soaking'
@@ -681,7 +681,7 @@ function ScheduleExperiment({ user, onBack }: { user: User; onBack: () => void }
if (scheduled.airdryingStart) {
events.push({
id: `${scheduled.repetitionId}-airdrying`,
title: `Exp ${experiment.experiment_number} Rep ${repetition.repetition_number}`,
title: `🌬️ Airdrying - Exp ${experiment.experiment_number} Rep ${repetition.repetition_number}`,
start: scheduled.airdryingStart,
end: new Date(scheduled.airdryingStart.getTime() + 30 * 60000),
resource: 'airdrying'
@@ -692,7 +692,7 @@ function ScheduleExperiment({ user, onBack }: { user: User; onBack: () => void }
if (scheduled.crackingStart) {
events.push({
id: `${scheduled.repetitionId}-cracking`,
title: `Exp ${experiment.experiment_number} Rep ${repetition.repetition_number}`,
title: `⚡ Cracking - Exp ${experiment.experiment_number} Rep ${repetition.repetition_number}`,
start: scheduled.crackingStart,
end: new Date(scheduled.crackingStart.getTime() + 30 * 60000),
resource: 'cracking'
@@ -1004,26 +1004,38 @@ function ScheduleExperiment({ user, onBack }: { user: User; onBack: () => void }
}
const color = colors[resource as keyof typeof colors] || '#6b7280'
// Get step names and icons
const stepInfo = {
soaking: { name: 'Soaking', icon: '💧' },
airdrying: { name: 'Airdrying', icon: '🌬' },
cracking: { name: 'Cracking', icon: '' }
}
const step = stepInfo[resource as keyof typeof stepInfo]
return {
style: {
backgroundColor: color,
borderColor: color,
color: 'white',
borderRadius: '4px',
borderRadius: '6px',
border: 'none',
height: '8px',
minHeight: '8px',
fontSize: '10px',
padding: '2px 4px',
height: '36px',
minHeight: '36px',
fontSize: '13px',
padding: '6px 10px',
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
justifyContent: 'space-between',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start',
fontWeight: 'bold',
zIndex: 10,
position: 'relative',
lineHeight: '1.2',
textShadow: '1px 1px 2px rgba(0,0,0,0.7)'
lineHeight: '1.4',
textShadow: '1px 1px 2px rgba(0,0,0,0.7)',
gap: '6px',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}
}
}
@@ -1081,6 +1093,7 @@ function AvailabilityCalendar({ user }: { user: User }) {
endTime: '17:00'
})
const [currentView, setCurrentView] = useState(Views.MONTH)
const [currentDate, setCurrentDate] = useState(new Date())
// Load availability from DB on mount
useEffect(() => {
@@ -1335,6 +1348,8 @@ function AvailabilityCalendar({ user }: { user: User }) {
style={{ height: '100%' }}
view={currentView}
onView={setCurrentView}
date={currentDate}
onNavigate={setCurrentDate}
views={[Views.MONTH, Views.WEEK, Views.DAY]}
selectable
onSelectSlot={handleSelectSlot}