From 82a653f64b64c15b67072e76083e90709a61e21b Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Mon, 4 Apr 2022 13:46:46 -0300 Subject: [PATCH] refactor: Removes the CSS files from the Treemap plugin (#19486) --- .../legacy-plugin-chart-treemap/package.json | 36 +++++++++---------- .../src/{ReactTreemap.js => ReactTreemap.jsx} | 33 +++++++++++++++-- .../src/Treemap.css | 36 ------------------- .../src/Treemap.js | 1 - 4 files changed, 48 insertions(+), 58 deletions(-) rename superset-frontend/plugins/legacy-plugin-chart-treemap/src/{ReactTreemap.js => ReactTreemap.jsx} (52%) delete mode 100644 superset-frontend/plugins/legacy-plugin-chart-treemap/src/Treemap.css diff --git a/superset-frontend/plugins/legacy-plugin-chart-treemap/package.json b/superset-frontend/plugins/legacy-plugin-chart-treemap/package.json index afd55b88c18a4..96d582d7859cb 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-treemap/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-treemap/package.json @@ -2,31 +2,25 @@ "name": "@superset-ui/legacy-plugin-chart-treemap", "version": "0.18.25", "description": "Superset Legacy Chart - Treemap", - "sideEffects": [ - "*.css" - ], - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, "keywords": [ "superset" ], - "author": "Superset", - "license": "Apache-2.0", + "homepage": "https://github.com/apache-superset/superset-ui#readme", "bugs": { "url": "https://github.com/apache-superset/superset-ui/issues" }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "publishConfig": { - "access": "public" + "repository": { + "type": "git", + "url": "git+https://github.com/apache-superset/superset-ui.git" }, + "license": "Apache-2.0", + "author": "Superset", + "main": "lib/index.js", + "module": "esm/index.js", + "files": [ + "esm", + "lib" + ], "dependencies": { "d3-hierarchy": "^1.1.8", "d3-selection": "^1.4.0", @@ -34,6 +28,10 @@ }, "peerDependencies": { "@superset-ui/chart-controls": "*", - "@superset-ui/core": "*" + "@superset-ui/core": "*", + "react": "^16.13.1" + }, + "publishConfig": { + "access": "public" } } diff --git a/superset-frontend/plugins/legacy-plugin-chart-treemap/src/ReactTreemap.js b/superset-frontend/plugins/legacy-plugin-chart-treemap/src/ReactTreemap.jsx similarity index 52% rename from superset-frontend/plugins/legacy-plugin-chart-treemap/src/ReactTreemap.js rename to superset-frontend/plugins/legacy-plugin-chart-treemap/src/ReactTreemap.jsx index 743115c018798..c00d8b5d17492 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-treemap/src/ReactTreemap.js +++ b/superset-frontend/plugins/legacy-plugin-chart-treemap/src/ReactTreemap.jsx @@ -16,7 +16,36 @@ * specific language governing permissions and limitations * under the License. */ -import { reactify } from '@superset-ui/core'; +import React from 'react'; +import { reactify, styled } from '@superset-ui/core'; import Component from './Treemap'; -export default reactify(Component); +const ReactComponent = reactify(Component); + +const Treemap = ({ className, ...otherProps }) => ( +