Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
May 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Alert, Button, Col, Modal } from 'react-bootstrap';
import Select from 'react-select';
import { Table } from 'reactable';
import shortid from 'shortid';
import { getExploreUrl } from '../../explorev2/exploreUtils';
import { getExploreUrl } from '../../explore/exploreUtils';
import * as actions from '../actions';

const CHART_TYPES = [
Expand Down Expand Up @@ -285,4 +285,3 @@ function mapDispatchToProps(dispatch) {

export { VisualizeModal };
export default connect(mapStateToProps, mapDispatchToProps)(VisualizeModal);

4 changes: 2 additions & 2 deletions superset/assets/javascripts/modules/superset.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import $ from 'jquery';
import Mustache from 'mustache';
import vizMap from '../../visualizations/main';
import { getExploreUrl } from '../explorev2/exploreUtils';
import { applyDefaultFormData } from '../explorev2/stores/store';
import { getExploreUrl } from '../explore/exploreUtils';
import { applyDefaultFormData } from '../explore/stores/store';

const utils = require('./utils');

Expand Down
2 changes: 1 addition & 1 deletion superset/assets/javascripts/syncBackend.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint no-console: 0 */
import fs from 'fs';
import path from 'path';
import { controls } from './explorev2/stores/controls';
import { controls } from './explore/stores/controls';

function exportFile(fileLocation, content) {
fs.writeFile(fileLocation, content, function (err) {
Expand Down
8 changes: 4 additions & 4 deletions superset/assets/spec/javascripts/explorev2/actions_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { it, describe } from 'mocha';
import { expect } from 'chai';
import sinon from 'sinon';
import $ from 'jquery';
import * as actions from '../../../javascripts/explorev2/actions/exploreActions';
import * as exploreUtils from '../../../javascripts/explorev2/exploreUtils';
import { defaultState } from '../../../javascripts/explorev2/stores/store';
import { exploreReducer } from '../../../javascripts/explorev2/reducers/exploreReducer';
import * as actions from '../../../javascripts/explore/actions/exploreActions';
import * as exploreUtils from '../../../javascripts/explore/exploreUtils';
import { defaultState } from '../../../javascripts/explore/stores/store';
import { exploreReducer } from '../../../javascripts/explore/reducers/exploreReducer';

describe('reducers', () => {
it('sets correct control value given a key and value', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// import { expect } from 'chai';
// import { describe, it } from 'mocha';

// import ChartContainer from '../../../../javascripts/explorev2/components/ChartContainer';
// import ChartContainer from '../../../../javascripts/explore/components/ChartContainer';

// describe('ChartContainer', () => {
// const mockProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme';

import CheckboxControl from '../../../../javascripts/explorev2/components/controls/CheckboxControl';
import CheckboxControl from '../../../../javascripts/explore/components/controls/CheckboxControl';

const defaultProps = {
name: 'show_legend',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme';
import { getFormDataFromControls, defaultControls }
from '../../../../javascripts/explorev2/stores/store';
from '../../../../javascripts/explore/stores/store';
import {
ControlPanelsContainer,
} from '../../../../javascripts/explorev2/components/ControlPanelsContainer';
import ControlPanelSection from '../../../../javascripts/explorev2/components/ControlPanelSection';
} from '../../../../javascripts/explore/components/ControlPanelsContainer';
import ControlPanelSection from '../../../../javascripts/explore/components/ControlPanelSection';

const defaultProps = {
datasource_type: 'table',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { shallow } from 'enzyme';
import ControlSetRow from '../../../../javascripts/explorev2/components/ControlRow';
import ControlSetRow from '../../../../javascripts/explore/components/ControlRow';

describe('ControlSetRow', () => {
it('renders a single row with one element', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { mount } from 'enzyme';
import { Modal } from 'react-bootstrap';
import ModalTrigger from './../../../../javascripts/components/ModalTrigger';

import DisplayQueryButton from '../../../../javascripts/explorev2/components/DisplayQueryButton';
import DisplayQueryButton from '../../../../javascripts/explore/components/DisplayQueryButton';

describe('DisplayQueryButton', () => {
const defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { describe, it } from 'mocha';
import { shallow, mount } from 'enzyme';
import { OverlayTrigger } from 'react-bootstrap';

import EmbedCodeButton from '../../../../javascripts/explorev2/components/EmbedCodeButton';
import EmbedCodeButton from '../../../../javascripts/explore/components/EmbedCodeButton';

describe('EmbedCodeButton', () => {
const defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import { shallow } from 'enzyme';
import ExploreActionButtons from
'../../../../javascripts/explorev2/components/ExploreActionButtons';
'../../../../javascripts/explore/components/ExploreActionButtons';

describe('ExploreActionButtons', () => {
const defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
// import { shallow } from 'enzyme';

// import ExploreViewContainer
// from '../../../../javascripts/explorev2/components/ExploreViewContainer';
// from '../../../../javascripts/explore/components/ExploreViewContainer';
// import QueryAndSaveBtns
// from '../../../../javascripts/explore/components/QueryAndSaveBtns';
// import ControlPanelsContainer
// from '../../../../javascripts/explorev2/components/ControlPanelsContainer';
// from '../../../../javascripts/explore/components/ControlPanelsContainer';
// import ChartContainer
// from '../../../../javascripts/explorev2/components/ChartContainer';
// from '../../../../javascripts/explore/components/ChartContainer';

// describe('ExploreViewContainer', () => {
// it('renders', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import sinon from 'sinon';
import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme';
import FilterControl from '../../../../javascripts/explorev2/components/controls/FilterControl';
import Filter from '../../../../javascripts/explorev2/components/controls/Filter';
import FilterControl from '../../../../javascripts/explore/components/controls/FilterControl';
import Filter from '../../../../javascripts/explore/components/controls/Filter';

const defaultProps = {
choices: ['country_name'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import sinon from 'sinon';
import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme';
import Filter from '../../../../javascripts/explorev2/components/controls/Filter';
import SelectControl from '../../../../javascripts/explorev2/components/controls/SelectControl';
import Filter from '../../../../javascripts/explore/components/controls/Filter';
import SelectControl from '../../../../javascripts/explore/components/controls/SelectControl';

const defaultProps = {
changeFilter: sinon.spy(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { expect } from 'chai';
import { shallow } from 'enzyme';
import sinon from 'sinon';

import QueryAndSaveButtons from '../../../../javascripts/explorev2/components/QueryAndSaveBtns';
import QueryAndSaveButtons from '../../../../javascripts/explore/components/QueryAndSaveBtns';
import Button from '../../../../javascripts/components/Button';

describe('QueryAndSaveButtons', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { shallow } from 'enzyme';
import { Modal, Button, Radio } from 'react-bootstrap';
import sinon from 'sinon';

import { defaultFormData } from '../../../../javascripts/explorev2/stores/store';
import { SaveModal } from '../../../../javascripts/explorev2/components/SaveModal';
import { defaultFormData } from '../../../../javascripts/explore/stores/store';
import { SaveModal } from '../../../../javascripts/explore/components/SaveModal';

const defaultProps = {
can_edit: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sinon from 'sinon';
import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme';
import SelectControl from '../../../../javascripts/explorev2/components/controls/SelectControl';
import SelectControl from '../../../../javascripts/explore/components/controls/SelectControl';

const defaultProps = {
choices: [[10, 10], [20, 20]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sinon from 'sinon';
import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme';
import TextAreaControl from '../../../../javascripts/explorev2/components/controls/TextAreaControl';
import TextAreaControl from '../../../../javascripts/explore/components/controls/TextAreaControl';

const defaultProps = {
name: 'x_axis_label',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { expect } from 'chai';
import { describe, it } from 'mocha';

import URLShortLinkButton from '../../../../javascripts/explorev2/components/URLShortLinkButton';
import URLShortLinkButton from '../../../../javascripts/explore/components/URLShortLinkButton';

describe('URLShortLinkButton', () => {
const defaultProps = {
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/spec/javascripts/explorev2/utils_spec.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { it, describe } from 'mocha';
import { expect } from 'chai';
import URI from 'urijs';
import { getExploreUrl } from '../../../javascripts/explorev2/exploreUtils';
import { getExploreUrl } from '../../../javascripts/explore/exploreUtils';

describe('utils', () => {
const formData = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import $ from 'jquery';
import { queries } from './fixtures';
import { sqlLabReducer } from '../../../javascripts/SqlLab/reducers';
import VisualizeModal from '../../../javascripts/SqlLab/components/VisualizeModal';
import * as exploreUtils from '../../../javascripts/explorev2/exploreUtils';
import * as exploreUtils from '../../../javascripts/explore/exploreUtils';

global.notify = {
info: () => {},
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { category21 } from '../javascripts/modules/colors';
import { timeFormatFactory, formatDate } from '../javascripts/modules/dates';
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');

Expand Down
2 changes: 1 addition & 1 deletion superset/assets/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config = {
'css-theme': APP_DIR + '/javascripts/css-theme.js',
common: APP_DIR + '/javascripts/common.js',
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'],
welcome: ['babel-polyfill', APP_DIR + '/javascripts/welcome.js'],
profile: ['babel-polyfill', APP_DIR + '/javascripts/profile/index.jsx'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

{% block tail_js %}
{{ super() }}
{% with filename="explorev2" %}
{% with filename="explore" %}
{% include "superset/partials/_script_tag.html" %}
{% endwith %}
{% endblock %}
15 changes: 13 additions & 2 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
import sqlalchemy as sqla

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.actions import action
from flask_appbuilder.models.sqla.interface import SQLAInterface
Expand Down Expand Up @@ -985,6 +986,16 @@ def import_dashboards(self):
return redirect('/dashboardmodelview/list/')
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
@has_access
@expose("/explore/<datasource_type>/<datasource_id>/")
Expand Down Expand Up @@ -1059,7 +1070,7 @@ def explore(self, datasource_type, datasource_id):
if datasource_type == 'table' \
else datasource.datasource_name
return self.render_template(
"superset/explorev2.html",
"superset/explore.html",
bootstrap_data=json.dumps(bootstrap_data),
slice=slc,
standalone_mode=standalone,
Expand Down