[Dashboards] [Warning] Remove gauge chart support and delete existing widgets (#20172)
## Summary Removes gauge chart from the chart-type picker and deletes existing gauge widgets via a workspace migration. The gauge was rendering a hardcoded `0.7 / "Progress"` stub regardless of configuration -- never wired to real data. The contract stays in place. We keep `WidgetConfigurationType.GAUGE_CHART`, the DTO, the GraphQL union member, and the gauge folder -- so stored gauge JSON still resolves through the schema. The render path falls through to `default: return null`, so any un-migrated gauge widget renders as an empty cell, not a crash. This PR just removes existing gauge widgets if there are any (via `upgrade:2-3:delete-gauge-widgets`). The deliberate cleanup -- deleting the type definitions, the gauge folder, the DTO -- comes in a follow-up PR after the migration has run. --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
-1
@@ -11,7 +11,6 @@ export const PAGE_LAYOUT_WIDGET_SEEDS = {
|
||||
CUSTOMER_COMPANIES_BY_SIZE: 'CUSTOMER_COMPANIES_BY_SIZE_WIDGET',
|
||||
CUSTOMER_ANNUAL_RECURRING_REVENUE: 'CUSTOMER_ANNUAL_RECURRING_REVENUE_WIDGET',
|
||||
CUSTOMER_REVENUE_DISTRIBUTION: 'CUSTOMER_REVENUE_DISTRIBUTION_WIDGET',
|
||||
CUSTOMER_AVERAGE_ARR: 'CUSTOMER_AVERAGE_ARR_WIDGET',
|
||||
CUSTOMER_LINKEDIN_COUNT: 'CUSTOMER_LINKEDIN_COUNT_WIDGET',
|
||||
CUSTOMER_LINKEDIN_DISTRIBUTION: 'CUSTOMER_LINKEDIN_DISTRIBUTION_WIDGET',
|
||||
|
||||
|
||||
-34
@@ -168,40 +168,6 @@ export const getPageLayoutWidgetDataSeedsV2 = (
|
||||
} satisfies SeederFlatPageLayoutWidget)
|
||||
: null,
|
||||
|
||||
// GAUGE chart: Average ARR (Customer Analytics)
|
||||
isDefined(companyArrFieldId)
|
||||
? ({
|
||||
id: generateSeedId(
|
||||
workspaceId,
|
||||
PAGE_LAYOUT_WIDGET_SEEDS.CUSTOMER_AVERAGE_ARR,
|
||||
),
|
||||
pageLayoutTabId: generateSeedId(
|
||||
workspaceId,
|
||||
PAGE_LAYOUT_TAB_SEEDS.CUSTOMER_ANALYTICS,
|
||||
),
|
||||
title: 'Average ARR',
|
||||
type: WidgetType.GRAPH,
|
||||
gridPosition: { row: 0, column: 7, rowSpan: 6, columnSpan: 5 },
|
||||
position: {
|
||||
layoutMode: PageLayoutTabLayoutMode.GRID,
|
||||
row: 0,
|
||||
column: 7,
|
||||
rowSpan: 6,
|
||||
columnSpan: 5,
|
||||
},
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.GAUGE_CHART,
|
||||
aggregateFieldMetadataId: companyArrFieldId,
|
||||
aggregateOperation: AggregateOperations.AVG,
|
||||
displayDataLabel: true,
|
||||
timezone: 'UTC',
|
||||
firstDayOfTheWeek: CalendarStartDay.MONDAY,
|
||||
},
|
||||
objectMetadataId: companyObject?.id ?? null,
|
||||
overrides: null,
|
||||
} satisfies SeederFlatPageLayoutWidget)
|
||||
: null,
|
||||
|
||||
// PIE chart: Companies by LinkedIn (Customer Overview)
|
||||
isDefined(companyIdFieldId) && isDefined(companyLinkedinLinkFieldId)
|
||||
? ({
|
||||
|
||||
Reference in New Issue
Block a user