feat(ui) - insights - fixed an issue with dropdown
This commit is contained in:
parent
3182cdbf06
commit
b4e684b7b4
3 changed files with 11 additions and 7 deletions
|
|
@ -121,7 +121,7 @@ export const issueOptions = [
|
|||
export const issueCategories = [
|
||||
{ label: 'Resources', value: IssueCategory.RESOURCES },
|
||||
{ label: 'Network', value: IssueCategory.NETWORK },
|
||||
{ label: 'Click Rage', value: IssueCategory.CLICK_RAGE },
|
||||
{ label: 'Rage', value: IssueCategory.RAGE },
|
||||
{ label: 'Errors', value: IssueCategory.ERRORS },
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ import FilterSeries from "./filterSeries";
|
|||
import { DateTime } from 'luxon';
|
||||
import Session from "App/mstore/types/session";
|
||||
import Funnelissue from 'App/mstore/types/funnelIssue';
|
||||
import { issueOptions } from 'App/constants/filterOptions';
|
||||
import { issueOptions, issueCategories } from 'App/constants/filterOptions';
|
||||
import { FilterKey } from 'Types/filter/filterType';
|
||||
import Period, { LAST_24_HOURS } from 'Types/app/period';
|
||||
import { metricService } from "App/services";
|
||||
import { WEB_VITALS } from "App/constants/card";
|
||||
import { INSIGHTS, TABLE, WEB_VITALS } from "App/constants/card";
|
||||
|
||||
export default class Widget {
|
||||
public static get ID_KEY():string { return "metricId" }
|
||||
|
|
@ -76,7 +76,7 @@ export default class Widget {
|
|||
runInAction(() => {
|
||||
this.metricId = json.metricId
|
||||
this.widgetId = json.widgetId
|
||||
this.metricValue = this.metricValueFromArray(json.metricValue)
|
||||
this.metricValue = this.metricValueFromArray(json.metricValue, json.metricType)
|
||||
this.metricOf = json.metricOf
|
||||
this.metricType = json.metricType
|
||||
this.metricFormat = json.metricFormat
|
||||
|
|
@ -172,9 +172,13 @@ export default class Widget {
|
|||
})
|
||||
}
|
||||
|
||||
private metricValueFromArray(metricValue: any) {
|
||||
private metricValueFromArray(metricValue: any, metricType: string) {
|
||||
if (!Array.isArray(metricValue)) return metricValue;
|
||||
return issueOptions.filter((i: any) => metricValue.includes(i.value))
|
||||
if (metricType === TABLE) {
|
||||
return issueOptions.filter((i: any) => metricValue.includes(i.value))
|
||||
} else if (metricType === INSIGHTS) {
|
||||
return issueCategories.filter((i: any) => metricValue.includes(i.value))
|
||||
}
|
||||
}
|
||||
|
||||
private metricValueToArray(metricValue: any) {
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ export enum IssueType {
|
|||
export enum IssueCategory {
|
||||
RESOURCES = 'resources',
|
||||
NETWORK = 'network',
|
||||
CLICK_RAGE = 'click_rage',
|
||||
RAGE = 'rage',
|
||||
ERRORS = 'errors'
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue