From 08ff9a348a1177bb0cf8516f36c5d6a28be3778b Mon Sep 17 00:00:00 2001 From: Daniel Kos Date: Wed, 2 Jan 2019 08:56:28 +0100 Subject: [PATCH] CR fixes Feature #14348 Arvados-DCO-1.1-Signed-off-by: Daniel Kos --- src/components/data-explorer/data-explorer.tsx | 6 +++--- src/views-components/data-explorer/renderers.tsx | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx index d2b161ed..878f47ff 100644 --- a/src/components/data-explorer/data-explorer.tsx +++ b/src/components/data-explorer/data-explorer.tsx @@ -122,7 +122,7 @@ export const DataExplorer = withStyles(styles)( component="div" /> : } @@ -137,8 +137,8 @@ export const DataExplorer = withStyles(styles)( 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) => diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx index d52dcab1..6905e960 100644 --- a/src/views-components/data-explorer/renderers.tsx +++ b/src/views-components/data-explorer/renderers.tsx @@ -233,9 +233,10 @@ const clusterColors = [ ]; 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