From 783aae19c9543816cdd564dfb9c4c9aa261a3921 Mon Sep 17 00:00:00 2001 From: Jesse Yang Date: Mon, 1 Feb 2021 04:32:55 -0800 Subject: [PATCH 01/10] chore: bump superset-ui packages to v0.17.2 and v0.17.3 (#12854) * chore: bump superset-ui packages to v0.17.2 and v0.17.3 * Bump also the nvd3 chart --- superset-frontend/package-lock.json | 306 ++++++++++------------------ superset-frontend/package.json | 52 ++--- 2 files changed, 131 insertions(+), 227 deletions(-) diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index afbfa1ca58f84..820adf3c6c4dc 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -18552,9 +18552,9 @@ } }, "@superset-ui/chart-controls": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.17.1.tgz", - "integrity": "sha512-dfJRoVH0WbG5FQ8smszVtiYLI3NvvLAQxW6HRgOqTLegiKocIIB8hjpMpGrOPxx2G0mBigAubeQowC1VOlpAZQ==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.17.2.tgz", + "integrity": "sha512-Rqk68T0sJlB77E1mO9If64NAymi4POy6STsdODtGQ7UlRx9DnbKMUxUqfPgGhLqiDRpYmsoQpG/CPHEvCdE5Pg==", "requires": { "@superset-ui/core": "0.17.1", "lodash": "^4.17.15", @@ -18647,11 +18647,11 @@ } }, "@superset-ui/legacy-plugin-chart-calendar": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.17.1.tgz", - "integrity": "sha512-v9Hh2hNdxsu3vSRtx1KjqsDhDYlCStbEQekp2+BKRH55RKitbJzbw+6GgXxA09s/6VgIxji8oEaZVYAWylzJtQ==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.17.2.tgz", + "integrity": "sha512-syc/v+lCp9Xfx76171YZ5PD0ZxdxneKQViUY0L4I6KtvIHPtUQqj3kQJRELPSWh933pKdqO1HtWTMG8jyNsmEw==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3-array": "^2.0.3", "d3-selection": "^1.4.0", @@ -18670,11 +18670,11 @@ } }, "@superset-ui/legacy-plugin-chart-chord": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-chord/-/legacy-plugin-chart-chord-0.17.1.tgz", - "integrity": "sha512-xJbr9oyHBOBRp1IWQn1HuLsrArJtADVk2FE6r4QZTVYCKzJoKrQTqQEfkA2roHOHfOZtlcHcD1rlOMt8KpdmDw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-chord/-/legacy-plugin-chart-chord-0.17.2.tgz", + "integrity": "sha512-ya0f6IBwc3JumcM4510glquY7OAV04fimgFpoH+9XEpTx2ikKnUwS02gGVzpWw4/0VfrSJNQqTy3vG+wmGvkSQ==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "prop-types": "^15.6.2", @@ -18682,11 +18682,11 @@ } }, "@superset-ui/legacy-plugin-chart-country-map": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-country-map/-/legacy-plugin-chart-country-map-0.17.1.tgz", - "integrity": "sha512-CCJPFGp0P1lEX4W0JqcSC0Lq43gx8BSUNeE//xz+ZKc9JoERttVCKjwEyFCov6Y++iFM/EfDpg1bRS0XpJxD4A==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-country-map/-/legacy-plugin-chart-country-map-0.17.2.tgz", + "integrity": "sha512-+5SnkN/KzPkWDUNMVJ7E9hljG2ldsrAqpCget+x7oIfE1Nb0sbMm7q2ewQeAmUXs9ftSlrKVvb0560G9uLRqMQ==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "d3-array": "^2.0.3", @@ -18704,33 +18704,33 @@ } }, "@superset-ui/legacy-plugin-chart-event-flow": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-event-flow/-/legacy-plugin-chart-event-flow-0.17.1.tgz", - "integrity": "sha512-pGuo5cVjLRJILKbE2oc7mFoWUTrOIf2ChNLHpULZZeNtpG8H3gXGA97qK+5KgXtslfv2BVi1sbR97VV9IH3gTw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-event-flow/-/legacy-plugin-chart-event-flow-0.17.2.tgz", + "integrity": "sha512-9sIO2ilA1iJ4MhYqdO8oj+byjyLvSdtsx/wmhGf6U4QqjLDSVpXgf3g2hQt6x34foMQodL8WcC9vAHa11ILpfw==", "requires": { "@data-ui/event-flow": "^0.0.84", - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-force-directed": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.17.1.tgz", - "integrity": "sha512-F8aV/iGBeHOh+9ewE8rfpWN2J/avAvlWl1zIM/PZTMlwimVwBXj8voTWk32LVL+Cb+9DwntB5KA093r8yWHK5Q==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.17.2.tgz", + "integrity": "sha512-0S/iF17heD+UNetgQvE7jO4bvym2py54hGersDhtLuZm9Ch5Vhk+1q6X9j8QOTR5lcupIxkMvFIV/rCf3tjR+A==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "prop-types": "^15.7.2" } }, "@superset-ui/legacy-plugin-chart-heatmap": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.17.1.tgz", - "integrity": "sha512-IlItjyVT9Y3aE3qYml+CEbGpwVrPJu68MYb5UNOp+ms5DEETRH0Z61kKvX/egCVouYznyVrxjdc8SvL8tHqQYg==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.17.2.tgz", + "integrity": "sha512-15XO5xoFn118TVgdp+GBnHd1cSM+/ieb1N5fZmulgSy88v0kLG/hl4NdG+lMSMWXoDkaWMlzJnz9EsP3hb+Vmw==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "d3-svg-legend": "^1.x", @@ -18739,13 +18739,13 @@ } }, "@superset-ui/legacy-plugin-chart-histogram": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.17.1.tgz", - "integrity": "sha512-awZCVmpXH5LCOOCktZdaj5PrPUBeAWdK/60A6n/oKufZ2x4eoXVLgBpsj3JCS73XcKu3FwhWRHLujE0pZthKhA==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.17.2.tgz", + "integrity": "sha512-VbQ+5qGEg+XF3ovPPXDDfBYXwZyqkbqnA4R+yPG1y/rJldsvQ1/3TINT90Hz4rve9agvJihc0ERkoMUaFBgXtg==", "requires": { "@data-ui/histogram": "^0.0.84", "@data-ui/theme": "^0.0.84", - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "@vx/legend": "^0.0.198", "@vx/responsive": "^0.0.199", @@ -18814,11 +18814,11 @@ } }, "@superset-ui/legacy-plugin-chart-horizon": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.17.1.tgz", - "integrity": "sha512-1omJPgUSktLCqBXqDMMqb9dFfflxWGmEdl6lxVPMqqCrlRILdNCd1rdsQFsu1cN90FmZav7AMVj7SLvIHWvNnQ==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.17.2.tgz", + "integrity": "sha512-JaEeIkWP0D2iAxNA7cOqJnjnaYWcG74DFYOWNzNdnzHwz4830yglHwzBH1gK9+5QxW7BiQ2MvLRA9T8Qzql5Hg==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3-array": "^2.0.3", "d3-scale": "^3.0.1", @@ -18848,11 +18848,11 @@ } }, "@superset-ui/legacy-plugin-chart-map-box": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.17.1.tgz", - "integrity": "sha512-RHI9k3ulGodGjKgX2kBF3muMyTZKCQGPXV6BbNRzV8DJCc6eGrcE1eznC0ipHiy4yBYeKHfMwcWX3jh9dCI/kg==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.17.2.tgz", + "integrity": "sha512-lg8jLk62T/QRVutyArUvw+rac/ee00IRG8EL6QIRxiHSayrST6GRcTQ6EZ6wxQ9444O3oDYBkFAwiCEXe9NHEA==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "immutable": "^3.8.2", "mapbox-gl": "^0.53.0", @@ -18870,11 +18870,11 @@ } }, "@superset-ui/legacy-plugin-chart-paired-t-test": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-paired-t-test/-/legacy-plugin-chart-paired-t-test-0.17.1.tgz", - "integrity": "sha512-WExiHSMvByu8+weNJoKll82cPrhF4zNRnMGzdiYMewJ6TZLN4Ws3ZLR+b2c26BnWQFyA8qXPpsCcQzX9c9WODw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-paired-t-test/-/legacy-plugin-chart-paired-t-test-0.17.2.tgz", + "integrity": "sha512-BEdZxUXx8SiK0QXmdcXF0uPL/ctF3oiHofQvx6Doi1WWb9QBJMV+jgG5vtEuQvQGMI9DNm/71g9iqt50onMjTQ==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "distributions": "^1.0.0", "prop-types": "^15.6.2", @@ -18882,22 +18882,22 @@ } }, "@superset-ui/legacy-plugin-chart-parallel-coordinates": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-parallel-coordinates/-/legacy-plugin-chart-parallel-coordinates-0.17.1.tgz", - "integrity": "sha512-v6HPEyQRKEOhVpydKzVo+HWUDNaYJhgWL/mrr/kDhT+htUPOUqtTqQZ2BsvgpTQiX4qXHUMnAOXAN7eBa4Xf3w==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-parallel-coordinates/-/legacy-plugin-chart-parallel-coordinates-0.17.2.tgz", + "integrity": "sha512-/jeQtKEQvxQFllcgD3I45176GgCnxsvbgdM3ztUgCflsLhrHQMD685PMDXacbhNE3WKnLszDZ/9Ayw+3PXu3vw==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "prop-types": "^15.7.2" } }, "@superset-ui/legacy-plugin-chart-partition": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.17.1.tgz", - "integrity": "sha512-Zx7lEjgz0N/MQBmXFrhAsjryIl7QzZc5Gi5bXEi9GYiXcDUaZJmLW0cUnJT5Maqgwt3HCtKgCDZEh/SRj+XBsQ==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.17.2.tgz", + "integrity": "sha512-F0R8+JW6xrdVufjzoKx+/iyswWR+9I0lf2kODArcwyEYa4OkhqVjBJIWF1x8VpA6YFWreRmq1Tn0c3QcZrhh4w==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "d3-hierarchy": "^1.1.8", @@ -18905,11 +18905,11 @@ } }, "@superset-ui/legacy-plugin-chart-pivot-table": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-pivot-table/-/legacy-plugin-chart-pivot-table-0.17.1.tgz", - "integrity": "sha512-qlXdtaKNQsMibpyJIeQUqaJTLE4Uce9Kn47t9mgB6lCLQc5c+egM9hVwB57P8tUxMBCJePQcjiRIJRnyLKjOTA==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-pivot-table/-/legacy-plugin-chart-pivot-table-0.17.2.tgz", + "integrity": "sha512-7eILPkjFvJuE6vbOAHHumfjEvJAT2j7pgOe9oS/4WYJrc/LCmOKRhZy/Fqn3yEMQX18TDfusu+hWsG8fD9T0Bw==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "datatables.net-bs": "^1.10.15", @@ -18917,11 +18917,11 @@ } }, "@superset-ui/legacy-plugin-chart-rose": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-rose/-/legacy-plugin-chart-rose-0.17.1.tgz", - "integrity": "sha512-dQykgdgrtOTAq4ck/uZ98R8Vhv4UtercXUlNDMTsiJo5nz3/Ka/4Oz3zBf3Pey+3JrsIOQtJP1vKRKt/j37Zkg==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-rose/-/legacy-plugin-chart-rose-0.17.2.tgz", + "integrity": "sha512-c/Ka3mKmL5SisrkDVJ6TaRg0eAIZVDWcJdtOzXRsU7cUExtSDhkxc4aQ1LAOKc8cldxvQatI21HF3hAzk13NSw==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "nvd3": "1.8.6", @@ -18929,11 +18929,11 @@ } }, "@superset-ui/legacy-plugin-chart-sankey": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey/-/legacy-plugin-chart-sankey-0.17.1.tgz", - "integrity": "sha512-gy5COpeeEHllYFuenXwdZr5OZ8bL1g+C16bGbjACG9/kIaF9ShoTN+Ad5cNTepb78Cox+WhmPHKIzbgPybN3Bw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey/-/legacy-plugin-chart-sankey-0.17.2.tgz", + "integrity": "sha512-DpKWknNlxGuwQhVCa/gwRTzTGnTMBHjnwC0M0kq1AtcoaYRgOnRN8XurNvXVIByxS9m4Y3YqhpYmQ65NIT7xAA==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "d3-sankey": "^0.4.2", @@ -18941,11 +18941,11 @@ } }, "@superset-ui/legacy-plugin-chart-sankey-loop": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey-loop/-/legacy-plugin-chart-sankey-loop-0.17.1.tgz", - "integrity": "sha512-r46LqceZi1hv6DDiZMinuU/hR+jyAgURcBvXy/5GvEAF+0eVHUzqbQ8SWivmFCNRwVTAEBMYkUa3IKZ6LBeUbw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey-loop/-/legacy-plugin-chart-sankey-loop-0.17.2.tgz", + "integrity": "sha512-6iP5lSUvb4WaUikoeVGpmRZ9dzg7uS+1hTrOTxl+e0WgmOfbopH6I/Iv/oNLs+hAklrrLvWT14nKFRvmOayZ1g==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3-sankey-diagram": "^0.7.3", "d3-selection": "^1.4.0", @@ -18953,22 +18953,22 @@ } }, "@superset-ui/legacy-plugin-chart-sunburst": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sunburst/-/legacy-plugin-chart-sunburst-0.17.1.tgz", - "integrity": "sha512-hyP36lNaLBWCKfRXTMTG/uvJZa1bMjyX0jYDRAY/tNVxPBAjhTrB76SW1eShfpugg6baaqys9XrbVkxiKRcFnA==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sunburst/-/legacy-plugin-chart-sunburst-0.17.2.tgz", + "integrity": "sha512-bPiw75rEwt+Q2EPNbeM4CAb0g697F7P1WaVOnyo623o1jwZR61y4Gs1n5DvSijQvD3flHOuzK1oGnVSWEwG4sw==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-treemap": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-treemap/-/legacy-plugin-chart-treemap-0.17.1.tgz", - "integrity": "sha512-z6dQo1ZDb2/drZUJ3nYScBbDXHiIYchtpscYNszyB/jGxJ90ridUniLQicyLxMkjdK4mpuBW9MgidSg0y0I0sw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-treemap/-/legacy-plugin-chart-treemap-0.17.2.tgz", + "integrity": "sha512-9rLBpx6DvCNndMmlenardcn5P350xyKyHWZtJrdAhmWK5IZ/G2VbPiynciApXZpBIK+cAiPM5VENp7G80sxLWw==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3-hierarchy": "^1.1.8", "d3-selection": "^1.4.0", @@ -18976,11 +18976,11 @@ } }, "@superset-ui/legacy-plugin-chart-world-map": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-world-map/-/legacy-plugin-chart-world-map-0.17.1.tgz", - "integrity": "sha512-S9XuCVUIbgfCH4sG0PWGMdEc14fzunZIiUZOC2hh2JtLV/vU452XO4a9viTzWFvAY75zHNetgkTtuoCsrQdLOw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-world-map/-/legacy-plugin-chart-world-map-0.17.2.tgz", + "integrity": "sha512-gOmugDzjLWK39ab2WYA+lEYaqv39bipH2aal6Dz2MtfODzZbF7JfDzeyquUhdMEr89fWHmEjiB2FU+DeXZN9yQ==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "d3-array": "^2.4.0", @@ -19005,12 +19005,12 @@ } }, "@superset-ui/legacy-preset-chart-big-number": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-big-number/-/legacy-preset-chart-big-number-0.17.1.tgz", - "integrity": "sha512-961i+DqTNcPNlvH3GAB2ofViEk4CcZFdcjZ/rMdCzlEichmLLrNzKUPfouvhMpMokb4ysEADOkQvE7POlKjDWw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-big-number/-/legacy-preset-chart-big-number-0.17.2.tgz", + "integrity": "sha512-zgPTBuHxdSgCT2B3H0YF5zvlCLp+iLluSIUfFHMpfE7deMKPOnR+dObgozXJfDus3kVXWp6qr8uWFlMN3crtyw==", "requires": { "@data-ui/xy-chart": "^0.0.84", - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "@types/d3-color": "^1.2.2", "@types/shortid": "^0.0.29", @@ -19044,13 +19044,13 @@ } }, "@superset-ui/legacy-preset-chart-nvd3": { - "version": "0.16.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.16.10.tgz", - "integrity": "sha512-zQPybEGYfthiUpwSOV4E1YUWnSqWY6S4nGXR8rVh2FIUFzyYyr4f5ZzOr6DKmytPlQbL1oXg0m35A8boshOh0g==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.17.2.tgz", + "integrity": "sha512-hoxc93lYYHoh02hxEogMREe5pHPjU/f69Jv1r0IOiApzeCJ9EG6rOVf1f1sfCaESZWG63Y1QpaHaQxb5koLyaw==", "requires": { "@data-ui/xy-chart": "^0.0.84", - "@superset-ui/chart-controls": "0.16.9", - "@superset-ui/core": "0.16.7", + "@superset-ui/chart-controls": "0.17.2", + "@superset-ui/core": "0.17.1", "d3": "^3.5.17", "d3-tip": "^0.9.1", "dompurify": "^2.0.6", @@ -19061,109 +19061,14 @@ "nvd3-fork": "^2.0.5", "prop-types": "^15.6.2", "urijs": "^1.18.10" - }, - "dependencies": { - "@superset-ui/chart-controls": { - "version": "0.16.9", - "resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.16.9.tgz", - "integrity": "sha512-GTwnJx5AhiYqwed3F3FCz+8Yuc56jlLM/g872zoHYQUejnAXGs/Iomeznga6+281DKfsbCO6ptH6qiOZYDH8PA==", - "requires": { - "@superset-ui/core": "0.16.7", - "lodash": "^4.17.15", - "prop-types": "^15.7.2" - } - }, - "@superset-ui/core": { - "version": "0.16.7", - "resolved": "https://registry.npmjs.org/@superset-ui/core/-/core-0.16.7.tgz", - "integrity": "sha512-9i/o9ZC+dJibhoWZnoKGvxMMFcz65LjHuYk+hRspuRWA4qwobcdu64piQpfwuFVhw1yh3cbdxq+OSsNmNX9A9g==", - "requires": { - "@babel/runtime": "^7.1.2", - "@emotion/core": "^10.0.28", - "@emotion/styled": "^10.0.27", - "@types/d3-format": "^1.3.0", - "@types/d3-interpolate": "^1.3.1", - "@types/d3-scale": "^2.1.1", - "@types/d3-time": "^1.0.9", - "@types/d3-time-format": "^2.1.0", - "@types/lodash": "^4.14.149", - "@types/rison": "0.0.6", - "@types/seedrandom": "^2.4.28", - "@vx/responsive": "^0.0.197", - "csstype": "^2.6.4", - "d3-format": "^1.3.2", - "d3-interpolate": "^1.4.0", - "d3-scale": "^3.0.0", - "d3-time": "^1.0.10", - "d3-time-format": "^2.2.0", - "emotion-theming": "^10.0.27", - "fetch-retry": "^4.0.1", - "jed": "^1.1.1", - "lodash": "^4.17.11", - "pretty-ms": "^7.0.0", - "react-error-boundary": "^1.2.5", - "reselect": "^4.0.0", - "rison": "^0.1.1", - "seedrandom": "^3.0.5", - "whatwg-fetch": "^3.0.0" - } - }, - "@vx/responsive": { - "version": "0.0.197", - "resolved": "https://registry.npmjs.org/@vx/responsive/-/responsive-0.0.197.tgz", - "integrity": "sha512-Qv15PJ/Hy79LjyfJ/9E8z+zacKAnD43O2Jg9wvB6PFSNs73xPEDy/mHTYxH+FZv94ruAE3scBO0330W29sQpyg==", - "requires": { - "@types/lodash": "^4.14.146", - "@types/react": "*", - "lodash": "^4.17.10", - "prop-types": "^15.6.1", - "resize-observer-polyfill": "1.5.1" - } - }, - "d3-array": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.11.0.tgz", - "integrity": "sha512-26clcwmHQEdsLv34oNKq5Ia9tQ26Y/4HqS3dQzF42QBUqymZJ+9PORcN1G52bt37NsL2ABoX4lvyYZc+A9Y0zw==", - "requires": { - "internmap": "^1.0.0" - } - }, - "d3-interpolate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", - "requires": { - "d3-color": "1" - } - }, - "d3-scale": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.2.3.tgz", - "integrity": "sha512-8E37oWEmEzj57bHcnjPVOBS3n4jqakOeuv1EDdQSiSrYnMCBdMd3nc4HtKk7uia8DUHcY/CGuJ42xxgtEYrX0g==", - "requires": { - "d3-array": "^2.3.0", - "d3-format": "1 - 2", - "d3-interpolate": "1.2.0 - 2", - "d3-time": "1 - 2", - "d3-time-format": "2 - 3" - } - }, - "d3-time-format": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", - "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", - "requires": { - "d3-time": "1" - } - } } }, "@superset-ui/plugin-chart-echarts": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-echarts/-/plugin-chart-echarts-0.17.1.tgz", - "integrity": "sha512-+PzvoEbeTfrZ+SkM/bldwGljTjy+VBSz/AoPsDEgKmaJ8UZSG7rXQM01X0so7XkD9WRvAMI5q6+uFjL2zfDJlw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-echarts/-/plugin-chart-echarts-0.17.2.tgz", + "integrity": "sha512-wvxCUFvC4q7bBB2aZsylC6P3+qJp1vuAFpOCt4Bmk0QXn5IRchzpxwv+xv6f9G/XEKAS0O2BHgbbeepyF0z6FA==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "@types/echarts": "^4.9.3", "@types/mathjs": "^6.0.7", @@ -19172,12 +19077,12 @@ } }, "@superset-ui/plugin-chart-table": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-table/-/plugin-chart-table-0.17.1.tgz", - "integrity": "sha512-Jkf4nAU2usJUQthRMO5dSdeatlUvI+3QYCWujneTXCbR4MMBXhnlePlD0LO5dTteLNBql56rg2SbD10NDIZGZA==", + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-table/-/plugin-chart-table-0.17.3.tgz", + "integrity": "sha512-mfVrm/P0vdiwDvsSwjc/h9KaYaOtV/Kr+IgQZ8FDrcovuKokkyXSvnkPBB/FFogBGuhXn1EEymrqgF7yQZqiMA==", "requires": { "@emotion/core": "^10.0.28", - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "@types/d3-array": "^2.0.0", "@types/react-table": "^7.0.19", @@ -19201,11 +19106,11 @@ } }, "@superset-ui/plugin-chart-word-cloud": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-word-cloud/-/plugin-chart-word-cloud-0.17.1.tgz", - "integrity": "sha512-jPz/22L3IwIoQqsHEFqwQTGyYdatednazPB3zGUv1KMzkj4AyU/sd5AsnCCDDC7EL10ylhy9NB8EYk12x5Z7vw==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-word-cloud/-/plugin-chart-word-cloud-0.17.2.tgz", + "integrity": "sha512-mfBPE+xZ2mjND2jqkHZAIWY2v+sMZ2n+rBfHJbK8EQhttqXrD7fJ5tmzDjWQqrYWpkGYwgdxLXZeZVgOedgg0w==", "requires": { - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "@types/d3-cloud": "^1.2.1", "@types/d3-scale": "^2.0.2", @@ -19238,13 +19143,13 @@ } }, "@superset-ui/preset-chart-xy": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@superset-ui/preset-chart-xy/-/preset-chart-xy-0.17.1.tgz", - "integrity": "sha512-N1mSF8OE04n+xM8Fh6ZsNLD1ARGnVlh3zzld1YmhasS7rRP8UZ3STGEjLm4IV8mTYeVc+i7+Xg/VI5Fl42Uhow==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@superset-ui/preset-chart-xy/-/preset-chart-xy-0.17.2.tgz", + "integrity": "sha512-OaZgtt+e5Jncum18lOvpYWJ3cbVMElTL+YO6MEpk3CvFvcROjH8R6MleK1Vm4iM8CTL3865Ycu8KeHwdpoSetg==", "requires": { "@data-ui/theme": "^0.0.84", "@data-ui/xy-chart": "^0.0.84", - "@superset-ui/chart-controls": "0.17.1", + "@superset-ui/chart-controls": "0.17.2", "@superset-ui/core": "0.17.1", "@vx/axis": "^0.0.198", "@vx/legend": "^0.0.198", @@ -20995,7 +20900,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", - "dev": true, "requires": { "@types/react": "*", "hoist-non-react-statics": "^3.3.0" @@ -31359,7 +31263,7 @@ "dependencies": { "core-js": { "version": "1.2.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "resolved": "http://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" } } diff --git a/superset-frontend/package.json b/superset-frontend/package.json index 6ebad9d3f268b..51f2ddfb9e710 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -65,34 +65,34 @@ "@babel/runtime-corejs3": "^7.12.5", "@data-ui/sparkline": "^0.0.84", "@emotion/core": "^10.0.35", - "@superset-ui/chart-controls": "^0.17.1", + "@superset-ui/chart-controls": "^0.17.2", "@superset-ui/core": "^0.17.1", - "@superset-ui/legacy-plugin-chart-calendar": "^0.17.1", - "@superset-ui/legacy-plugin-chart-chord": "^0.17.1", - "@superset-ui/legacy-plugin-chart-country-map": "^0.17.1", - "@superset-ui/legacy-plugin-chart-event-flow": "^0.17.1", - "@superset-ui/legacy-plugin-chart-force-directed": "^0.17.1", - "@superset-ui/legacy-plugin-chart-heatmap": "^0.17.1", - "@superset-ui/legacy-plugin-chart-histogram": "^0.17.1", - "@superset-ui/legacy-plugin-chart-horizon": "^0.17.1", - "@superset-ui/legacy-plugin-chart-map-box": "^0.17.1", - "@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.1", - "@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.1", - "@superset-ui/legacy-plugin-chart-partition": "^0.17.1", - "@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.1", - "@superset-ui/legacy-plugin-chart-rose": "^0.17.1", - "@superset-ui/legacy-plugin-chart-sankey": "^0.17.1", - "@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.1", - "@superset-ui/legacy-plugin-chart-sunburst": "^0.17.1", - "@superset-ui/legacy-plugin-chart-treemap": "^0.17.1", - "@superset-ui/legacy-plugin-chart-world-map": "^0.17.1", - "@superset-ui/legacy-preset-chart-big-number": "^0.17.1", + "@superset-ui/legacy-plugin-chart-calendar": "^0.17.2", + "@superset-ui/legacy-plugin-chart-chord": "^0.17.2", + "@superset-ui/legacy-plugin-chart-country-map": "^0.17.2", + "@superset-ui/legacy-plugin-chart-event-flow": "^0.17.2", + "@superset-ui/legacy-plugin-chart-force-directed": "^0.17.2", + "@superset-ui/legacy-plugin-chart-heatmap": "^0.17.2", + "@superset-ui/legacy-plugin-chart-histogram": "^0.17.2", + "@superset-ui/legacy-plugin-chart-horizon": "^0.17.2", + "@superset-ui/legacy-plugin-chart-map-box": "^0.17.2", + "@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.2", + "@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.2", + "@superset-ui/legacy-plugin-chart-partition": "^0.17.2", + "@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.2", + "@superset-ui/legacy-plugin-chart-rose": "^0.17.2", + "@superset-ui/legacy-plugin-chart-sankey": "^0.17.2", + "@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.2", + "@superset-ui/legacy-plugin-chart-sunburst": "^0.17.2", + "@superset-ui/legacy-plugin-chart-treemap": "^0.17.2", + "@superset-ui/legacy-plugin-chart-world-map": "^0.17.2", + "@superset-ui/legacy-preset-chart-big-number": "^0.17.2", "@superset-ui/legacy-preset-chart-deckgl": "^0.4.1", - "@superset-ui/legacy-preset-chart-nvd3": "^0.16.10", - "@superset-ui/plugin-chart-echarts": "^0.17.1", - "@superset-ui/plugin-chart-table": "^0.17.1", - "@superset-ui/plugin-chart-word-cloud": "^0.17.1", - "@superset-ui/preset-chart-xy": "^0.17.1", + "@superset-ui/legacy-preset-chart-nvd3": "^0.17.2", + "@superset-ui/plugin-chart-echarts": "^0.17.2", + "@superset-ui/plugin-chart-table": "^0.17.3", + "@superset-ui/plugin-chart-word-cloud": "^0.17.2", + "@superset-ui/preset-chart-xy": "^0.17.2", "@vx/responsive": "^0.0.195", "abortcontroller-polyfill": "^1.1.9", "antd": "^4.9.4", From 51195af4fa4581361fb3e61fb0ad31d9c74983a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20G=C3=A2ndara=20Pinto?= Date: Mon, 1 Feb 2021 15:41:57 +0000 Subject: [PATCH 02/10] fix: Presto column_type_mappings time and timestamp (#12861) * Fix presto column_type_mappings time and timestamp * Added unit tests --- superset/db_engine_specs/presto.py | 2 +- tests/db_engine_specs/presto_tests.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/superset/db_engine_specs/presto.py b/superset/db_engine_specs/presto.py index 5570e1d53957e..071fd885f8d6a 100644 --- a/superset/db_engine_specs/presto.py +++ b/superset/db_engine_specs/presto.py @@ -353,8 +353,8 @@ def _show_columns( (re.compile(r"^varbinary.*", re.IGNORECASE), types.VARBINARY()), (re.compile(r"^json.*", re.IGNORECASE), types.JSON()), (re.compile(r"^date.*", re.IGNORECASE), types.DATE()), - (re.compile(r"^time.*", re.IGNORECASE), types.Time()), (re.compile(r"^timestamp.*", re.IGNORECASE), types.TIMESTAMP()), + (re.compile(r"^time.*", re.IGNORECASE), types.Time()), (re.compile(r"^interval.*", re.IGNORECASE), Interval()), (re.compile(r"^array.*", re.IGNORECASE), Array()), (re.compile(r"^map.*", re.IGNORECASE), Map()), diff --git a/tests/db_engine_specs/presto_tests.py b/tests/db_engine_specs/presto_tests.py index 9b2024dd72837..d0343a32d792d 100644 --- a/tests/db_engine_specs/presto_tests.py +++ b/tests/db_engine_specs/presto_tests.py @@ -554,6 +554,12 @@ def test_get_sqla_column_type(self): sqla_type = PrestoEngineSpec.get_sqla_column_type("integer") assert isinstance(sqla_type, types.Integer) + sqla_type = PrestoEngineSpec.get_sqla_column_type("time") + assert isinstance(sqla_type, types.Time) + + sqla_type = PrestoEngineSpec.get_sqla_column_type("timestamp") + assert isinstance(sqla_type, types.TIMESTAMP) + sqla_type = PrestoEngineSpec.get_sqla_column_type(None) assert sqla_type is None From c781ab8adf4cb002edb33a9f2118ed84db8d6941 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Mon, 1 Feb 2021 20:13:10 -0300 Subject: [PATCH 03/10] Migrates Button component from Bootstrap to AntD (#12832) --- .../addSlice/AddSliceContainer_spec.tsx | 23 +- .../nativeFilters/FilterBar_spec.tsx | 6 +- .../components/QueryAndSaveBtns_spec.jsx | 16 +- .../src/CRUD/CollectionTable.tsx | 2 +- .../src/SqlLab/components/ResultSet.tsx | 7 +- .../SqlLab/components/SaveDatasetModal.tsx | 6 +- .../src/SqlLab/components/TableElement.jsx | 3 +- .../src/components/Button/Button.stories.jsx | 147 ------- .../src/components/Button/Button.stories.tsx | 141 ++++++ .../src/components/Button/Button.test.tsx | 6 - .../src/components/Button/index.tsx | 403 +++++++----------- .../ButtonGroup/ButtonGroup.stories.tsx | 70 +++ .../ButtonGroup/ButtonGroup.test.tsx | 50 +++ .../src/components/ButtonGroup/index.tsx | 53 +++ .../ImportModal/ImportModal.test.tsx | 11 +- .../src/dashboard/components/Header.jsx | 2 +- .../dashboard/components/PropertiesModal.jsx | 6 +- .../components/RefreshIntervalModal.tsx | 8 +- .../filterscope/FilterScopeSelector.jsx | 8 +- .../components/nativeFilters/FilterBar.tsx | 6 +- .../src/datasource/DatasourceEditor.jsx | 2 +- .../src/datasource/DatasourceModal.tsx | 6 +- .../explore/components/DataTableControl.tsx | 2 +- .../explore/components/DisplayQueryButton.jsx | 2 +- .../explore/components/PropertiesModal.tsx | 8 +- .../explore/components/QueryAndSaveBtns.jsx | 90 ++-- .../src/explore/components/SaveModal.tsx | 10 +- .../components/controls/AnnotationLayer.jsx | 8 +- superset-frontend/src/views/CRUD/utils.tsx | 7 - .../src/views/CRUD/welcome/ChartTable.tsx | 9 +- .../src/views/CRUD/welcome/DashboardTable.tsx | 9 +- .../src/views/CRUD/welcome/EmptyState.tsx | 18 +- .../src/views/CRUD/welcome/SavedQueries.tsx | 14 +- 33 files changed, 603 insertions(+), 556 deletions(-) delete mode 100644 superset-frontend/src/components/Button/Button.stories.jsx create mode 100644 superset-frontend/src/components/Button/Button.stories.tsx create mode 100644 superset-frontend/src/components/ButtonGroup/ButtonGroup.stories.tsx create mode 100644 superset-frontend/src/components/ButtonGroup/ButtonGroup.test.tsx create mode 100644 superset-frontend/src/components/ButtonGroup/index.tsx diff --git a/superset-frontend/spec/javascripts/addSlice/AddSliceContainer_spec.tsx b/superset-frontend/spec/javascripts/addSlice/AddSliceContainer_spec.tsx index 4af7fec71e80d..c3b8bac8a4b9c 100644 --- a/superset-frontend/spec/javascripts/addSlice/AddSliceContainer_spec.tsx +++ b/superset-frontend/spec/javascripts/addSlice/AddSliceContainer_spec.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { shallow, ShallowWrapper } from 'enzyme'; +import { ReactWrapper } from 'enzyme'; import Button from 'src/components/Button'; import Select from 'src/components/Select'; import AddSliceContainer, { @@ -25,6 +25,7 @@ import AddSliceContainer, { AddSliceContainerState, } from 'src/addSlice/AddSliceContainer'; import VizTypeControl from 'src/explore/components/controls/VizTypeControl'; +import { styledMount as mount } from 'spec/helpers/theming'; const defaultProps = { datasources: [ @@ -34,14 +35,18 @@ const defaultProps = { }; describe('AddSliceContainer', () => { - let wrapper: ShallowWrapper< + let wrapper: ReactWrapper< AddSliceContainerProps, AddSliceContainerState, AddSliceContainer >; beforeEach(() => { - wrapper = shallow(); + wrapper = mount() as ReactWrapper< + AddSliceContainerProps, + AddSliceContainerState, + AddSliceContainer + >; }); it('uses table as default visType', () => { @@ -58,9 +63,9 @@ describe('AddSliceContainer', () => { }); it('renders a disabled button if no datasource is selected', () => { - expect(wrapper.find(Button).dive().find({ disabled: true })).toHaveLength( - 1, - ); + expect( + wrapper.find(Button).find({ disabled: true }).hostNodes(), + ).toHaveLength(1); }); it('renders an enabled button if datasource is selected', () => { @@ -70,9 +75,9 @@ describe('AddSliceContainer', () => { datasourceId: datasourceValue.split('__')[0], datasourceType: datasourceValue.split('__')[1], }); - expect(wrapper.find(Button).dive().find({ disabled: true })).toHaveLength( - 0, - ); + expect( + wrapper.find(Button).find({ disabled: true }).hostNodes(), + ).toHaveLength(0); }); it('formats explore url', () => { diff --git a/superset-frontend/spec/javascripts/dashboard/components/nativeFilters/FilterBar_spec.tsx b/superset-frontend/spec/javascripts/dashboard/components/nativeFilters/FilterBar_spec.tsx index bdd6dd92d4791..7e6e9b04a540f 100644 --- a/superset-frontend/spec/javascripts/dashboard/components/nativeFilters/FilterBar_spec.tsx +++ b/superset-frontend/spec/javascripts/dashboard/components/nativeFilters/FilterBar_spec.tsx @@ -20,6 +20,7 @@ import React from 'react'; import { styledMount as mount } from 'spec/helpers/theming'; import { Provider } from 'react-redux'; import FilterBar from 'src/dashboard/components/nativeFilters/FilterBar'; +import Button from 'src/components/Button'; import { mockStore } from 'spec/fixtures/mockStore'; describe('FilterBar', () => { @@ -42,7 +43,8 @@ describe('FilterBar', () => { expect(wrapper.find({ name: 'collapse' })).toExist(); }); it('has apply and reset all buttons', () => { - expect(wrapper.find('.btn-primary')).toExist(); - expect(wrapper.find('.btn-secondary')).toExist(); + expect(wrapper.find(Button).length).toBe(2); + expect(wrapper.find(Button).at(0)).toHaveProp('buttonStyle', 'secondary'); + expect(wrapper.find(Button).at(1)).toHaveProp('buttonStyle', 'primary'); }); }); diff --git a/superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx b/superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx index 6bca5fb55de4b..12e1a95e8ef75 100644 --- a/superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/QueryAndSaveBtns_spec.jsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { shallow } from 'enzyme'; +import { styledMount as mount } from 'spec/helpers/theming'; import sinon from 'sinon'; import QueryAndSaveButtons from 'src/explore/components/QueryAndSaveBtns'; @@ -38,23 +38,21 @@ describe('QueryAndSaveButtons', () => { // Test the output describe('output', () => { - let wrapper; - - beforeEach(() => { - wrapper = shallow(); - }); + const wrapper = mount(); it('renders 2 buttons', () => { expect(wrapper.find(Button)).toHaveLength(2); }); it('renders buttons with correct text', () => { - expect(wrapper.find(Button).contains('Run')).toBe(true); - expect(wrapper.find(Button).contains('Save')).toBe(true); + expect(wrapper.find(Button).at(0).text().trim()).toBe('Run'); + expect(wrapper.find(Button).at(1).text().trim()).toBe('Save'); }); it('calls onQuery when query button is clicked', () => { - const queryButton = wrapper.find('[data-test="run-query-button"]'); + const queryButton = wrapper + .find('[data-test="run-query-button"]') + .hostNodes(); queryButton.simulate('click'); expect(defaultProps.onQuery.called).toBe(true); }); diff --git a/superset-frontend/src/CRUD/CollectionTable.tsx b/superset-frontend/src/CRUD/CollectionTable.tsx index 8166034d4f47f..ea46856df7b88 100644 --- a/superset-frontend/src/CRUD/CollectionTable.tsx +++ b/superset-frontend/src/CRUD/CollectionTable.tsx @@ -308,7 +308,7 @@ export default class CRUDCollection extends React.PureComponent< {this.props.allowAddItem && ( + - ))} - - ))} - -); - -export const InteractiveButton = args => { - const { label, ...btnArgs } = args; - return ; -}; - -InteractiveButton.args = { - buttonStyle: STYLES.defaultValue, - buttonSize: SIZES.defaultValue, - type: TYPES.defaultValue, - target: TARGETS.defaultValue, - href: HREFS.defaultValue, - label: 'Button!', -}; -InteractiveButton.argTypes = { - buttonStyle: { - name: STYLES.label, - control: { type: 'select', options: Object.values(STYLES.options) }, - }, - size: { - name: SIZES.label, - control: { type: 'select', options: Object.values(SIZES.options) }, - }, - type: { - name: TYPES.label, - control: { type: 'select', options: Object.values(TYPES.options) }, - }, - target: { - name: TARGETS.label, - control: { type: 'select', options: Object.values(TARGETS.options) }, - }, - href: { - name: HREFS.label, - control: { type: 'select', options: Object.values(HREFS.options) }, - }, - onClick: { action: 'clicked' }, - label: { name: 'Label', control: { type: 'text' } }, -}; - -ButtonGallery.argTypes = { onClick: { action: 'clicked' } }; diff --git a/superset-frontend/src/components/Button/Button.stories.tsx b/superset-frontend/src/components/Button/Button.stories.tsx new file mode 100644 index 0000000000000..b5a683b36fa24 --- /dev/null +++ b/superset-frontend/src/components/Button/Button.stories.tsx @@ -0,0 +1,141 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React from 'react'; +import Button, { ButtonProps } from './index'; + +type ButtonStyle = Pick; +type ButtonStyleValue = ButtonStyle[keyof ButtonStyle]; +type ButtonSize = Pick; +type ButtonSizeValue = ButtonSize[keyof ButtonSize]; + +export default { + title: 'Button', + component: Button, + includeStories: ['ButtonGallery', 'InteractiveButton'], +}; + +const buttonStyles: ButtonStyleValue[] = [ + 'primary', + 'secondary', + 'tertiary', + 'dashed', + 'danger', + 'warning', + 'success', + 'link', + 'default', +]; + +const buttonSizes: ButtonSizeValue[] = ['xsmall', 'small', 'default']; + +export const STYLES = { + label: 'styles', + options: buttonStyles, + defaultValue: undefined, +}; + +export const SIZES = { + label: 'sizes', + options: buttonSizes, + defaultValue: undefined, +}; + +const TARGETS = { + label: 'target', + options: { + blank: '_blank', + none: null, + }, + defaultValue: null, +}; + +const HREFS = { + label: 'href', + options: { + superset: 'https://superset.apache.org/', + none: null, + }, + defaultValue: null, +}; + +export const ButtonGallery = () => ( + <> + {SIZES.options.map(size => ( +
+

{size}

+ {Object.values(STYLES.options).map(style => ( + + ))} +
+ ))} + +); + +ButtonGallery.story = { + parameters: { + actions: { + disabled: true, + }, + controls: { + disabled: true, + }, + knobs: { + disabled: true, + }, + }, +}; + +export const InteractiveButton = (args: ButtonProps & { label: string }) => { + const { label, ...btnArgs } = args; + return ; +}; + +InteractiveButton.story = { + parameters: { + knobs: { + disabled: true, + }, + }, +}; + +InteractiveButton.args = { + buttonStyle: 'default', + buttonSize: 'default', + label: 'Button!', +}; + +InteractiveButton.argTypes = { + target: { + name: TARGETS.label, + control: { type: 'select', options: Object.values(TARGETS.options) }, + }, + href: { + name: HREFS.label, + control: { type: 'select', options: Object.values(HREFS.options) }, + }, + onClick: { action: 'clicked' }, +}; diff --git a/superset-frontend/src/components/Button/Button.test.tsx b/superset-frontend/src/components/Button/Button.test.tsx index ab0f368fd99e5..3c2f895480369 100644 --- a/superset-frontend/src/components/Button/Button.test.tsx +++ b/superset-frontend/src/components/Button/Button.test.tsx @@ -59,10 +59,4 @@ describe('Button', () => { expect(wrapper.find(Button).length).toEqual(permutationCount); }); - - // test things NOT in the storybook! - it('renders custom button styles without melting', () => { - wrapper = mount( + + + + + + + + + + + +); +InteractiveButtonGroup.args = { + buttonStyle: 'tertiary', + buttonSize: 'default', +}; + +InteractiveButtonGroup.argTypes = { + buttonStyle: { + name: STYLES.label, + control: { type: 'select', options: STYLES.options }, + }, + buttonSize: { + name: SIZES.label, + control: { type: 'select', options: SIZES.options }, + }, +}; + +InteractiveButtonGroup.story = { + parameters: { + actions: { + disabled: true, + }, + knobs: { + disabled: true, + }, + }, +}; diff --git a/superset-frontend/src/components/ButtonGroup/ButtonGroup.test.tsx b/superset-frontend/src/components/ButtonGroup/ButtonGroup.test.tsx new file mode 100644 index 0000000000000..e305eba122128 --- /dev/null +++ b/superset-frontend/src/components/ButtonGroup/ButtonGroup.test.tsx @@ -0,0 +1,50 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React from 'react'; +import { ReactWrapper } from 'enzyme'; +import { styledMount as mount } from 'spec/helpers/theming'; +import Button from 'src/components/Button'; +import ButtonGroup from '.'; + +describe('ButtonGroup', () => { + let wrapper: ReactWrapper; + + it('renders 1 button', () => { + expect( + React.isValidElement( + + + , + ), + ).toBe(true); + }); + + it('renders 3 buttons', () => { + wrapper = mount( + + + + + , + ); + + expect(wrapper.find(Button).length).toEqual(3); + }); +}); diff --git a/superset-frontend/src/components/ButtonGroup/index.tsx b/superset-frontend/src/components/ButtonGroup/index.tsx new file mode 100644 index 0000000000000..a812207d02d63 --- /dev/null +++ b/superset-frontend/src/components/ButtonGroup/index.tsx @@ -0,0 +1,53 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React from 'react'; + +export interface ButtonGroupProps { + className?: string; + children?: React.ReactNode; +} + +export default function ButtonGroup(props: ButtonGroupProps) { + const { className, children } = props; + return ( +
+ {children} +
+ ); +} diff --git a/superset-frontend/src/components/ImportModal/ImportModal.test.tsx b/superset-frontend/src/components/ImportModal/ImportModal.test.tsx index a7a1cf5e2fdc7..8594005937252 100644 --- a/superset-frontend/src/components/ImportModal/ImportModal.test.tsx +++ b/superset-frontend/src/components/ImportModal/ImportModal.test.tsx @@ -21,7 +21,7 @@ import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; import { styledMount as mount } from 'spec/helpers/theming'; import { ReactWrapper } from 'enzyme'; - +import Button from 'src/components/Button'; import { ImportResourceName } from 'src/views/CRUD/types'; import ImportModelsModal from 'src/components/ImportModal'; import Modal from 'src/common/components/Modal'; @@ -82,18 +82,13 @@ describe('ImportModelsModal', () => { }); it('should render the import button initially disabled', () => { - expect(wrapper.find('button[children="Import"]').prop('disabled')).toBe( - true, - ); + expect(wrapper.find(Button).at(1).prop('disabled')).toBe(true); }); it('should render the import button enabled when a file is selected', () => { const file = new File([new ArrayBuffer(1)], 'model_export.zip'); wrapper.find('input').simulate('change', { target: { files: [file] } }); - - expect(wrapper.find('button[children="Import"]').prop('disabled')).toBe( - false, - ); + expect(wrapper.find(Button).at(1).prop('disabled')).toBe(false); }); it('should render password fields when needed for import', () => { diff --git a/superset-frontend/src/dashboard/components/Header.jsx b/superset-frontend/src/dashboard/components/Header.jsx index e155413bad62d..d15232c563d33 100644 --- a/superset-frontend/src/dashboard/components/Header.jsx +++ b/superset-frontend/src/dashboard/components/Header.jsx @@ -21,7 +21,7 @@ import moment from 'moment'; import React from 'react'; import PropTypes from 'prop-types'; import { styled, CategoricalColorNamespace, t } from '@superset-ui/core'; -import { ButtonGroup } from 'react-bootstrap'; +import ButtonGroup from 'src/components/ButtonGroup'; import { LOG_ACTIONS_PERIODIC_RENDER_DASHBOARD, diff --git a/superset-frontend/src/dashboard/components/PropertiesModal.jsx b/superset-frontend/src/dashboard/components/PropertiesModal.jsx index f45f483d6d602..411eda0faed80 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal.jsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal.jsx @@ -296,8 +296,8 @@ class PropertiesModal extends React.PureComponent { footer={ <> - diff --git a/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.jsx b/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.jsx index 6cfcc0eee0a8f..882931983e4cd 100644 --- a/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.jsx +++ b/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.jsx @@ -531,11 +531,15 @@ export default class FilterScopeSelector extends React.PureComponent { - {showSelector && ( - )} diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar.tsx index 692207093415f..617928ce8c00b 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar.tsx @@ -497,15 +497,15 @@ const FilterBar: React.FC = ({ ); + const theme = useTheme(); + return ( - -
- - {qryOrStopButton} - + + {errorMessage && ( + + {' '} + - {t('Save')} - - - {errorMessage && ( - - {' '} - - - - - )} -
-
+ + +
+ )} + ); } diff --git a/superset-frontend/src/explore/components/SaveModal.tsx b/superset-frontend/src/explore/components/SaveModal.tsx index 46d0d5a10a387..767099a6f9e1d 100644 --- a/superset-frontend/src/explore/components/SaveModal.tsx +++ b/superset-frontend/src/explore/components/SaveModal.tsx @@ -170,12 +170,16 @@ class SaveModal extends React.Component { title={t('Save chart')} footer={
-
{isNew ? ( - ) : ( - )}
)} diff --git a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx index 2eef7d4f24834..f86b0b82c3a8a 100644 --- a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx +++ b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx @@ -29,12 +29,7 @@ import DeleteModal from 'src/components/DeleteModal'; import Icon from 'src/components/Icon'; import SubMenu from 'src/components/Menu/SubMenu'; import EmptyState from './EmptyState'; -import { - IconContainer, - CardContainer, - createErrorHandler, - shortenSQL, -} from '../utils'; +import { CardContainer, createErrorHandler, shortenSQL } from '../utils'; SyntaxHighlighter.registerLanguage('sql', sql); @@ -272,9 +267,10 @@ const SavedQueries = ({ buttons={[ { name: ( - - SQL Query{' '} - +
+ + SQL Query{' '} +
), buttonStyle: 'tertiary', onClick: () => { From 68dae80110c5e5bdd863802a2f240e3d1ed7f1d9 Mon Sep 17 00:00:00 2001 From: Rob DiCiuccio Date: Mon, 1 Feb 2021 16:07:28 -0800 Subject: [PATCH 04/10] build: Skip loading example data from configs in CI (#12610) * Skip loading example data from configs in CI * Use .test suffix for example data required by e2e tests * Address linting error with regex --- superset/cli.py | 8 ++++---- .../{Unicode_Cloud.yaml => Unicode_Cloud.test.yaml} | 0 .../{Unicode_Test.yaml => Unicode_Test.test.yaml} | 0 .../{unicode_test.yaml => unicode_test.test.yaml} | 0 superset/examples/utils.py | 10 +++++++--- 5 files changed, 11 insertions(+), 7 deletions(-) rename superset/examples/configs/charts/{Unicode_Cloud.yaml => Unicode_Cloud.test.yaml} (100%) rename superset/examples/configs/dashboards/{Unicode_Test.yaml => Unicode_Test.test.yaml} (100%) rename superset/examples/configs/datasets/examples/{unicode_test.yaml => unicode_test.test.yaml} (100%) diff --git a/superset/cli.py b/superset/cli.py index 56c6f98a67e99..5955eb54de540 100755 --- a/superset/cli.py +++ b/superset/cli.py @@ -130,6 +130,9 @@ def load_examples_run( print("Loading [Birth names]") examples.load_birth_names(only_metadata, force) + print("Loading [Tabbed dashboard]") + examples.load_tabbed_dashboard(only_metadata) + if not load_test_data: print("Loading [Random time series data]") examples.load_random_time_series_data(only_metadata, force) @@ -164,11 +167,8 @@ def load_examples_run( print("Loading DECK.gl demo") examples.load_deck_dash() - print("Loading [Tabbed dashboard]") - examples.load_tabbed_dashboard(only_metadata) - # load examples that are stored as YAML config files - examples.load_from_configs(force) + examples.load_from_configs(force, load_test_data) @with_appcontext diff --git a/superset/examples/configs/charts/Unicode_Cloud.yaml b/superset/examples/configs/charts/Unicode_Cloud.test.yaml similarity index 100% rename from superset/examples/configs/charts/Unicode_Cloud.yaml rename to superset/examples/configs/charts/Unicode_Cloud.test.yaml diff --git a/superset/examples/configs/dashboards/Unicode_Test.yaml b/superset/examples/configs/dashboards/Unicode_Test.test.yaml similarity index 100% rename from superset/examples/configs/dashboards/Unicode_Test.yaml rename to superset/examples/configs/dashboards/Unicode_Test.test.yaml diff --git a/superset/examples/configs/datasets/examples/unicode_test.yaml b/superset/examples/configs/datasets/examples/unicode_test.test.yaml similarity index 100% rename from superset/examples/configs/datasets/examples/unicode_test.yaml rename to superset/examples/configs/datasets/examples/unicode_test.test.yaml diff --git a/superset/examples/utils.py b/superset/examples/utils.py index 951b741b28d69..66ca811df2d35 100644 --- a/superset/examples/utils.py +++ b/superset/examples/utils.py @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +import re from pathlib import Path from typing import Any, Dict @@ -24,13 +25,13 @@ YAML_EXTENSIONS = {".yaml", ".yml"} -def load_from_configs(force_data: bool = False) -> None: - contents = load_contents() +def load_from_configs(force_data: bool = False, load_test_data: bool = False) -> None: + contents = load_contents(load_test_data) command = ImportExamplesCommand(contents, overwrite=True, force_data=force_data) command.run() -def load_contents() -> Dict[str, Any]: +def load_contents(load_test_data: bool = False) -> Dict[str, Any]: """Traverse configs directory and load contents""" root = Path("examples/configs") resource_names = resource_listdir("superset", str(root)) @@ -39,6 +40,7 @@ def load_contents() -> Dict[str, Any]: contents: Dict[Path, str] = {} while queue: path_name = queue.pop() + test_re = re.compile(r"\.test\.|metadata\.yaml$") if resource_isdir("superset", str(path_name)): queue.extend( @@ -46,6 +48,8 @@ def load_contents() -> Dict[str, Any]: for child_name in resource_listdir("superset", str(path_name)) ) elif path_name.suffix.lower() in YAML_EXTENSIONS: + if load_test_data and test_re.search(str(path_name)) is None: + continue contents[path_name] = ( resource_stream("superset", str(path_name)).read().decode("utf-8") ) From 388edbf7b28f6c5321803328f451542fc4e5ae83 Mon Sep 17 00:00:00 2001 From: ejianu <57224408+ejianu@users.noreply.github.com> Date: Tue, 2 Feb 2021 05:19:24 +0100 Subject: [PATCH 05/10] [Helm] Automate datasource import (#10771) * added a new config posibility for automating datasource connections at Init * [Helm] val piped to tpl --- .../templates/configmap-superset.yaml | 32 +++++++++++++++++++ helm/superset/templates/init-job.yaml | 10 ++++++ helm/superset/values.yaml | 17 +++++++++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 helm/superset/templates/configmap-superset.yaml diff --git a/helm/superset/templates/configmap-superset.yaml b/helm/superset/templates/configmap-superset.yaml new file mode 100644 index 0000000000000..104bc353b1be6 --- /dev/null +++ b/helm/superset/templates/configmap-superset.yaml @@ -0,0 +1,32 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- if .Values.extraConfigs }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "superset.fullname" . }}-extra-config + labels: + app: {{ template "superset.name" . }} + chart: {{ template "superset.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{- range $path, $config := .Values.extraConfigs }} + {{ $path }}: | +{{ tpl $config . | indent 4 -}} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/helm/superset/templates/init-job.yaml b/helm/superset/templates/init-job.yaml index 099b2ef450213..4645fcc64be15 100644 --- a/helm/superset/templates/init-job.yaml +++ b/helm/superset/templates/init-job.yaml @@ -51,10 +51,20 @@ spec: - name: superset-config mountPath: {{ .Values.configMountPath | quote }} readOnly: true + {{ if .Values.extraConfigs }} + - name: superset-extra-config + mountPath: {{ .Values.extraConfigMountPath | quote }} + readOnly: true + {{- end }} command: {{ tpl (toJson .Values.init.command) . }} volumes: - name: superset-config secret: secretName: {{ tpl .Values.configFromSecret . }} + {{- if .Values.extraConfigs }} + - name: superset-extra-config + configMap: + name: {{ template "superset.fullname" . }}-extra-config + {{- end }} restartPolicy: Never {{- end }} diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 366f7a39b3baa..dee9808d7fcbe 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -41,8 +41,23 @@ envFromSecret: '{{ template "superset.fullname" . }}-env' ## extraEnv: {} +extraConfigs: {} + # datasources-init.yaml: | + # databases: + # - allow_csv_upload: true + # allow_ctas: true + # allow_cvas: true + # database_name: example-db + # extra: "{\r\n \"metadata_params\": {},\r\n \"engine_params\": {},\r\n \"\ + # metadata_cache_timeout\": {},\r\n \"schemas_allowed_for_csv_upload\": []\r\n\ + # }" + # sqlalchemy_uri: example://example-db.local + # tables: [] + configMountPath: "/app/pythonpath" +extraConfigMountPath: "/app/configs" + image: repository: apache/superset tag: latest @@ -256,4 +271,4 @@ nodeSelector: {} tolerations: [] -affinity: {} +affinity: {} \ No newline at end of file From 2adfb8559736bff97b47c6fee2725b4344c4ebf3 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Tue, 2 Feb 2021 03:15:07 -0300 Subject: [PATCH 06/10] Migrates Label component from Bootstrap to AntD. (#12774) --- .../integration/explore/control.test.ts | 2 +- .../explore/visualizations/table.test.ts | 2 +- .../javascripts/components/Timer_spec.tsx | 5 +- .../explore/components/RowCountLabel_spec.jsx | 2 +- .../javascripts/profile/Security_spec.tsx | 12 +- .../src/SqlLab/components/QueryStateLabel.jsx | 6 +- .../src/SqlLab/components/QueryTable.jsx | 2 +- .../src/SqlLab/components/SouthPane.jsx | 7 +- .../src/SqlLab/components/SqlEditor.jsx | 6 +- superset-frontend/src/SqlLab/constants.ts | 2 +- .../src/addSlice/AddSliceContainer.tsx | 2 +- .../src/common/components/index.tsx | 1 + .../src/components/CachedLabel.jsx | 4 +- .../src/components/DatabaseSelector.tsx | 11 +- .../src/components/Label/Label.stories.tsx | 63 +++--- .../src/components/Label/Label.test.tsx | 18 +- .../src/components/Label/index.tsx | 209 +++++++----------- superset-frontend/src/components/Timer.tsx | 9 +- .../src/explore/components/RowCountLabel.jsx | 4 +- .../components/controls/VizTypeControl.jsx | 12 +- .../src/views/CRUD/chart/ChartCard.tsx | 2 +- 21 files changed, 159 insertions(+), 222 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts b/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts index 70b01351eaa9f..c65b5dfb59252 100644 --- a/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts @@ -104,7 +104,7 @@ describe('VizType control', () => { numScripts = nodes.length; }); - cy.get('.Control .label').contains('Table').click(); + cy.get('[data-test="visualization-type"]').contains('Table').click(); cy.get('[role="button"]').contains('Line Chart').click(); diff --git a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts index 868d2fe27f18f..0af7dce36fa82 100644 --- a/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/explore/visualizations/table.test.ts @@ -161,7 +161,7 @@ describe('Visualization > Table', () => { cy.verifySliceContainer('table'); expect(response?.body.result[0].data.length).to.eq(limit); }); - cy.get('span.label-danger').contains('10 rows'); + cy.get('[data-test="row-count-label"]').contains('10 rows'); }); it('Test table with columns and row limit', () => { diff --git a/superset-frontend/spec/javascripts/components/Timer_spec.tsx b/superset-frontend/spec/javascripts/components/Timer_spec.tsx index 4af7ae7087ca1..f37004af838f8 100644 --- a/superset-frontend/spec/javascripts/components/Timer_spec.tsx +++ b/superset-frontend/spec/javascripts/components/Timer_spec.tsx @@ -21,7 +21,7 @@ */ import React from 'react'; import { render, sleep, waitFor } from 'spec/helpers/testing-library'; -import Timer from 'src/components/Timer'; +import Timer, { TimerProps } from 'src/components/Timer'; import { now } from 'src/modules/dates'; function parseTime(text?: string | null) { @@ -29,7 +29,7 @@ function parseTime(text?: string | null) { } describe('Timer', () => { - const mockProps = { + const mockProps: TimerProps = { startTime: now(), endTime: undefined, isRunning: true, @@ -41,7 +41,6 @@ describe('Timer', () => { const node = screen.getByRole('timer'); let text = node.textContent || ''; expect(node).toBeInTheDocument(); - expect(node).toHaveClass('label-warning'); expect(node).toHaveTextContent('00:00:00.00'); // should start running await waitFor(() => { diff --git a/superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx b/superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx index 7776788cb19da..13de226e70927 100644 --- a/superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/RowCountLabel_spec.jsx @@ -45,6 +45,6 @@ describe('RowCountLabel', () => { limit: 100, }; const wrapper = shallow(); - expect(wrapper.find(Label).first().props().bsStyle).toBe('danger'); + expect(wrapper.find(Label).first().props().type).toBe('danger'); }); }); diff --git a/superset-frontend/spec/javascripts/profile/Security_spec.tsx b/superset-frontend/spec/javascripts/profile/Security_spec.tsx index 6732e7b2a8177..31eda0aae7652 100644 --- a/superset-frontend/spec/javascripts/profile/Security_spec.tsx +++ b/superset-frontend/spec/javascripts/profile/Security_spec.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { styledMount as mount } from 'spec/helpers/theming'; import Security from 'src/profile/components/Security'; - +import Label from 'src/components/Label'; import { user, userNoPerms } from './fixtures'; describe('Security', () => { @@ -31,19 +31,19 @@ describe('Security', () => { }); it('renders 2 role labels', () => { const wrapper = mount(); - expect(wrapper.find('.roles').find('.label')).toHaveLength(2); + expect(wrapper.find('.roles').find(Label)).toHaveLength(2); }); it('renders 2 datasource labels', () => { const wrapper = mount(); - expect(wrapper.find('.datasources').find('.label')).toHaveLength(2); + expect(wrapper.find('.datasources').find(Label)).toHaveLength(2); }); it('renders 3 database labels', () => { const wrapper = mount(); - expect(wrapper.find('.databases').find('.label')).toHaveLength(3); + expect(wrapper.find('.databases').find(Label)).toHaveLength(3); }); it('renders no permission label when empty', () => { const wrapper = mount(); - expect(wrapper.find('.datasources').find('.label')).not.toExist(); - expect(wrapper.find('.databases').find('.label')).not.toExist(); + expect(wrapper.find('.datasources').find(Label)).not.toExist(); + expect(wrapper.find('.databases').find(Label)).not.toExist(); }); }); diff --git a/superset-frontend/src/SqlLab/components/QueryStateLabel.jsx b/superset-frontend/src/SqlLab/components/QueryStateLabel.jsx index 74b0d3f7a7287..5afb30bd3de60 100644 --- a/superset-frontend/src/SqlLab/components/QueryStateLabel.jsx +++ b/superset-frontend/src/SqlLab/components/QueryStateLabel.jsx @@ -20,16 +20,16 @@ import React from 'react'; import PropTypes from 'prop-types'; import Label from 'src/components/Label'; -import { STATE_BSSTYLE_MAP } from '../constants'; +import { STATE_TYPE_MAP } from '../constants'; const propTypes = { query: PropTypes.object.isRequired, }; export default function QueryStateLabel({ query }) { - const bsStyle = STATE_BSSTYLE_MAP[query.state]; + const type = STATE_TYPE_MAP[query.state]; return ( -

diff --git a/superset-frontend/src/common/components/index.tsx b/superset-frontend/src/common/components/index.tsx index f56b09e4fd569..bfbccbe40bc6e 100644 --- a/superset-frontend/src/common/components/index.tsx +++ b/superset-frontend/src/common/components/index.tsx @@ -52,6 +52,7 @@ export { Select, Skeleton, Switch, + Tag, Tabs, Tooltip, Input as AntdInput, diff --git a/superset-frontend/src/components/CachedLabel.jsx b/superset-frontend/src/components/CachedLabel.jsx index db4bd2e46dbaf..a7bc72089e0c1 100644 --- a/superset-frontend/src/components/CachedLabel.jsx +++ b/superset-frontend/src/components/CachedLabel.jsx @@ -67,12 +67,12 @@ class CacheLabel extends React.PureComponent { } render() { - const labelStyle = this.state.hovered ? 'primary' : 'default'; + const labelType = this.state.hovered ? 'primary' : 'default'; return (