diff --git a/frontend/app/components/Dashboard/components/WidgetPreview/WidgetPreview.tsx b/frontend/app/components/Dashboard/components/WidgetPreview/WidgetPreview.tsx
index 9e5465382..98bb11a1b 100644
--- a/frontend/app/components/Dashboard/components/WidgetPreview/WidgetPreview.tsx
+++ b/frontend/app/components/Dashboard/components/WidgetPreview/WidgetPreview.tsx
@@ -4,7 +4,6 @@ import WidgetWrapper from '../WidgetWrapper';
import { useStore } from 'App/mstore';
import { SegmentSelection, Button, Icon } from 'UI';
import { useObserver } from 'mobx-react-lite';
-import SelectDateRange from 'Shared/SelectDateRange';
import { FilterKey } from 'Types/filter/filterType';
import WidgetDateRange from '../WidgetDateRange/WidgetDateRange';
// import Period, { LAST_24_HOURS, LAST_30_DAYS } from 'Types/app/period';
@@ -12,6 +11,7 @@ import DashboardSelectionModal from '../DashboardSelectionModal/DashboardSelecti
interface Props {
className?: string;
+ name: string;
}
function WidgetPreview(props: Props) {
const [showDashboardSelectionModal, setShowDashboardSelectionModal] = React.useState(false);
@@ -38,24 +38,6 @@ function WidgetPreview(props: Props) {
// })
// }
- const getWidgetTitle = () => {
- if (isTimeSeries) {
- return 'Time Series';
- } else if (isTable) {
- if (metric.metricOf === FilterKey.SESSIONS) {
- // return 'Table of Sessions';
- return
Sessions {metric.data.total}
;
- } else if (metric.metricOf === FilterKey.ERRORS) {
- // return 'Table of Errors';
- return Errors {metric.data.total}
;
- } else {
- return 'Table';
- }
- } else if (metric.metricType === 'funnel') {
- return 'Funnel';
- }
- }
-
const canAddToDashboard = metric.exists() && dashboards.length > 0;
return useObserver(() => (
@@ -63,7 +45,7 @@ function WidgetPreview(props: Props) {
- {getWidgetTitle()}
+ {props.name}
{isTimeSeries && (
@@ -120,7 +102,7 @@ function WidgetPreview(props: Props) {
-
+
{ canAddToDashboard && (
diff --git a/frontend/app/components/Dashboard/components/WidgetSessions/WidgetSessions.tsx b/frontend/app/components/Dashboard/components/WidgetSessions/WidgetSessions.tsx
index e3de553d2..d1e10d10a 100644
--- a/frontend/app/components/Dashboard/components/WidgetSessions/WidgetSessions.tsx
+++ b/frontend/app/components/Dashboard/components/WidgetSessions/WidgetSessions.tsx
@@ -62,7 +62,7 @@ function WidgetSessions(props: Props) {
}, [filter.startTimestamp, filter.endTimestamp, filter.filters, depsString, metricStore.sessionsPage]);
return useObserver(() => (
-
+
Sessions
@@ -80,7 +80,7 @@ function WidgetSessions(props: Props) {
)}
-
+
}
-
+
{widget.metricOf !== FilterKey.SESSIONS && widget.metricOf !== FilterKey.ERRORS && (
<>
{(widget.metricType === 'table' || widget.metricType === 'timeseries') &&
}
diff --git a/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx b/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx
index a9b6e2046..6354af350 100644
--- a/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx
+++ b/frontend/app/components/Dashboard/components/WidgetWrapper/WidgetWrapper.tsx
@@ -25,6 +25,7 @@ interface Props {
history?: any
onClick?: () => void;
isWidget?: boolean;
+ hideName?: boolean;
}
function WidgetWrapper(props: Props & RouteComponentProps) {
const { dashboardStore } = useStore();
@@ -112,7 +113,7 @@ function WidgetWrapper(props: Props & RouteComponentProps) {
-
{widget.name}
+ {!props.hideName ?
{widget.name}
: null}
{isWidget && (
{!isPredefined && isTimeSeries && (