ui: check for metric type
This commit is contained in:
parent
48a573399e
commit
c41deb1af2
2 changed files with 4 additions and 4 deletions
|
|
@ -135,11 +135,10 @@ function CategoryTab({ tab, inCards }: { tab: string, inCards?: boolean }) {
|
|||
const handleCardSelection = (card: string) => {
|
||||
metricStore.init();
|
||||
const selectedCard = CARD_LIST.find((c) => c.key === card) as CardType;
|
||||
|
||||
const cardData: any = {
|
||||
metricType: selectedCard.cardType,
|
||||
name: selectedCard.title,
|
||||
metricOf: selectedCard.metricOf
|
||||
metricOf: selectedCard.metricOf,
|
||||
};
|
||||
|
||||
if (selectedCard.filters) {
|
||||
|
|
|
|||
|
|
@ -152,10 +152,11 @@ function WidgetChart(props: Props) {
|
|||
}
|
||||
prevMetricRef.current = metric;
|
||||
const timestmaps = drillDownPeriod.toTimestamps();
|
||||
const isTimeseries = metric.metricType === TIMESERIES;
|
||||
const payload = isSaved
|
||||
// TODO: remove after backend adds support for more view types
|
||||
? { ...metricParams, viewType: 'lineChart' }
|
||||
: { ...params, ...timestmaps, ...metric.toJson(), viewType: 'lineChart' };
|
||||
? { ...metricParams, viewType: isTimeseries ? 'lineChart' : metric.viewType }
|
||||
: { ...params, ...timestmaps, ...metric.toJson(), viewType: isTimeseries ? 'lineChart' : metric.viewType };
|
||||
debounceRequest(
|
||||
metric,
|
||||
payload,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue