diff --git a/frontend/app/components/Dashboard/Widgets/common/Styles.js b/frontend/app/components/Dashboard/Widgets/common/Styles.js
index eef6ef5b8..9075bf6f2 100644
--- a/frontend/app/components/Dashboard/Widgets/common/Styles.js
+++ b/frontend/app/components/Dashboard/Widgets/common/Styles.js
@@ -70,6 +70,9 @@ export default {
lineHeight: '0.75rem',
color: '#000',
fontSize: '12px'
+ },
+ cursor: {
+ fill: '#eee'
}
},
gradientDef: () => (
diff --git a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx
index a5a3f9090..26b4de0f5 100644
--- a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx
+++ b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx
@@ -9,7 +9,7 @@ import { useStore } from 'App/mstore';
import AreaChart from '../../Widgets/CustomMetricsWidgets/AreaChart';
import BarChart from '../../Widgets/CustomMetricsWidgets/BarChart';
import ProgressBarChart from '../../Widgets/CustomMetricsWidgets/ProgressBarChart';
-
+import BugNumChart from '../../Widgets/CustomMetricsWidgets/BigNumChart'
import WidgetDatatable from '../WidgetDatatable/WidgetDatatable';
import WidgetPredefinedChart from '../WidgetPredefinedChart';
import { getStartAndEndTimestampsByDensity } from 'Types/dashboard/helper';
@@ -274,6 +274,7 @@ function WidgetChart(props: Props) {
return (
);
}
@@ -302,12 +307,32 @@ function WidgetChart(props: Props) {
data={data[0]}
colors={colors}
params={params}
+ label={
+ metric.metricOf === 'sessionCount'
+ ? 'Number of Sessions'
+ : 'Number of Users'
+ }
/>
);
}
if (viewType === 'table') {
return null;
}
+ if (viewType === 'metric') {
+ return (
+
+ )
+ }
}
if (metricType === TABLE) {
diff --git a/frontend/app/components/Dashboard/components/WidgetDatatable/WidgetDatatable.tsx b/frontend/app/components/Dashboard/components/WidgetDatatable/WidgetDatatable.tsx
index a1565fb94..8fb9c60b4 100644
--- a/frontend/app/components/Dashboard/components/WidgetDatatable/WidgetDatatable.tsx
+++ b/frontend/app/components/Dashboard/components/WidgetDatatable/WidgetDatatable.tsx
@@ -11,12 +11,14 @@ const initTableProps = [
dataIndex: 'seriesName',
key: 'seriesName',
sorter: (a, b) => a.seriesName.localeCompare(b.seriesName),
+ fixed: 'left',
},
{
title: 'Avg.',
dataIndex: 'average',
key: 'average',
sorter: (a, b) => a.average - b.average,
+ fixed: 'left',
},
];
@@ -132,6 +134,7 @@ function WidgetDatatable(props: Props) {
pagination={false}
rowSelection={rowSelection}
size={'small'}
+ scroll={{ x: 'max-content' }}
/>
{/* 1.23+ export menu floater */}
{/*
*/}
diff --git a/frontend/app/components/Dashboard/components/WidgetDateRange/RangeGranularity.tsx b/frontend/app/components/Dashboard/components/WidgetDateRange/RangeGranularity.tsx
index f77c54546..566b3e574 100644
--- a/frontend/app/components/Dashboard/components/WidgetDateRange/RangeGranularity.tsx
+++ b/frontend/app/components/Dashboard/components/WidgetDateRange/RangeGranularity.tsx
@@ -15,6 +15,7 @@ function RangeGranularity({
return calculateGranularities(period.getDuration());
}, [period]);
+
const menuProps = {
items: granularityOptions,
onClick: (item: any) => onDensityChange(item.key),
@@ -22,13 +23,19 @@ function RangeGranularity({
const selected = React.useMemo(() => {
let selected = 'Custom';
for (const option of granularityOptions) {
- if (option.key <= density) {
+ if (option.key === density) {
selected = option.label;
break;
}
}
return selected;
- }, [])
+ }, [period, density])
+
+ React.useEffect(() => {
+ const defaultOption = Math.max(granularityOptions.length - 2, 0);
+ onDensityChange(granularityOptions[defaultOption].key);
+ }, [period]);
+
return (
diff --git a/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx b/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx
index e2b2a60da..ee7284d7a 100644
--- a/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx
+++ b/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx
@@ -136,21 +136,6 @@ const FilterSection = observer(({ metric, excludeFilterKeys }: any) => {
)}
-
- {metric.series[0] ?
-
-
-
- : null}
>
);
});
diff --git a/frontend/app/components/Dashboard/components/WidgetOptions.tsx b/frontend/app/components/Dashboard/components/WidgetOptions.tsx
index 8a5de8708..3bec940c1 100644
--- a/frontend/app/components/Dashboard/components/WidgetOptions.tsx
+++ b/frontend/app/components/Dashboard/components/WidgetOptions.tsx
@@ -6,7 +6,7 @@ import { useStore } from 'App/mstore';
import ClickMapRagePicker from 'Components/Dashboard/components/ClickMapRagePicker/ClickMapRagePicker';
import { FilterKey } from 'Types/filter/filterType';
import { observer } from 'mobx-react-lite';
-import { ChartLine, ChartArea, ChartColumn, ChartBar, ChartPie, Table } from 'lucide-react'
+import { ChartLine, ChartArea, ChartColumn, ChartBar, ChartPie, Table, Hash } from 'lucide-react'
function WidgetOptions() {
const { metricStore } = useStore();
@@ -23,6 +23,7 @@ function WidgetOptions() {
pieChart: 'Pie',
progressChart: 'Bar',
table: 'Table',
+ metric: 'Metric',
}
const chartIcons = {
lineChart:
,
@@ -31,6 +32,7 @@ function WidgetOptions() {
pieChart:
,
progressChart:
,
table:
,
+ metric:
,
}
return (
diff --git a/frontend/app/components/Dashboard/components/WidgetView/WidgetViewHeader.tsx b/frontend/app/components/Dashboard/components/WidgetView/WidgetViewHeader.tsx
index 3712e01ab..1f22def67 100644
--- a/frontend/app/components/Dashboard/components/WidgetView/WidgetViewHeader.tsx
+++ b/frontend/app/components/Dashboard/components/WidgetView/WidgetViewHeader.tsx
@@ -1,47 +1,50 @@
import React from 'react';
-import cn from "classnames";
-import WidgetName from "Components/Dashboard/components/WidgetName";
-import {useStore} from "App/mstore";
-import {useObserver} from "mobx-react-lite";
-import AddToDashboardButton from "Components/Dashboard/components/AddToDashboardButton";
-import {Button, Space} from "antd";
-import CardViewMenu from "Components/Dashboard/components/WidgetView/CardViewMenu";
+import cn from 'classnames';
+import WidgetName from 'Components/Dashboard/components/WidgetName';
+import { useStore } from 'App/mstore';
+import { useObserver } from 'mobx-react-lite';
+import AddToDashboardButton from 'Components/Dashboard/components/AddToDashboardButton';
+import { Button, Space } from 'antd';
+import CardViewMenu from 'Components/Dashboard/components/WidgetView/CardViewMenu';
interface Props {
- onClick?: () => void;
- onSave: () => void;
- undoChanges?: () => void;
+ onClick?: () => void;
+ onSave: () => void;
+ undoChanges?: () => void;
}
-function WidgetViewHeader({onClick, onSave, undoChanges}: Props) {
- const {metricStore, dashboardStore} = useStore();
- const widget = useObserver(() => metricStore.instance);
+function WidgetViewHeader({ onClick, onSave, undoChanges }: Props) {
+ const { metricStore, dashboardStore } = useStore();
+ const widget = useObserver(() => metricStore.instance);
- return (
-
+
+ metricStore.merge({ name })}
+ canEdit={true}
+ />
+
+
+
+
- );
+ Update
+
+
+
+
+ );
}
export default WidgetViewHeader;
diff --git a/frontend/app/components/shared/SelectDateRange/SelectDateRange.tsx b/frontend/app/components/shared/SelectDateRange/SelectDateRange.tsx
index e9ab568c9..7a6d7a25f 100644
--- a/frontend/app/components/shared/SelectDateRange/SelectDateRange.tsx
+++ b/frontend/app/components/shared/SelectDateRange/SelectDateRange.tsx
@@ -81,11 +81,11 @@ function SelectDateRange(props: Props) {
setIsCustom(false);
};
- const isCustomRange = period ? period.rangeName === CUSTOM_RANGE : false;
+ const isCustomRange = usedPeriod ? usedPeriod.rangeName === CUSTOM_RANGE : false;
const isUSLocale =
navigator.language === 'en-US' || navigator.language.startsWith('en-US');
const customRange = isCustomRange
- ? period.rangeFormatted(
+ ? usedPeriod.rangeFormatted(
isUSLocale ? 'MMM dd yyyy, hh:mm a' : 'MMM dd yyyy, HH:mm'
)
: '';
@@ -97,6 +97,7 @@ function SelectDateRange(props: Props) {
selectedValue={selectedValue}
onChange={onChange}
isCustomRange={isCustomRange}
+ isCustom={isCustom}
customRange={customRange}
setIsCustom={setIsCustom}
onApplyDateRange={onApplyDateRange}
@@ -189,6 +190,7 @@ function AndDateRange({
},
};
+ const comparisonValue = isCustomRange && selectedValue ? customRange : selectedValue?.label;
return (
{comparison ? (
@@ -200,9 +202,7 @@ function AndDateRange({
}
>
- {isCustomRange
- ? customRange
- : `Compare to ${selectedValue ? selectedValue?.label : ''}`}
+ {`Compare to ${comparisonValue || ''}`}
diff --git a/frontend/app/constants/card.ts b/frontend/app/constants/card.ts
index 70808fbdc..08bba396e 100644
--- a/frontend/app/constants/card.ts
+++ b/frontend/app/constants/card.ts
@@ -19,7 +19,6 @@ export const FUNNEL = 'funnel';
export const ERRORS = 'errors';
export const USER_PATH = 'pathAnalysis';
export const RETENTION = 'retention';
-export const FEATURE_ADOPTION = 'featureAdoption';
export const INSIGHTS = 'insights';
export const PERFORMANCE = 'performance';
diff --git a/frontend/app/mstore/metricStore.ts b/frontend/app/mstore/metricStore.ts
index 9e7d9bd53..43eb6b223 100644
--- a/frontend/app/mstore/metricStore.ts
+++ b/frontend/app/mstore/metricStore.ts
@@ -125,7 +125,6 @@ export default class MetricStore {
}
}
- console.log('ch', obj)
Object.assign(this.instance, obj);
this.instance.updateKey('hasChanged', updateChangeFlag);
}