Skip to content

Commit

Permalink
feat: upgrade @superset-ui to v0.12 (apache-superset#183)
Browse files Browse the repository at this point in the history
* build: update dependencies

* feat: replace payload with queryData

* feat: replace payload with queryData

* fix: rename hooks

* fix: types from query package

* fix: more typings

* docs: update readme

* fix: import query

* fix: change NOOP to const

* fix: update dependency versions
  • Loading branch information
kristw authored Aug 26, 2019
1 parent 7e8e921 commit 3d28baf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/
```js
<SuperChart
chartType="table"
chartProps={{
width: 600,
height: 600,
formData: {...},
payload: {
data: {...},
},
width={600}
height={600}
formData={...}
queryData={{
data: {...},
}}
/>
```
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"prop-types": "^15.6.2"
},
"peerDependencies": {
"@superset-ui/chart": "^0.10.0 || ^0.11.0",
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
"@superset-ui/time-format": "^0.10.0 || ^0.11.0",
"@superset-ui/translation": "^0.10.0 || ^0.11.0"
"@superset-ui/chart": "^0.12.0",
"@superset-ui/number-format": "^0.12.0",
"@superset-ui/time-format": "^0.12.0",
"@superset-ui/translation": "^0.12.0"
}
}
2 changes: 1 addition & 1 deletion src/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const propTypes = {

const formatValue = getNumberFormatter(NumberFormats.INTEGER);
const formatPercent = getNumberFormatter(NumberFormats.PERCENT_3_POINT);
function NOOP() {}
const NOOP = () => {};

function TableVis(element, props) {
const {
Expand Down
8 changes: 5 additions & 3 deletions src/transformProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
*/
/* eslint-disable sort-keys */
export default function transformProps(chartProps) {
const { height, datasource, filters, formData, onAddFilter, payload } = chartProps;
const { height, datasource, initialValues, formData, hooks, queryData } = chartProps;
const { onAddFilter = () => {} } = hooks;

const {
alignPn,
colorPn,
Expand All @@ -32,7 +34,7 @@ export default function transformProps(chartProps) {
timeseriesLimitMetric,
} = formData;
const { columnFormats, verboseMap } = datasource;
const { records, columns } = payload.data;
const { records, columns } = queryData.data;

const processedColumns = columns.map(key => {
let label = verboseMap[key];
Expand All @@ -59,7 +61,7 @@ export default function transformProps(chartProps) {
alignPositiveNegative: alignPn,
colorPositiveNegative: colorPn,
columns: processedColumns,
filters,
filters: initialValues,
includeSearch,
metrics,
onAddFilter,
Expand Down

0 comments on commit 3d28baf

Please sign in to comment.