mirror of https://github.com/apache/superset.git
[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:
parent
a4a2bf7ae9
commit
0c9f9b695b
|
@ -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 = [
|
||||
|
@ -285,4 +285,3 @@ function mapDispatchToProps(dispatch) {
|
|||
|
||||
export { VisualizeModal };
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(VisualizeModal);
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
|
@ -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'],
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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]],
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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: () => {},
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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'],
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
{% block tail_js %}
|
||||
{{ super() }}
|
||||
{% with filename="explorev2" %}
|
||||
{% with filename="explore" %}
|
||||
{% include "superset/partials/_script_tag.html" %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
|
@ -16,7 +16,8 @@ import traceback
|
|||
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
|
||||
|
@ -985,6 +986,16 @@ class Superset(BaseSupersetView):
|
|||
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>/")
|
||||
|
@ -1059,7 +1070,7 @@ class Superset(BaseSupersetView):
|
|||
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,
|
||||
|
|
Loading…
Reference in New Issue