Commit Graph

443 Commits

Author SHA1 Message Date
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
Bogdan
d454fb402b Add refresh druid datasources endpoint. (#1065) 2016-09-07 17:27:35 -07:00
vera-liu
9ae231aeb8 adjust bottom margin according to label sizes on x-axis (#1029)
* adjust bottom margin according to label sizes on x-axis
Note: same as the method in heatmap.js

* add default bottom_margin to dropdown

* Change default to auto
2016-09-07 14:07:02 -07:00
Bogdan
e783219a76 Add cache warmup endpoint (#1063)
* Refactor permissions in the views.py.

* Add get_viz to the slice.

* Add warm up cache endpoint.

* Resolve comments.
2016-09-06 13:58:09 -07:00
Maxime Beauchemin
62c71110df Adding a ShrinkSql component (#1058) 2016-09-06 11:20:58 -07:00
vera-liu
9914901099 Change the font on axis (#1028)
A minor css change to make histogram viz look consistent
2016-09-02 10:01:13 -07:00
Maxime Beauchemin
badac7379e [touchup] using input-sm on text fields in explore view 2016-09-01 14:59:28 -07:00
Maxime Beauchemin
7dd01cff6f [bugfix] btn timer contianer was left behind 2016-09-01 14:44:20 -07:00
Maxime Beauchemin
4b77710016 [SQL Lab] Adding DB options for SQL LAb (#1054)
* [SQL Lab] Adding DB options for SQL LAb

each db can be exposed or not in SQL Lab
CTAS is an option
target_schema placeholder (not hooked yet, but would force the CTAS to
target a specific schema)

* Addressing comments
2016-09-01 14:21:46 -07:00
Chris Williams
bae21194c1 Chris/remove redirect from slice id endpoint (#1044)
* call explore() directly from '/caravel/slice/id/' endpoint instead of redirecting to it.

* pass slice_id instead of slice_params in 'caravel/slice/id/' endpoint to avoid logging errors. add fix for MultiDict bug

* address max's comments

* remove the /slice/id/ endpoint in preference of /datasource_type/datasource_id/slice_id/

* pep8
2016-08-31 16:45:03 -07:00
Bogdan
f300ee1010 Small codeclimate fixes. (#1033) 2016-08-31 13:28:42 -07:00
Bogdan
85d03f5e18 Set up istanbul with codeclimate and travis. (#1046)
* Set up istanbul with codeclimate and travis.

* Put the codeclimate tocken inside .travis.yml
2016-08-31 09:27:07 -07:00
Maxime Beauchemin
3f889492f9 Fixing the build [that I broke] 2016-08-30 23:27:56 -07:00
maxime.beauchemin@airbnb.com
508feb2bad [hotfix] getting presto on track 2016-08-31 00:11:00 +00:00
Maxime Beauchemin
9f8eef498c [theme] a little bit less blue (#1024)
* [theme] a little bit less blue

* Addressing comments
2016-08-30 15:02:09 -07:00
Maxime Beauchemin
561828c2f8 [SQL Lab] moving the db/schema/table select to the left (#1038) 2016-08-30 11:08:41 -07:00
Maxime Beauchemin
38b8db8051 SQL Lab - A multi-tab SQL editor (#514)
* Carapal react mockup

This is really just a mock up written in React to try different
components. It could become scaffolding to build a prototype, or not.

* Merging in Alanna's theme tweaks for SQL lab

* Tweak the display of the alert message in navbar

* Sketching the middleware refresh for Queries

* Adjustments

* Implement timer sync.

* CTAS

* Refactor the queries to be stored as a dict. (#994)

* Download csv endpoint. (#992)

* CSV download engdpoint.

* Use lower case booleans.

* Replcate loop with the object lookup by key.

* First changes for the sync

* Address comments

* Fix query deletions. Update only the queries from the store.

* Sync queries using tmp_id.

* simplify

* Fix the tests in the carapal. (#1023)

* Sync queries using tmp_id.

* Fix the unit tests

* Bux fixes. Pass 2.

* Tweakin' & linting

* Adding alpha label to the SQL LAb navbar entry

* Fixing the python unit tests
2016-08-29 21:55:31 -07:00
Maxime Beauchemin
f17cfcbfa2 [filter box] making filter order matches the dropdown (#1007)
fixes https://github.com/airbnb/caravel/issues/1005
2016-08-26 15:22:43 -07:00
Maxime Beauchemin
7eceb140be [bugfix] slice description makes charts overflow (#993) (#1010) 2016-08-26 15:21:16 -07:00
Maxime Beauchemin
b93f9ec598 [line chart] adding option for circle markers (#1006) 2016-08-26 11:45:46 -07:00
Alanna Scott
36a6714e9e slice/explore header (#996)
* move slice header to partial, show datasource in slice title area if no slice is saved

* change partial name, and use same styling as slice title

* use jinja style guide spacing rule

* use [datasource] - untitled
2016-08-25 11:22:11 -07:00
Shashank Shekhar
30071eef09 Reduced number of ticks provided as hint to d3.ticks (#1012)
The number of the ticks suggested scales with 3 times as much
as the number of bins. This is unwanted since the number
of ticks is a hint to d3 as per (https://github.com/d3/d3-3.x-api-reference/blob/master/Quantitative-Scales.md#identity_ticks) The high number of suggesting ticks leads to a congested y-axis.
2016-08-25 08:18:22 -07:00
Alanna Scott
e85978a7ed add if enableAddSlice is truthy (#1015) 2016-08-25 00:03:46 -07:00
Alanna Scott
d1f43e3e28 [ui] a few unmerged rules (#1014)
* make btn default grey text on lighter bg

* get nav bar links working

* use same bg as airbnb body
2016-08-25 00:02:23 -07:00
Alanna Scott
de39923d06 [ui] design review changes - default/primary btn colors (#1008)
* change primary colors and inverse nav

* use primary small bans

* only use primary for query btn
2016-08-24 22:28:22 -07:00
Maxime Beauchemin
f800ff16c1 Making default labels visible (#999) 2016-08-23 14:03:10 -07:00
Alanna Scott
ef118dee6a move staging alert out of nav (#995) 2016-08-23 10:15:00 -07:00
Maxime Beauchemin
2bc1674237 [bugfix] slice description makes charts overflow (#993) 2016-08-22 20:27:03 -07:00
Maxime Beauchemin
9445549aff [tweak] allowing markup widget to overflow 2016-08-22 18:06:57 -07:00
Maxime Beauchemin
95eb928beb [bugfix] markup image is missing in examples 2016-08-22 18:03:08 -07:00
Maxime Beauchemin
a8fd23dfa4 Linting JSX files (#941)
`.jsx` linting is now in-scope for the `npm run lint` command, and
I linted the base files and some of the viz, there's still quite a bit
of work there, but that's a first pass on it.
2016-08-22 13:21:30 -07:00
Maxime Beauchemin
7f2805a3c5 [bugfix] fixing && linting the histogram viz (#987) 2016-08-19 18:03:27 -07:00
Maxime Beauchemin
a8715294b0 [bugfix] dashboard list doesn't populate in explore->saveas (#979) 2016-08-19 16:50:05 -07:00
Alanna Scott
30ef8eba37 [ui] hack bootswatch/cosmo theme to get better tabs for sql-lab (and other things) (#975)
* start hacking cosmo theme and fixing small ui bugs on pages.

* straighten up welcome page

* fix tab styling

* remove paper theme files

* add tables to docs

* make alerts lighter
2016-08-18 23:49:31 -07:00
Maxime Beauchemin
23a5463208 Hack around the "last migration doesn't stamp" Alembic bug (#967)
* Hack around the "last migration doesn't stamp" Alembic bug

This makes MySQL, Sqlite and Postgres work with a special hard coded
rule. I'm hoping Alembic fixes the root cause eventually.

* Running db upgrade twice in tests
2016-08-17 17:10:07 -07:00
Maxime Beauchemin
84213ab8cd [line] growth vs factor option for 'Period Ratio' (#970)
* [line] growth vs factor option for 'Period Ratio'

* i18n
2016-08-17 12:26:10 -07:00
Alanna Scott
379cf6cbd9 [ui] tweaks and improvements (#965)
* update panel headings, titles

* remove panel heading collapser

* style slice meta controls

* fix favstar on dashboard

* add space between heat map and list
2016-08-17 08:05:47 -07:00
Maxime Beauchemin
ac512ef731 [hotfix] SQL endpoint JQUERY error
Fixes #935
2016-08-16 22:29:11 -07:00
vera-liu
80974958bd vera_liu-deleted_dashboard_title_column_in_welcome_page (#951) 2016-08-16 21:52:57 -07:00
Riccardo Magliocchetti
cc058e5c9e viz: cache datetime.now() in query_obj (#955)
It shouldn't be a big deal, and it's pretty cheap on linux, but
still :)
2016-08-16 21:40:27 -07:00
Riccardo Magliocchetti
061d4f1ac7 Refine gamma experience (#883)
* gamma: filter the sqla tables the user has access to

Refs #359

* gamma: filter slices available for dashboards in DashboardModelView

Refs #359

* gamma: limit owners to dashboard to self

As we don't want to leak other users to unpriviliged users

Refs #359
2016-08-16 21:37:55 -07:00
Adam Jones
88f4260777 Change default location for db and logs to ~/.caravel Fix #915 (#947) 2016-08-16 21:35:31 -07:00
Adam Jones
66c2b84cb4 Add time grains for mssql. (#956) 2016-08-16 21:23:03 -07:00
Maxime Beauchemin
c474581138 Fixing the rendering of the separator widget (#936) 2016-08-16 09:47:47 -07:00
Maxime Beauchemin
d79220fb71 .codeclimate.yml on the right spot 2016-08-14 17:14:34 -07:00
Maxime Beauchemin
10011d572a Adding Code Climate conf file 2016-08-14 16:57:46 -07:00
Maxime Beauchemin
aa01283774 [hotfix] adding react-select to package.json 2016-08-13 23:28:52 -07:00
Maxime Beauchemin
1b9458dcf0 Adding config element for alert message in navbar (#938) 2016-08-12 23:40:24 -07:00
Maxime Beauchemin
e243a14c64 Refactor around how visualizations/*.js are required (#913)
* Refactor around how visualizations/*.js are required

* Reactifying FilterBox further

* Fixing the auto-refresh on filtering events

* Fixing preselected filters
2016-08-11 21:39:10 -07:00
Gustavo Brian
198226a39f Fix date serialization (#873)
* [panoramix] -> [dashed]

* merge from caravel/master

* Updated from airbnb

* Cleaning

* Rebase with upstream/master

* merge from caravel/master

* Updated from airbnb

* Cleaning

* Manual rebase

* Last pending change to rebase

* Convert date to datetime before serialization.
Approach choosen: transform data before serialize and keep just one way to serialize

* Unit test created

* stupid error :(

* remove uneeded code and rename test

* Avoid double type checking
Test updated
note: isinstance(<datetime>, <date>) == True, check order changed

* Increase coverage

* Fix assertRaises
2016-08-10 23:13:59 -07:00
Chris Williams
2bfb9cc7dd pass the standalone request arg in the /caravel/slices/<slice_id>/ endpoint redirect (#876)
* pass the  request arg in the /caravel/slices/<slice_id>/ endpoint.

remove unused import.

* test that a single slice redirects rather than testing them all. update standalone redirect logic for Javascript 'false' instead of Python False
2016-08-10 23:11:53 -07:00
Riccardo Magliocchetti
71bdabe1a1 dashboard: don't enable buttons that would fail (#881)
With gamma users saving the dashboard model would fail if they
are not owner of the dashboard.
So if that's not the case just disable the "Add a new slice to
the dashboard" and "Save the current positioning and CSS".

Refs #359
2016-08-10 23:10:59 -07:00
Maxime Beauchemin
9b3b1f69df Fixes explore view when no slice is defined (#924) 2016-08-10 22:59:35 -07:00
Maxime Beauchemin
bcbe08bd5c Fixing some aspects of the theme (#907) 2016-08-10 21:14:24 -07:00
Maxime Beauchemin
9a2c7740f0 [bugfix] nvd3's API changed and broke the range filter (#903)
* [bugfix] nvd3's API changed and broke the range filter

* Removing if that is not needed
2016-08-10 17:47:05 -07:00
Maxime Beauchemin
efdfa81f21 [bugfix] controls info bubble don't show up (#904) 2016-08-10 15:04:50 -07:00
Shashank Shekhar
15ee6d82e3 Histogram (#888)
* Add Histogram as a visualization

The css and js file use the histogram code from https://bl.ocks.org/mbostock/3048450.
THe viz.py extends from BaseViz to create chart data only for one histogram

* using d3.layout.histogram

* CSS updated

The new css has been used from the d3 chart http://bl.ocks.org/mbostock/1933560

* bars are visible

* added semicolons

* histogram from http://bl.ocks.org/mbostock/1933560

It takes as input no of bins. The histogram cycles through
a set of colors for different lengths of the bar. It places a
y axis coordinate on top or on the upper end of the bar
whichever is suitable.

* update style changes
2016-08-10 15:04:19 -07:00
Maxime Beauchemin
d15c557cd6 [bugfix] missing spinner in explore view (#914) 2016-08-10 15:02:13 -07:00
Maxime Beauchemin
08d682501e [webpack] set up proper dev/prod environment (#916) 2016-08-10 15:02:01 -07:00
Bogdan
d6bb8c6935 Add per database permissions for the SQL Lab. (#885) 2016-08-09 17:53:23 -07:00
Alanna Scott
b0a1f07818 ui update (#879)
* caravel ui update

* make headings bold on /explore

* bump back pagination color
2016-08-08 10:55:03 -07:00
Kang Tu
cb23362a5b handle UUID type field (some database like postgres support UUID type field) (#889) 2016-08-07 22:04:36 -07:00
Riccardo Magliocchetti
7c810dbd20 Miscellaneous style fixes spotted by landscape (#874) 2016-08-04 15:30:33 -07:00
Maxime Beauchemin
82a8e6316f [bugfix] refresh dashboard widget button doesn't work (#878) 2016-08-03 15:44:10 -07:00
Maxime Beauchemin
aaef338539 Altering theme for more subtle alerts / labels / buttons (#798)
* Altering theme for more subtle alerts / labels / buttons

* Taking comments into account

* changed button-primary to more sober grey instead of brand-primary
* remove carousel from theme demo page and other useless items

* Forcing links to be gray
2016-08-01 23:09:25 -07:00
Riccardo Magliocchetti
e7ce38b486 Smarter redirect on slice creation (#691)
After ea8a7ec1ba creating a slice
started redirecting to druid datasource from sqlalchemy tables.
That's quite painful for sqlalchemy tables users.
Instead of hardcoding a choice just query the db, if we don't
have any druid datasource fallback to sqlalchemy tables.
Bonus points we remove hacky javascript and make the message
translatable.

While at it fix druid client test to not hardcode datasource id.
2016-08-01 23:06:19 -07:00
George Ke
cbca740f9f use css transforms for dashboard grid cells (#848) 2016-08-01 23:02:54 -07:00
Riccardo Magliocchetti
55afda3a7e viz: use sort_values(inplace=True) instead of sort (#870) 2016-08-01 23:02:16 -07:00
Maxime Beauchemin
ee9141a31a New endpoint that receives SQL and returns data as JSON (#842)
* New endpoint that receives SQL and returns data as JSON

* Addressing comments
2016-07-29 22:39:33 -07:00
Hari Prasath R
299e31fdff Added order_by_cols to as_list. Fix to issue #821 (#823) 2016-07-28 11:51:21 -07:00
George Ke
f9427b9bfb Fix mapbox radius calculations being off when changing latitude (#824) 2016-07-28 11:50:39 -07:00
plumbeo
88726773f1 Add an option to allow users to choose to what IP address the web server must bind to. Default to 0.0.0.0 (all IP addresses). (#826) 2016-07-28 11:49:43 -07:00
x4base
29e3dd404d Let the user decide the label type of pie charts (#819) 2016-07-28 11:39:29 -07:00
Alanna Scott
1101de5ae4 [js linting] use airbnb eslint settings (#796)
* add airbnb eslint settings and lint all the code

* fix linting erros
2016-07-27 16:57:05 -07:00
x4base
f43e5f18d5 Support showing the values on top of the bars (#777) 2016-07-25 20:38:26 -07:00
Maxime Beauchemin
7dd5b6716e Fixing serializing the lazy string (#818) 2016-07-25 20:15:57 -07:00