change(ui): dont ask chart for dashboard and metrics pages for lcickmap
This commit is contained in:
parent
b50688d6f9
commit
35a282a510
2 changed files with 9 additions and 1 deletions
|
|
@ -250,7 +250,7 @@ export default class Widget {
|
|||
}
|
||||
}
|
||||
|
||||
this.data = _data;
|
||||
Object.assign(this.data, _data)
|
||||
return _data;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import Widget from "App/mstore/types/widget";
|
||||
import APIClient from 'App/api_client';
|
||||
import { CLICKMAP } from "App/constants/card";
|
||||
|
||||
export default class MetricService {
|
||||
private client: APIClient;
|
||||
|
|
@ -72,6 +73,13 @@ export default class MetricService {
|
|||
}
|
||||
|
||||
getMetricChartData(metric: Widget, data: any, isWidget: boolean = false): Promise<any> {
|
||||
if (
|
||||
metric.metricType === CLICKMAP
|
||||
&& document.location.pathname.split('/').pop() !== 'metrics'
|
||||
&& (document.location.pathname.indexOf('dashboard') !== -1 && document.location.pathname.indexOf('metric') === -1)
|
||||
) {
|
||||
return Promise.resolve({})
|
||||
}
|
||||
const path = isWidget ? `/cards/${metric.metricId}/chart` : `/cards/try`;
|
||||
return this.client.post(path, data)
|
||||
.then(r => r.json())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue