fix(chalice): fixed cards different viewTypes (#3047)

This commit is contained in:
Kraiem Taha Yassine 2025-02-20 16:21:08 +01:00 committed by GitHub
parent 3e1f073e07
commit 1293cbde7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -851,18 +851,21 @@ class MetricTimeseriesViewType(str, Enum):
LINE_CHART = "lineChart"
AREA_CHART = "areaChart"
BAR_CHART = "barChart"
PIE_CHART = "pieChart"
PROGRESS_CHART = "progressChart"
TABLE_CHART = "table"
PIE_CHART = "pieChart"
METRIC_CHART = "metric"
TABLE_CHART = "table"
class MetricTableViewType(str, Enum):
TABLE = "table"
TABLE_CHART = "table"
class MetricOtherViewType(str, Enum):
OTHER_CHART = "chart"
COLUMN_CHART = "columnChart"
METRIC_CHART = "metric"
TABLE_CHART = "table"
LIST_CHART = "list"
@ -876,8 +879,6 @@ class MetricType(str, Enum):
HEAT_MAP = "heatMap"
class MetricOfTable(str, Enum):
USER_BROWSER = FilterType.USER_BROWSER.value
USER_DEVICE = FilterType.USER_DEVICE.value
@ -1086,7 +1087,7 @@ class CardFunnel(__CardSchema):
def __enforce_default(cls, values):
if values.get("metricOf") and not MetricOfFunnels.has_value(values["metricOf"]):
values["metricOf"] = MetricOfFunnels.SESSION_COUNT
values["viewType"] = MetricOtherViewType.OTHER_CHART
# values["viewType"] = MetricOtherViewType.OTHER_CHART
if values.get("series") is not None and len(values["series"]) > 0:
values["series"] = [values["series"][0]]
return values