Commit Graph

518 Commits

Author SHA1 Message Date
Ryan Ye
4cf4e3805c Bugfix when there's only date filter in FilterBox (no groupby) (#1326) 2016-10-12 13:51:40 -07:00
Maxime Beauchemin
ef2670ca32 Using inheritance scheme to organize db specific code (#1294)
* Using inheritance scheme to organize db specific code

* Addressing comments
2016-10-12 13:50:47 -07:00
Bogdan
8626c80d3a Stop duplicating datasources (#1321)
* Prevent creating duplicate tables.

* Stop duplicating the tables and druid datasouces.

* Use sqlalchemy func.count
2016-10-12 12:48:24 -07:00
Alanna Scott
5cb3cc2ed8 polyfill es2015 in older browsers and for phantomjs (#1323)
* use babel polyfill

* alphabetize entry files, only add babel-polyfill once for each entry
2016-10-12 10:41:26 -07:00
Bogdan
73cd2ea3b1 Import / export of the dashboards. (#1197)
* Implement import / export dashboard functionality.

* Address comments from discussion.

* Add function descriptions.

* Minor fixes

* Fix tests for python 3.

* Export datasources.

* Implement tables import.

* Json.loads does not support trailing commas.

* Improve alter_dict func

* Resolve comments.

* Refactor tests

* Move params_dict and alter_params to the ImportMixin

* Fix flask menues.
2016-10-11 17:54:40 -07:00
Dennis O'Brien
cd2ab42abc do not overwrite the stored password with the masked password (#1209)
* do not over-write the stored password with a masked password.
his addresses issue #1199

* added a test to validate that sending a password-masked sqlalchemy_uri does not over-write the stored sqlalchemy_uri

* requery the database object after the update.
use self.assertEqual for more informative error messages.
2016-10-11 16:49:40 -07:00
Maxime Beauchemin
bf1f5ea3de [sqllab] use encodeURIComponent for copy query URL (#1317)
had to bump babel-preset-airbnb for object-rest-spread to work in my
env.

Change the menu icon, text and tooltip to clarify the usage
2016-10-11 15:50:36 -07:00
Mihail Diordiev
79460abdd2 [SQLLab] Fix the usage of Redux DevTools Enhancer (#1278)
* Fix the usage of Redux DevTools Enhancer

* Fix ESLint error
2016-10-11 15:27:25 -07:00
Juho Lamminmäki
1e6e144d24 Fixed viewing dashboards as anonymous (#1320) 2016-10-11 08:04:00 -07:00
Alanna Scott
fe66557bbb [explore-v2] hook up ExploreViewContainer to state and add specs (#1300)
* add getParams func to common

* get data from redux state

* specs for chart container and explore view container
2016-10-10 13:46:00 -07:00
vera-liu
f8e2ce6ff3 Change status color in tab to match with success (#1247) 2016-10-10 13:32:38 -07:00
Bogdan
19677438c2 Add cascade delete to the 1 to composite relationships. (#1295) 2016-10-09 19:06:22 -07:00
Alanna Scott
9012b11101 add ImmutableMultiDict back to views.py (#1298) 2016-10-07 18:27:19 -07:00
Maxime Beauchemin
f70d301f0d Refactor the explore view (#1252)
* Refactor the explore view

* Fixing the tests

* Addressing comments
2016-10-07 16:24:39 -07:00
vera-liu
b7d1f78f5e Put formData in store (#1281)
* Put formData in store

* Reform actions and reducers

* Maded modifications based on comments:
2016-10-07 14:53:36 -07:00
Maxime Beauchemin
3384e7598e Fixing explore actions & slice controller interactions (#1292)
* Fixing explore actions & slice controller interactions

* Addressing a comment
2016-10-07 14:06:26 -07:00
Alanna Scott
382b8e85da [explore v2] add scrollbar to control panel container (#1284)
* add scroll bars to control panel container

* make query and save-btns block elements

* don't use react component, use custom styles

* move style to stylesheet
2016-10-07 11:57:05 -07:00
vera-liu
ecfe1a2417 Updated eslinter for object rest spread (#1289) 2016-10-07 10:18:23 -07:00
Stefano Ordine
609ae22bda less number of default workers. (#1206) 2016-10-07 10:16:41 -07:00
Francesco Riosa
94578cb6a7 reduce chunk size for countries table (#1279)
One user reported the load of the "countries" table exceed
max_allowed_packet which in some configurations can be as low as 1MB.

Changing the chunk size from 500 to 50 has a small cost on the initial
load of the data (one additional second to the 17 taken previously)
while being more universally usable without changing the configuration
of the mysql server.
The new packet size is estimated to be about 500KB.

The committer has not checked other tables
2016-10-07 09:16:26 -07:00
Alanna Scott
8a5f050f6c [explore v2] fix explorev2 chart errors (#1277)
* fix prototypes and arrow function

* only show line chart if viz type is line

* split render lines function

* fix arrow-body linter
2016-10-06 13:07:27 -07:00
vera-liu
5c5b393f2f Change userId, dbId to username and dbname (#1274) 2016-10-06 09:53:33 -07:00
Alanna Scott
f837733d85 [explorev2] chart and controls (#1251)
* create structure for new forked explore view (#1099)

* create structure for new forked explore view

* update component name

* add bootstrap data pattern

* remove console.log

* Created store and reducers (#1108)

* Created store and reducers

* Added spec

* Modifications based on comments

* do use bootstrap data for now

* don't deal with bootstrap data for now

* use victory as a base

* import fake line data, add fake panels, make chart fixed

* add fetch support

* get slice data from json endpoint

* render chart with slicejson

* update chart and label demo

* remove fetch config

* remove dummy control panels

* should be a func

* make TimeSeriesLineChart

* add a comment

* inner height for height

* don't need fetch yet

* trailing comma breaks in package json

* pass in viz data from props

* add style sheet

* set height on explore container

* add legend

* make chart responsive to window resize

* can't use head_css in template bc overrides head_css in basic

* fix linting

* break labelItem into own SFC, make legend SFC

* add propTypes and fix linter
2016-10-05 19:41:16 -07:00
vera-liu
66b498de25 Added controls for Table Viz (#1253)
* Added controls for Table Viz

* Change control panel container to stateless

* Changed specs

* Resolved conflicts
2016-10-05 14:53:51 -07:00
vera-liu
659bf6d7e8 Moved time column and grains to models.py (#1255) 2016-10-05 13:02:35 -07:00
vera-liu
421a86ade5 Some polish on query search (#1222)
* Some polish
- Changed query search icon
- CopyToClipboard in action bar

* Added dbId as linked-button, made modifications based on comments

* Fix duplicated import (linting)
2016-10-05 11:43:05 -07:00
Maxime Beauchemin
7a01d9dbcb v0.11.0 2016-10-04 21:27:19 -07:00
Bogdan
58dfa436ee Do not shadow _ function. (#1254) 2016-10-04 18:30:15 -07:00
vera-liu
8ab5e5015a Added access check + Druid in endpoint (#1224)
* Explore control panel - Chart control, TimeFilter, GroupBy, Filters (#1205)

* create structure for new forked explore view (#1099)

* create structure for new forked explore view

* update component name

* add bootstrap data pattern

* remove console.log

* Associate version to entry files (#1060)

* Associate version to entry files

* Modified path joins for configs

* Made changes based on comments

* Created store and reducers (#1108)

* Created store and reducers

* Added spec

* Modifications based on comments

* Explore control panel components: Chart control, Time filter, SQL,
GroupBy and Filters

* Modifications based on comments

* Added access check + Druid in endpoint

* pull grains to constants

* Switch explore.html to old version
2016-10-04 13:44:45 -07:00
vera-liu
a92190c3ae Fix npm linting error with version string (#1249) 2016-10-04 10:40:46 -07:00
Maxime Beauchemin
055fb6110f bump version to 0.10.0.dev0 2016-10-04 08:46:31 -07:00
Maxime Beauchemin
19ab3e2fbd Adding a 'Misc Charts' dashboard as part of the examples (#1208)
This showcases some of the visualization types that were there only as
slices, not as part of any dashboards.
2016-10-04 08:18:17 -07:00
Alanna Scott
ae54ac9d58 [sql-lab] fix react warnings in dev (#1232)
* rename file to match class

* fix react warnings

* fix proptype typo

* add missing keys
2016-10-03 23:58:47 -07:00
Alanna Scott
e6e902e8df [explore-v2] setup, basic layout, control panels, v2 url (#1233)
* Explore control panel - Chart control, TimeFilter, GroupBy, Filters (#1205)

* create structure for new forked explore view (#1099)

* create structure for new forked explore view

* update component name

* add bootstrap data pattern

* remove console.log

* Associate version to entry files (#1060)

* Associate version to entry files

* Modified path joins for configs

* Made changes based on comments

* Created store and reducers (#1108)

* Created store and reducers

* Added spec

* Modifications based on comments

* Explore control panel components: Chart control, Time filter, SQL,
GroupBy and Filters

* Modifications based on comments

* accommodate old and new explore urls

* move bootstrap data up in scope

* fix code climate issues

* fix long lines

* fix syntax error
2016-10-03 22:47:39 -07:00
vera-liu
d8638dbcf3 revert devtool alert (#1238) 2016-10-03 16:21:33 -07:00
Bogdan
9795e4a532 [SQLLab] Fix updating the database state. (#1225) 2016-10-03 10:40:27 -07:00
Bogdan
e11ef994bb [SQLLab] user server for the query limit check. (#1230) 2016-10-03 09:59:08 -07:00
Maxime Beauchemin
472679bb38 [security] allow for requesting access when denied on a dashboard view (#1192)
* Request access on dashboard view

* Fixing the unit tests

* Refactored much in the tests
2016-10-02 18:03:19 -07:00
vera-liu
d066f8b726 Added alert to install redux devtool (#1228)
* Added alert to install redux devtool

* Change to warning
2016-09-30 15:02:52 -07:00
Bogdan
9c83b900ae Bring DB in sync with the models.py (#1172)
* Bring DB in sync with the models.py

* Make sure that migrations run on multiple dbs
2016-09-28 13:55:06 -07:00
Maxime Beauchemin
f0289cef3a [minor] fixing the icons in the navbar
the top item on the navbar had no icon, and the content of the menu had
two items with the same icon
2016-09-28 10:44:55 -07:00
vera-liu
96844c5c12 Share query (#1154)
* In the tab's dropdown menu under SQL editors, copy query link option is
added. A url with copied query will pop up a new editor tab.

* Made changes based on comments

* Move copy query button to right bottom of sql editor box

* Added in Alanna's code for copy url under menu item

* Fixed linting issues
2016-09-27 22:48:01 -07:00
Maxime Beauchemin
1a29163530 A few bugfixes 2016-09-27 10:20:20 -07:00
Maxime Beauchemin
b67906cfe1 [hotfix] dashboard doesn't have filter_immune_slices pre-save 2016-09-26 17:11:03 -07:00
Maxime Beauchemin
153667505f [hotfix] slice page is broken 2016-09-26 16:51:11 -07:00
Aveplatter
b6f4062874 Update countries.md (#1194) 2016-09-26 10:23:59 -07:00
prokh
44be42c922 Remove duplicate code for property name of SqlaTable (#1190) 2016-09-25 08:41:44 -07:00
vera-liu
5f6ef84c4e Vliu query search (#1187)
* Query search page under SQL Lab tab

* Modifications based on comments

* Hash

* Added spec and endpoint test with modifications
based on second round comments

* Changed permission menu in https://github.com/airbnb/caravel/pull/1095/files
2016-09-23 17:41:24 -07:00
vera-liu
551c97112c Revert "Query Search Page" (#1186) 2016-09-23 16:28:21 -07:00
vera-liu
d5c5c0d6ac Query Search Page (#1122)
* Query search page under SQL Lab tab

* Modifications based on comments

* Hash

* Added spec and endpoint test with modifications
based on second round comments

* Changed permission menu in https://github.com/airbnb/caravel/pull/1095/files
2016-09-23 16:13:18 -07:00
Maxime Beauchemin
98902599ff [hotfix] issues around empty params 2016-09-23 15:07:33 -07:00
Maxime Beauchemin
7f3c205c46 [hotfix] reactable bump to 0.14.0 2016-09-23 14:28:13 -07:00
Maxime Beauchemin
d397c0bbf8 [hotfix] FilterBox has issues with react-select version in prod 2016-09-23 13:20:39 -07:00
Maxime Beauchemin
6e5a93a6e1 [hotfix] result set always updates 2016-09-23 12:06:57 -07:00
Bogdan
df89bec712 Infer types. Smart defaults for the visualize window. Basic implementation. (#1134)
* Implement smart suggestions for the visualize flow.

* Address JS comments.

* Implement caravel dataframe wrapper.
2016-09-23 11:14:38 -07:00
Maxime Beauchemin
fc921d63a1 Simplifying source_registry (#1180) 2016-09-22 21:19:03 -07:00
Maxime Beauchemin
aed473d0d2 [filtering] define combo of slice/fields unafected by filtering (#1179)
* [FilterBox] dashboard date range filtering

* [filtering] define combo of slice/fields unafected by filtering

* adding an entry to the docs

* Addressed comments
2016-09-22 20:12:48 -07:00
Maxime Beauchemin
7115c5458d [FilterBox] dashboard date range filtering (#1165)
* [FilterBox] dashboard date range filtering

* Addressing comments
2016-09-22 14:30:39 -07:00
Maxime Beauchemin
8cb0bea57c [sqllab] db migration - setting Database.allow_run_sync=True (#1174) 2016-09-22 14:09:00 -07:00
Dennis O'Brien
1fa18922fa when adding a new database use Database.set_sqlalchemy_uri so that the password is stored encrypted. (#1177)
This fixes a regression I introduced with PR #1137
2016-09-22 14:08:42 -07:00
Maxime Beauchemin
49cefc8b00 Improve the Test Connection error message (#1175) 2016-09-22 13:09:10 -07:00
Bogdan
cbc70d3738 Implement permission request/approve flow. (#1095)
* Implement permission request/approve flow

* Address the comments.

* Refactor the code to support multiple datasources.

* Reformat the queries.
2016-09-22 09:53:14 -07:00
Bogdan
b855e2f1a6 Add dashboard creator as owner of the dashboard (#1166)
* Add dashboard creator as owner of the dashboard

* Address comments.
2016-09-22 08:17:27 -07:00
Dennis O'Brien
bc7d0ffad2 Fix TEST CONNECTION on a newly added database. (#1168)
This addresses issue #1167
If the database name passed in the request is not found in the db, test using the sqlalchemy uri passed.
2016-09-22 08:17:05 -07:00
Alanna Scott
2f2ed229fb [redux] move some redux utils to shared file (#1164)
* move some redux utils to shared file so they can be used in the new export view too

* enhancer is a func now
2016-09-21 21:54:03 -07:00
Maxime Beauchemin
b5875764ed [security] allowing to set static headers as configuration (#1126)
* [security] setting X-Frame-Options=SAMEORIGIN to prevent clickjacking

* Changing to a more flexible approach
2016-09-21 14:41:42 -07:00
Maxime Beauchemin
f1e80a8e1b Adding indexes to table metadata (#1160) 2016-09-21 14:40:33 -07:00
ShengyaoQian
5a0e06e7a2 Generalize switch between different datasources (#1078)
* Generalize switch between different datasources.

* Fix previous migration since slice model changed

* Fix warm up cache and other small stuff

* Adding modules and datasources through config

* Replace tabs w/ spaces

* Fix other style issues

* Change add method for SliceModelView to pick the first non-empty ds

* Remove tests on slice add redirect

* Change way of db migration

* Fix styling

* Fix create slice

* Small fixes

* Fix code climate check

* Adding notes on how to create new datasource in CONTRIBUTING.md

* Fix last merge

* A commit just to trigger travis build again

* Add migration to merge two heads

* Fix codeclimate

* Simplify source_registry

* Fix codeclimate

* Remove all getter methods
2016-09-21 09:52:05 -07:00
Alanna Scott
0e7af8d8a6 [explore] refactor slice action button group (#1074)
* pull explore actions button group into component

* use button component

* make sure we render all action buttons

* test that embed code is correct

* don't need before each

* generalize modal trigger for use with plain links or icons
2016-09-20 13:45:27 -07:00
Maxime Beauchemin
32980a653c [big_number] fix subheader is missing (#1146) 2016-09-20 12:24:29 -07:00
Bob Ziuchkovski
d15a212e64 Add support for Werkzeug ProxyFix middleware (#1150)
Add an ENABLE_PROXY_FIX config param.  When set to True, insert the Werkzeug ProxyFix
middleware.  This middleware extracts and applies the X-Forwarded-* headers that are
inserted by common proxies and load balancers.  Fixes #1139.
2016-09-20 12:24:15 -07:00
Maxime Beauchemin
1ce8acc154 Adding license to package.json 2016-09-19 23:48:16 -07:00
Maxime Beauchemin
e8088d5c9a More improvements to SQL Lab (#1104)
* Handling timeouts

* Fixing timer on non-utc server

* Allowing async with results

* [bugfix] database is not selected

* Making sure the session is up and running

* Cleaning up query results and query objects

* Picking a groupby and metric field on visualize flow

* Showing local time in query history

* Using pull-left pull-right instead of grid layout for table metdata

Long column name were looking weird and icons were wrapping oddly

* Linting

* Eliminating east buttons under the sql editor

* Sort database dropdown by name

* Linting

* Allowing non-SELECT statements to run

* Adding a db config

* Making sqla checkout check cross-db
2016-09-19 15:28:10 -07:00
Riccardo Magliocchetti
8081080709 log: be more robust against malformed input (#1127)
Refs #1113
2016-09-19 15:26:57 -07:00
Riccardo Magliocchetti
8c619e8383 models: fix slice creation (#1130)
Fix #1128
2016-09-19 15:23:15 -07:00
Maxime Beauchemin
1c544c9845 Enable list with checkboxes only on Table->Columns view (#1138) 2016-09-19 15:22:37 -07:00
Dennis O'Brien
ca66ba4893 Fix initialization of Database sqlalchemy_uri and password (#1137)
* move initialization of Database sqlalchemy_uri and password from DatabaseView.pre_add to utils.get_or_create_main_db.
Unit tests for mysql and postgres include username and password in the SQLALCHEMY_DATABASE_URI.

* modified test_testconn to work with sqlalchemy uri with a username and password.
2016-09-19 15:14:00 -07:00
Riccardo Magliocchetti
afa1f0916b Make sql test connection work with saved Database instance (#694)
Fix #596
2016-09-17 12:32:41 -07:00
Riccardo Magliocchetti
69d37d8b2a Fix double escaping of dttm expressions (#744) (#1103)
If ddtm_expr is an expression with special characters then timestamp_grain escapes
the special characters already escaped.

Solution discussed with sqlalchemy upstream:
https://bitbucket.org/zzzeek/sqlalchemy/issues/3737/literal_column-given-a-specific-sql

Fix #617
2016-09-17 12:30:50 -07:00
Maxime Beauchemin
b62d7e3e8e [security] prevent XSS on FAB list views (#1125)
* [security] prevent XSS on FAB list views

* addressing comments
2016-09-16 16:25:42 -07:00
Maxime Beauchemin
e8f1baba43 [explore] giving more room to Slice title (#1118)
* [explore] giving more room to Slice title

* h2->h3 for slice title
2016-09-16 15:41:34 -07:00
vera-liu
ffe6fb849f Apply stretchMargin only to distribution bar (#1124)
* When the label size is too short, the constant for calculating
margin_size does not apply. Also nvd3 auto-adjust font-size of axis
labels.
Temporary solution here: Setting a fixed font-size on nvd3 axis labels
and a minimum threshold for label size.

* Only stretch margin for dist_bar
2016-09-16 15:39:50 -07:00
Maxime Beauchemin
3602d940eb [hotfix] lint 2016-09-16 09:47:21 -07:00
Maxime Beauchemin
9389f89889 [welcome] removing calendar heatmap from welcome page (#1119) 2016-09-16 08:32:59 -07:00
Maxime Beauchemin
edcc2a11c6 Fixing druid culster perms to mirror sqla databases (#1123) 2016-09-16 08:32:37 -07:00
Maxime Beauchemin
2adc8a0274 [explore] clarifying force-refresh message 2016-09-16 08:20:06 -07:00
vera-liu
2432c3155a Associate version to entry files (#1060)
* Associate version to entry files

* Modified path joins for configs

* Made changes based on comments
2016-09-15 17:20:18 -07:00
vera-liu
2132f6715e When the label size is too short, the constant for calculating (#1120)
margin_size does not apply. Also nvd3 auto-adjust font-size of axis
labels.
Temporary solution here: Setting a fixed font-size on nvd3 axis labels
and a minimum threshold for label size.
2016-09-15 16:48:35 -07:00
Maxime Beauchemin
e895807158 [bugfix] namespacing the mapbox css 2016-09-14 21:24:06 -07:00
Maxime Beauchemin
17a317554c [bugfix] filter_immune_slices doesn't work (#1110) 2016-09-14 14:19:37 -07:00
Bogdan
a871ee7858 Clean up the druid sync api. (#1101) 2016-09-13 17:30:36 -07:00
Ryan Ye
2e6b4b121f Time grain support for unix-timestamp columns (#1093)
* Add time grain support for time columnd in unix timestamp

* Fix datetime parsing for unix epoch

Since we've already converted unix epoch to datetime type,
we shouldn't specify 'unit' parameter in pandas.to_datetime

* Fix SQLite timestamp to datetime conversion
2016-09-13 11:58:47 -07:00
Maxime Beauchemin
df533d30fc [sql lab] specify schema name when generating vanila query (#1096)
* [sql lab] specify schema name when generating vanila query

* Fixing some react warnings
2016-09-12 23:09:18 -07:00
vera-liu
1f761c61dd Single quote filter values with comma (#1084)
* Single quote filter values with comma

* refactor for codeclimate limite

* Added unit tests and tooltip
2016-09-12 13:41:05 -07:00
Maxime Beauchemin
9bf5620887 [sqllab] hide SqlEditor textarea to prevent flicker 2016-09-12 09:23:14 -07:00
Maxime Beauchemin
1971bf653c Numerous improvements to SQL Lab (#1088)
* Improving the Visualize flow

* Fixed the timer

* CTAS

* Expiclit engine handling

* make tab full height, stretch for longer content (#1081)

* Better error handling for queries

* Hooked and fixed CSV export

* Linting

* Tying in the dttm in the viz flow

* Indicator showing when going offline

* Addressing comments, fixing the build

* Fixing unit tests
2016-09-11 07:39:07 -07:00
Bogdan
c20ee0c129 Filter Druid Datasources by user permissions. (#1090) 2016-09-09 17:12:09 -07:00
Maxime Beauchemin
6aadc6ec13 Simplifying the flow to add a table (#1068)
When specifying a table reference that can not be found, the system used
to still create the object, which would result in confusion and bad
error messages down the line. Now it will fail and not create the
object.

I also removed fields that are not necessary to worry about when
initially creating the table.
2016-09-09 16:39:11 -07:00
Alanna Scott
8eb4cbf66e only show the reset state button if location param (#1075) 2016-09-08 13:54:00 -07:00
Alanna Scott
0e0eaa0ccd [sql-lab] ui polish (#1079)
* we don't need tooltips on accordion menu, known ui pattern

* use consistent type sizes, bump body type down to 14px

* make editor same height as 3 selects

* table meta data accordion menu

- prevent default on accordion clicks
- always show table actions, they are more discoverable like that
- polish spacing/layout

* remove hover effect on table actions
2016-09-08 12:31:45 -07:00