diff --git a/MANIFEST.in b/MANIFEST.in index a1b3ffac9..027ea43e7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,6 +2,7 @@ recursive-include superset/templates * recursive-include superset/static * recursive-exclude superset/static/docs * recursive-exclude superset/static/spec * +recursive-exclude superset/static/assets/node_modules * recursive-exclude tests * recursive-include superset/data * recursive-include superset/migrations * diff --git a/superset/assets/javascripts/SqlLab/components/HighlightedSql.jsx b/superset/assets/javascripts/SqlLab/components/HighlightedSql.jsx index dc5a5a90f..f7d69416d 100644 --- a/superset/assets/javascripts/SqlLab/components/HighlightedSql.jsx +++ b/superset/assets/javascripts/SqlLab/components/HighlightedSql.jsx @@ -1,9 +1,14 @@ import React from 'react'; import PropTypes from 'prop-types'; -import SyntaxHighlighter from 'react-syntax-highlighter'; -import { github } from 'react-syntax-highlighter/dist/styles'; + +import SyntaxHighlighter, { registerLanguage } from 'react-syntax-highlighter/dist/light'; +import sql from 'react-syntax-highlighter/dist/languages/sql'; +import github from 'react-syntax-highlighter/dist/styles/github'; + import ModalTrigger from '../../components/ModalTrigger'; +registerLanguage('sql', sql); + const defaultProps = { maxWidth: 50, maxLines: 5, @@ -26,8 +31,8 @@ class HighlightedSql extends React.Component { }; } shrinkSql() { - const sql = this.props.sql || ''; - let lines = sql.split('\n'); + const ssql = this.props.sql || ''; + let lines = ssql.split('\n'); if (lines.length >= this.props.maxLines) { lines = lines.slice(0, this.props.maxLines); lines.push('{...}'); diff --git a/superset/assets/javascripts/explore/components/DisplayQueryButton.jsx b/superset/assets/javascripts/explore/components/DisplayQueryButton.jsx index 9194ed159..1e27cb7f2 100644 --- a/superset/assets/javascripts/explore/components/DisplayQueryButton.jsx +++ b/superset/assets/javascripts/explore/components/DisplayQueryButton.jsx @@ -1,10 +1,15 @@ import React from 'react'; import PropTypes from 'prop-types'; -import SyntaxHighlighter from 'react-syntax-highlighter'; -import { github } from 'react-syntax-highlighter/dist/styles'; +import SyntaxHighlighter, { registerLanguage } from 'react-syntax-highlighter/dist/light'; +import html from 'react-syntax-highlighter/dist/languages/htmlbars'; +import markdown from 'react-syntax-highlighter/dist/languages/markdown'; +import github from 'react-syntax-highlighter/dist/styles/github'; import ModalTrigger from './../../components/ModalTrigger'; +registerLanguage('markdown', markdown); +registerLanguage('html', html); + const $ = window.$ = require('jquery'); const propTypes = { diff --git a/superset/assets/javascripts/explore/components/controls/TextAreaControl.jsx b/superset/assets/javascripts/explore/components/controls/TextAreaControl.jsx index 31fe2bb25..953106256 100644 --- a/superset/assets/javascripts/explore/components/controls/TextAreaControl.jsx +++ b/superset/assets/javascripts/explore/components/controls/TextAreaControl.jsx @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Button, FormGroup, FormControl } from 'react-bootstrap'; + import AceEditor from 'react-ace'; import 'brace/mode/sql'; import 'brace/mode/json'; diff --git a/superset/assets/javascripts/welcome.js b/superset/assets/javascripts/welcome.js index 82415f95b..cfece7e68 100644 --- a/superset/assets/javascripts/welcome.js +++ b/superset/assets/javascripts/welcome.js @@ -1,13 +1,12 @@ /* eslint no-unused-vars: 0 */ -import 'datatables.net'; -import dt from 'datatables.net-bs'; import d3 from 'd3'; +import dt from 'datatables.net-bs'; +import 'datatables.net-bs/css/dataTables.bootstrap.css'; import '../stylesheets/welcome.css'; import { appSetup } from './common'; appSetup(); -require('datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css'); dt(window, $); diff --git a/superset/assets/package.json b/superset/assets/package.json index 6039e6dcb..fd78bdeaa 100644 --- a/superset/assets/package.json +++ b/superset/assets/package.json @@ -39,27 +39,25 @@ }, "homepage": "http://superset.apache.org/", "dependencies": { - "@data-ui/event-flow": "0.0.4", + "@data-ui/event-flow": "0.0.8", "babel-register": "^6.24.1", "bootstrap": "^3.3.6", "brace": "^0.10.0", "brfs": "^1.4.3", "cal-heatmap": "3.6.2", "classnames": "^2.2.5", - "d3": "^3.5.15", + "d3": "^3.5.17", "d3-cloud": "^1.2.1", "d3-sankey": "^0.4.2", "d3-tip": "^0.6.7", "datamaps": "^0.5.8", - "datatables-bootstrap3-plugin": "^0.5.0", - "datatables.net": "^1.10.13", - "datatables.net-bs": "^1.10.12", + "datatables.net-bs": "^1.10.15", "immutable": "^3.8.1", - "jquery": "^3.2.1", + "jquery": "3.1.1", "lodash.throttle": "^4.1.1", "moment": "^2.14.1", "mustache": "^2.2.1", - "nvd3": "1.8.5", + "nvd3": "1.8.6", "prop-types": "^15.5.8", "react": "^15.5.1", "react-ace": "^5.0.1", @@ -78,7 +76,7 @@ "react-select": "1.0.0-rc.3", "react-select-fast-filter-options": "^0.2.1", "react-split-pane": "^0.1.66", - "react-syntax-highlighter": "^5.0.0", + "react-syntax-highlighter": "^5.7.0", "react-virtualized": "^9.3.0", "react-virtualized-select": "^2.4.0", "reactable": "^0.14.0", @@ -108,10 +106,10 @@ "eslint": "^3.19.0", "eslint-config-airbnb": "^15.0.1", "eslint-plugin-import": "^2.2.0", - "eslint-plugin-jsx-a11y": "^5.0.3", + "eslint-plugin-jsx-a11y": "^5.1.1", "eslint-plugin-react": "^7.0.1", "exports-loader": "^0.6.3", - "extract-text-webpack-plugin": "2.1.2", + "extract-text-webpack-plugin": "3.0.0", "file-loader": "^0.11.1", "github-changes": "^1.0.4", "ignore-styles": "^5.0.1", @@ -125,13 +123,13 @@ "react-addons-test-utils": "^15.5.1", "react-test-renderer": "^15.5.1", "redux-mock-store": "^1.2.3", - "sinon": "^2.1.0", + "sinon": "^3.2.1", "style-loader": "^0.18.2", "transform-loader": "^0.2.3", "uglifyjs-webpack-plugin": "^0.4.6", "url-loader": "^0.5.7", "webpack": "^3.4.1", - "webpack-manifest-plugin": "1.2.1", + "webpack-manifest-plugin": "1.3.1", "webworkify-webpack": "2.0.5" } } diff --git a/superset/assets/spec/javascripts/sqllab/HighlightedSql_spec.jsx b/superset/assets/spec/javascripts/sqllab/HighlightedSql_spec.jsx index a800d3f06..0b9ae88f5 100644 --- a/superset/assets/spec/javascripts/sqllab/HighlightedSql_spec.jsx +++ b/superset/assets/spec/javascripts/sqllab/HighlightedSql_spec.jsx @@ -28,7 +28,9 @@ describe('HighlightedSql', () => { const pre = wrapper.find('pre'); expect(pre).to.have.length(1); pre.simulate('click'); - const modalBody = mount(wrapper.state().modalBody); - expect(modalBody.find(SyntaxHighlighter)).to.have.length(2); + setTimeout(() => { + const modalBody = mount(wrapper.state().modalBody); + expect(modalBody.find(SyntaxHighlighter)).to.have.length(2); + }, 10); }); }); diff --git a/superset/assets/visualizations/pivot_table.js b/superset/assets/visualizations/pivot_table.js index df18221c4..7dbfcb15e 100644 --- a/superset/assets/visualizations/pivot_table.js +++ b/superset/assets/visualizations/pivot_table.js @@ -1,7 +1,6 @@ -import 'datatables.net'; import dt from 'datatables.net-bs'; +import 'datatables.net-bs/css/dataTables.bootstrap.css'; import $ from 'jquery'; -import 'datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css'; import { d3format, fixDataTableBodyHeight } from '../javascripts/modules/utils'; import './pivot_table.css'; diff --git a/superset/assets/visualizations/table.js b/superset/assets/visualizations/table.js index 82b030586..80808afc3 100644 --- a/superset/assets/visualizations/table.js +++ b/superset/assets/visualizations/table.js @@ -1,7 +1,6 @@ import d3 from 'd3'; -import 'datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css'; -import 'datatables.net'; import dt from 'datatables.net-bs'; +import 'datatables.net-bs/css/dataTables.bootstrap.css'; import { fixDataTableBodyHeight, d3TimeFormatPreset } from '../javascripts/modules/utils'; import './table.css';