fix(ui): fix metric creation bug

This commit is contained in:
sylenien 2022-08-24 17:35:16 +02:00
parent 23ea4a8513
commit 81dea007ec
2 changed files with 5 additions and 5 deletions

View file

@ -17,12 +17,12 @@ interface Props {
const metricIcons = {
timeseries: 'graph-up',
table: 'table',
table: 'table',
funnel: 'funnel',
}
function WidgetForm(props: Props) {
const { history, match: { params: { siteId, dashboardId } } } = props;
const { metricStore, dashboardStore } = useStore();
const dashboards = dashboardStore.dashboards;
@ -101,7 +101,7 @@ function WidgetForm(props: Props) {
<div className="form-group">
<label className="font-medium">Metric Type</label>
<div className="flex items-center">
<SegmentSelection
<SegmentSelection
icons
outline
name="metricType"
@ -180,7 +180,7 @@ function WidgetForm(props: Props) {
</div>
{metric.series.length > 0 && metric.series.slice(0, (isTable || isFunnel) ? 1 : metric.series.length).map((series: any, index: number) => (
<div className="mb-2">
<div className="mb-2" key={series.name}>
<FilterSeries
observeChanges={() => metric.updateKey('hasChanged', true)}
hideHeader={ isTable }

View file

@ -43,7 +43,7 @@ function WidgetView(props: Props) {
setMetricNotFound(true);
}
});
} else if (metricId === 'create') {
} else {
metricStore.init();
}
}, []);