diff --git a/src/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js b/src/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js index 403150bed..f82486192 100644 --- a/src/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +++ b/src/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js @@ -3,7 +3,7 @@ import React from 'react'; import throttle from 'lodash/throttle'; import PropTypes from 'prop-types'; -import routes, {createHref} from '../../../routes'; +import {getTabletPagePath} from '../../../routes'; import {basename as appBasename} from '../../../store/index'; import {cn} from '../../../utils/cn'; @@ -90,7 +90,7 @@ export const HeatmapCanvas = (props) => { const generateTabletExternalLink = (tablet) => { const {TabletId: id} = tablet; const hostname = window.location.hostname; - const path = createHref(routes.tablet, {id}); + const path = getTabletPagePath(id); const protocol = 'https://'; const href = [hostname, appBasename, path] .map((item) => (item.startsWith('/') ? item.slice(1) : item)) diff --git a/src/containers/Tablets/Tablets.tsx b/src/containers/Tablets/Tablets.tsx index f230c907a..7d6b2b194 100644 --- a/src/containers/Tablets/Tablets.tsx +++ b/src/containers/Tablets/Tablets.tsx @@ -10,7 +10,7 @@ import {ResponseError} from '../../components/Errors/ResponseError'; import {InternalLink} from '../../components/InternalLink'; import {ResizeableDataTable} from '../../components/ResizeableDataTable/ResizeableDataTable'; import {TableSkeleton} from '../../components/TableSkeleton/TableSkeleton'; -import routes, {createHref} from '../../routes'; +import {getTabletPagePath} from '../../routes'; import {selectIsUserAllowedToMakeChanges} from '../../store/reducers/authentication/authentication'; import {selectTabletsWithFqdn, tabletsApi} from '../../store/reducers/tablets'; import {ETabletState} from '../../types/api/tablet'; @@ -54,11 +54,10 @@ const columns: DataTableColumn[] = [ return EMPTY_DATA_PLACEHOLDER; } - const tabletPath = createHref( - routes.tablet, - {id: row.TabletId}, - {nodeId: row.NodeId, type: row.Type}, - ); + const tabletPath = getTabletPagePath(row.TabletId, { + nodeId: row.NodeId, + type: row.Type, + }); return ( = { return (