-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canvas: Rewrite table state manangement #6499
base: feat/canvas-toggle-filter-bar
Are you sure you want to change the base?
Canvas: Rewrite table state manangement #6499
Conversation
@@ -66,6 +70,13 @@ export class CanvasResolvedSpec { | |||
Object.keys($validSpecStore?.data?.metricsViews || {}), | |||
); | |||
|
|||
this.getMetricsViewFromName = (metricViewName: string) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd rename to getMetricsViewValidSpecFromName
, since it returns a validSpec
, not the whole metricsView
resource
export function getTableConfig( | ||
instanceId: string, | ||
tableProperties: TableProperties, | ||
ctx: StateManagers, | ||
tableSpec: TableSpec, | ||
pivotState: PivotState, | ||
): Readable<PivotDataStoreConfig> { | ||
const { metrics_view, time_range, comparison_range } = tableProperties; | ||
const { metrics_view, time_range, comparison_range, dimension_filters } = | ||
tableSpec; | ||
const { | ||
canvasEntity: { | ||
createTimeAndFilterStore, | ||
spec: { getMetricsViewFromName }, | ||
}, | ||
} = ctx; | ||
|
||
const timeAndFilterStore = createTimeAndFilterStore(metrics_view, { | ||
componentTimeRange: time_range, | ||
componentComparisonRange: comparison_range, | ||
componentFilter: dimension_filters, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as here, namely we should not instantiate a new Canvas-level timeAndFilterStore
for every Component.
tableProperties: TableProperties, | ||
) { | ||
export function validateTableSchema( | ||
ctx: StateManagers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this weren't coupled to a Canvas ctx
and rather accepted a metricsView
Merge after #6493
metrics_view
is changed.