diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/package.json b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/package.json index 5d5a085d91ffd..de3791bbe3a47 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/package.json @@ -2,31 +2,25 @@ "name": "@superset-ui/legacy-plugin-chart-paired-t-test", "version": "0.18.25", "description": "Superset Legacy Chart - Paired T Test", - "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": { "distributions": "^1.0.0", "prop-types": "^15.6.2", @@ -36,5 +30,8 @@ "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", "react": "^15 || ^16" + }, + "publishConfig": { + "access": "public" } } diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.css b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.css deleted file mode 100644 index ee62864b25941..0000000000000 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.css +++ /dev/null @@ -1,86 +0,0 @@ -/** - * 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. - */ - -.superset-legacy-chart-paired_ttest .scrollbar-container { - overflow: auto; -} - -.paired-ttest-table .scrollbar-content { - padding-left: 5px; - padding-right: 5px; - margin-bottom: 0; -} - -.paired-ttest-table table { - margin-bottom: 0; -} - -.paired-ttest-table h1 { - margin-left: 5px; -} - -.reactable-data tr, -.reactable-header-sortable { - -webkit-transition: ease-in-out 0.1s; - transition: ease-in-out 0.1s; -} - -.reactable-data tr:hover { - background-color: #e0e0e0; -} - -.reactable-data tr .false { - color: #f44336; -} - -.reactable-data tr .true { - color: #4caf50; -} - -.reactable-data tr .control { - color: #2196f3; -} - -.reactable-data tr .invalid { - color: #ff9800; -} - -.reactable-data .control td { - background-color: #eeeeee; -} - -.reactable-header-sortable:hover, -.reactable-header-sortable:focus, -.reactable-header-sort-asc, -.reactable-header-sort-desc { - background-color: #e0e0e0; - position: relative; -} - -.reactable-header-sort-asc:after { - content: '\25bc'; - position: absolute; - right: 10px; -} - -.reactable-header-sort-desc:after { - content: '\25b2'; - position: absolute; - right: 10px; -} diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx index 4f20e92301914..33870b03ead36 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx @@ -19,8 +19,8 @@ /* eslint-disable react/no-array-index-key */ import PropTypes from 'prop-types'; import React from 'react'; +import { styled } from '@superset-ui/core'; import TTestTable, { dataPropType } from './TTestTable'; -import './PairedTTest.css'; const propTypes = { alpha: PropTypes.number, @@ -39,29 +39,103 @@ const defaultProps = { pValPrec: 6, }; +const StyledDiv = styled.div` + ${({ theme }) => ` + .superset-legacy-chart-paired_ttest .scrollbar-container { + overflow: auto; + } + + .paired-ttest-table .scrollbar-content { + padding-left: ${theme.gridUnit}px; + padding-right: ${theme.gridUnit}px; + margin-bottom: 0; + } + + .paired-ttest-table table { + margin-bottom: 0; + } + + .paired-ttest-table h1 { + margin-left: ${theme.gridUnit}px; + } + + .reactable-data tr, + .reactable-header-sortable { + -webkit-transition: ease-in-out 0.1s; + transition: ease-in-out 0.1s; + } + + .reactable-data tr:hover { + background-color: ${theme.colors.grayscale.light3}; + } + + .reactable-data tr .false { + color: ${theme.colors.error.base}; + } + + .reactable-data tr .true { + color: ${theme.colors.success.base}; + } + + .reactable-data tr .control { + color: ${theme.colors.primary.base}; + } + + .reactable-data tr .invalid { + color: ${theme.colors.warning.base}; + } + + .reactable-data .control td { + background-color: ${theme.colors.grayscale.light3}; + } + + .reactable-header-sortable:hover, + .reactable-header-sortable:focus, + .reactable-header-sort-asc, + .reactable-header-sort-desc { + background-color: ${theme.colors.grayscale.light3}; + position: relative; + } + + .reactable-header-sort-asc:after { + content: '\\25bc'; + position: absolute; + right: ${theme.gridUnit * 3}px; + } + + .reactable-header-sort-desc:after { + content: '\\25b2'; + position: absolute; + right: ${theme.gridUnit * 3}px; + } + `} +`; + class PairedTTest extends React.PureComponent { render() { const { className, metrics, groups, data, alpha, pValPrec, liftValPrec } = this.props; return ( -
-
-
- {metrics.map((metric, i) => ( - - ))} + +
+
+
+ {metrics.map((metric, i) => ( + + ))} +
-
+ ); } }