15530: Eliminate silly hack adding "-" to use ResourceCluster
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Fri, 25 Oct 2019 19:27:57 +0000 (15:27 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Fri, 25 Oct 2019 19:27:57 +0000 (15:27 -0400)
src/views-components/data-explorer/renderers.tsx
src/views/search-results-panel/search-results-panel-view.tsx
src/views/site-manager-panel/site-manager-panel-root.tsx

index 16389e077996c82d3e69caf9124f6df3508718db..32e14c5a08cd04e202251ab33681be9bdbdae4b0 100644 (file)
@@ -235,7 +235,7 @@ const clusterColors = [
 
 export const ResourceCluster = (props: { uuid: string }) => {
     const CLUSTER_ID_LENGTH = 5;
-    const pos = props.uuid.indexOf('-');
+    const pos = props.uuid.length > CLUSTER_ID_LENGTH ? props.uuid.indexOf('-') : 5;
     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))
index a834effe3ac50b222477cb9163ce301658a5f712..6eac09fa0b08bd1d8191dafaa5ef9ec35c65b651 100644 (file)
@@ -125,9 +125,9 @@ export const SearchResultsPanelView = withStyles(styles, { withTheme: true })(
             title={
                 <div>
                     {loggedIn.length === 1 ?
-                        <span>Searching local cluster <ResourceCluster uuid={props.localCluster + "-"} /></span>
+                        <span>Searching local cluster <ResourceCluster uuid={props.localCluster} /></span>
                         : <span>Searching clusters: {loggedIn.map((ss) => <span key={ss.clusterId}>
-                            <a href={props.remoteHostsConfig[ss.clusterId].workbench2Url} style={{ textDecoration: 'none' }}> <ResourceCluster uuid={ss.clusterId + "-"} /></a></span>)}</span>}
+                            <a href={props.remoteHostsConfig[ss.clusterId].workbench2Url} style={{ textDecoration: 'none' }}> <ResourceCluster uuid={ss.clusterId} /></a></span>)}</span>}
                     {loggedIn.length === 1 && props.localCluster !== homeCluster ?
                         <span>To search multiple clusters, <a href={props.remoteHostsConfig[homeCluster] && props.remoteHostsConfig[homeCluster].workbench2Url}> start from your home Workbench.</a></span>
                         : <span style={{ marginLeft: "2em" }}>Use <Link to={Routes.SITE_MANAGER} >Site Manager</Link> to manage which clusters will be searched.</span>}
index 64457f97f2c4299ddb32108237943bad3c4cfdae..e75aa1f95578a091ef24f975ae4bb360c5961c5e 100644 (file)
@@ -143,7 +143,7 @@ export const SiteManagerPanelRoot = compose(
                                 const validating = session.status === SessionStatus.BEING_VALIDATED;
                                 return <TableRow key={index} className={classes.tableRow}>
                                     <TableCell>{remoteHostsConfig[session.clusterId] ?
-                                        <a href={remoteHostsConfig[session.clusterId].workbench2Url} style={{ textDecoration: 'none' }}> <ResourceCluster uuid={session.clusterId + "-"} /></a>
+                                        <a href={remoteHostsConfig[session.clusterId].workbench2Url} style={{ textDecoration: 'none' }}> <ResourceCluster uuid={session.clusterId} /></a>
                                         : session.clusterId}</TableCell>
                                     <TableCell>{session.remoteHost}</TableCell>
                                     <TableCell>{validating ? <CircularProgress size={20} /> : session.username}</TableCell>