Commit Graph

107 Commits

Author SHA1 Message Date
Alanna Scott
2ace73e9a1 [sql-lab] make datasource name in visualize flow more descriptive (#2103)
* make data source name more descriptive

* add user name to datasource name as well
2017-02-09 12:11:25 -08:00
Bogdan
898d80ba38 Viz the compiled query rather than user input. (#2086) 2017-01-31 19:56:59 -08:00
vera-liu
27aeac6859 Remove fetch results button for async queries (#2084) 2017-01-31 17:25:06 -08:00
vera-liu
8da371e324 Make show query button work for v1 (#2080) 2017-01-31 14:47:50 -08:00
Alanna Scott
e169c67760 [vis] fix axis labels display (#2066)
* re-render chart after adjusting for long axis labels

* measure all of the labels and take the max height

* add missing isTimeSeries var

* fix linting

* use jQuery to get text ticks

* rotate 45 rather than 90
2017-01-31 11:15:59 -08:00
vera-liu
3a5a927dc6 check if tempTable exists for ctas queries (#2073) 2017-01-30 17:08:52 -08:00
vera-liu
2d419e4253 Return alert instead of fetch button when async results has no data (#2072) 2017-01-30 11:03:37 -08:00
vera-liu
87869a29c9 Customize tooltip with axis format (#2068) 2017-01-30 10:43:11 -08:00
vera-liu
544211f5ec Revert "Display no data alert when async result has zero rows" (#2069) 2017-01-27 15:31:28 -08:00
vera-liu
4a8cd04de6 Display no data when async result has zero rows (#2055) 2017-01-27 11:06:54 -08:00
vera-liu
85806624db Use a key-value store model for sharing long queries (#1951)
* Add KeyValue model for storing id-value pairs
use it for storing shared queries

* Change string to text and added test

* Put getQueryLink in one place

* Changed migration down version

* Changes based on comments

* Update bcf3126872fc_add_keyvalue.py
2017-01-27 10:20:24 -08:00
vera-liu
a8c29c4ffe Change validator of timeshift to allow for strings (#2051) 2017-01-26 09:55:47 -08:00
Maxime Beauchemin
e46ba2b4a4 Simplifying the viz interface (#2005) 2017-01-24 14:03:17 -08:00
vera-liu
1c338ba742 [WIP] [explorev2] Refactor filter into FieldSet (#1981)
* [explorev2] Refactor filter into FieldSet

* Fixed tests

* Added tests

* Modifications based on comments
2017-01-24 13:32:40 -08:00
Alanna Scott
9cbd667eb7 [explore-v2] Fix edit datasource link for druid datasources (#1982)
* only add imgSrc key if choices contain an imgSrc

* handle table and druid edit links for datasource drop down

* fix linting
2017-01-23 10:08:00 -08:00
Maxime Beauchemin
0807a8d016 [hotfix] load selectors in render 2017-01-19 15:27:01 -08:00
Maxime Beauchemin
a96024d0e7 [explorev2] Fields can validate input and handle errors (#1980)
As a result here, TextField does its own validation and now casts
the values it sends to Int or Float if set to do so.
2017-01-13 16:25:37 -08:00
Maxime Beauchemin
ff4020ea73 [explorev2] using label in 'Visualization Type' Select instead of key (#1927)
* [explorev2] using label in 'Visualization Type' Select

* moved url related logic upstream in the caller
* moved option creation logic from render method to the constructor as
  it only needs to be executed once

* Refactoring out getOptions
2017-01-12 12:32:42 -08:00
Maxime Beauchemin
470a6e9d76 [explorev2] adding support for client side validators on controls (#1920)
* Adding support for client side validators on controls

* Applying validators to more fields

* Addressing comments
2017-01-12 09:21:17 -08:00
Alanna Scott
fc74fbeeaa [explore-v2] make control panel sections and fields more dense (#1954)
* make control panel sections and fields more dense

* remove Panel

* use <Panel> with className prop
2017-01-11 21:57:36 -08:00
vera-liu
49b6b38741 Pass query instead of slice to Action buttons to prevent lagging query (#1948)
* Pass query instead of slice to Action buttons to prevent lagging query

* Delete beforeOpen and put DisplayQueryButton in pure component
2017-01-11 12:29:06 -08:00
vera-liu
a385ee9e97 Use POST in sqllab_viz instead of url params to avoid error with long queries (#1933)
* Use POST in sqllab_viz instead of url params to avoid error with long queries

* Delete error handling

* Fix returning statement
2017-01-11 11:58:16 -08:00
vera-liu
f0917c62f2 Add a Async Select that fetches options from given endpoint (#1909)
* Add a Async Select that fetches options from given endpoint

* update it statement
2017-01-11 10:31:30 -08:00
vera-liu
94d20168da Change fields for dual_line to match with new SelectField structure (#1932) 2017-01-11 10:07:30 -08:00
Alanna Scott
5d94d7067e [explore-v2] add edit link below datasource select (#1919)
* add edit link below datasource select

* add default prop
2017-01-10 21:13:25 -08:00
vera-liu
761462ef93 Revert "#views users for created dashboards on profile page" (#1943)
* Revert "#views users for created dashboards on profile page"

* Change the downversion after after-version

* Update models.py
2017-01-10 16:58:19 -08:00
vera-liu
cec4cf014c #views users for created dashboards on profile page (#1667)
* Add #views and #distinct users to created dashboard on profile page

* Added index on logs to speed up query

* Added #views and #users for slice table

* Add a views column to dashboards and slices, prepopulate
them with Log data

* Remove index on Log model

* Remove unused index

* Update 1b2c3f7c96f9_.py

fix multiple heads

* Exclude postgres in prepopulating views column
2017-01-06 16:31:20 -08:00
Maxime Beauchemin
222671675c [exploreV2] mapStateToProps for fields (#1882)
* Controls support for mapStateToProps

* Binding methods in the constructor

* Adressing comments

* Fixing tests
2017-01-06 12:38:44 -08:00
vera-liu
c3edc6e24b [WIP] Add dual-axis line chart to viz (#1782)
* Add dual-axis line chart to viz
 - Add a new viz using two y axis for multi-chart in nvd3
 - Option to set metric and axis format for two y axis

* Resolve conflicts

* Fixed x axis and resized thumbnail

* Added example to __init__.py

* Change get_df to match with format
2017-01-06 10:30:27 -08:00
Maxime Beauchemin
119b0c55e9 [explore] fix height in embed mode (#1898)
* [explore] fix height in embed mode

* Linting
2017-01-06 09:41:53 -08:00
Maxime Beauchemin
c14c7edc5e [explore] show the broken query when failing (#1871)
* Return query when failing

* Linting

* sjson -> simplejson
2017-01-05 10:00:39 -08:00
Maxime Beauchemin
7aab8b0ae3 Simplifying the Fields (Controls) interface (#1868)
* Simplifying the Field interface / logic

* Moving ControlLabelWithTooltip where it belongs

* Progress

* Rename FieldClass->FieldType
2017-01-04 15:46:52 -08:00
vera-liu
9bc7ad9cd5 Do not use persistState for explorev2 (#1894)
* Do not use persistState for explorev2

* Change enhancerWithPersistState to enhancer and function name to initEnhancer
2017-01-03 20:23:43 -08:00
Maxime Beauchemin
a1e3fc1c23 [explorev2] giving more room for long textboxes (#1881) 2017-01-03 18:06:49 -08:00
Alanna Scott
242869db3a [sql lab] only show single run query button (#1858)
* only show single run query button, allow async if possible

* only pass the needed props, rather than entire objects to the component

* add simple test

* fix linting
2017-01-03 17:20:30 -08:00
Maxime Beauchemin
8924bb79e7 [explorev2] moving the "Time" section up to 2nd section (#1885)
This keeps the same section ordering as in v1.
2017-01-03 14:18:55 -08:00
Maxime Beauchemin
16731056ed [sqllab] async queries - better error handling (#1853) 2016-12-19 22:33:55 -08:00
vera-liu
6732f01cb7 Enable freeform-select with fetched column values for filter values (#1697)
* Enable freeform-select with fetched column values for filter values
 - db migration to add filter_select_enabled
 - add freeform-multi option for Selectfield
 - modify formatFilter() function on query to accomodate filter-select

* Fix js tests

* Fix codeclimate issue

* Changes based on comments

* Add test for filter endpoint

* Extract out renderFilterFormField function from render

* Fix landscape issues
2016-12-16 14:23:48 -08:00
Maxime Beauchemin
007ee88d33 [explorev2] improving the scrolling/scrollbars placement (#1840) 2016-12-16 08:06:40 -08:00
vera-liu
7a5bb94754 Stop ChartContainer from rendering twice on chartStatus change (#1828)
* Stop ChartContainer from rendering twice on chartStatus change

* Make spinner overlay and dim chart while laoding

* Added timeout to make render more stable on resize

* Put viz in state and call resize at browser size change

* add render after height change since resize depends on render called on the same object

* Change name of renderVis to renderVisOnChange

* Only call resize at height change, persist viz in state

* Call resize wihout render at window size change
2016-12-15 14:06:54 -08:00
vera-liu
e06a0cd89b Add force_ctas_schema to query model when enabled (#1825)
* Add force_ctas_schema to query model when enabled

* Add schema to temp_table_name

* Remove extra arg in create_table_as
2016-12-15 13:19:54 -08:00
Maxime Beauchemin
b6cba13293 [explorev2] enabling redux dev tools (#1842) 2016-12-15 08:54:02 -08:00
Maxime Beauchemin
d929bbfe30 [explorev2] making QueryAndSaveBtns disabled while running queries (#1841)
As I altered QueryAndSaveBtns to add the `disabled` prop
I also moved it to using react-boostrap
2016-12-15 08:53:33 -08:00
Maxime Beauchemin
bf67d64708 [explorev2] making Datasource an Viz controls not clearable (#1845)
* [explorev2] making Datasource an Viz controls not clearable

* Making choices default to empty list
2016-12-15 08:53:15 -08:00
Maxime Beauchemin
733ab8014b [explorev2] using a loader to load the explorev2 specific css (#1843) 2016-12-14 18:31:50 -08:00
Maxime Beauchemin
84a3b55912 [explorev2] remove unused file SqlClause.jsx (#1839) 2016-12-14 15:17:45 -08:00
vera-liu
fa9c066ffe Add email-to option in action buttons for dashboard and slice (#1705)
* Add email-to option in explore action buttons

* email to option for dashboard
2016-12-14 11:52:53 -08:00
vera-liu
e1e20b8757 Sort searched queries by recency (#1735)
* Sort searched queries by recency

* Fixed sqllab tests

* Add one more tr to QueryTable spec for pagination

* Change desc to asc as we reverse queries in component
2016-12-14 10:14:54 -08:00
rlei
7a9604a3c9 Workaround for slices "Not Found" issue in IE <= 11 (#1821)
This should fix issue #1339.

IE 11 and lower has a long standing issue: out-of-document element's
pathname has no leading '/'. See

https://connect.microsoft.com/IE/feedbackdetail/view/1002846/pathname-incorrect-for-out-of-document-elements

And Superset's Slice.jsonEndpoint() method relies on pathname() to build
JSON API URL for slices:

```javascript
      jsonEndpoint() {
        const parser = document.createElement('a');
        parser.href = data.json_endpoint;
        let endpoint = parser.pathname + this.querystring();
        endpoint += '&json=true';
        endpoint += '&force=' + this.force;
        return endpoint;
      },
```

`parser` above is exactly an out-of-document element. Therefore when
running in IE <= 11, Superset would build wrong JSON endpoint URLs,
hence the 404 errors for loading data for slices.

This commit adds a simple workaround when leading '/' is missing in the
value returned by pathname().
2016-12-14 08:41:03 -08:00
vera-liu
9f7486f402 remove extra call to get_viz in explorev2 (#1812)
* Not working errors

* Remove update_explore endpoint, only update explore endpoints in reducer on query

* Change scroll to auto and make container reponse to height:

* Remove update_explore endpoint

* Remove can_update_explore perm
2016-12-12 10:58:07 -08:00