From 7b3ab5f71398c7180b5a24f69e67016802025183 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Thu, 16 May 2019 11:40:04 -0700 Subject: [PATCH] feat: add hooks (#158) --- packages/superset-ui-chart/src/models/ChartProps.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/superset-ui-chart/src/models/ChartProps.ts b/packages/superset-ui-chart/src/models/ChartProps.ts index bb079ba0e48e2..ac907249fde05 100644 --- a/packages/superset-ui-chart/src/models/ChartProps.ts +++ b/packages/superset-ui-chart/src/models/ChartProps.ts @@ -22,6 +22,7 @@ interface ChartPropsConfig { filters?: Filters; formData?: SnakeCaseFormData; height?: number; + hooks?: PlainObject; onAddFilter?: HandlerFunction; onError?: HandlerFunction; payload?: QueryData; @@ -45,6 +46,7 @@ export default class ChartProps { formData: CamelCaseFormData; rawFormData: SnakeCaseFormData; height: number; + hooks: PlainObject; onAddFilter: HandlerFunction; onError: HandlerFunction; payload: QueryData; @@ -58,6 +60,7 @@ export default class ChartProps { datasource = {}, filters = [], formData = {}, + hooks = {}, onAddFilter = NOOP, onError = NOOP, payload = {}, @@ -73,6 +76,7 @@ export default class ChartProps { this.rawDatasource = datasource; this.filters = filters; this.formData = convertKeysToCamelCase(formData); + this.hooks = hooks; this.rawFormData = formData; this.onAddFilter = onAddFilter; this.onError = onError; @@ -89,6 +93,7 @@ ChartProps.createSelector = function create(): ChartPropsSelector { input => input.filters, input => input.formData, input => input.height, + input => input.hooks, input => input.onAddFilter, input => input.onError, input => input.payload, @@ -101,6 +106,7 @@ ChartProps.createSelector = function create(): ChartPropsSelector { filters, formData, height, + hooks, onAddFilter, onError, payload, @@ -114,6 +120,7 @@ ChartProps.createSelector = function create(): ChartPropsSelector { filters, formData, height, + hooks, onAddFilter, onError, payload,