Skip to content

Commit

Permalink
Add missing sorting functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Dagonite authored and Pasarus committed Feb 29, 2024
1 parent 7754b2e commit 5a067f1
Showing 1 changed file with 30 additions and 22 deletions.
52 changes: 30 additions & 22 deletions src/ReductionHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,15 @@ const ReductionHistory: React.FC = () => {
Experiment Number
</TableSortLabel>
</TableCell>
<TableCell>Reduction Input</TableCell>
<TableCell>
<TableSortLabel
active={orderBy === 'filename'}
direction={orderBy === 'filename' ? orderDirection : 'asc'}
onClick={() => handleSort('filename')}
>
Reduction Input
</TableSortLabel>
</TableCell>
<TableCell>
<TableSortLabel
active={orderBy === 'reduction_state'}
Expand All @@ -191,50 +199,50 @@ const ReductionHistory: React.FC = () => {
</TableCell>
<TableCell>
<TableSortLabel
active={orderBy === 'reduction_start'}
direction={orderBy === 'reduction_start' ? orderDirection : 'asc'}
onClick={() => handleSort('reduction_start')}
active={orderBy === 'run_start'}
direction={orderBy === 'run_start' ? orderDirection : 'asc'}
onClick={() => handleSort('run_start')}
>
Reduction Start
Run Start
</TableSortLabel>
</TableCell>
<TableCell>
<TableSortLabel
active={orderBy === 'reduction_start'}
direction={orderBy === 'reduction_start' ? orderDirection : 'asc'}
onClick={() => handleSort('reduction_start')}
active={orderBy === 'run_end'}
direction={orderBy === 'run_end' ? orderDirection : 'asc'}
onClick={() => handleSort('run_end')}
>
Reduction End
Run End
</TableSortLabel>
</TableCell>
<TableCell>Title</TableCell>
<TableCell>
<TableSortLabel
active={orderBy === 'reduction_start'}
direction={orderBy === 'reduction_start' ? orderDirection : 'asc'}
onClick={() => handleSort('reduction_start')}
>
Title
Reduction Start
</TableSortLabel>
</TableCell>
<TableCell>
<TableSortLabel
active={orderBy === 'run_start'}
direction={orderBy === 'run_start' ? orderDirection : 'asc'}
onClick={() => handleSort('run_start')}
active={orderBy === 'reduction_end'}
direction={orderBy === 'reduction_end' ? orderDirection : 'asc'}
onClick={() => handleSort('reduction_end')}
>
Run Start
Reduction End
</TableSortLabel>
</TableCell>
<TableCell>
<TableSortLabel
active={orderBy === 'run_end'}
direction={orderBy === 'run_end' ? orderDirection : 'asc'}
onClick={() => handleSort('run_end')}
active={orderBy === 'reduction_outputs'}
direction={orderBy === 'reduction_outputs' ? orderDirection : 'asc'}
onClick={() => handleSort('reduction_outputs')}
>
Run End
Reduction Outputs
</TableSortLabel>
</TableCell>
<TableCell>Reduction Outputs</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand All @@ -243,11 +251,11 @@ const ReductionHistory: React.FC = () => {
<TableCell>{reduction.runs[0].experiment_number}</TableCell>
<TableCell>{extractFileName(reduction.runs[0].filename)}</TableCell>
<TableCell>{formatReductionStatus(reduction.reduction_state)}</TableCell>
<TableCell>{formatDateTime(reduction.reduction_start)}</TableCell>
<TableCell>{formatDateTime(reduction.reduction_end)}</TableCell>
<TableCell>{reduction.runs[0].title}</TableCell>
<TableCell>{formatDateTime(reduction.runs[0].run_start)}</TableCell>
<TableCell>{formatDateTime(reduction.runs[0].run_end)}</TableCell>
<TableCell>{reduction.runs[0].title}</TableCell>
<TableCell>{formatDateTime(reduction.reduction_start)}</TableCell>
<TableCell>{formatDateTime(reduction.reduction_end)}</TableCell>
<TableCell>{reduction.reduction_outputs}</TableCell>
</StyledTableRow>
))}
Expand Down

0 comments on commit 5a067f1

Please sign in to comment.