[clarity/consistency] rename /explorev2/ -> /explore/ (#2802)

* rename /explorev2/ -> /explore/

* add redirect for existing explorev2 urls

* fix long line

* remove extra line

* fix missed ref in spec
This commit is contained in:
Alanna Scott 2017-05-24 17:12:28 -07:00 committed by GitHub
parent a4a2bf7ae9
commit 0c9f9b695b
54 changed files with 48 additions and 38 deletions

View File

@ -8,7 +8,7 @@ import { Alert, Button, Col, Modal } from 'react-bootstrap';
import Select from 'react-select'; import Select from 'react-select';
import { Table } from 'reactable'; import { Table } from 'reactable';
import shortid from 'shortid'; import shortid from 'shortid';
import { getExploreUrl } from '../../explorev2/exploreUtils'; import { getExploreUrl } from '../../explore/exploreUtils';
import * as actions from '../actions'; import * as actions from '../actions';
const CHART_TYPES = [ const CHART_TYPES = [
@ -285,4 +285,3 @@ function mapDispatchToProps(dispatch) {
export { VisualizeModal }; export { VisualizeModal };
export default connect(mapStateToProps, mapDispatchToProps)(VisualizeModal); export default connect(mapStateToProps, mapDispatchToProps)(VisualizeModal);

View File

@ -2,8 +2,8 @@
import $ from 'jquery'; import $ from 'jquery';
import Mustache from 'mustache'; import Mustache from 'mustache';
import vizMap from '../../visualizations/main'; import vizMap from '../../visualizations/main';
import { getExploreUrl } from '../explorev2/exploreUtils'; import { getExploreUrl } from '../explore/exploreUtils';
import { applyDefaultFormData } from '../explorev2/stores/store'; import { applyDefaultFormData } from '../explore/stores/store';
const utils = require('./utils'); const utils = require('./utils');

View File

@ -1,7 +1,7 @@
/* eslint no-console: 0 */ /* eslint no-console: 0 */
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import { controls } from './explorev2/stores/controls'; import { controls } from './explore/stores/controls';
function exportFile(fileLocation, content) { function exportFile(fileLocation, content) {
fs.writeFile(fileLocation, content, function (err) { fs.writeFile(fileLocation, content, function (err) {

View File

@ -2,10 +2,10 @@ import { it, describe } from 'mocha';
import { expect } from 'chai'; import { expect } from 'chai';
import sinon from 'sinon'; import sinon from 'sinon';
import $ from 'jquery'; import $ from 'jquery';
import * as actions from '../../../javascripts/explorev2/actions/exploreActions'; import * as actions from '../../../javascripts/explore/actions/exploreActions';
import * as exploreUtils from '../../../javascripts/explorev2/exploreUtils'; import * as exploreUtils from '../../../javascripts/explore/exploreUtils';
import { defaultState } from '../../../javascripts/explorev2/stores/store'; import { defaultState } from '../../../javascripts/explore/stores/store';
import { exploreReducer } from '../../../javascripts/explorev2/reducers/exploreReducer'; import { exploreReducer } from '../../../javascripts/explore/reducers/exploreReducer';
describe('reducers', () => { describe('reducers', () => {
it('sets correct control value given a key and value', () => { it('sets correct control value given a key and value', () => {

View File

@ -5,7 +5,7 @@
// import { expect } from 'chai'; // import { expect } from 'chai';
// import { describe, it } from 'mocha'; // import { describe, it } from 'mocha';
// import ChartContainer from '../../../../javascripts/explorev2/components/ChartContainer'; // import ChartContainer from '../../../../javascripts/explore/components/ChartContainer';
// describe('ChartContainer', () => { // describe('ChartContainer', () => {
// const mockProps = { // const mockProps = {

View File

@ -6,7 +6,7 @@ import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha'; import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import CheckboxControl from '../../../../javascripts/explorev2/components/controls/CheckboxControl'; import CheckboxControl from '../../../../javascripts/explore/components/controls/CheckboxControl';
const defaultProps = { const defaultProps = {
name: 'show_legend', name: 'show_legend',

View File

@ -3,11 +3,11 @@ import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha'; import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import { getFormDataFromControls, defaultControls } import { getFormDataFromControls, defaultControls }
from '../../../../javascripts/explorev2/stores/store'; from '../../../../javascripts/explore/stores/store';
import { import {
ControlPanelsContainer, ControlPanelsContainer,
} from '../../../../javascripts/explorev2/components/ControlPanelsContainer'; } from '../../../../javascripts/explore/components/ControlPanelsContainer';
import ControlPanelSection from '../../../../javascripts/explorev2/components/ControlPanelSection'; import ControlPanelSection from '../../../../javascripts/explore/components/ControlPanelSection';
const defaultProps = { const defaultProps = {
datasource_type: 'table', datasource_type: 'table',

View File

@ -2,7 +2,7 @@ import React from 'react';
import { expect } from 'chai'; import { expect } from 'chai';
import { describe, it } from 'mocha'; import { describe, it } from 'mocha';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import ControlSetRow from '../../../../javascripts/explorev2/components/ControlRow'; import ControlSetRow from '../../../../javascripts/explore/components/ControlRow';
describe('ControlSetRow', () => { describe('ControlSetRow', () => {
it('renders a single row with one element', () => { it('renders a single row with one element', () => {

View File

@ -5,7 +5,7 @@ import { mount } from 'enzyme';
import { Modal } from 'react-bootstrap'; import { Modal } from 'react-bootstrap';
import ModalTrigger from './../../../../javascripts/components/ModalTrigger'; import ModalTrigger from './../../../../javascripts/components/ModalTrigger';
import DisplayQueryButton from '../../../../javascripts/explorev2/components/DisplayQueryButton'; import DisplayQueryButton from '../../../../javascripts/explore/components/DisplayQueryButton';
describe('DisplayQueryButton', () => { describe('DisplayQueryButton', () => {
const defaultProps = { const defaultProps = {

View File

@ -4,7 +4,7 @@ import { describe, it } from 'mocha';
import { shallow, mount } from 'enzyme'; import { shallow, mount } from 'enzyme';
import { OverlayTrigger } from 'react-bootstrap'; import { OverlayTrigger } from 'react-bootstrap';
import EmbedCodeButton from '../../../../javascripts/explorev2/components/EmbedCodeButton'; import EmbedCodeButton from '../../../../javascripts/explore/components/EmbedCodeButton';
describe('EmbedCodeButton', () => { describe('EmbedCodeButton', () => {
const defaultProps = { const defaultProps = {

View File

@ -3,7 +3,7 @@ import { expect } from 'chai';
import { describe, it } from 'mocha'; import { describe, it } from 'mocha';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import ExploreActionButtons from import ExploreActionButtons from
'../../../../javascripts/explorev2/components/ExploreActionButtons'; '../../../../javascripts/explore/components/ExploreActionButtons';
describe('ExploreActionButtons', () => { describe('ExploreActionButtons', () => {
const defaultProps = { const defaultProps = {

View File

@ -7,13 +7,13 @@
// import { shallow } from 'enzyme'; // import { shallow } from 'enzyme';
// import ExploreViewContainer // import ExploreViewContainer
// from '../../../../javascripts/explorev2/components/ExploreViewContainer'; // from '../../../../javascripts/explore/components/ExploreViewContainer';
// import QueryAndSaveBtns // import QueryAndSaveBtns
// from '../../../../javascripts/explore/components/QueryAndSaveBtns'; // from '../../../../javascripts/explore/components/QueryAndSaveBtns';
// import ControlPanelsContainer // import ControlPanelsContainer
// from '../../../../javascripts/explorev2/components/ControlPanelsContainer'; // from '../../../../javascripts/explore/components/ControlPanelsContainer';
// import ChartContainer // import ChartContainer
// from '../../../../javascripts/explorev2/components/ChartContainer'; // from '../../../../javascripts/explore/components/ChartContainer';
// describe('ExploreViewContainer', () => { // describe('ExploreViewContainer', () => {
// it('renders', () => { // it('renders', () => {

View File

@ -5,8 +5,8 @@ import sinon from 'sinon';
import { expect } from 'chai'; import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha'; import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import FilterControl from '../../../../javascripts/explorev2/components/controls/FilterControl'; import FilterControl from '../../../../javascripts/explore/components/controls/FilterControl';
import Filter from '../../../../javascripts/explorev2/components/controls/Filter'; import Filter from '../../../../javascripts/explore/components/controls/Filter';
const defaultProps = { const defaultProps = {
choices: ['country_name'], choices: ['country_name'],

View File

@ -6,8 +6,8 @@ import sinon from 'sinon';
import { expect } from 'chai'; import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha'; import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import Filter from '../../../../javascripts/explorev2/components/controls/Filter'; import Filter from '../../../../javascripts/explore/components/controls/Filter';
import SelectControl from '../../../../javascripts/explorev2/components/controls/SelectControl'; import SelectControl from '../../../../javascripts/explore/components/controls/SelectControl';
const defaultProps = { const defaultProps = {
changeFilter: sinon.spy(), changeFilter: sinon.spy(),

View File

@ -4,7 +4,7 @@ import { expect } from 'chai';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import sinon from 'sinon'; import sinon from 'sinon';
import QueryAndSaveButtons from '../../../../javascripts/explorev2/components/QueryAndSaveBtns'; import QueryAndSaveButtons from '../../../../javascripts/explore/components/QueryAndSaveBtns';
import Button from '../../../../javascripts/components/Button'; import Button from '../../../../javascripts/components/Button';
describe('QueryAndSaveButtons', () => { describe('QueryAndSaveButtons', () => {

View File

@ -5,8 +5,8 @@ import { shallow } from 'enzyme';
import { Modal, Button, Radio } from 'react-bootstrap'; import { Modal, Button, Radio } from 'react-bootstrap';
import sinon from 'sinon'; import sinon from 'sinon';
import { defaultFormData } from '../../../../javascripts/explorev2/stores/store'; import { defaultFormData } from '../../../../javascripts/explore/stores/store';
import { SaveModal } from '../../../../javascripts/explorev2/components/SaveModal'; import { SaveModal } from '../../../../javascripts/explore/components/SaveModal';
const defaultProps = { const defaultProps = {
can_edit: true, can_edit: true,

View File

@ -5,7 +5,7 @@ import sinon from 'sinon';
import { expect } from 'chai'; import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha'; import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import SelectControl from '../../../../javascripts/explorev2/components/controls/SelectControl'; import SelectControl from '../../../../javascripts/explore/components/controls/SelectControl';
const defaultProps = { const defaultProps = {
choices: [[10, 10], [20, 20]], choices: [[10, 10], [20, 20]],

View File

@ -5,7 +5,7 @@ import sinon from 'sinon';
import { expect } from 'chai'; import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha'; import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import TextAreaControl from '../../../../javascripts/explorev2/components/controls/TextAreaControl'; import TextAreaControl from '../../../../javascripts/explore/components/controls/TextAreaControl';
const defaultProps = { const defaultProps = {
name: 'x_axis_label', name: 'x_axis_label',

View File

@ -2,7 +2,7 @@ import React from 'react';
import { expect } from 'chai'; import { expect } from 'chai';
import { describe, it } from 'mocha'; import { describe, it } from 'mocha';
import URLShortLinkButton from '../../../../javascripts/explorev2/components/URLShortLinkButton'; import URLShortLinkButton from '../../../../javascripts/explore/components/URLShortLinkButton';
describe('URLShortLinkButton', () => { describe('URLShortLinkButton', () => {
const defaultProps = { const defaultProps = {

View File

@ -1,7 +1,7 @@
import { it, describe } from 'mocha'; import { it, describe } from 'mocha';
import { expect } from 'chai'; import { expect } from 'chai';
import URI from 'urijs'; import URI from 'urijs';
import { getExploreUrl } from '../../../javascripts/explorev2/exploreUtils'; import { getExploreUrl } from '../../../javascripts/explore/exploreUtils';
describe('utils', () => { describe('utils', () => {
const formData = { const formData = {

View File

@ -12,7 +12,7 @@ import $ from 'jquery';
import { queries } from './fixtures'; import { queries } from './fixtures';
import { sqlLabReducer } from '../../../javascripts/SqlLab/reducers'; import { sqlLabReducer } from '../../../javascripts/SqlLab/reducers';
import VisualizeModal from '../../../javascripts/SqlLab/components/VisualizeModal'; import VisualizeModal from '../../../javascripts/SqlLab/components/VisualizeModal';
import * as exploreUtils from '../../../javascripts/explorev2/exploreUtils'; import * as exploreUtils from '../../../javascripts/explore/exploreUtils';
global.notify = { global.notify = {
info: () => {}, info: () => {},

View File

@ -7,7 +7,7 @@ import { category21 } from '../javascripts/modules/colors';
import { timeFormatFactory, formatDate } from '../javascripts/modules/dates'; import { timeFormatFactory, formatDate } from '../javascripts/modules/dates';
import { customizeToolTip } from '../javascripts/modules/utils'; import { customizeToolTip } from '../javascripts/modules/utils';
import { TIME_STAMP_OPTIONS } from '../javascripts/explorev2/stores/controls'; import { TIME_STAMP_OPTIONS } from '../javascripts/explore/stores/controls';
const nv = require('nvd3'); const nv = require('nvd3');

View File

@ -15,7 +15,7 @@ const config = {
'css-theme': APP_DIR + '/javascripts/css-theme.js', 'css-theme': APP_DIR + '/javascripts/css-theme.js',
common: APP_DIR + '/javascripts/common.js', common: APP_DIR + '/javascripts/common.js',
dashboard: ['babel-polyfill', APP_DIR + '/javascripts/dashboard/Dashboard.jsx'], dashboard: ['babel-polyfill', APP_DIR + '/javascripts/dashboard/Dashboard.jsx'],
explorev2: ['babel-polyfill', APP_DIR + '/javascripts/explorev2/index.jsx'], explore: ['babel-polyfill', APP_DIR + '/javascripts/explore/index.jsx'],
sqllab: ['babel-polyfill', APP_DIR + '/javascripts/SqlLab/index.jsx'], sqllab: ['babel-polyfill', APP_DIR + '/javascripts/SqlLab/index.jsx'],
welcome: ['babel-polyfill', APP_DIR + '/javascripts/welcome.js'], welcome: ['babel-polyfill', APP_DIR + '/javascripts/welcome.js'],
profile: ['babel-polyfill', APP_DIR + '/javascripts/profile/index.jsx'], profile: ['babel-polyfill', APP_DIR + '/javascripts/profile/index.jsx'],

View File

@ -17,7 +17,7 @@
{% block tail_js %} {% block tail_js %}
{{ super() }} {{ super() }}
{% with filename="explorev2" %} {% with filename="explore" %}
{% include "superset/partials/_script_tag.html" %} {% include "superset/partials/_script_tag.html" %}
{% endwith %} {% endwith %}
{% endblock %} {% endblock %}

View File

@ -16,7 +16,8 @@ import traceback
import sqlalchemy as sqla import sqlalchemy as sqla
from flask import ( from flask import (
g, request, redirect, flash, Response, render_template, Markup, abort) g, request, redirect, flash, Response, render_template, Markup,
abort, url_for)
from flask_appbuilder import expose from flask_appbuilder import expose
from flask_appbuilder.actions import action from flask_appbuilder.actions import action
from flask_appbuilder.models.sqla.interface import SQLAInterface from flask_appbuilder.models.sqla.interface import SQLAInterface
@ -985,6 +986,16 @@ class Superset(BaseSupersetView):
return redirect('/dashboardmodelview/list/') return redirect('/dashboardmodelview/list/')
return self.render_template('superset/import_dashboards.html') return self.render_template('superset/import_dashboards.html')
@log_this
@has_access
@expose("/explorev2/<datasource_type>/<datasource_id>/")
def explorev2(self, datasource_type, datasource_id):
return redirect(url_for(
'Superset.explore',
datasource_type=datasource_type,
datasource_id=datasource_id,
**request.args))
@log_this @log_this
@has_access @has_access
@expose("/explore/<datasource_type>/<datasource_id>/") @expose("/explore/<datasource_type>/<datasource_id>/")
@ -1059,7 +1070,7 @@ class Superset(BaseSupersetView):
if datasource_type == 'table' \ if datasource_type == 'table' \
else datasource.datasource_name else datasource.datasource_name
return self.render_template( return self.render_template(
"superset/explorev2.html", "superset/explore.html",
bootstrap_data=json.dumps(bootstrap_data), bootstrap_data=json.dumps(bootstrap_data),
slice=slc, slice=slc,
standalone_mode=standalone, standalone_mode=standalone,