Skip to content

Commit

Permalink
Removed sort option for Visualization and log column in leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
pushpanjalip committed Jan 7, 2020
1 parent 776bf5c commit fcb6f29
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/components/Forms/Algorithm/AlgorithmSubmission.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
.selectionContainer select {
flex: 1;
height: 30px;
font: 15px Lato, sans-serif
}
.selectionContainer {
display: flex;
Expand Down
36 changes: 20 additions & 16 deletions src/components/Leaderboard/LeaderboardHead/LeaderboardHead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,25 @@ class Leaderboard extends React.Component<IProps, {}> {
numeric: false,
disablePadding: false,
label: 'Name',
sortable: true,
},
{
id: 'version',
numeric: false,
disablePadding: false,
label: 'Version',
sortable: true,
},
...this.props.metricFields.map((fieldName) => ({
id: fieldName,
numeric: true,
disablePadding: false,
label: fieldName,
sortable: true,
})),
{ id: 'visualization', numeric: false, disablePadding: false, label: 'Visualization' },
{ id: 'date', numeric: false, disablePadding: false, label: 'Date' },
{ id: 'log', numeric: false, disablePadding: false, label: 'Logs' },
{ id: 'visualization', numeric: false, disablePadding: false, label: 'Visualization', sortable: false },
{ id: 'date', numeric: false, disablePadding: false, label: 'Date', sortable: true },
{ id: 'log', numeric: false, disablePadding: false, label: 'Logs', sortable: false },
];

const { order, orderBy,
Expand All @@ -57,7 +60,6 @@ class Leaderboard extends React.Component<IProps, {}> {
return (
<TableHead>
<TableRow>
{/*Commented for production */}
<TableCell padding="checkbox">
<Checkbox
indeterminate={numSelected > 0 && numSelected < rowCount}
Expand All @@ -75,19 +77,21 @@ class Leaderboard extends React.Component<IProps, {}> {
padding={row.disablePadding ? 'none' : 'default'}
sortDirection={orderBy === row.id ? order : false}
>
<Tooltip
title="Sort"
placement={row.numeric ? 'bottom-end' : 'bottom-start'}
enterDelay={300}
>
<TableSortLabel
active={orderBy === row.id}
direction={order}
onClick={this.createSortHandler(row.id)}
{row.sortable ?
(<Tooltip
title="Sort"
placement={row.numeric ? 'bottom-end' : 'bottom-start'}
enterDelay={300}
>
{row.label}
</TableSortLabel>
</Tooltip>
<TableSortLabel
active={orderBy === row.id}
direction={order}
onClick={this.createSortHandler(row.id)}
>
{row.label}
</TableSortLabel>
</Tooltip>) : row.label
}
</TableCell>
);
}, this)}
Expand Down

0 comments on commit fcb6f29

Please sign in to comment.