component="div" /> : <Button
variant="text"
size="medium"
- onClick={() => this.loadMore(this.props.page)}
+ onClick={this.loadMore}
>Load more</Button>}
</Grid>
</Toolbar>
this.props.onChangeRowsPerPage(parseInt(event.target.value, 10));
}
- loadMore = (page: number) => {
- this.props.onLoadMore(page + 1);
+ loadMore = () => {
+ this.props.onLoadMore(this.props.page + 1);
}
renderContextMenuTrigger = (item: T) =>
];
export const ResourceCluster = (props: { uuid: string }) => {
- const p = props.uuid.indexOf('-');
- const clusterId = p >= 5 ? props.uuid.substr(0, p) : '';
- const ci = p >= 5 ? (props.uuid.charCodeAt(0) + props.uuid.charCodeAt(1)) % clusterColors.length : 0;
+ const CLUSTER_ID_LENGTH = 5;
+ const pos = props.uuid.indexOf('-');
+ const clusterId = pos >= CLUSTER_ID_LENGTH ? props.uuid.substr(0, pos) : '';
+ const ci = pos >= CLUSTER_ID_LENGTH ? (props.uuid.charCodeAt(0) + props.uuid.charCodeAt(1)) % clusterColors.length : 0;
return <Typography>
<div style={{
backgroundColor: clusterColors[ci][0],