Compare commits

..

1303 Commits

Author SHA1 Message Date
Gabriel Dutra
19343a0520 Clear QueryBasedParameterInput 2020-11-23 19:18:35 -03:00
Gabriel Dutra
c1ed8848f0 Merge branch 'master' into query-based-dropdown--parameters 2020-11-23 16:42:06 -03:00
Gabriel Dutra
b40070d7f5 Use LabeledValues for parameterized queries 2020-11-23 16:40:18 -03:00
Rafael Wendel
fa2b57a209 Remove unwanted props from Select component (#5277)
* Explicitly selected props so as to avoid errors from non-wanted props

* Simplified approach

* Ran prettier 😬

* Fixed minor issues
2020-11-22 13:07:56 -03:00
Jiajie Zhong
132fed64b3 Correct cleanup_query_results comment (#5276)
Correct comment from QUERY_RESULTS_MAX_AGE
to QUERY_RESULTS_CLEANUP_MAX_AGE
2020-11-20 23:11:13 +02:00
Gabriel Dutra
bd9ce68f68 Don't filter out values when param has search 2020-11-20 15:14:17 -03:00
Gabriel Dutra
0c0b62ae1a Remove searchTerm from structure 2020-11-20 15:13:47 -03:00
Gabriel Dutra
08bcdf77d0 Mock query instead of query_has_parameters 2020-11-12 09:11:54 -03:00
Gabriel Dutra
aa2064b1ab Fix other dropdown_values usages to use query obj 2020-11-11 13:58:01 -03:00
Gabriel Dutra
d0a787cab1 Make NoResultFound invalid parameters 2020-11-10 22:10:47 -03:00
Gabriel Dutra
a741341938 Oops 2020-11-10 20:46:51 -03:00
Gabriel Dutra
53385fa24b Merge branch 'master' into query-based-dropdown--parameters 2020-11-10 15:19:43 -03:00
Gabriel Dutra
fa7ecca485 Frontend updates from internal fork (#5259)
* DynamicComponent for QuerySourceAlerts

* General Settings updates

* Dynamic Date[Range] updates

* EmptyState updates

* Query and SchemaBrowser updates

* Adjust page headers and add disablePublish

* Policy updates

* Separate Home FavoritesList component

* Update FormatQuery

* Autolimit frontend fixes

* Misc updates

* Keep registering of QuerySourceDropdown

* Undo changes in DynamicComponent

* Change sql-formatter package.json syntax

* Allow opening help trigger in new tab

* Don't run npm commands as root in Dockerfile

* Cypress: Remove extra execute query
2020-11-10 14:59:15 +02:00
deecay
8f484706b1 Enable Boxplot to be horizontal (#5262) 2020-11-08 23:17:08 +02:00
Josh Bohde
e2e8714155 Enable graceful shutdown of rq workers (#5214)
* Enable graceful shutdown of rq workers

* Use `exec` in the `worker` command of the entrypoint to propagate
  the `TERM` signal
* Allow rq processes managed by supervisor to exit without restart on
  expected status codes
* Allow supervisorctl to contact the running supervisor
* Add a `shutdown_worker` command that will send `TERM` to all running
  worker processes and then sleep. This allows orchestration systems
  to initiate a graceful shutdown before sending `SIGTERM` to
  supervisord

* Use Heroku worker as the BaseWorker

This implements a graceful shutdown on SIGTERM, which simplifies
external shutdown procedures.

* Fix imports based upon review

* Remove supervisorctl config
2020-11-05 11:49:45 +02:00
Jerry
c6bf8a1c55 bugfix: fix #5254 (#5255)
Co-authored-by: Jerry <jerry.yuan@webweye.com>
2020-11-04 20:56:41 +02:00
Rafael Wendel
12f71925c2 Multiselect dropdown slowness (fix) (#5221)
* created util to estimate reasonable width for dropdown

* removed unused import

* improved calculation of item percentile

* added getItemOfPercentileLength to relevant spots

* added getItemOfPercentileLength to relevant spots

* Added missing import

* created custom select element

* added check for property path

* removed uses of percentile util

* gave up on getting element reference

* finished testing Select component

* removed unused imports

* removed older uses of Option component

* added canvas calculation

* removed minWidth from Select

* improved calculation

* added fallbacks

* added estimated offset

* removed leftovers 😅

* replaced to percentiles to max value

* switched to memo and renamed component

* proper useMemo syntax

* Update client/app/components/Select.tsx

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

* created custom restrictive types

* added quick const

* fixed style

* fixed generics

* added pos absolute to fix percy

* removed custom select from ParameterMappingInput

* applied prettier

* Revert "added pos absolute to fix percy"

This reverts commit 4daf1d4bef.

* Pin Percy version to 0.24.3

* Update client/app/components/ParameterMappingInput.jsx

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

* renamed Select.jsx to SelectWithVirtualScroll

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-11-03 21:50:39 +02:00
Omer Lachish
cae088f35b extend the refresh_queries timeout from 3 minutes to 10 minutes (#5253) 2020-11-02 22:36:57 +02:00
Rafael Wendel
a3c79f26b9 Fix for the typo button in ParameterMappingInput (#5244) 2020-10-29 17:24:13 -03:00
Jonathan Hult
c7c92a3192 Fix annotation bug causing queries not to run - ORA-00933 (#5179) 2020-10-28 10:03:26 +02:00
Rafael Wendel
55cf17aa47 added required to Form.Item and Input for better UI (#5231)
* added required to Form.Item and Input for better UI

* removed required from input

* Revert "removed required from input"

This reverts commit b56cd76fa1.

* Redo "removed required from input"

* removed typo

Co-authored-by: rafawendel2010@gmail.com <rafawendel>
2020-10-28 09:37:16 +02:00
Levko Kravets
8dd76a00c5 Fix dashboard background grid (#5238) 2020-10-26 21:46:38 +02:00
Christopher Grant
e242ac2b10 Static SAML configuration and assertion encryption (#5175)
* Change front-end and data model for SAML2 auth - static configuration

* Add changes to use inline metadata.

* add switch for static and dynamic SAML configurations

* Fixed config of backend static/dynamic to match UI

* add ability to encrypt/decrypt SAML assertions with pem and crt files. Upgraded to pysaml2 6.1.0 to mitigate signature mismatch during decryption

* remove print debug statement

* Use utility to find xmlsec binary for encryption, formatting saml_auth module

* format SAML Javascript, revert want_signed_response to pre-PR value

* pysaml2's entityid should point to the sp, not the idp

* add logging for entityid for validation

* use mustache_render instead of string formatting. put all static logic into static branch

* move mustache template for inline saml metadata to the global level

* Incorporate SAML type with Enabled setting

* Update client/app/pages/settings/components/AuthSettings/SAMLSettings.jsx

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

Co-authored-by: Chad Chen <chad.chen@databricks.com>
Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-10-25 12:06:45 -03:00
Gabriel Dutra
66463aedd4 Fix Home EmptyState help link (#5217) 2020-10-16 11:53:21 -03:00
Rafael Wendel
8a6524c1ba Add horizontal bar chart (#5154)
* added bar chart boilerplate

* added x/y manipulation

* replaced x/y management to inner series preparer

* added tests

* moved axis inversion to all charts series

* removed line and area

* inverted labels ui

* removed normalizer check, simplified inverted axes check

* finished working hbar

* minor review

* added conditional title to YAxis

* generalized horizontal chart for line charts, resetted state on globalSeriesType change

* fixed updates

* fixed updates to layout

* fixed minor issues

* removed right Y axis when axes inverted

* ran prettier

* fixed updater function conflict and misuse of getOptions

* renamed inverted to swapped

* created mappingtypes for swapped columns

* removed unused import

* minor polishing

* improved series behaviour in h-bar

* minor fix

* added basic filter to ChartTypeSelect

* final setup of filtered chart types

* Update viz-lib/src/components/visualizations/editor/createTabbedEditor.jsx

* added proptypes and renamed ChartTypeSelect props

* Add missing import

* fixed import, moved result array to global scope

* merged import

* clearer naming in ChartTypeSelect

* better lodash map syntax

* fixed global modification

* moved result inside useMemo

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
Co-authored-by: Levko Kravets <levko.ne@gmail.com>
2020-10-15 21:34:38 +03:00
Gabriel Dutra
9097feb100 Frontend updates from internal fork (#5209) 2020-10-15 14:25:22 -03:00
Gabriel Dutra
db4e97fa6f Remove build args from Cypress start script (#5203) 2020-10-09 12:23:14 -03:00
Levko Kravets
0d4615a482 Extra actions on Queries and Dashboards pages (#5201)
* Extra actions for Query View and Query Source pages

* Convert Queries List page to functional component

* Convert Dashboards List page to functional component

* Extra actions for Query List page

* Extra actions for Dashboard List page

* Extra actions for Dashboard page

* Pass some extra data to Dashboard.HeaderExtra component

* CR1
2020-10-09 12:12:56 +03:00
Alexander Rusanov
ff008a076b Updated Cypress to v5.3 and fixed e2e tests (#5199)
* Upgraded Cypress to v5.3 and fixed e2e tests

* Updated cypress image

* Fixed failing tests

* Updated NODE_VERSION in netlify

* Update client/cypress/integration/visualizations/choropleth_spec.js

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

* fixed test in choropleth

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-10-06 16:06:47 -03:00
Gabriel Dutra
8d548ecbac Share Embed Spec: Make sure query is executed (#5191) 2020-10-04 16:01:30 +03:00
Gabriel Dutra
2992c382d1 ScheduleDialog: Filter empty interval groups (#5196) 2020-10-03 05:54:05 +03:00
Gabriel Dutra
f4dcb2918a Move Cypress to dev dependencies (#3991)
* Test Cypress on package list

* Skip Puppeteer Chromium as well

* Put back missing npm install on netlify.toml

* Netlify: move env vars to build.environment

* Remove cypress:install script

* Update Cypress dockerfile

* Copy package-lock.json to Cypress dockerfile
2020-09-29 09:51:28 +03:00
Gabriel Dutra
c821cab4cb Generate Code Coverage report for Cypress (#5137) 2020-09-28 21:43:04 -03:00
Levko Kravets
4fb77867b0 Align Y axes at zero (#5053)
* Align Y axes as zero

* Fix typo (with @deecay)

* Add alignYAxesAtZero function

* Avoid 0 division

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-09-28 13:12:40 +03:00
Levko Kravets
a473611cb0 Some Choropleth improvements/refactoring (#5186)
* Directly map query results column to GeoJSON property

* Use cache for geoJson requests

* Don't handle bounds changes while loading geoJson data

* Choropleth: fix map "jumping" on load; don't save bounds if user didn't edit them; refine code a bit

* Improve cache

* Optimize Japan Perfectures map (remove irrelevant GeoJson properties)

* Improve getOptions for Choropleth; remove unused code

* Fix test

* Add US states map

* Convert USA map to Albers projection

* Allow to specify user-friendly field names for maps
2020-09-24 14:39:09 +03:00
Levko Kravets
210008c714 Ask user to log in when session expires (#5178)
* Ask user to log in when session expires

* Update implementation

* Update implementation

* Minor fix

* Update modal

* Do not intercept calls to api/session as Auth.requireSession() relies on it

* Refine code; adjust popup size and position
2020-09-23 16:30:08 +03:00
Omer Lachish
aa5d4f5f4e add 'cancelled' meta directive to all cancelled jobs (#5187) 2020-09-23 12:54:48 +03:00
Omer Lachish
6b811c5245 Refresh CSRF tokens (#5177)
* expire CSRF tokens after 6 hours

* use axios' built-in cookie to header copy mechanism

* add axios-auth-refresh

* retry CSRF-related 400 errors by refreshing the cookie

* export the auth refresh interceptor to support ejecting it if neccessary

* reject the original request if it's unrelated to CSRF
2020-09-21 23:21:14 +03:00
Levko Kravets
83726da48a Keep additional URL params when forking a query (#5184) 2020-09-21 12:54:55 +03:00
Levko Kravets
72dc157bbe Allow to clear selected tags on list pages (#5142)
* Convert TagsList to functional component

* Convert TagsList to typescript

* Allow to unselect all tags

* Add title to Tags block and explicit "clear filter" button

* Some tweaks
2020-09-17 14:01:15 +03:00
Lingkai Kong
1b8ff8e810 Add default limit (1000) to SQL queries (#5088)
* add default limit 1000

* Add frontend changes and connect to backend

* Fix query hash because of default limit

* fix CircleCI test

* adjust for comment
2020-09-14 14:18:31 +03:00
Omer Lachish
31ddd0fb79 prevent assigning queries to view_only data sources (#5152) 2020-09-10 15:43:25 +03:00
Levko Kravets
5cabf7a724 Keep selected filters when switching visualizations (#5146)
* getredash/redash#4944 Query pages: keep selected filters when switching visualizations

* Pass current filters to expanded widget modal
2020-09-10 13:42:53 +03:00
max-voronov
59b135ace7 Move CardsList to typescript (#5136)
* Refactor CardsList - pass a suffix for list item

Adding :id to an item to be used as a key suffix is redundant and the same
can be accomplished by using :index from the map function.

* Move CardsList to typescript

* Convert CardsList component to functional component

* CR1

* CR2
2020-09-05 20:08:01 +03:00
Gabriel Dutra
32b41e4112 Misc frontend changes from internal fork (#5143) 2020-09-04 08:00:30 -03:00
Gabriel Dutra
2e31b91054 Antd v4: Fix CreateUserDialog (#5139)
* Antd v4: Update CreateUserDialog

* Add Cypress test for user creation
2020-09-04 07:57:43 -03:00
Gabriel Dutra
205915e6db Add toggle to disable public URLs (#5140)
* Add toggle to disable public URLs

* Add Cypress tests
2020-09-01 08:49:30 -03:00
Levko Kravets
b7c245f925 Support multiple queries in a single query box (#5058)
* Support multiple queries in a single query box

* Implement statement splitting function and add tests for it

* Add a test for databricks-specific syntax

* Split statements before running query
2020-08-30 15:54:16 +03:00
Levko Kravets
681b2f1abd Introduce Link component (#5122)
* Introduce Link component

* Use Link component for external links as well

* Remove unused file (I hope it's really not needed)

* Use Link component in visualizations library

* Simplify Link component implementation

* CR1

* Trigger build

* CR2
2020-08-30 15:33:38 +03:00
Gabriel Dutra
a31196aef8 Upgrade Ant Design to v4 (#5068) 2020-08-25 14:24:15 -03:00
Arik Fraimovich
596e5bee3a Misc changes to codebase back ported from internal fork - part 2 (#5130)
* Auth: make login url configurable.

* More portable image url.

* durationHumanize: support for milliseconds.

* Sorter: support for custom sort.
2020-08-25 15:08:07 +03:00
Arik Fraimovich
84d516bfd1 Misc changes to codebase back ported from internal fork (#5129)
* Set corejs version in .babelrc so Jest doesn't complain.

* Rewrite services/routes in TypeScript.

* Add TypeScript definitions for DialogComponent.

* Make image paths more portable

* Add current route context and hook.

* Make EmptyState more flexible by being able to pass in getSteps function.

* Rewrite ItemsList in TypeScript.

* Introduce the possibility to add custom sorters for a column.

* Rearrange props to be friendly to TypeScript.

* Type definitions for NotificationApi.

* Use Databricks query editor components for databricks_internal type of query runner.

* URL Escape password in Alembic configuration.

* Compare types in migrations.
2020-08-25 14:11:38 +03:00
Gabriel Dutra
2cc3bd3d54 Add DynamicComponent to PermissionsControl flag (#5116) 2020-08-21 17:14:19 -03:00
Gabriel Dutra
ac652c20bf Fix create link on data sources page (#5121)
* Fix create link on data sources page

* Cypress: Add test that the source dialog opens
2020-08-21 16:47:42 -03:00
Gabriel Dutra
1bc6cd8f41 Keep widget loading when fetch request is replaced (#5118) 2020-08-20 19:00:57 -03:00
Levko Kravets
4c70b5ce8e Remove content width limit on all pages (#5091)
* Remove content width limit on all pages

* Update client/app/assets/less/inc/base.less

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

* Remove content limit; limit sidebar width

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-08-20 15:04:53 +03:00
Omer Lachish
de052ff02b Cypress touch-ups (#5109)
* allow non-sequential IDs for DataSources in Cypress tests

* refactor redash-api to a set of Cypress commands

* support mounting Redash endpoints in Cypress routes

* fix some parameter specs by waiting for schema to load

* extract baseUrl from cypress.json

* Restyled by prettier (#5110)

Co-authored-by: Restyled.io <commits@restyled.io>

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2020-08-19 21:00:06 +03:00
Gabriel Dutra
a596d6558c Use Skeleton as ItemsList loading state (#5079) 2020-08-19 09:36:11 -03:00
Gabriel Dutra
fc71acdc09 Make DataSourceListComponent a dynamic component (#5113) 2020-08-19 08:59:53 -03:00
Gabriel Dutra
b326d36ae8 Update Organization Settings (#5114)
* Update Organization Settings

* Cypress: Update tab naming
2020-08-19 13:09:28 +03:00
Omer Lachish
378cc57d42 CSRF Exempts (#5108)
* if present, always convert CSRF cookies to headers

* exempt auth blueprints from CSRF protection

* respect CSRF exempts
2020-08-17 22:39:46 +03:00
peterlee
83c6a6bcd2 Make table visualization header fixed (#5103)
* add lock table header

* Move styling to a new class

* Update renderer.less

* Move class to table and fix top border

* Update renderer.less

* Update viz-lib/src/visualizations/table/renderer.less

Thanks, this change is good to me.

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-08-17 09:26:34 -03:00
Omer Lachish
5afd0554d0 Add support for CSRF tokens (#5055)
* add flask-wtf

* add CSRF tokens to all static forms

* add CSRF tokens to all axios requests

* disable CSRF validation in unit tests

* support CSRF-protected requests in *most* cypress tests

* don't enfroce CSRF checks by default

* avoid CSRF enforcement in unit tests

* remove redundant spread

* some camel casing hiccups

* always yield the CSRF cookie, but avoid enforcing it if CSRF toggle is off

* Restyled by prettier (#5056)

Co-authored-by: Restyled.io <commits@restyled.io>

* set a CSRF header only if cookie is present

* enforce CSRF in CI

* install lodash directly for Cypress

* install request-cookies directly for Cypress. We should probably start loading package.json deps

* enable CSRF support when logout and login happen within the same spec

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2020-08-09 15:47:00 +03:00
Levko Kravets
eb603f63f0 Bar chart with second y axis overlaps data series (#4150) 2020-08-05 20:28:03 +03:00
Arik Fraimovich
6c00f7c4e3 Add: periodic job to remove ghost locks. (#5087) 2020-08-05 17:48:19 +03:00
koooge
f56f4c4899 fix: Compose version due to --build-arg (#5083)
Signed-off-by: koooge <koooooge@gmail.com>
2020-08-05 12:41:25 +03:00
Tobias Macey
d3b639a68a Exposing setting for overriding template directory (#4324)
When using some of the customized login flows such as `REMOTE_USER` the deployed site breaks due to not finding template files. This change updated the app default to use the existing Flask templates directory rather than the compiled static assets directory which only contains an index.html file.
2020-08-04 12:05:43 +03:00
Gabriel Dutra
3332b656ac Make sure Policy is loaded for user session (#5081) 2020-07-31 01:39:30 -03:00
Gabriel Dutra
24c95379ca Introduce caching to the Databricks Schema Browser (#5038)
* Add refresh button in the bottom

* Add caching

* Drop allSettled

* Simplify refresh button

* Update error to return 500

* Load tables before loading columns

* Don't mutate schema

* Reset db name and schemas when changing data source

* Load both tables and columns

* Return error with code 200

* Code review updates

* Add expiration time to the cache Keys

* Back with RQ
2020-07-30 15:16:14 +03:00
Levko Kravets
93b4be672f Queries list: move "My Queries" above "Archived" (#5072) 2020-07-28 19:53:22 +03:00
Gabriel Dutra
f3a47a9658 Move page size select to the Paginator component (#5064) 2020-07-27 16:52:09 -03:00
Omer Lachish
7804dfd68e loosen up some proptypes and backend casting to allow different primary key types (#5066) 2020-07-27 17:01:59 +03:00
Ben Amor
2dacd08bea Add override mechanism for webpack config (#5057) 2020-07-27 14:52:02 +03:00
Gabriel Dutra
fd76a2ecfb Add Column Type to Databricks schema browser (#5052)
* Add Column Type to Databricks schema browser

* Map schema columns to be an object

* Format pg with Black

* Add data_type for Postgres
2020-07-23 12:52:09 +03:00
Omer Lachish
7f98d7b694 Load extensions on db init (#5062)
* Only try to create tables and stamp DB if not tables exist already.

* load extensions when creating the database
2020-07-23 11:05:20 +03:00
Levko Kravets
a1255b4144 Fix wrong Y-axis range for stacked bar chart (#5029)
* getredash/redash#5026 Fix wrong Y-axis range for stacked bar chart

* Update tests

* Use Plotly's built-in algorinthm to compute Y-axis range

* Update tests

* Revert previous solution (yRange-related code)

* Revert other unrelated changes

* Revert other unrelated changes

* Move chart rendering to own file and ensure that rendering steps will occur in necessary order

* Reduce amount of plot updates by mergin separate updates into a sigle cumulative update

* Give better names for several functions
2020-07-17 11:28:15 +03:00
dependabot[bot]
6c349ea70a Bump lodash from 4.17.15 to 4.17.19 in /viz-lib (#5051)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-16 22:41:16 -03:00
Omer Lachish
95c28c47ad Eager load outdated queries (#5049)
* eager load outdated queries

* explicitly use .all() instead of list()
2020-07-16 23:29:47 +03:00
simonschneider-db
48924de700 Add TypeScript support (#5027)
* TASK Add typescript dependencies to package.json

* TASK Add typescript to build process and npm scripts and TASK Move example components to typescript and add an example definition file.

* TASK Move back to ts-loader instead of babel typescript preset

* FIX Remove unnecessary changes

* FIX Explicitly mention tsconfig file in webpack.config.js to avoid `error while parsing tsconfig.json, The 'files' list in config file 'tsconfig.json' is empty`
See (https://github.com/TypeStrong/ts-loader/issues/405#issuecomment-330108362)

* FIX Move tsconfig to client subdirectory to make it accessible in docker container (only webpack.config.js is copied over from root folder in Dockerfile)

* TASK Move from ts-loader to babel to reduce compatibility issues between ES6/7 and typescript compilation.

* TASK Add types for classnames, hoist-non-react-statics and lodash. Fix default export of DashboardList and run prettier on eslintrc

* Run npm install

* Trigger tests

* Run npm install 2

* Trigger tests
2020-07-16 23:05:44 +03:00
Jannis Leidel
41a691328a Fix bundle-extensions script to work on recent importlib-resources. (#5050)
Also adds a test case for running the script.
2020-07-16 23:05:22 +03:00
Omer Lachish
cb97364771 Dashboard URL does not show new name when dashboard name is updated (#1009)
* on dashboard api calls - take the id from the beginning of the slug, unless there is no number in it - in that case, take the entire slug as id

* add dashboard id when showing links to dashboards

* change path to include new name when renaming dashboards

* move slug generation to backend

* redirect to new name after changing (this time with a proper promise)

* oh right, we already have a slug function

* add spec that makes sure that renamed dashboards are redirected to the
url which contains their new name

* use id-slug in all Cypress specs

* move dashboards from /dashboard/:slug to /dashboards/:id-:name_as_slug

* Update dashboard url as its name changes

* Update separator to be "/"

* Update missing dashboard urls

* Update api not to depend on int id

* Use '-' instead of '/' as separator and update Dashboard.get calls

* slug -> name_as_slug

* Keep slug urls on cypress

* Update route path

* Use legacy attr for GET

* Use getter for urlForDashboard

* Update dashboard url when loaded by slug

* Update Dashboard routes to use id instead of slug

* Update Dashboard handler tests

* Update Cypress tests

* Fix create new dashboard spec

* Use axios { params }

* Drop Ternary operator

* Send updated slug directly in 'slug' attr

* Update multiple urls Dashboard test name

* Update route names

Co-authored-by: Levko Kravets <levko.ne@gmail.com>

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
Co-authored-by: Levko Kravets <levko.ne@gmail.com>
2020-07-16 23:03:59 +03:00
Gabriel Dutra
d12691dc2a Databricks Schema Browser: Allow eventlet worker instead of RQ (#5045)
* Add loading button in UI

* Handle databricks schema requests without RQ

* Don't use gevent worker

* Revert "Don't use gevent worker"

This reverts commit 9704c70a94.

* Use eventlet

* Use first column instead of 'namespace' one

* Revert "Add loading button in UI"

This reverts commit c0e4dfb966.

* Remove databricks tasks

* Update eventlet

* Add libevent

* Display logs on failure

* Revert "Add libevent"

This reverts commit a00d067cb7.

* Test updating gunicorn

* Don't set eventlet as the default for Redash

Co-authored-by: Arik Fraimovich <arik@arikfr.com>

* Remove fetchDataFromJob usage

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-07-15 17:35:59 +03:00
Levko Kravets
6f9e79c641 getredash/redash#5031 Counter is too large on Query View/Source pages (#5044) 2020-07-14 21:56:01 +03:00
Gabriel Dutra
461f98bbfc Update Ace Editor version (#5041) 2020-07-14 10:02:33 -03:00
Levko Kravets
81e7c72d48 Allow to change order of legend items (#5021)
* Allow to change order of legend items

* Update tests
2020-07-13 19:08:51 +03:00
Gabriel Dutra
328f0f3f0c Visualizations Library: Enhance docs (#4946) 2020-07-12 12:36:03 -03:00
Omer Lachish
ecb9adf903 purge_failed_jobs can take up to several minutes, so better have a proper timeout (#5033) 2020-07-12 10:18:38 +03:00
Gabriel Dutra
87e09f676e Dynamic Form: Make default extra fields state a prop (#5039) 2020-07-09 12:39:25 -03:00
Gabriel Dutra
6fc5c803e0 Fix schema browser items height (#5024) 2020-07-08 11:55:10 -03:00
Gabriel Dutra
6c57aa448e Query Source: Add Shift+Enter shortcut for query execution (#5037) 2020-07-08 10:36:16 -03:00
Lei Ni
878b297601 Fix: sorting queries by schedule was resulting in a wrong order (#4954)
* fix schedule sorting issue

* style change

* Update to meet code style.

* move the schedule sort to backend

* mod comment

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-07-07 21:29:12 +03:00
Levko Kravets
9c0450c84e Explicitly sort routes to reduce a chance of conflicts (#5020)
* Explicitly sort routes to reduce (avoid at all?) a chance of conflicts

* Sort routes by params count
2020-07-03 21:11:39 +03:00
Levko Kravets
74f206614f Refactor: extract commonly used pattern into hook (#5022) 2020-07-03 10:44:51 +03:00
Gabriel Dutra
2f26cf791c Fix Databricks Schema Browser scrollbar (#5023) 2020-07-02 17:20:22 -03:00
Levko Kravets
c6be5758ad Y-axis autoscale fails when min or max is set (#4904)
* getredash/redash#4784 Y-axis autoscale fails when min or max is set

* Update tests

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-07-02 20:33:20 +03:00
Alex Kovar
8341592b05 Add plus between tags to clarify how they are used #4628 (#5017)
Co-authored-by: Levko Kravets <kravets-levko@users.noreply.github.com>

Co-authored-by: Levko Kravets <kravets-levko@users.noreply.github.com>
2020-07-02 18:44:38 +03:00
Gabriel Dutra
a7edbf1e8d Handle React exception when a function is provided (#5016) 2020-07-01 22:53:42 -03:00
Gabriel Dutra
217f41b586 Allow GET from non-admins on data source resource (#4992) 2020-07-01 10:10:24 -03:00
Gabriel Dutra
a8bd07e293 Databricks custom Schema Browser (#5010) 2020-07-01 10:09:18 -03:00
Omer Lachish
332c16b130 add a couple of missed custom key types hooks (#5014) 2020-07-01 12:39:46 +03:00
Vladislav Denisov
7940d36616 Python query runner fix (#4966)
* fixed print method

* fixed `.items()` error

* added extra builtins

* added guarded_unpack_sequence
2020-07-01 10:53:27 +03:00
Daniel Lang
68b70ed63b Fixed broken custom JS visualization settings (#5013) 2020-07-01 01:22:07 -03:00
Gabriel Dutra
e0297835df Add "Last 12 months" option to dynamic date ranges (#5004) 2020-06-30 09:56:00 -03:00
Omer Lachish
004bc7a2ac Custom primary/foreign key types (#5008)
* allow overriding the type of key used for primary/foreign keys of the different models

* rename key_types to singular key_type

* add some documentation for `database_key_definitions`
2020-06-30 15:08:28 +03:00
Gabriel Dutra
efcf22079f Allow private addresses when enforcing is disabled (#4983) 2020-06-30 10:54:49 +03:00
Levko Kravets
a83cb18cc5 Textbox: confirm close if text was changed (#5009)
* Textbox: confirm close if text was changed

* Update texting (with @gabrieldutra)

* Update texting

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-06-29 19:29:56 +03:00
Levko Kravets
1ecdf7b853 Too large visualization cause filters block to collapse (#5007) 2020-06-29 15:20:08 +03:00
Omer Lachish
90024ebc92 Delete locks for cancelled queries (#5006)
* delete locks for cancelled queries

* test that query cancellations do not prevent reenqueues
2020-06-29 13:09:01 +03:00
Gabriel Dutra
a37b7babbf Remove pace-progress (#4990) 2020-06-28 15:27:48 -03:00
Mike Nason
8f4ac958b1 Fix org option in users create_root cli command (#5003)
Thanks @nason 👍
2020-06-25 22:02:46 +03:00
Omer Lachish
637d9837f4 Avoid purging operational queues (#4973)
* avoid purging operational queues

* schema queues actually run queries, so they should be purged
2020-06-25 15:35:50 +03:00
Levko Kravets
bdd3c3e735 Dynamically register frontend routes (#4998)
* Allow to override frontend routes

* Configure app before initializing ApplicationArea

* Refine code
2020-06-25 13:38:23 +03:00
Levko Kravets
6fc35510d3 Allow unregistering settings tabs (#5000) 2020-06-25 12:54:46 +03:00
Levko Kravets
6f842ef94a Refactor User Profile page and add extension points to it (#4996)
* Move components specific to UserProfile page to corresponding folder

* Split UserProfile page into components

* Rename components, refine code a bit

* Add some extension points

* Fix margin
2020-06-25 12:03:19 +03:00
Levko Kravets
a563900f0a Refactor Organization Settings and add extension points to it (#4995)
* Split OrganizationSettings page into components

* Update change handling: use objects instead of string keys, move some logic to more appropriate place

* Convert OrganizationSettings page to functional component and refine code a bit

* Add some extension points

* Improve onChange handler

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-06-24 12:36:45 +03:00
Gabriel Dutra
ee3930c64d Catch QueryResultError on widget load (#4991) 2020-06-23 19:48:14 -03:00
Levko Kravets
10bff8b3b1 Some permissions fixes (#4994)
* Don't show New ... buttons on list pages if user doesn't have corresponding permissions

* Hide Create menu item if no create actions available
2020-06-23 22:56:24 +03:00
Jim Sparkman
a8510d1ad5 Fix CLI command for "status" (#4989)
* Fix CLI command for "status"

CLI command "status" can fail due to incorrect connection information to RQ.

This change matches the behavior from line 65 and solves the connection error.

* Move connection up to CLI entrypoint
2020-06-23 14:40:36 +03:00
Levko Kravets
3a543a4ab2 ErrorMessage is not centered (#4981)
* ErrorMessage is not centered

* Adjust ErrorMessage size on large screens

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-06-18 15:35:51 +03:00
Levko Kravets
2b1ba1ee33 Add New Dashboard/Query/Alert buttons to corresponding list pages (#4976) 2020-06-18 15:23:48 +03:00
Levko Kravets
4a54ad9d06 Add/Edit Tags dialog does not set focus on tags input (#4979)
* Refactor: convert EditTagsDialog to functional component; properly cleanup on destruction

* Pass focus to select when EditTagsDialog opens
2020-06-18 15:05:07 +03:00
Levko Kravets
676f560830 Navbar: show correct settings link for non-admin users (#4978)
* Non-admin users have an access to some settings, so need to show correct menu item in navbar

* Refine settings test

* Add some tests
2020-06-18 14:49:08 +03:00
Levko Kravets
98a5154345 Fix headless mode (didn't work with vertical navbar) (#4977)
* Fix headless mode (didn't work with vertical navbar)

* Fix header margins on public dashboard page

* Fix test
2020-06-17 11:10:12 +03:00
Gabriel Dutra
4c324ddc80 Custom Query components per Data Source type (#4948) 2020-06-15 16:13:10 -03:00
Gabriel Dutra
05c2233782 Don't reuse getErrorMessage (#4968) 2020-06-15 07:45:02 -03:00
Levko Kravets
0ac24e38a1 Vertical navbar (#4859)
* Vertical navbar

* Update vertical menu look and add create menu.

* Make query editor work with vertical nav.

* Dark mode

* Fix create menu & make sidebar fixed.

* Update Alert pages layout

* Update System status pages

* Update Queries and Dashboards list pages

* Update Query Source and Query View pages

* Use dark theme for mobile navbar

* Update Dashboard page: fix Add widget/textbox panel positioning

* Dashboard page: fix layout issues when container changes its size (fixes known issues: navbar expand/collapse, scrollbar appears/hides)

* Fix dashboard page sticky header (there was a 15px space above it)

* Fix embeds

* Extract desktop navbar component; move mobile navbar and its styles to ApplicationLayout folder

* Remove old app header

* Fix tests

* Restore version info block

* Make Percy capture entire page

* Make vertical navbar expand/collapse animation smoother (as it's currently impossible to disable it :-( )

* Fix misc UI issues (show Create label on expanded menu; fix some CSS; don't select items on click)

* Allow to override navbars with DynamicComponent

* Fix misc UI issues: expand/collapse button animation, menu items styles, menu expand/collapse animation

* Hide submenu arrow; show username when menu is expanded

* Refine CSS and make it more isolated; adjust colors

* Update tests

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-06-15 10:01:49 +03:00
Arik Fraimovich
d036df0ca1 V9 changelog (in master) (#4967)
* V9 Changelog: Initial Draft from Jesse

* V9 Changelog: Add later updates

* Adjust title spacing

* Apply Jesse's suggestions

Co-authored-by: Jesse <jesse@whitehouse.dev>

* provide an explanation on how to switch from Celery to RQ when upgrading to v9

* Update CHANGELOG.md

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

* Add contributor names

* Update version.

* Update CHANGELOG

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
Co-authored-by: Jesse <jesse@whitehouse.dev>
Co-authored-by: Omer Lachish <omer@rauchy.net>
2020-06-11 12:33:36 +03:00
Gabriel Dutra
56df870f39 Plotly Charts: use .legend to determine legends size (#4935)
* Plotly Charts: use .bg to determine legends size

* Test: remove hack for legend below plotly

* Revert "Test: remove hack for legend below plotly"

This reverts commit d8efb0c032.

* Use .legend to calculate bounds

* Also update plots without legend
2020-06-11 12:30:55 +03:00
Arik Fraimovich
05540164e1 Small updates to Dockerfile (#4964) 2020-06-11 12:28:59 +03:00
Gabriel Dutra
bdb62365b1 Fix Sankey issue to render 1 and 5 stages (#4965)
* Sankey: Make sure last stage has "Exit"

* Sankey: Use 2 as min stage width size to render

* Use null instead of "Exit"

* Add comment about corresponding exit node

* Add multiple stages on Cypress test
2020-06-11 12:28:45 +03:00
Gabriel Dutra
6a12168f40 Make sure page updates when 'routes' changes (#4962) 2020-06-09 15:43:23 -03:00
Gabriel Dutra
ac0b494953 Fix Destination not returning custom error message (#4959) 2020-06-09 11:14:29 -03:00
Gabriel Dutra
77e8d70a64 Make sure queries have options and parameters (#4952) 2020-06-09 11:13:42 -03:00
Rob Hudson
8597b727a7 Update requirements_bundles versions and comment (#4939) 2020-06-09 13:38:29 +02:00
Omer Lachish
e233611840 Fix wrong Sentry exception messages on invalid parameters (#4945)
* don't join underlying exception message with commas when invalid parameter errors happen

* Revert "don't join underlying exception message with commas when invalid parameter errors happen"

This reverts commit 71a21b7ce6.

* when a problem occurs during refresh_queries, report it as a RefreshQueriesError
2020-06-07 13:05:31 +03:00
Gabriel Dutra
dd6098d405 MongoDB: Only set readPreference when it has one (#4947)
* MongoDB: Only set readPreference when it has one

* Use .get for readPreference
2020-06-07 12:39:43 +03:00
Omer Lachish
d38d3b6b4d support comma-separated queue lists for backward compatability (spaces are still supported) (#4937) 2020-06-03 15:13:52 +03:00
Gabriel Dutra
100c7be5e0 Return cached data source schema when available (#4934) 2020-06-02 11:26:53 +03:00
chulucninh09
733bc1c109 fix strftime format notation for second and millisecond (#4922) 2020-05-31 22:23:42 +03:00
Saravanan Selvamohan
19cc7f1be8 Added correct usage of the article (#4911)
Add an article - the level
Correct article usage - a schema browser
Consider adding hyphen - ready-made
Removed comma - environment
2020-05-31 22:22:01 +03:00
Arik Fraimovich
43e5c2aa11 Fix: auto hide Plotly Modebar (#4930)
* Only set value for displayModeBar if we want to hide it

* Update viz-lib/src/visualizations/chart/Renderer/PlotlyChart.jsx
2020-05-31 21:18:52 +03:00
Gabriel Dutra
376b317e2e Update requests usages not to allow redirects (#4924)
* Update requests usages not to allow redirects

* Remove type from super()

Co-authored-by: Jannis Leidel <jannis@leidel.info>

Co-authored-by: Jannis Leidel <jannis@leidel.info>
2020-05-31 12:49:39 +03:00
Levko Kravets
d550427485 Fork button disabled on View Query page for non-admin users (#4927) 2020-05-29 11:41:07 +03:00
Ievgen Aleinikov
d1044c1963 Athena: set query cost (#4077) 2020-05-27 13:16:46 +03:00
Gabriel Dutra
46e18b0c6f Use memoized query result data (#4920) 2020-05-26 11:30:31 -03:00
Levko Kravets
38dd3ff248 Fix flaky Map (Markers) tests (#4915)
* Fix flaky Map (Markers) tests

* Fix flaky Choropleth tests
2020-05-26 10:57:08 +03:00
Gabriel Dutra
6bac19c1e4 Use Antd Descriptions on Details visualization (#4914)
* Use Antd Descriptions for Details visualization

* Update styling

* Add some spacing to pagination
2020-05-26 09:52:03 +03:00
Gabriel Dutra
ce6bc2d64a Update antd to v3.26.17 (#4913)
* Update antd to v3.26.17

* Remove custom bg color for danger button

* Update ScheduleDialog snapshot
2020-05-24 22:28:39 +03:00
Gabriel Dutra
27c4992003 Use lambda on options for destinations factory (#4912) 2020-05-24 22:22:01 +03:00
Gabriel Dutra
13e454de86 Update Query Page shortcuts for MacOS (#4910)
* Add Ctrl+Enter to run queries (for Mac)

* Check altKey and show as "Option" key when for Mac
2020-05-24 11:19:50 +03:00
Levko Kravets
f4c9d7db1a getredash/redash#4692 When resizing chart to a certain size it errors out (#4907) 2020-05-24 11:17:25 +03:00
Gabriel Dutra
0d11d7bec2 Change visualizations build to be on postinstall instead of preinstall (#4909) 2020-05-22 11:07:52 -03:00
Arik Fraimovich
ec68e8bba3 Fix: table viz crashing when search is enabled (#4899)
* Fix: table viz crashing when search is enabled

* Replace that weird hack with more controlled code

* Don't clear search input, apply search when data changes

Co-authored-by: Levko Kravets <levko.ne@gmail.com>
2020-05-21 11:13:36 +03:00
chulucninh09
831512e52d Fix: front-end error when parse python float nan (#4903)
* float nan or inf will be serialized as null instead of NaN

* Re-implement float nan serialization fix for consistency
2020-05-21 11:12:19 +03:00
Patrick Yang
dfc873fb8b Add additional statsd metrics for worker/scheduler (#4884)
* Add additional statsd metrics for worker/scheduler
2020-05-20 14:35:55 -07:00
koooge
b117485571 chore: Skip dev install in frontend testing (#4897)
Signed-off-by: koooge <koooooge@gmail.com>
2020-05-20 13:14:28 +03:00
Gianni Moschini
3661d6cbc5 Remove heroku bin/pre_compile file (#4900) 2020-05-20 13:02:39 +03:00
Jannis Leidel
a2217cc4ec Set the schema item title attribute correctly. (#4892)
Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-05-15 15:04:00 -03:00
Gabriel Dutra
a7ea94f69a Pin @percy/agent version and update Cypress (#4896) 2020-05-15 14:22:43 -03:00
Gabriel Dutra
8010781f0d Add private address check to BaseHTTPQueryRunner (#4885)
Co-authored-by: Arik Fraimovich <arik@arikfr.com>

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-05-14 09:56:22 +03:00
Gabriel Dutra
7c8874b8ee Fix HelpTrigger in header not working (#4887) 2020-05-12 12:56:04 -03:00
Arik Fraimovich
8907a86e33 Make frontend build in Docker image optional (#4879)
* Add build arg to Dockerfile to control if we should build frontend assets

* Move more env settings into the shared one.

* Use build arg in docker-compose to skip frontend build.

* CirlceCI: Skip building frontend assets in backend tests

* Create dummy template files

* Expand file names manually.

* Add build arg to skip dev dependencies.

* Update Dockerfile

* Reverse logic of skip_dev_deps to what it should be.
2020-05-12 16:46:53 +03:00
Gabriel Dutra
22f0030864 Add release to html webpack config (#4883)
Co-authored-by: Arik Fraimovich <arik@arikfr.com>

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-05-12 10:55:48 +03:00
Gabriel Dutra
baf16d2501 Oracle: Encoding fix (#4882)
* Oracle: Encoding fix

Co-authored-by: Arik Fraimovich <arik@arikfr.com>

* Update redash/query_runner/oracle.py

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-05-12 10:54:32 +03:00
Gabriel Dutra
0446080d3f Yandex Metrica: rename .host to .url. (#4880)
Co-authored-by: Arik Fraimovich <arik@arikfr.com>

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-05-12 10:42:07 +03:00
Arik Fraimovich
a8a2964cb0 Make the Databricks driver URL and environment variable (#4878)
* Make the Databricks driver URL and environment variable

* Replace ENV with ARG
2020-05-11 13:24:11 +03:00
Omer Lachish
9562718a6a Run queries through ad-hoc SSH tunnels (#4797)
* run queries through adhoc SSH tunnels

* reduce indent by losing try/else clause

* document host/port getters and setters

* handle forceful schema refreshes in RQ and poll for their results using the /jobs endpoint

* set schema refresh timeout to 5 minutes

* Restyled by prettier (#4847)

Co-authored-by: Restyled.io <commits@restyled.io>

* send schema refresh errors as part of API response

* Use correct get_schema call.

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-05-11 13:22:40 +03:00
Takuya Arita
e470347d7f Refactor docker-compose.yml for development (#4544)
* Update description for the new setup repository

* Refactor docker-compose.yml for development

* Use Docker Compose file v2
2020-05-11 13:01:32 +03:00
Gabriel Dutra
76aeab02eb Postgres: Add support for uploading SSL certs (#4871)
Co-authored-by: Arik Fraimovich <arik@arikfr.com>

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-05-08 09:42:00 +03:00
Gabriel Dutra
9568c74fd0 Sentry's Performance tracing (#4872)
* Upgrade sentry-sdk

Co-authored-by: Arik Fraimovich <arik@arikfr.com>

* Move traces sample rate to configuration

Co-authored-by: Arik Fraimovich <arik@arikfr.com>

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-05-08 09:40:20 +03:00
Gabriel Dutra
57287b2c0b Fix: there is no host field. (#4873)
Co-authored-by: Arik Fraimovich <arik@arikfr.com>

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-05-08 09:39:22 +03:00
Gabriel Dutra
6d857588a1 Log data source id on errors (#4874)
Co-authored-by: Omer Lachish <omer@rauchy.net>

Co-authored-by: Omer Lachish <omer@rauchy.net>
2020-05-08 08:59:06 +03:00
Levko Kravets
dc49585320 Add option to explicitly set chart legend position (#4865)
* Add option to explicitly set chart legend position

* Revert some chanes in order to fix tests

* Leave only "auto" and "below the plot" legend placement options

* Move Show legend checkbox to select; fix spelling
2020-05-07 17:21:31 +03:00
Gabriel Dutra
fc246aafc4 Separate visualizations into their own package (#4837)
* Add visualizations project settings

* Move visualizations to redash-visualizations

* Delete shared components

* Remove antd from deps

* Remove p-r-5 from table utils

* Remove visualization deps from package.json

* Rename package and change its version

* Test preinstall script

* Update Dockerfile build for frontend

* Test adding dockerignore

* Update jest tests

* Add step for jest tests

* Include viz-lib on dev commands

* User prettier v1 for now

* Delete unused libs on the app

* Add readme draft (to be finished)

* Add getOptions to Editor

* Add required libraries and finish basic example

* Bump version
2020-05-06 10:49:15 +03:00
Gabriel Dutra
4f8d2caed4 Cypress: Add tests for Filters (#4757) 2020-05-05 01:12:01 -03:00
Levko Kravets
27eab28405 Search in navbar works only for first search term (#4857)
* Queries list page: react on search term change (from navbar)

* Items List components: update search input value when changed "outside"

* Code style
2020-05-04 15:05:49 +03:00
Reynold Xin
8a9a2e7199 Minor tweak to README (#4862) 2020-05-04 10:23:02 +03:00
Reynold Xin
8d29e80013 A new intro paragraph to explain what Redash is (#4861)
* A new intro paragraph to explain what Redash is

We have been using Redash at Databricks and really love it. I took the time to work with Arik to create a better, more up-to-date description of the project.

* Add data sources
2020-05-03 23:43:11 +03:00
Gabriel Dutra
0e3d25c40c Fix visualizations with filters not showing selected values (#4854) 2020-05-03 12:37:23 -03:00
Arik Fraimovich
fdc4205774 Add blob: to allowed img-src rules in CSP (#4860)
This is needed for Plotly download PNG feature to work.
2020-05-03 12:32:17 +03:00
Arik Fraimovich
873c87b4b3 Fix: showing current settings tab broken in MULTI_ORG. (#4855)
* Fix: showing current settings tab broken in MULTI_ORG.

* Revert "Fix: showing current settings tab broken in MULTI_ORG."

This reverts commit a88defd0b5.

* Add test for SettingsMenu#isActive

* Use stripBase to remove slug from url
2020-05-02 14:45:54 +03:00
Gabriel Dutra
ae9bbe25e5 Cypress: Assert results keep up on widget refresh (#4846) 2020-04-30 12:20:04 +03:00
koooge
e3fff396cb chore: Update node8 to 12 (#4845)
Signed-off-by: koooge <koooooge@gmail.com>
2020-04-30 12:19:06 +03:00
Gabriel Dutra
f37e3d5a10 Fix dashboard not showing results while refreshing (#4840) 2020-04-29 21:09:35 +03:00
Gabriel Dutra
45e1478be3 Specify restylers versions for restyled (#4842)
* Specify restylers versions for restyled

* Trigger file change for testing

* Revert "Trigger file change for testing"

This reverts commit d203e37700.
2020-04-29 15:44:57 +03:00
Jannis Leidel
2c90d920b3 Add ability to ship periodic RQ jobs as part of extensions again. (#4822)
This was dropped in aa17681af2.
2020-04-28 18:39:30 +02:00
Gabriel Dutra
bb767f3747 Remove Helper Classes from visualizations (#4788) 2020-04-25 15:51:21 -03:00
Gabriel Dutra
60bc1f8e35 Visualizations customizable settings (#4793) 2020-04-25 12:33:42 -03:00
koooge
de6d665c6e fix: Make sure boto installed (#4835)
Signed-off-by: koooge <koooooge@gmail.com>
2020-04-25 12:34:45 +03:00
Arik Fraimovich
60f92a2efc Add column description to table viz (#4831)
* Add column description to table viz

* Fix: misplaced super long titles tooltip.
2020-04-24 18:50:45 +03:00
Arik Fraimovich
ea8a075a2d ODBC Based Databricks Connector (#4814)
* ODBC Based Databricks connector.

* Install Databricks' ODBC driver in Docker image

* Add useragent string.

* Add Types enum to redash.query_runner to replace the seprate constants.

* Databricks connector:

1. Parse types.
2. Send additional connection options.
3. Correctly parse errors.

* Switch to TYPE constants to use code with Python 2.

* Add note about the Databricks driver terms and conditions.

* Show message about Databricks driver terms and conditions.

* Handle cases when the query doesn't return any results.

* Update redash/query_runner/databricks.py

Co-Authored-By: Jesse <jesse@whitehouse.dev>

* Use new Databricks logo

* Fix connection string options

Co-authored-by: Jesse <jesse@whitehouse.dev>
2020-04-24 18:04:44 +03:00
Arik Fraimovich
6ee9b43ef9 Show explicit user name instead of avatar in lists. (#4828) 2020-04-24 17:32:45 +03:00
Arik Fraimovich
cfc82156c2 Reduce number of queries used to load the dashboards list (#4816)
* Reduce number of queries used to load the dashboards list.

* Use DashboardSerializer everywhere.

* Call serialize
2020-04-21 10:07:48 +03:00
Omer Lachish
ab6dc51540 reset is_invitation_pending if someone tries to login through a reset passwrod link for the first time (#4817) 2020-04-20 20:39:08 +03:00
James T. Boylan
70186ab835 Dashboard Search bug fix (#4804)
* Move Dashboard off `subqueryload()` loader in all() method due to inconsistent results bug in SQLAlchemy when leveraging distinct within a subqueryload call through paginate.

* Added source reference to Presto Query Runner connection through the pyhive client to announce to presto that the query is coming from `redash` instead of `pyhive`.

* Removing source line from presto query runner to refactor based on feedback.
2020-04-19 21:46:25 +03:00
Matt N
e99c37a36a Don't immediately remove notifications from notification trays (#4773)
Let the notifications go into browser/OS notification trays so users can click on them from there if they miss the initial notification. Modern browsers generally use OS notifications so the user is in control of the notification at the OS level.
2020-04-14 14:27:03 +03:00
Cemre Mengu
de40f1a07b Fix comparison error when scale is None (#4638)
* Fix comparison error when scale is None

Prevents `'>' not supported between instances of 'NoneType' and 'int'` error when scale is `None`

* Update oracle.py

* Fix scale logic.

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-04-14 13:36:12 +03:00
Arik Fraimovich
2c1eb5c10d Disable Percy snapshot for Choropleth test (#4799)
* Disable Percy snapshot for Choropleth test

* Increase wait.

* Diasble Percy snapshot.

* Reduce wait time to original value.

* Restyled by prettier (#4800)

Co-authored-by: Restyled.io <commits@restyled.io>

* Update choropleth_spec.js

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2020-04-14 13:34:35 +03:00
Daniel Lang
02cf895983 Added setting to hide Plotly mode bar (#4644) 2020-04-14 13:08:17 +03:00
Stefan Mees
940bd564d7 Datasource Exasol: support encryption setting (#4712)
* add pyexasol datasource, ensure that integer dont overflow in javascript

* support setting encryption for Exasol connections

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-04-14 12:38:01 +03:00
Jesse
9ba57a9491 Adds option to show 500 rows in the table visualization. Previous max (#4770)
was 250.
2020-04-14 12:36:27 +03:00
Omer Lachish
b80abd11fb use total_seconds to find stale jobs (#4777) 2020-04-14 11:49:17 +03:00
Levko Kravets
1d4ca5cf2e Pie Chart: set contrast colors for text in sectors (#4783) 2020-04-14 11:48:54 +03:00
Weng Kham
f7df6e0cdc Fix test connection on mongodb datasource (#4785)
Co-authored-by: Weng Kham Kan <wengkham.kan@icarasia.com>
2020-04-14 11:47:14 +03:00
Gabriel Dutra
3df1a86d66 Fix param added with empty query ignores options (#4736) 2020-04-14 11:41:52 +03:00
Gabriel Dutra
bad1294402 Dashboard Performance: Memoize widgets (#4734) 2020-04-14 11:04:39 +03:00
Gabriel Dutra
3d26afef16 Move the dropdown to the side in Edit Mode (#4758) 2020-04-14 10:37:06 +03:00
Logan Price
2d29240195 feature: add ability to make the restriction of api calls to private addresses optional (#4790)
* feature: add ability to make the restriction of api calls to private addresses optional

* chore: fix typo

* Update redash/settings/__init__.py

Co-authored-by: lprice92 <lprice92@iastate.edu>
Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-04-14 10:34:13 +03:00
Gabriel Dutra
c698359cb8 Remove "context" prop from visualizations (#4789) 2020-04-13 10:17:33 -03:00
Gabriel Dutra
2b3d9053e9 Fix Multi-Filters: "select all" makes table view unscrollable (#4782)
* Limit filters to 40% of query fixed layout space

* Add check for height to determine fixed layout

* Add maxTagCount of 5 to Filters

* Update maxTagCount settings to be similar to Parameters
2020-04-13 15:13:28 +03:00
Atharva Inamdar
45ea5171cb 4791 redshift schema bugfix (#4792)
* #4791 exclude pg_ tables from redshift table schema inspection

* restrictict only pg_temp
2020-04-12 13:56:06 +03:00
Omer Lachish
6a5445b726 sent stack trace to Sentry when refresh_queries fails to enqueue a certain query (#4780) 2020-04-08 16:34:36 +03:00
Levko Kravets
51b573230f Upgrade Plotly (#4752)
* Upgrade Plotly

* Fixes to Plotly wrapper

* Decrease plot margins

* Adjust plot margins
2020-04-06 13:35:39 +03:00
Levko Kravets
54b04eaff7 Pie chart ignores series labels (#4775) 2020-04-06 13:31:58 +03:00
Georgi Staykov
1e96faed3b Add db thread pool option to keep idle connections alive (#4741)
* Add db thread pool option to keep idle connections alive

* Add SQLALCHEMY_ENABLE_POOL_PRE_PING setting

* Change SQLALCHEMY_ENABLE_POOL_PRE_PING default value to false.

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-04-05 14:13:20 +03:00
Arik Fraimovich
90bfba57d4 Fix: extendedEnum breaks JSONSchema parsing (#4774)
(probably due to Python 3 migration)
2020-04-03 12:07:25 +03:00
lihan
7f2a0af841 Removing the PIP cache from the built image (#4766) 2020-04-03 12:06:55 +03:00
Arihant Surana
f9e3ac7534 feat: Add ssl options for Cassandra data source (#4665)
* feat: provide ssl options for Cassandra data source

* remove Log and prints

* Refactor to create module methods and unit tests

* Switch to using Enumerator and temp file

* Fix temporary file lifecycle for cert

* Align with changes on master

* Fix non certificate but ssl enabled usecase
2020-04-03 11:03:47 +03:00
Gabriel Dutra
4d266176d0 Fix parameter spec flaky test (#4771) 2020-04-02 16:01:22 -03:00
Levko Kravets
3373cfc1eb Sankey diagram should occupy all available area (not just the left part) (#4765)
* Code style

* Remove dead and duplcated code

* getredash/redash#4763 Sankey diagram should occupy full available area (not just the left part)
2020-03-31 23:10:27 +03:00
Gabriel Dutra
e3745f8ba3 Fix there's no publish button on mobile query page (#4760) 2020-03-30 18:16:36 -03:00
Arik Fraimovich
3f6699032f Add apt update step in build docker image job. 2020-03-24 16:11:49 +02:00
Gabriel Dutra
adf8b2e42b Cypress: Add/Edit query and dashboard tags spec (#4744) 2020-03-24 16:03:22 +02:00
Gabriel Dutra
8db1612689 Fix query based param with no results crashing page (#4707)
* Fix query based param with no results crashing page

* Add message for empty dropdown parameters

* Handle 500 no results case with empty result set

* Cypress: Make sure it shows the message

* Use .ant-select-selection to open dropdown
2020-03-24 14:48:14 +02:00
Gabriel Dutra
fabaf73b7b Move data source/destination deprecated handling to frontend (#4753)
* Move DS deprecated handling to frontend

* Add Cypress assertion for deprecated types
2020-03-24 10:09:03 +02:00
Ezekiel Templin
45914f941f Set POSTGRES_HOST_AUTH_METHOD environment variable (#4740)
Redash's docker-compose file will no longer bring up an environment from
a cold start due to recent upstream changes to the postgres image that
force the user to either set a password for the default superuser or
opt-in to allowing all connections without a password via environment
variable.

Upstream PR: https://github.com/docker-library/postgres/pull/658
Related Discussion: https://github.com/docker-library/postgres/issues/681
2020-03-18 14:52:23 +02:00
Gabriel Dutra
1e9b8f1126 Fix no button to add query tags (#4737) 2020-03-17 22:11:33 +02:00
Levko Kravets
52911b7be3 Cohort appearance settings (#4597)
* Cohort: add settings for tooltips, value formats and placeholder

* Cohort: add settings for colors

* Cohort: change all settings tabs to use horizontal inputs

* Cohort: show color labels in editor
2020-03-17 13:42:45 +02:00
Levko Kravets
a10a3f1731 getredash/redash#4728 DOMPurify by default removes 'target' attribute (#4729) 2020-03-17 13:30:55 +02:00
Gabriel Dutra
33131c1354 Trigger CI lint failure on warnings and fix failing frontend unit tests (#4735)
* Trigger lint error on warnings on CI

* Test removing pip3 command from frontend unit

* Test eslint warning

* Revert "Test eslint warning"

This reverts commit 89d407345a.

* Revert "Test removing pip3 command from frontend unit"

This reverts commit 424c900200.

* Run apt update before installing pip3
2020-03-16 13:27:21 +02:00
Gabriel Dutra
f6750428cf Dashboard Performance: HtmlContent improvements (#4726)
* Dashboard Performance: Memoize HtmlContent

* Only render HtmlContent if there is a description
2020-03-15 15:12:50 +02:00
Gabriel Dutra
f4b69d4495 Cypress: Separate start command and update to v4.1.0 (#4690) 2020-03-11 16:14:33 -03:00
Levko Kravets
db71ff399c Refactor dialog wrapper component (#4594)
* Dialog wrapper: stop using promises to handle results - replace with callbacks

* Dialog wrapper: handle async operation on close
2020-03-10 22:22:42 +02:00
Levko Kravets
e552effd96 Remove route.resolve feature (#4607)
* Stop using route.resolve feature (pages should load all the data themselves)

* Remove route.resolve feature

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-03-10 13:09:26 +02:00
Satyam Krishna
75cc6b3f53 Fix : Alembic migration for scheduled query from older to newer version (#4709) 2020-03-08 17:41:21 +02:00
Gabriel Dutra
bf3095c794 Update Dashboard and Alert headers with the Query one (#4710) 2020-03-06 14:26:37 -03:00
Omer Lachish
ee6dcab362 Cancel BigQuery Queries (#4701)
* cancel BigQuery queries when user requests cancellation or when the job times out

* create a new bigquery client to flush exising requests
2020-03-04 22:45:20 +02:00
Gabriel Dutra
e0312fb717 Mobile experience improvements (#4694)
* Allow touch action on dashboard grid

* Deactivate touch when resizing widgets

* Disable touch interactions on Plotly

* Update Plotly and use dragmode: false

* Remove autoFocus from ItemsList search

* Fix spacing for queries and dashboard favorites

* Make sure admin pages don't go over 100% width
2020-03-04 12:55:51 +02:00
Omer Lachish
791a0b3ec7 allow comparison with strings containing numbers as alert values (#4705) 2020-03-04 12:40:23 +02:00
Anton Yuzhaninov
e03e58c5c7 Fix: show size of actually used Redash database (#4706)
'postgres' is a default database name in the Docker image, but if an
external database server is used, than Redash database can have
a different name (specified in REDASH_DATABASE_URL).
2020-03-03 21:21:56 +02:00
Arik Fraimovich
78201c6108 Dynamic Form: boolean fields related fixes (#4586)
* Fix: when default value is false make sure it's still stringified.

* Fix: when extra field is of type boolean make sure it's different from default value to decide if it's open.

* Use isNil to check the default value

* Restyled by prettier (#4704)

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
2020-03-03 12:55:54 +02:00
Arik Fraimovich
d687befa59 Query page: update empty state text (#4699) 2020-03-03 10:53:45 +02:00
Gabriel Dutra
9635d00476 Fix error for query snippets with empty description (#4693) 2020-03-01 15:05:44 -03:00
Jesse
418590003e Solves redashlabs/product#47 (#4669) 2020-03-01 14:19:00 +02:00
Levko Kravets
3650f0c45b Table visualization: Show which columns are being used for search (#4680)
* Table visualization: Show which columns are being used for search

* Fix accidental bug
2020-03-01 14:15:49 +02:00
erels
668403c126 Fixed Clickhouse column name encoding problem (#4682) 2020-03-01 14:11:49 +02:00
Arik Fraimovich
4b94a5c88f Snowflake: use different method of showing columns if no schema specified in db name (#4696)
* Snowflake: use different method of showing columns if no schema specified in db name

* Update redash/query_runner/snowflake.py

Co-Authored-By: Omer Lachish <omer@rauchy.net>

* Update redash/query_runner/snowflake.py

Co-authored-by: Omer Lachish <omer@rauchy.net>
2020-03-01 13:55:28 +02:00
Omer Lachish
a9cb87d4b3 refresh_queries shouldn't break because of a single query having a bad schedule object (#4163)
* move filtering of invalid schedules to the query

* simplify retrieved_at assignment and wrap in a try/except block to avoid one query blowing up the rest

* refactor refresh_queries to use simpler functions with a single responsibility and add try/except blocks to avoid one query blowing up the rest

* avoid blowing up when job locks point to expired Job objects. Enqueue them again instead

* there's no need to check for the existence of interval - all schedules have intervals

* disable faulty schedules

* reduce FP style in refresh_queries

* report refresh_queries errors to Sentry (if it is configured)

* avoid using exists+fetch and use exceptions instead
2020-03-01 11:02:46 +02:00
Omer Lachish
b0f1cdd194 remove rq_healthcheck entrypoint and deprecate celery_healthcheck (#4574) 2020-02-27 17:55:04 +02:00
juanvasquezreyes
5d533a3277 Oracle: update DSN construction to support special characters in user/password. (#4659)
* Update oracle.py

The reason I propose this change is to fix an issue when oracle password has an @
example of connection string: user/p@ssword@host

* Update oracle.py

Fixing init after comments

* Remove empty constructor.

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-02-27 17:50:46 +02:00
Gabriel Dutra
5fa5cd958b Change visualization editor scroll to internal divs (#4689) 2020-02-26 23:09:53 +02:00
Levko Kravets
c5f14e5538 Use main react-grid-layout package instead of fork (#4687) 2020-02-26 21:20:30 +02:00
Levko Kravets
7043951f00 Use npm ci instead of npm install in CI scripts (#4688) 2020-02-26 19:23:32 +02:00
Omer Lachish
9790b0731d Perform cleanup on job timeouts (#4681)
* move repeated query cancellation error messages to the job serializer

* oerform cleanup on JobTimeoutException and DRY query cancellation exception blocks

* import JobTimeoutException directly from rq

* fix syntax error introduced by mistake

* add missing import
2020-02-26 13:24:57 +02:00
Levko Kravets
3102e2df94 Fix: Chart with a horizontal legend sometimes doesn't render properly (#4683) 2020-02-25 13:07:17 +02:00
Gabriel Dutra
f396c96457 Merge branch 'master' into query-based-dropdown--parameters 2020-02-25 07:49:36 -03:00
Omer Lachish
35250d64b9 Job timeout doesn't kill the mysql query (#4629)
* forward timeout SIGALRMs to MySQL threads in order to kill any running proccesses

* no need to attach to SIGALRM as RQ already does that
2020-02-25 00:16:19 +02:00
Gabriel Dutra
cdfa102125 Query View page design adjustments (#4670)
* Realign Data Source and Refresh Schedule

* Adjust execution status height

* Rewrite Query Page Header flexibility

* Remove margin from QuerySource parameters

* Cypress: Visit visualization instead of click in tab

* Fix wrong css class name in dashboard-grid
2020-02-24 21:05:58 +02:00
Gabriel Dutra
8bfcbf21e3 Remove redundant import 2020-02-24 11:44:28 -03:00
Gabriel Dutra
8a1640c4e7 Separate InputPopover component 2020-02-24 11:44:18 -03:00
Gabriel Dutra
209ee16261 Fix verification email url on home page (#4647) 2020-02-24 10:15:35 -03:00
Arik Fraimovich
f1a2f8cb88 Enable ODBC and MS SQL ODBC support (#4676)
Closes #4356.
2020-02-23 11:57:39 +02:00
Arik Fraimovich
dd8e23040a Remove core-js and polyfill include as we don't use Phantom anymore (#4583) 2020-02-23 11:15:53 +02:00
Gabriel Dutra
a37e7f93dc Add is_safe test for queries with params 2020-02-22 15:47:29 -03:00
Gabriel Dutra
cc34e781d3 Small updates
- Change searchTerm separator
- Add cy.wait
2020-02-22 15:23:43 -03:00
Gabriel Dutra
6aa0ea715e Invert tooltip messages order 2020-02-22 14:08:19 -03:00
Gabriel Dutra
6c27619671 Make Parameter Mapping required in UI 2020-02-21 23:00:26 -03:00
Gabriel Dutra
6eeb3b3eb2 Separate UI components 2020-02-21 15:49:23 -03:00
Gabriel Dutra
d40edb81c2 Fix backend tests 2020-02-21 14:18:59 -03:00
Gabriel Dutra
f128b4b85f Only allow search for Text Parameters 2020-02-21 13:36:06 -03:00
Gabriel Dutra
264fb5798d Merge branch 'master' into query-based-dropdown--parameters 2020-02-21 13:31:49 -03:00
Gabriel Dutra
90023ac435 Make sure Table updates correctly 2020-02-21 11:03:37 -03:00
Gabriel Dutra
df755fbc17 Add try except for NoResultFound 2020-02-21 09:40:52 -03:00
Gabriel Dutra
e555642844 Add is_safe check for parameterized query based 2020-02-21 09:27:12 -03:00
Gabriel Dutra
bdd7b146ae Change stored mapping attributes 2020-02-20 21:59:19 -03:00
Gabriel Dutra
b7478defec Don't validade query params with params 2020-02-20 19:29:43 -03:00
Gabriel Dutra
bb0d7830c9 Fixes + temp remove validation for Query param 2020-02-20 18:49:29 -03:00
Gabriel Dutra
d2cc2d20b6 Query Editor: Remove overflow visible from visualization (#4668) 2020-02-20 18:16:26 -03:00
Levko Kravets
7f8b103aea getredash/redash#4666 The download button on the dashboard will redirect users to an invalid page (#4667) 2020-02-20 21:16:16 +02:00
Gabriel Dutra
9eaa44da4a Query View redesign (#4536)
Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-02-19 17:47:34 -03:00
Gabriel Dutra
2833bb539f Fix Add Widget always shows recent queries list (#4658) 2020-02-18 18:01:26 -03:00
Gabriel Dutra
137aa22dd4 Parameter Mapping UI (2/2) 2020-02-18 17:55:27 -03:00
Levko Kravets
7ff5af1bf5 getredash/redash#4655 Closing the Help Drawer redirects you the homepage (#4657) 2020-02-18 21:23:23 +02:00
Omer Lachish
7124bc91d7 Avoid timing out when no timeout is set (#4653)
* soft limits should not exceed if they are set to run infinitely

* use a variable to explain magic number
2020-02-18 15:29:33 +02:00
Gabriel Dutra
9cf396599a Parameter Mapping UI (1/2) 2020-02-17 23:32:10 -03:00
Gabriel Dutra
b70f0fa921 Iterate over backend verification 2020-02-16 13:39:05 -03:00
Omer Lachish
abbfd598d7 support relative time in cloudwatch queries (#4649) 2020-02-16 12:23:25 +02:00
Gabriel Dutra
5e3613d6cb Start experiements with a 'search' parameter 2020-02-13 16:29:50 -03:00
Gabriel Dutra
545da898ee Fix dashboard editing permissions not working (#4613)
* Use dashboard.can_edit instead of checking owner

* Add owner or admin check to Manage Permissions

* Remove unnecessary useMemo
2020-02-13 11:50:45 +02:00
Omer Lachish
ddb0ef15c1 Set default query execution time limit to unlimited (#4626)
* default query execution time limit to 1 hour

* use -1 (run infinitely)  as a default limit
2020-02-11 11:23:02 +02:00
Jannis Leidel
9646156965 Handle stale jobs more carefully before purging them. (#4615) 2020-02-11 11:14:26 +02:00
Jannis Leidel
5c7cb1af3d Update cassandra-driver to 3.21.0. (#4636)
This provides binary wheel files and reduces Docker build times drastically.
2020-02-10 21:48:43 +02:00
Arik Fraimovich
2bd8771188 Fix: no need to encode strings anymore (#4627)
* It's 2020, we got Python 3, no need to encode strings anymore

* Remove encode calls from other places

* use alert.name directly
2020-02-10 20:34:42 +02:00
Arik Fraimovich
86f8f32ab4 Snowflake: switch to simpler query for fetching columns (#4634)
Because we already call USE DATABASE before running SHOW COLUMNS adding IN DATABASE is redundant, but causes an error if the user specifies a schema along with database name.
2020-02-10 20:34:23 +02:00
Gabriel Dutra
fdccaabbe9 Check for LDAP Login in Organization Settings (#4359)
* Check for LDAP Login in Organization Settings

* Restyled by prettier (#4570)

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
2020-02-10 20:13:56 +02:00
Levko Kravets
2f5920d5e4 getredash/redash#4601 Chart editor: enable search in columns selects (#4602) 2020-02-09 17:38:48 +02:00
Omer Lachish
e97510b2ee Clickhouse: control whether to verify SSL certificate (#4631) 2020-02-09 16:03:43 +02:00
Omer Lachish
80cfa3c557 set correct values for ProxyFix (#4630) 2020-02-09 15:20:16 +02:00
mickeey2525
9b71b569e2 Fix treasuredata endpoint (#4582)
* fix treasuredata endpoint

* make endpoint as a required

* fix unneccessart required parameter
2020-02-09 13:52:44 +02:00
Arik Fraimovich
f2159472da Fix: encode/decode bytestring for base64. (#4624)
* Fix: encode/decode bytestring for base64.

* Apply b64encode fix to HiveHttp
2020-02-09 13:41:41 +02:00
Omer Lachish
c961c33e49 If the error message happens to be empty, it will break serailization. (#4622) 2020-02-09 13:17:43 +02:00
Omer Lachish
5afc94c562 sync_user_details doens't really need a custom ttl (#4625) 2020-02-09 12:57:16 +02:00
Jesse
cee1a07320 Sort schema columns alphabetically (#4595)
* Adds logic to sort column names returned by the query runner. If `sorted`
raises an Exception it returns the column names unaltered from the query
runner.

* Moves table name sorting from model code into schema handler.

* Moves token sorting into the model code.

* Replaces single-quotes with double-quotes for consistency.

* Applies black formatting to changes.

* Moves schema sort into separate method. Adds test.

* Fixes output schema variable name. Without this the sorted cache is never returned!

   ____  ____  ____  _____
  / __ \/ __ \/ __ \/ ___/
 / /_/ / /_/ / /_/ (__  )
 \____/\____/ .___/____/
           /_/

* Adds test case guaranteeing that the model actually _uses_ the schema sorter.

Related to a31f90178c
2020-02-09 12:40:47 +02:00
Eduardo Garcia
42b1eadeb2 Update copyright year to 2020 in LICENSE (#4616) 2020-02-09 12:39:22 +02:00
Omer Lachish
7edac9ca89 keep adhoc job results longer (determined by settings.JOB_EXPIRY_TIME) (#4559) 2020-02-09 12:28:58 +02:00
David Hernández
69893f0304 Force specific version of Werkzeug to prevent the breaking changes of the new release. (#4618) 2020-02-09 09:23:48 +02:00
Jannis Leidel
b089f5f0ef Use correct logger when enqueuing a query execution. (#4614) 2020-02-06 15:16:21 +01:00
Omer Lachish
7a34a76817 RQ: Missing currently executing queries view (#4558)
* add meta information to executing queries

* add a table for running queries

* add pagination to queues table

* sort the queues table

* add pagination to all tables
2020-02-03 23:51:20 +02:00
Levko Kravets
2de3895986 Query editor: fix shortcuts (#4598) 2020-01-29 21:26:05 +02:00
Levko Kravets
713fd2d0fb Change visualizations import to be static (#4592)
* getredash/redash#4565 Change visualizations import to be static

* Move visualizations-related components to own folder
2020-01-28 12:48:38 +02:00
Levko Kravets
19c6d331b6 Refine routes definitions (#4579)
* Refine routes definitions

* Replace HoC wrappers with functions to create route definition

* Some updates for code consistency

* ItemsList component: remove currentRoute dependency

* Prepare route parametes in wrapper functions
2020-01-26 14:53:40 +02:00
Omer Lachish
a36b10173c Fix empty values sent in dynamic form (#3886)
* remove legacy session identifier support

* remove redundant test

* redirect to login to support any invalid session identifiers

* be more specific with caught errors

* reject empty values in DynamicForm

* don't submit form values if they are empty (unless they are
intentionally set to empty string)

* set empty values to null to clear out data source option in the model

* check explicitly for null
2020-01-23 21:21:49 +02:00
Eran Sandler
7d11fae9ea Added support for running MongoDB queries on secondary in replicaset mode (#1424)
* - Added support to specify read preference when query a replicaset database (for example, secondaryPreferred - to try and read data from secondary before primary).
- Removed old code that used MongoClientReplicaSet as it is now just a reference to MongoClient
- Fixed a documentation type :-)

* Moving to PyMongo 3.3.1 which also supports MongoDB 3.2

* Changed the readPreference config to use an enum

* Pass readPreference to MongoClient

* primaryPreferred is now the default
2020-01-23 21:14:37 +02:00
Levko Kravets
35e41385dc Fixes several bugs on dashboard page (see description) (#4571)
* Move each hook to own file; move hooks and components to own folders

* Update URL and timer only when refresh rate changes

* Skip dashboard refresh if previous refresh is still running

* Fix test
2020-01-23 17:03:37 +02:00
Levko Kravets
cdefa847c0 Restore query execute notifications (missed during React migration) (#4577) 2020-01-23 16:21:51 +02:00
Levko Kravets
a90b8c7443 getredash/redash#173 Don't allow to fork query while previous fork is still in progress (#4578) 2020-01-23 16:08:59 +02:00
Levko Kravets
1ba3a23457 Bug: when using global dashboard filters, widgets continuously update their local filters (#4575) 2020-01-23 16:07:28 +02:00
Levko Kravets
8a5e0ea3f4 Refine Timer and TimeAgo components (get rid of force update) (#4580) 2020-01-23 16:06:38 +02:00
Levko Kravets
cbc56264ea React migration cleanup (#4572)
* Revisit ANGULAR_REMOVE_ME things

* Remove styles related to 3rd-party Angular and jQuery libraries

* Remove some more unused styles

* Revisit error handling (app-wide)

* Remove unused file

* CR1
2020-01-22 17:15:25 +02:00
Levko Kravets
c92bb63f8b Fix Map visualization: L.layerGroup cannot compute its bounds (#4573) 2020-01-22 10:11:29 +02:00
Levko Kravets
ff0dbd5f01 Save new query before adding new visualization (#4569) 2020-01-21 13:06:26 +02:00
Leo Palmer Sunmo
80bfd405fd Force saml auth scheme (#3614)
* Add SAML scheme override env var

* Make it pretty, please the linter

* Import settings properly
2020-01-21 11:45:21 +02:00
taminif
945f53fea3 delete variable (#3813)
* delete variable

* delete duplicate code

* add empty line

* delete empty line
2020-01-21 11:29:56 +02:00
Steve Buckingham
56b51be64a Add redshift role use option (#4532)
* Add redshift role use option

* Update requirements for SSL socket wrap issue fixes

* Split Redshift class into User and IAM logins

* Update incorrect register

* Change type names

* Correct class name to inherit

* Render IAM redshift image and field order correct

* Update redash/query_runner/pg.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>

* Update redash/query_runner/pg.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>

* Remove need for specified urllib - specify pyopenssl is enough

* Pyopenssl back down to 19.0.0

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-01-21 11:18:33 +02:00
Levko Kravets
a682265e13 Migrate router and <app-view> to React (#4525)
* Migrate router and <app-view> to React: skeleton

* Update layout on route change

* Start moving page routes from angular to react

* Move page routes to react except of public dashboard and visualization embed)

* Move public dashboard and visualization embed routes to React

* Replace $route/$routeParams usages

* Some cleanup

* Replace AngularJS $location service with implementation based on history library

* Minor fix to how ApplicationView handles route change

* Explicitly use global layout for each page instead of handling related stuff in ApplicationArea component

* Error handling

* Remove AngularJS and related dependencies

* Move Parameter factory method to a separate file

* Fix CSS (replace custom components with classes)

* Fix: keep other url parts when updating location partially; refine code

* Fix tests

* Make router work in multi-org mode (respect <base> tag)

* Optimzation: don't resolve route if path didn't change

* Fix search input in header; error handling improvement (handle more errors in pages; global error handler for unhandled errors; dialog dismiss 'unhandled rejection' errors)

* Fix page keys; fix navigateTo calls (third parameter not available)

* Use relative links

* Router: ignore location REPLACE events, resolve only on PUSH/POP

* Fix tests

* Remove unused jQuery reference

* Show error from backend when creating Destination

* Remove route.resolve where not necessary (used constant values)

* New Query page: keep state on saving, reload when creating another new query

* Use currentRoute.key instead of hard-coded keys for page components

* Tidy up Router

* Tidy up location service

* Fix tests

* Don't add parameters changes to browser's history

* Fix test (improved fix)

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-01-20 20:56:37 +02:00
Arik Fraimovich
a891160b4d Upgrade snowflake-connector-python (#4567)
* Upgrade snowflake-connector-python

* Downgrade requests
2020-01-20 19:50:57 +02:00
Gabriel Dutra
086798bbb7 Fix Cypress issues after React version of Query Pages (#4545)
* Update Pivot rows assertion

* Allow replacing Query results with Apply Changes
2020-01-20 14:26:22 +02:00
Levko Kravets
ebcec85c0c Tags filter doesn't work because of wrong query params format (#4563)
* getredash/redash#4557 Tags filter doesn't work because of wrong query params format

* Fix tests
2020-01-20 12:49:17 +02:00
Gabriel Dutra
2b5bfad054 Add padding to QueryExecutionStatus text (#4553) 2020-01-16 21:18:06 +02:00
Gabriel Dutra
479b277b91 Add loading state to Query save button (#4551)
* Add loading state to Query save button

* Hide dirty indication and icon when saving
2020-01-16 14:21:38 +02:00
Arik Fraimovich
94ac11c787 webpack: remove children from output (#4540) 2020-01-14 14:05:37 +02:00
Jannis Leidel
a7ef3ad72a Get rid of six and fix str/unicode types regression that became active on Python 3. (#4533)
This was introduced in d38ca803c5.
2020-01-14 12:51:36 +02:00
Ari Ekmekji
afe8c95f4d Load collections in all workspaces (#4541) 2020-01-14 12:48:04 +02:00
Omer Lachish
fe06f7f63e Google Analytics runner - iterate over keys the Python 3 way (#4538)
* iterate over key names instead of dict_keys values

* use dict comprehension instead of manipulating existing dict
2020-01-13 14:41:30 +02:00
Omer Lachish
5e01211852 adjust imports to match influxdb 5.2.3 (#4531) 2020-01-13 10:43:29 +02:00
Gabriel Dutra
375ffd3250 Migrate services and replace $http with axios (#4497) 2020-01-12 22:25:26 -03:00
Omer Lachish
674f057c59 fix typo in azure kusto runner (#4537) 2020-01-12 22:45:32 +02:00
Omer Lachish
aa17681af2 Nuke Celery (#4521)
* enforce hard limits on non-responsive work horses by workers

* move differences from Worker to helper methods to help make the specialization clearer

* move HardLimitingWorker to redash/tasks

* move schedule.py to /tasks

* explain the motivation for HardLimitingWorker

* pleasing CodeClimate

* pleasing CodeClimate

* port query execution to RQ

* get rid of argsrepr

* avoid star imports

* allow queries to be cancelled in RQ

* return QueryExecutionErrors as job results

* fix TestTaskEnqueue and QueryExecutorTests

* remove Celery monitoring

* get rid of QueryTask and use RQ jobs directly (with a job serializer)

* Revert "remove Celery monitoring"

This reverts commit 37a74ea403.

* reduce occurences of the word 'task'

* use Worker, Queue and Job instead of spreading names that share behavior details

* remove locks for failed jobs as well

* did I not commit that colon? oh my

* push the redis connection to RQ's stack on every request to avoid verbose connection setting

* use a connection context for tests

* remove Celery monitoring

* 👋 Celery

* remove Celery from Cypress

* black it up

* some more black

* return all started/queued job ids (for future monitoring

* Restyled by prettier (#4522)

* remove celery.py

* remove some frontend residuals that reappeared after a merge

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
2020-01-12 22:36:48 +02:00
Takuya Arita
13c3531956 Update description for the new setup repository (#4535) 2020-01-12 15:22:10 +02:00
Gabriel Dutra
350716c525 Add maildev missing settings (#4527) 2020-01-10 09:29:33 +02:00
Gabriel Dutra
fe11b8cc35 Cypress: Add test for Settings Tabs (#4530) 2020-01-09 12:40:40 -03:00
Gabriel Dutra
465dbc03b7 Hide unavailable page links to non-admin users in settings and header (#4524)
* Filter unavailable menu items in SettingsWrapper

* Don't show Alert Destination in header to users
2020-01-08 10:59:59 +02:00
Gabriel Dutra
76f0dcb085 Replace angular-sanitize with DOMPurify (#4502)
* Switch angular-sanitize package with dompurify

* Replace $sanitize with DOMPurify.sanitize

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-01-08 10:56:11 +02:00
Gabriel Dutra
99c276fc9a Migrate Query pages to React (#4429)
* Migrate Query Source View page to React: skeleton

* Sync QueryView and QuerySource (#4430)

* Migrate schema browser to react (#4432)

* Restyle code with Prettier

* Migrate Query page to React: Save changes (#4452)

* Migrate query source to React: Set of updates (#4457)

* Migrate Query page to React: Visualization Tabs (#4453)

Co-Authored-By: Levko Kravets <levko.ne@gmail.com>

* Migrate Query Source page to React: Visualizations area (#4463)

* Migrate Query page to React: Delete visualization button (#4461)

* Migrate Query Source page to React: Visualization actions (#4467)

* Migrate Query pages to React: Execute query hook (#4470)

* Migrate Query Source page to React: Editor area (#4468)

* Migrate Query Source page to React: metadata, schedule and description blocks (#4476)

* Migrate Query page to React: Cancel query execution (#4496)

* Migrate Query Source page to React: refine code (#4499)

* Migrate Query Source page to React: alerts (#4504)

* Migrate Query Source page to React: unsaved changes alert (#4505)

* Migrate Query Source to React: resizable areas (v2) (#4503)

* Migrate Query page to React: Query View (#4455)

Co-authored-by: Levko Kravets <levko.ne@gmail.com>

* Switch React and Angular versions of pages (until Angular version removed)

* Migrate Query pages to React: fix permissions (#4506)

* Migrate Query Source page to React: don't reload when saving new query (#4507)

* Migrate Query pages to React: fix tests (#4509)

* Use skipParametersDirtyFlag in executeQuery

* Fix: cannot fork query from Query View page

* Optimize query editor: handle query text changes faster

* Revert "Optimize query editor: handle query text changes faster"

This reverts commit 2934e53be6.

* Reduce debounced time to 100

* Migrate Query pages to React: cleanup (#4512)

* Migrate Query pages to React: cleanup

* Further cleanup

* Remove unused dependencies

* Fix embed pages

* Attempt to fix flaky test

* Cleanup: explicitly register the last Angular component

* Move contents of /filters folder to /lib

* Remove unnecessary import

* Remove cy.wait from Parameters spec

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

Co-authored-by: Levko Kravets <levko.ne@gmail.com>
2020-01-06 20:51:45 +02:00
Levko Kravets
fc9e8fe2aa Add error boundary to catch errors in visualizations (#4518)
* Add error boundary to catch errors in visualizations

* Fix: Funnel crash when step column is date/time

* CR1

* CR2
2020-01-06 10:22:20 +02:00
Omer Lachish
260bfca767 Multiprocess RQ workers (using supervisor) (#4371)
* launch and monitor multiple workers using supervisor

* run supervisord in non-daemon mode

* redirect all output to stdout/stderr

* no need to log supervisord's output because it is redirected to stdout anyway

* updated and less brittle healthcheck

* add supervisor healthchecks

* remove redundant supervisor installation as it is installed by pip

* add a 5 minute check gate
2020-01-01 15:32:29 +02:00
Arik Fraimovich
f85490cf50 Fix: don't try to access message property of an exception (#4516)
(not supported in Python 3)
2019-12-31 12:45:29 +02:00
Gabriel Dutra
29582e3212 Run prettier on cypress folder (#4510)
* Run prettier on cypress folder

* Test Restyled

* Revert "Test Restyled"

This reverts commit 13d43968fe.
2019-12-30 19:40:56 +02:00
Omer Lachish
329e85987c Execute Queries in RQ (#4413)
* enforce hard limits on non-responsive work horses by workers

* move differences from Worker to helper methods to help make the specialization clearer

* move HardLimitingWorker to redash/tasks

* move schedule.py to /tasks

* explain the motivation for HardLimitingWorker

* pleasing CodeClimate

* pleasing CodeClimate

* port query execution to RQ

* get rid of argsrepr

* avoid star imports

* allow queries to be cancelled in RQ

* return QueryExecutionErrors as job results

* fix TestTaskEnqueue and QueryExecutorTests

* remove Celery monitoring

* get rid of QueryTask and use RQ jobs directly (with a job serializer)

* Revert "remove Celery monitoring"

This reverts commit 37a74ea403.

* reduce occurences of the word 'task'

* use Worker, Queue and Job instead of spreading names that share behavior details

* remove locks for failed jobs as well

* did I not commit that colon? oh my

* push the redis connection to RQ's stack on every request to avoid verbose connection setting

* use a connection context for tests

* black it up

* run RQ on all queues when running in Cypress
2019-12-30 14:11:01 +02:00
Arik Fraimovich
ff34dedf46 Fix: properly encode UTF-8 filenames in query results request (#4498)
* Fix: properly encode UTF-8 filenames in query results request

Ended up copying the implementation from Flask's send_file helper function, because send_file doesn't really fit our use case.

* Update tests/handlers/test_query_results.py

Co-Authored-By: Omer Lachish <omer@rauchy.net>

Co-authored-by: Omer Lachish <omer@rauchy.net>
2019-12-30 11:52:18 +02:00
Arik Fraimovich
d0fb377ed6 Viz Embed: Add option to hide timestamp (#4491) 2019-12-30 11:45:22 +02:00
Arik Fraimovich
30bc1e2ff6 Refine permissions usage in Redash to allow for guest users (#4492)
* Allow executing query with either view_query or execute_query permissions.

* Render AuthHeader according to permissions.

* Don't return dashboards where you only have access to textbox widget.

Closes #4099.
2019-12-30 10:07:20 +02:00
Gabriel Dutra
fd46194580 Update EditInPlace to use Antd components (#4493) 2019-12-26 12:53:33 -03:00
deecay
f5900a1929 Chart: Bubble size control by coefficient and sizemode (#3928) 2019-12-26 16:19:45 +02:00
Tsuyoshi Yoshizawa
c2b39db03e Support download as TSV File (#4445) 2019-12-26 16:16:48 +02:00
Omer Lachish
f420e02cee adjust imports to match simple-salesforce 0.74.3 (#4490) 2019-12-25 16:26:58 +02:00
Arik Fraimovich
0aa176e2e5 Don't update query's updated_at when updating schedule_failures counter (#4488) 2019-12-25 16:25:16 +02:00
Arik Fraimovich
97d523e348 Retain tags when forking a query (#4489) 2019-12-25 16:25:02 +02:00
Arik Fraimovich
88d21e9461 Add explicit handling of 404 errors in query result requests. (#4487) 2019-12-25 15:46:13 +02:00
Arik Fraimovich
40c1ef0f59 Fix: query results query runner fails to load cached results. (#4486) 2019-12-25 15:21:43 +02:00
Arik Fraimovich
10ba2ddbaa Snowflake: add missing date types (#4484)
Without those the values might be miscategorized in the UI.
2019-12-25 14:58:45 +02:00
Omer Lachish
e7eedd0556 fix all occurances of B306: BaseException.message has been deprecated as of Python 2.6 and is removed in Python 3. Use str(e) to access the user-readable message. Use e.args to access arguments passed to the exception. (#4482) 2019-12-25 10:13:39 +02:00
Omer Lachish
c3299ff0ad totalRows are returned as a string and should be a number (#4481) 2019-12-24 22:20:17 +02:00
Randy Zwitch
6b2f23f357 Update pymapd to 0.19.0 (#4424) 2019-12-24 15:34:42 +02:00
Arik Fraimovich
0819f80e72 Hive/Databricks: mark date types as TYPE_DATE. (#4419) 2019-12-24 10:39:56 +02:00
Gabriel Dutra
7223f60ddf Migrate VisualizationEmbed to React (#4364)
* Migrate VisualizationEmbed to React

* Angular cleanup

* Remove onClick event from TimeAgo

* Check Table exists before taking snapshot

* Apply Prettier
2019-12-24 10:21:48 +02:00
Gabriel Dutra
38b6b47594 Migrate Dashboard and Public Dashboard to React (#4228)
* Initial React Rendering with useDashboard

* Make sure widgets refresh + useCallback

* Rename collectFilters and add refreshRate

* Fix error updates not being rendered

* Only render widget bottom when queryResults exists

* Cleanup

* Add useCallback to refreshDashboard

* Make sure Promise.all have all promises done

* Start migrating Dashoard to React
- initial rendering
- some actions
- temporary updated less file

* Fullscreen handler added

* Separate refreshRateHandler hook

* Add a few tooltips

* Separate DashboardControl and normalize btn width

* Share Button

* Fix serach params not updating

* Enumerate More Options

* Toggle Publish options

* Archive Dashboard

* Parameters + Filters

* Prepare Manage Permissions

* Start to create edit mode

* Add Edit Mode functionalities

* Use previous state when updating dashboard

* Mobile adjustments

* PermissionsEditorDialog + Dashboard page title

* Update Dashboard spec

* Fix other specs

* Break dashboard.less

* Hide publish button on mobile

* Angular Cleaning

* Keep edit state when changing resolution

* Bug fix: Dashboard Level Filters not updating

* Remove prepareWidgetsForDashboard

* Revert "Remove prepareWidgetsForDashboard"

This reverts commit b434f03da1.

* Avoid saving layout changes out of editing mode

* Apply policy for enabled refresh rates

* Disable loadDashboard deps

* Restyled by prettier (#4459)

* Update title when dashboard name updates

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
2019-12-24 10:20:40 +02:00
Levko Kravets
49dcb7f689 Refactor QueryEditor component (#4464) 2019-12-20 15:35:43 +02:00
deecay
425e79fdd2 Fix prettier commandline option to be recursive (#4458) 2019-12-17 14:52:45 +02:00
Levko Kravets
bc52b78889 Third column not selectable for Bubble and Heatmap charts (#4449) 2019-12-16 13:00:17 +02:00
deecay
944adb95ba Map: add tooltip and popup templating (#4443) 2019-12-14 20:07:09 +02:00
Daniel Dubovski
8cb49158bf Adding application to Azure Kusto query runner (#4441)
This is to allow for better metrics collection and tracking on the service side.
More info can be found [here](https://docs.microsoft.com/en-us/azure/kusto/api/netfx/request-properties#the-application-x-ms-app-named-property)
2019-12-13 21:47:11 +02:00
Gabriel Dutra
ca098172e9 Fix Restyled config (#4438) 2019-12-11 23:06:17 -03:00
Omer Lachish
a3beac0b78 allow setting of custom sentry environments (#4437) 2019-12-11 23:00:06 +02:00
Arik Fraimovich
56d3be2248 Prettier all the Javascript code & GitHub Action (#4433)
* Prettier all the JS files

* Add GitHub Action to autoformat code pushed to master

* Fix eslint violation due to formatting.

* Remove GitHub actions for styling

* Add restyled.io config
2019-12-11 17:05:38 +02:00
Arik Fraimovich
81b14a58ef Remove Husky (#4435) 2019-12-11 14:49:57 +02:00
Arik Fraimovich
2dff8b9a00 Black support for the Python codebase (#4297)
* Apply black formatting

* Add auto formatting when committing to master

* Update CONTRIBUTING.md re. Black & Prettier
2019-12-11 13:54:29 +02:00
Arik Fraimovich
37a964c8d9 Remove codeclimate config (#4434) 2019-12-11 13:44:52 +02:00
Arik Fraimovich
1b9b3032ca Change eslint configuration and fix resulting issues (#4423)
* Remove app/service/query-string (unused) and its dependency.

* Fix usage of mixed operators.

* eslint --fix fixes for missing dependencies for react hooks

* Fix: useCallback dependency passed to $http's .catch.

* Satisfy react/no-direct-mutation-state.

* Fix no-mixed-operators violations.

* Move the decision of whether to render Custom chart one level up to make sure hooks are called in the same order.

* Fix: name was undefined. It wasn't detected before because there is such global.

* Simplify eslint config and switch to creat-react-app's eslint base.

* Add prettier config.

* Make sure eslint doesn't conflict with prettier

* A few updates post eslint (#4425)

* Prettier command in package.json
2019-12-11 12:00:46 +02:00
David Mudro
0385b6fb64 Fix counter vizualization (#4385)
* crude unit tests for counter visualisation utils

* improve type safety with default param values for getCounterData()

* fix count rows never shows zero

* remove default values for getCounterData() params
2019-12-10 13:38:22 +02:00
Arik Fraimovich
7c05a730dc Remove --max-old-space-size=4096 from npm build command (#4381)
* Remove --max-old-space-size=4096 from build

Looks like it's no longer needed.

* Update to node v12.

* Add build:old-node-version for those who have Node < 12.
2019-12-05 22:41:57 +02:00
Kenji Ichihashi
263305214e Update rds-combined-ca-bundle.pem(#4290) (#4304)
Can use rds-ca-2019 and etc
`$ curl https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem \
> redash/query_runner/files/rds-combined-ca-bundle.pem`
2019-12-05 11:29:42 +02:00
Jakdaw
3494e21cf4 Add user/pass authentication support for Druid (#4315)
* Add support for configuring a Username/Password for the connection to Druid

* Bump pydruid version for username/password support

* Deal with missing/empty configuration parameters
2019-12-05 09:27:59 +02:00
Gabriel Dutra
15e8b88996 Cypress: Make sure params are saved before reload (#4420) 2019-12-04 13:37:31 -03:00
Levko Kravets
ba36b4e671 Migrate AddToDashboard dialog to React (#4408) 2019-12-04 17:50:50 +02:00
Levko Kravets
94bd03dc42 Set of improvements and refinements to visualizations after React migration (#4382) 2019-12-04 16:23:29 +02:00
Levko Kravets
041d05d18b Chart series switch places when picking Y axis or color (#4412) 2019-12-04 16:00:01 +02:00
Gabriel Dutra
c14e7ab4ca Fix dragged parameter wrapping in some cases (#4415) 2019-12-03 12:48:11 -03:00
Monica Gangwar
4d6c30ef13 refreshing snowflake schema w/o waking cluster (#4285)
* refreshing snowflake schema w/o waking cluster

Have also added a new internal method to not select a
warehouse while executing query
Using 'show columns' to fetch database schema instead of
executing a select query in information schema
show columns does not require a warehouse to run

* modularising snowflake code to avoid repetitions

fixing internal function syntax and avoiding
code repetition

* removing user object in snowflake schema query
2019-12-02 10:48:30 +02:00
Arik Fraimovich
36ab8eae89 Update Snowflake connector version to address compatibility issue with Azure dependencies (#4407) 2019-11-27 18:44:08 +02:00
Stefan Mees
e82373ac1d add pyexasol datasource, ensure that integer dont overflow in javascript (#4378) 2019-11-27 18:43:58 +02:00
Arik Fraimovich
d3feba69b2 Downgrade Kombu version to 4.6.3 (#4406)
It was accidentally upgraded as part of the dependencies upgrade we did recently, but 4.6.5 has a bug...
2019-11-27 18:08:47 +02:00
Omer Lachish
80f3ec1c99 avoid logging job parameters (#4311) 2019-11-27 09:33:20 +02:00
Arik Fraimovich
c612bba19c Amazon CloudWatch query runners (#4372)
* CloudWatch Metrics query runner

* Add: query runner for CloudWatch Logs Insights

* Add logos

* Update Insights type

* Basic test connection

* Format files
2019-11-27 09:14:28 +02:00
Nicolas Le Manchet
f5a40827aa Remove builtins invalid in Python 3 from Python runner (#4375)
These few builtins were available in Python 2.7 but not anymore
in Python 3, making the runner fail to start.
2019-11-27 09:12:36 +02:00
Gabriel Dutra
5de291a98d Fix Map spec and Alert Page snapshot flakyness (#4403) 2019-11-26 19:08:18 -03:00
Levko Kravets
c70a48db9c Table visualization with column named "children" renders +/- buttons (#4394) 2019-11-26 15:47:19 +02:00
Omer Lachish
be56035bd6 don't try to purge jobs which have already been deleted (#4396) 2019-11-25 11:04:00 +02:00
Gabriel Dutra
7c97d8eafa Add autoscroll to ng-view (#4337) 2019-11-24 14:01:35 -03:00
Gabriel Dutra
0563ecf648 Migrate Home to React (#4379) 2019-11-24 13:59:56 -03:00
Levko Kravets
e72d7a8cca Table visualization: accept timestamp for date/time columns (#4389) 2019-11-24 11:50:52 +02:00
Levko Kravets
a7a933946b Hide deprecated visualizations from query editor (#4388)
* Hide deprecated visualizations from query editor

* Fix Map tests
2019-11-24 11:05:01 +02:00
uncletimmy3
7cfd362a7a fix typo at unsupportedRedirect.js (#4387) 2019-11-24 10:46:16 +02:00
Arik Fraimovich
4d1b359713 Remove unused npm dependencies (#4380)
* Remove ui-ace.

* Remove ui-sortable.

* Remove angular-base64-upload.

* Remove angular-messages.

* Remove jquery-ui.

* Update package-lock.json.
2019-11-21 12:18:33 +02:00
Levko Kravets
818649bbec Migrate Chart visualization to React Part 2: Editor (#4139) 2019-11-20 21:57:12 +02:00
Levko Kravets
c6a2725f0a Migrate Map visualization to React (#4278) 2019-11-20 17:36:59 +02:00
Gabriel Dutra
5cd6913e40 Fix Cypress and Percy flakyness issues (#4365) 2019-11-18 10:37:01 -03:00
Gabriel Dutra
0aebb37317 Remove Chrome Logger and update Cypress and Percy (#4354) 2019-11-14 15:23:00 -03:00
Levko Kravets
aa06b32e17 Add some tests for Choropleth visualization (#4358) 2019-11-14 19:08:51 +02:00
Levko Kravets
b44fa51829 Migrate Funnel visualization to React (#4267)
* Migrate Funnel visualization to React: Editor

* Migrate Funnel visualization to React: Renderer

* Replace Auto sort options with Sort Column + Reverse Order

* Add option for items limit (instead of hard-coded value)

* Add number formatting options

* Replace d3.max with lodash.maxBy; fix bug in prepareData

* Add options for min/max percent values

* Debounce inputs

* Tests

* Refine Renderer: split components, use Ant Table for rendering, fix data handling

* Extract utility function to own file

* Fix tests

* Fix: sometimes after updating options, funnel shows "ghost" rows from previous dataset

* Sort by value column by default
2019-11-14 15:47:17 +02:00
Levko Kravets
1a95904ffd Migrate Choropleth visualization to React (#4313)
* Migrate Choropleth to React: skeleton

* Migrate Choropleth to React: Editor - skeleton

* Choropleth Editor: Bounds tab

* Choropleth Editor: Colors tab

* Choropleth Editor: Format tab

* Choropleth Editor: General tab

* Some refinements

* Migrate Choropleth to React: Renderer

* Refine code

* CR1
2019-11-14 15:42:15 +02:00
Omer Lachish
ef56e4e920 use to set the hash instead of directly manipulating it (#4351)
* use  to set the hash instead of directly manipulating it

* Update Jobs.jsx
2019-11-13 15:36:04 +02:00
shinsuke-nara
d5a3f0de57 CLI command to reencrypt data source options (#4190)
* Script to reencrypt data source options.

* Implement reencrypt sub command under database command.
2019-11-13 15:27:20 +02:00
Arik Fraimovich
cf274d96c8 Fix: number based alerts evaluation isn't working (#4295)
* Fix: correctly evaluate numeric thresholds

* Missing import

* More missing imports

* Alert evaluation: support for booleans
2019-11-13 15:11:21 +02:00
Levko Kravets
c00410768c Migrate Cohort visualization to React (#4270)
* Migrate Cohort to React: Editor

* Extract prepareData and getOptions to own files

* Refine CohortRenderer Angular component (js, less, prepareData) for easier migration

* Migrate Cohort to React: Renderer

* Migrate Cornelius to React: styles

* Migrate Cohort to React: Cornelius library

* Cornelius: add licence info; remove unused style

* Cornelius: use numeral to format numbers; revisit styles

* Cornelius: use moment to format date labels

* Cornelius: use chroma for cell backgrounds; update options; update proptypes; minor fixes

* Tidy up

* Tests
2019-11-13 14:39:08 +02:00
Jakdaw
dda5a9d58f Fix the DB migration so that the correct key is used for encrypting DS credentials. (#4344)
Without this upgrades from at least v5 (and earlier) won't work.
2019-11-11 21:49:05 +02:00
Omer Lachish
a0a32be3dd Admin status page's current tab does not preserve (#4299)
* handle a console warning about passing in string page options

* preserve selected tab in the location hash
2019-11-11 12:04:32 +02:00
Omer Lachish
e0e94d79ac Restarting rq-scheduler reschedules all periodics (#4302)
* add some logging to scheduler

* schedule jobs only if they are not already scheduled

* jobs scheduled with an interval over 24 hours were not repeated

* schedule version_check using standard scheduling

* clean up old jobs that are not part of the definition anymore

* add some tests

* add one more test to verify that reschedules are not done when not neccesary

* no need to check for func existence - all jobs have a func to run
2019-11-11 09:54:41 +02:00
Omer Lachish
f19d24287e auto-refresh data RQ jobs admin page (#4298) 2019-11-11 09:42:05 +02:00
Gabriel Dutra
80878abf7b Migrate Settings Screen to React (#4323)
* Migrate settings-screen to React

* Use black instead of blue color for active item

* Revert "Use black instead of blue color for active item"

This reverts commit 0e4ececa6a.

* Add selectable=false to the Menu
2019-11-10 09:07:40 +02:00
Gabriel Dutra
6716bb390c Update TagsList and Sidebar to use Ant components (#4338) 2019-11-07 13:41:15 -03:00
Omer Lachish
a33d11de3a RQ: periodically clear failed jobs (#4306)
* add some logging to scheduler

* clean failed RQ job data from Redis

* move stale job purging to tasks/general.py

* provide better documentation on why we don't reject keys in FailedJobRegistry at the moment

* pleasing the CodeClimate overlords

* simplified clenaup by deleting both job data and registry entry

* use FailedJobRegistry as source of truth for purging

* remove redundant key deletion

* Update redash/settings/__init__.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>
2019-11-07 17:00:53 +02:00
Omer Lachish
6f791a092b Adjust RQ job priorities (#4301)
* prioritize periodic jobs

* declare default queues in inside worker()

* separate send_email to its own queue
2019-11-06 13:36:27 +02:00
Kyle Krueger
cce6546a62 Feature/last x days parameter (#4333)
* Add last 14, 30, 60, and 90 days to DRP.js

Date Range Parameter (DRP)

* Add last 14, 30, 60, and 60 day params to DRP.jsx

DateRangeParameters (DRP)
2019-11-05 16:15:11 +02:00
Ran Byron
5fd78fdb23 New feature - Alert muting (#4276)
* New feature - Alert muting

* pep8 fix

* Fixed backend api update

* whoops semicolon

* Implemented mute
2019-11-02 14:54:26 +02:00
Gabriel Dutra
74dbb8acf3 Skip favorites dropdown loading state on init (#4318) 2019-10-31 13:28:28 -03:00
Omer Lachish
36638be1dd optimize work horse initialization by configuration mappers on the worker process (#4314) 2019-10-30 09:53:06 +02:00
Gabriel Dutra
82f488d231 Migrate PermissionsEditor to React (#4266)
Co-Authored-By: Arik Fraimovich <arik@arikfr.com>
2019-10-29 12:42:31 -03:00
Arik Fraimovich
7b3943052e Move the setup scripts to their own home (#4310) 2019-10-28 21:11:21 +02:00
Arik Fraimovich
96a95b7090 Add V8 to the CHANGELOG. 2019-10-28 13:27:34 +02:00
Omer Lachish
accf0f7ac5 show more workers per page. also allow page size selection (#4300) 2019-10-28 09:51:57 +02:00
Arik Fraimovich
88ae639ee4 CircleCI workflow improvements (#4296)
* CircleCI workflow improvements

- Don't automatically build the Docker image.
- Make the Python lint step requirement for the follow up steps. When it fails it usually means there is a code error which will prevent the next steps anyway.

* Fix YAML syntax error.

* Add separate build Docker image step for master branch
2019-10-27 22:27:34 +02:00
Omer Lachish
ba413c210e use rq_redis_connection instead of redis_connection (#4288) 2019-10-25 14:23:24 +03:00
Levko Kravets
7157244eec Migrate Table visualization to React Part 2: Editor (#4175)
* Migrate table editor to React: skeleton, Grid tab

* Columns tab

* Cleanup

* Columns tab: DnD column sorting

* Columns types should be JSX

* New Columns tab UI/X

* Use Sortable component on Columns tab

* Tests: Grid Settings

* Tests: Columns Settings

* Tests: Editors for Text, Number, Boolean and Date/Time columns

* Tests: Editors for Image and Link columns

* Minor UI fix

* Trigger build

* Debounce inputs
2019-10-24 12:46:46 +03:00
Gabriel Dutra
9f7844640a Introduce inheritance to the Parameter structure (#4049)
* Start draft for new Parameter structure

* Add the rest of the methods

* EnumParameter

* QueryBasedDropdownParameter

* DateParameter

* DateRangeParameter

* Update Parameter usage on code

* Merge dynamicValue into normalizedValue

* Add updateLocals and omit unwanted props

* Allow null NumberParameter and omit parentQueryId

* Rename parameter getValue to getExecutionValue

* Update $$value to normalizedValue + omit on save

* Add a few comments

* Remove ngModel property from Parameter

* Use value directly in DateRangeParameter

* Use simpler separator for DateRange url param

* Add backward compatibility

* Use normalizeValue null value for isEmpty

* Start creating jest tests

* Add more tests

* Normalize null value for multi mode in Enum

* Use saved value for param isEmpty
2019-10-24 12:42:30 +03:00
Nicolas Le Manchet
246eca1121 Migrate the application to Python 3 (#4251)
* Make core app compatible with Python 3

No backward compatibility with Python 2.7 is kept.
This commit mostly contains changes made with 2to3 and manual
tweaking when necessary.

* Use Python 3.7 as base docker image

Since it is not possible to change redash/base:debian to Python 3
without breaking future relases, its Dockerfile is temporarly
copied here.

* Upgrade some requirements to newest versions

Some of the older versions were not compatible with Python 3.

* Migrate tests to Python 3

* Build frontend on Python 3

* Make the HMAC sign function compatible with Python 3

In Python 3, HMAC only works with bytes so the strings and the
float used in the sign function need to be encoded.
Hopefully this is still backward compatible with already generated
signatures.

* Use assertCountEqual instead of assertItemsEqual

The latter is not available in Python 3.
See https://bugs.python.org/issue17866

* Remove redundant encoding header for Python 3 modules

* Remove redundant string encoding in CLI

* Rename list() functions in CLI

These functions shadow the builtin list function which is
problematic since 2to3 adds a fair amount of calls to the builtin
list when it finds dict.keys() and dict.values().

Only the Python function is renamed, from the perspective of the
CLI nothing changes.

* Replace usage of Exception.message in CLI

`message` is not available anymore, instead use the string
representation of the exception.

* Adapt test handlers to Python 3

* Fix test that relied on dict ordering

* Make sure test results are always uploaded (#4215)

* Support encoding memoryview to JSON

psycopg2 returns `buffer` objects in Python 2.7 and `memoryview`
in Python 3. See #3156

* Fix test relying on object address ordering

* Decode bytes returned from Redis

* Stop using e.message for most exceptions

Exception.message is not available in Python 3 anymore, except
for some exceptions defined by third-party libraries.

* Fix writing XLSX files in Python 3

The buffer for the file should be made of bytes and the actual
content written to it strings.

Note: I do not know why the diff is so large as it's only a two
lines change. Probably a white space or file encoding issue.

* Fix test by comparing strings to strings

* Fix another exception message unavailable in Python 3

* Fix export to CSV in Python 3

The UnicodeWriter is not used anymore. In Python 3, the interface
provided by the CSV module only deals with strings, in and out.
The encoding of the output is left to the user, in our case
it is given to Flask via `make_response`.

* (Python 3) Use Redis' decode_responses=True option (#4232)

* Fix test_outdated_queries_works_scheduled_queries_tracker (use utcnow)

* Make sure Redis connection uses decoded_responses option

* Remove unused imports.

* Use Redis' decode_responses option

* Remove cases of explicit Redis decoding

* Rename helper function and make sure it doesn't apply twice.

* Don't add decode_responses to Celery Redis connection URL

* Fix displaying error while connecting to SQLite

The exception message is always a string in Python 3, so no
need to try to decode things.

* Fix another missing exception message

* Handle JSON encoding for datasources returning bytes

SimpleJSON assumes the bytes it receives contain text data, so it
tries to UTF-8 encode them. It is sometimes not true, for instance
the SQLite datasource returns bytes for BLOB types, which typically
do not contain text but truly binary data.

This commit disables SimpleJSON auto encoding of bytes to str and
instead uses the same method as for memoryviews: generating a
hex representation of the data.

* Fix Python 3 compatibility with RQ

* Revert some changes 2to3 tends to do (#4261)

- Revert some changes 2to3 tends to do when it errs on the side of caution regarding dict view objects.

- Also fixed some naming issues with one character variables in list comprehensions.

- Fix Flask warning.

* Upgrade dependencies

* Remove useless `iter` added by 2to3

* Fix get_next_path tests (#4280)

* Removed setting SERVER_NAME in tests setup to avoid a warning.

* Change get_next_path to not return empty string in case of a domain only value.

* Fix redirect tests:

Since version 0.15 of Werkzeug it uses full path for fixing the location header instead of the root path.

* Remove explicit dependency for Werkzeug

* Switched pytz and certifi to unbinded versions.

* Switch to new library for getting country from IP

`python-geoip-geolite2` is not compatible with Python 3, instead
use `maxminddb-geolite2` which is very similar as it includes
the geolite2 database in the package .

* Python 3 RQ modifications (#4281)

* show current worker job (alongside with minor cosmetic column tweaks)

* avoid loading entire job data for queued jobs

* track general RQ queues (default, periodic and schemas)

* get all active RQ queues

* call get_celery_queues in another place

* merge dicts the Python 3 way

* extend the result_ttl of refresh_queries to 600 seconds to allow it to continue running periodically even after longer executions

* Remove legacy Python flake8 tests
2019-10-24 12:42:13 +03:00
Arik Fraimovich
7ffb97232e Pin Cypress version (#4284) 2019-10-24 12:22:56 +03:00
Omer Lachish
8b9fa53efe extend the result_ttl of refresh_queries to 600 seconds to allow it to continue running periodically even after longer executions (#4283) 2019-10-24 11:56:07 +03:00
Omer Lachish
43b35b6fb4 Monitor general RQ queues (default, periodic and schemas) (#4256)
* track general RQ queues (default, periodic and schemas)

* get all active RQ queues

* call get_celery_queues in another place
2019-10-23 12:31:32 +03:00
Omer Lachish
f0f85ece42 avoid loading entire job data for queued jobs (#4257) 2019-10-23 11:43:31 +03:00
Omer Lachish
612833404b show current worker job (alongside with minor cosmetic column tweaks) (#4262) 2019-10-23 11:20:15 +03:00
Ran Byron
5d58503623 Minor alert bug fixes (#4274) 2019-10-22 16:58:20 +03:00
Ran Byron
3dfad87266 Extracted alert menu button (#4273) 2019-10-22 13:00:16 +03:00
Levko Kravets
0659ef1079 Add "use-debounce" dependency (#4268) 2019-10-19 22:28:57 +03:00
Ran Byron
a2e21dd1c3 App Header React migration (#4245) 2019-10-19 14:25:58 +03:00
Levko Kravets
f165cad9ff Migrate Sunburst Renderer to React (#4259) 2019-10-17 19:16:05 +03:00
Levko Kravets
e0a2705c1a Restore <body> bottom padding (#4252) 2019-10-17 13:22:09 +03:00
Levko Kravets
0aca649cb5 Migrate Sankey renderer to React (#4255) 2019-10-17 13:19:29 +03:00
Stefan Maric
79b37e8843 Fix double-scrollbar when in fullscreen (#4243) 2019-10-16 23:46:44 +03:00
Ran Byron
72bb5d29a0 Fix: Alert page breaks when target query returns null result (#4250)
* Fix: Alert page breaks when target query returns null result

* Better handling of topValue value
2019-10-16 11:27:37 +03:00
Omer Lachish
5a5fdecdde Replace Celery with RQ (except for execute_query tasks) (#4093)
* add rq and an rq_worker service

* add rq_scheduler and an rq_scheduler service

* move beat schedule to periodic_jobs queue

* move version checks to RQ

* move query result cleanup to RQ

* use timedelta and DRY up a bit

* move custom tasks to RQ

* do actual schema refreshes in rq

* rename 'period_jobs' to 'periodic', as it obviously holds jobs

* move send_email to rq

* DRY up enqueues

* ditch  and use a partially applied  decorator

* move subscribe to rq

* move check_alerts_for_query to rq

* move record_event to rq

* make tests play nicely with rq

* 👋 beat

* rename rq_scheduler to plain scheduler, now that there's no Celery scheduler entrypoint

* add some color to rq-worker's output

* add logging context to rq jobs (while keeping execute_query context via get_task_logger for now)

* move schedule to its own module

* cancel previously scheduled periodic jobs. not sure this is a good idea.

* rename redash.scheduler to redash.schedule

* allow custom dynamic jobs to be added decleratively

* add basic monitoring to rq queues

* add worker monitoring

* pleasing the CodeClimate overlords

* adjust cypress docker-compose.yml to include rq changes

* DRY up Cypress docker-compose

* add rq dependencies to cypress docker-compose service

* an odd attempt at watching docker-compose logs when running with Cypress

* Revert "an odd attempt at watching docker-compose logs when running with Cypress"

This reverts commit 016bd1a93e.

* show docker-compose logs at Cypress shutdown

* Revert "DRY up Cypress docker-compose"

This reverts commit 43abac7084.

* minimal version for binding is 3.2

* remove unneccesary code reloads on cypress

* add a  command which errors if any of the workers running inside the current machine haven't been active in the last minute

* SCHEMAS_REFRESH_QUEUE is no longer a required setting

* split tasks/queries.py to execution.py and maintenance.py

* fix tests after query execution split

* pleasing the CodeClimate overlords

* rename worker to celery_worker and rq_worker to worker

* use /rq_status instead of /jobs

* show started jobs' time ago according to UTC

* replace all spaces in column names

* fix query tests after execution split

* exit with an int

* general lint

* add an entrypoint for rq_healthcheck

* fix indentation

* delete all existing periodic jobs before scheduling them

* remove some unrequired requires

* move schedule example to redash.schedule

* add RQ integration to Sentry's setup

* pleasing the CodeClimate overlords

* remove replication settings from docker-compose - a proper way to scale using docker-compose would be the --scale CLI option, which will be described in the knowledge based

* revert to calling a function in dynamic settings to allow periodic jobs to be scheduled after app has been loaded

* don't need to depend on context when templating failure reports

* set the timeout_ttl to double the interval to avoid job results from expiring and having periodic jobs not reschedule

* whoops, bad merge

* describe custom jobs and don't actually schedule them

* fix merge
2019-10-15 23:59:22 +03:00
Omer Lachish
f6e1470a7c Avoid depending on app context when templating failure reports (#4231)
* don't need to depend on context when templating failure reports

* extract a render_template function with some docs

* CodeClimate has really outdone itself this time. Removed a whitespace character in order to fix 2 CodeClimate errors

* apparently whitespace doesn't count as a character
2019-10-15 23:08:28 +03:00
Arik Fraimovich
27cd76797e Make sure query results are consistent (#4246) 2019-10-15 21:48:44 +03:00
Amol Grover
29b113005c pagerduty.py: Change default summary text (#4239)
* pagerduty.py: Change default summary text

Change is made to use alert name in PagerDuty's alert
destination default summary text instead of
query id and name

* Update default description text & field description
2019-10-15 11:34:34 +03:00
Ran Byron
53d971bf87 Implemented new condition comparison options (#4240)
* Implemented new condition comparison options

* Fixed test

* Move backward compatibility code to service
2019-10-15 08:41:23 +03:00
Gabriel Dutra
a102e93e50 Fix dashboard parameter mapping issues (#4211) 2019-10-14 17:21:44 -03:00
Ran Byron
74beed80d2 Fixed hangouts chat icon (#4236) 2019-10-11 13:11:15 +03:00
Ran Byron
39f038f992 Fixed alert destination hrefs (#4235)
* Fixed alert destination hrefs

* Added query url
2019-10-11 13:10:47 +03:00
Gabriel Dutra
da2ed56281 Extend bolder markdown fix to widget description (#4229) 2019-10-10 09:53:58 -03:00
Arik Fraimovich
9d8812a598 Postgres: make sure table from the public schema doesn't get merged with table from other schemas (#4224)
* Postgres: make sure table from the public schema doesn't get merged with a table from another schema.

* PEP8 updates
2019-10-10 13:02:22 +03:00
Arik Fraimovich
204447a9f5 Add interface to abstract query result persistence (#4147)
* Add interface to implement custom persistence for QueryResult data

Co-authored-by: Omer Lachish <omer@rauchy.net>

* Deserialize query results data in the model

* Change order of mixins.

* Make DBPersistence.data setter in sycn with getter + tests
2019-10-10 10:39:55 +03:00
Arik Fraimovich
3b7efb8c1f Make sure that the default settings signal that no email server is configured (#4226)
* The sender email address has to be None for the test of "is email server
configured" to be correct. Moved the dev setting into docker-compose.yml.

* Move the REDASH_MAIL_SERVER setting into docker-compose.yml to revert the default value to its original value in case anyone was using it.

* Make worker dependant on email as it's the one that actually using it.
2019-10-07 22:23:22 +03:00
Ran Byron
69dc761c60 Alert page - migrate to React and redesign (#4153) 2019-10-07 19:15:06 +03:00
Ran Byron
2f42b8154c Fix: Misleading warning when trying to download results of unsaved query #4218 (#4219) 2019-10-06 16:00:24 +03:00
Arik Fraimovich
3f9d49dbd1 Remove debug code (#4216) 2019-10-06 11:57:05 +03:00
Justin Clift
0a5dca5d72 Adjust botocore dependency, so we don't need to update it as often (#4154) 2019-10-06 11:47:16 +03:00
Gabriel Dutra
8ea285dda9 Split setup in advanced and regular for data sources and destinations (#4160)
* DynamicForm support for advanced options

* Randomly select a few options to be advanced

* Merge conditions with the same logic

* Address some comments

* Update styling for the button

* Some style adjustments (#4162)

* Don't set default value to additional settings

* Rename advanced -> extra

* Show extra fields by default when they are filled

* Update hasFilledExtraField logic

* Add example field from destination as extra
2019-10-06 11:46:50 +03:00
Gabriel Dutra
569c325aa0 Support for dropdown of predefined options in data sources setup (#4161)
* Support for predefined options in data sources

* DynamicForm Select: title -> name

* Make it work with "enum" prop

* Make it work for "extendedEnum" prop

* Not JS

* Deep copy the configuration schema
2019-10-06 11:44:56 +03:00
Gabriel Dutra
d8a0af1a95 Fix query based dropdown not adding quote marks correctly (#4186)
* Handle non-array in multi-value QueryBasedParameter

* Use state value in QueryBasedParameterInput

* Normalize array in parameter structure

* Add Multi-selection test

* Remove unnecessary not null check
2019-10-06 11:35:47 +03:00
Ran Byron
648847df0b Fix: Multi-value Dropdown not available in Static Value edit dialog (#4213) 2019-10-05 17:52:50 +03:00
Arik Fraimovich
3f31bf3fc0 Fix: use correct variable name (#4210) 2019-10-03 13:00:21 +03:00
Rui Z
f6ad3d9d24 Vertica: prevent overwriting row data when duplicated column names exist (#4201)
* Vertica: prevent overwriting row data when duplicated column names exist

* remove enumeration
2019-10-02 12:20:51 +03:00
bennywij
e8ccdc23c7 Correct typo in log stmt. Add comment re PR 4201 (#4205) 2019-10-02 11:37:57 +03:00
Levko Kravets
a8af968d70 Sortable component (#4199) 2019-09-30 19:12:27 +03:00
Jesse
cb14459881 Fixes #3766. (#4189) 2019-09-27 11:00:50 +02:00
Gabriel Dutra
780fbceba5 Fix Pivot Visualization should not be saving data (#4174) 2019-09-25 11:36:39 -03:00
Omer Lachish
2c77c219c6 Add maildev to the dev stack (#4173)
* add maildev to the dev stack

* Update redash/settings/__init__.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>
2019-09-25 10:50:34 +03:00
Gabriel Dutra
874e0d1ce3 Fix Execute Selected not working for dirty queries (#4176) 2019-09-24 10:59:40 -03:00
Gabriel Dutra
401d164622 Remove Widget dev console errors (#4177) 2019-09-24 07:39:03 -03:00
Arik Fraimovich
ff041b77cf Update Sentry-SDK (#4169) 2019-09-23 09:54:10 +03:00
Arik Fraimovich
b2d1636f8e Downgrade mysqlclient to 1.3.14 (#4165)
Closes #4164.
2019-09-22 14:56:09 +03:00
Arik Fraimovich
a3e8477410 List enabled Query Runner types during build (#4166)
* Add CLI command to list enabled query runner types
2019-09-22 14:55:21 +03:00
Omer Lachish
ed22b63f22 remove the annoying quoted title from EmptyState (#4168) 2019-09-22 14:33:19 +03:00
Arik Fraimovich
d636b29ba9 Update version (#4167) 2019-09-22 13:23:56 +03:00
Ran Byron
6173a2a619 Handle Create Dashboard with middle click (#4158) 2019-09-22 10:57:28 +03:00
Gabriel Dutra
fd435d2182 Migrate Pivot Table visualization to React (#4133)
* npm install react-pivottable

* Initiate Pivot Table Migration

* Update renderer with editor options

* Clean up

* Remove old pivottable from package.json

* Test Percy Snapshot with Pivot Table in a Dashboard

* Tmp: use cy.wait to make sure dashboard is loaded

* Clean up Percy snapshot test

* Small improvements
- cy.all with multiple args
- add controls to pivot valid options

* Watch for options in the Renderer
2019-09-22 10:46:03 +03:00
Gabriel Dutra
cb654b3f21 Migrate Widget component to React (#4020)
* Improve sizing for Number inputs

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* Migrate WidgetDialog

* Start migrating Widget

* Update textbox to use HtmlContent

* QueryLink migration and some updates

* Add visualization rendering

* Render widget

* Add delete button

* Update AutoHeight

* Add widget bottom

* Add Drodpown button

* Split Widget component

* Update with #4056 and trigger netlify

* In progress: use composition

* Add header and footer

* Update widget actions positioning

* Re-render when refreshing from widget

* Add workaround to force DashboardGrid re-render

* VisualizationWidgetFooter component

* VisualizationWidget menu

* Separate RestrictedWidget

* Update tests

* Update margin for Parameters

* Remove widget files

* Revert "Improve sizing for Number inputs"

This reverts commit a02ce8f0aa.

* Some cleanup

* Move refresh logic to the Dashboard

* Add loadingWidgets logic to the public dashboard

* Add onLoadWidget

* Remove parameter from URL when empty

* Recreate widget array instead of loadingWidgets

* Add comment about re-rendering + whitespace missing

* CR changes

* Use plain html instead of string syntax

Co-Authored-By: Ran Byron <ranbena@gmail.com>
2019-09-20 22:08:42 +03:00
Arik Fraimovich
e8d40bbdac CHANGELOG for v8.0.0-beta.2 (#4145)
* Stop building tarballs.

* Update version reference.

* CHANGELOG for 8.0.0-beta.2
2019-09-18 11:23:32 +03:00
Levko Kravets
e5d52055d9 Widget filters overlapped by visualization (#4137)
* Fix: widget filters overlapped by visualization

* Fix tests

* Fix tests
2019-09-18 11:22:26 +03:00
Levko Kravets
c5e414e6ba Color picker component (#4136) 2019-09-16 13:01:48 +03:00
Gabriel Dutra
b9a40d1808 Query Snippets: Use onClick instead of link for 'Click here' option (#4144)
* Snippets: Don't change url when not needed

* Revert "Snippets: Don't change url when not needed"

This reverts commit 2f346f3bb4.

* Query Snippets: use onClick instead of link
2019-09-16 10:00:23 +03:00
Ran Byron
033dd0d15e Bug fix: Query view doesn't sync parameters when selecting and deleting (#4146) 2019-09-16 07:15:38 +03:00
Arik Fraimovich
95795d93c7 CHANGELOG for V8-beta. (#4057)
* CHANGELOG for V8-beta.

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md
2019-09-15 15:48:59 +03:00
Arik Fraimovich
75e48b0bd6 Allow users to share aggregated usage information with us (#4108)
* Initial commit of BeaconConsent component

* Add comment about being able to change setting

* Use <Text> correctly

* Final version of consent screen

* Show beacon consent message on homepage only if it wasn't enabled already.

* Add consent setting to organization settings screen.

* Add support for custom message in OrgSetting.save.

* Implmenet consent saving.

* If consent given, send extra data

* Add HelpTrigger

* Make CodeClimate happy

* Wrap everything with DynamicComponent
2019-09-15 15:18:48 +03:00
Levko Kravets
75883a1a02 Counter Editor: move components to own files (#4138) 2019-09-13 22:35:19 +03:00
Gabriel Dutra
75a5546741 Add jsconfig settings with '@' webpack alias (#4135) 2019-09-12 18:25:40 -03:00
Levko Kravets
54071e4b87 Migrate Chart visualization to React Part 1: Renderer (#4130)
* Migrate Chart visualization: Renderer

* Refine PlotlyChart component; move stylesheets to visualization's folder

* Migrate Custom JS Chart to React

* Cleanup
2019-09-12 10:23:43 +03:00
Arik Fraimovich
6458a1eb62 Remove duplicate messages method (#4131) 2019-09-11 11:56:40 +03:00
Levko Kravets
ecf160c9bc Alerts: Add more condition comparison options (#4134)
* getredash/redash#4132 Add more condition comparison options

* Add arguments to fallback lambda
2019-09-11 11:18:59 +03:00
Levko Kravets
2c98f0425d Allow the user to decide how to handle null values in charts (#4071)
* getredash/redash#2629 Refactor Chart visualization, add option for handling NULL values (keep/convert to 0.0)

* Handle null values in line/area stacking code; some cleanup

* Handle edge case: line/area stacking when last value of one of series is missing

* Mjnor update to line/area stacking code

* Fix line/area normalize to percents feature

* Unit tests

* Refine tests; add tests for prepareLayout function

* Tests for prepareData (heatmap) function

* Tests for prepareData (pie) function

* Tests for prepareData (bar, line, area) function

* Tests for prepareData (scatter, bubble) function

* Tests for prepareData (box) function

* Remove unused file
2019-09-09 13:00:26 +03:00
Ran Byron
8f01988c8c Decrease size of widget pagination (#4120)
* Added tests

* Perhaps this would trigger percy

* Decrease size of widget pagination

* Removed unused attr

* Updated tests
2019-09-09 10:57:26 +03:00
Arik Fraimovich
b8741f6cff Sync botocor eversions across requirements files. (#4128) 2019-09-09 10:44:05 +03:00
Levko Kravets
424751d9e9 Migrate Counter visualization to React (#4106)
* Migrate Counter to React: Renderer

* Migrate Counter to React: Editor

* Cleanup

* Review and fix rows indexing algorithm

* Counter not properly scaled in editor

* Fix wrong label for/input id pair

* Tests

* Tests

* Fix vendor prefixes

* Remove unnecessary useEffect dependencies

* Update tests

* Fix Percy snapshot names
2019-09-09 10:10:10 +03:00
Arik Fraimovich
e048a69392 Upgrade Sentry-SDK and enable additional integratoins (#4127)
* Update sentry-sdk version

* Add additional Sentry integrations
2019-09-09 10:00:09 +03:00
Ran Byron
2c1e846837 Widget table scroll-x visible (#4101)
* Table viz horizontal scroll made visible

* Added tests

* Fixed snapshot pre-condition

* Perhaps this would trigger percy
2019-09-09 09:50:03 +03:00
Justin Clift
4b9e26de5a Update botocore, to get pass pip warning (#4122) 2019-09-04 09:12:22 +03:00
sphenlee
17f50192e7 hive_ds: show a user friendly error message when possible (#4121) 2019-09-04 08:10:56 +03:00
Gabriel Dutra
dcdec0abb5 Use ng-src for data source icons (#4123) 2019-09-03 20:42:19 +03:00
Ran Byron
302c6dd02e Fix number param value normlization (#4116) 2019-09-02 16:29:56 +03:00
Arik Fraimovich
4c56900248 Move annotation logic into Query Runner (#4113)
* Code formatting

* Move annotation logic into query runner, so it can be overriden in the query runner.

* Add mixin to __all__

* Switch to flag instead of mixin

* Feature (Redshift): option to set query group for adhoc/scheduled queries  (#4114)

* Add scheduled status to query job metadata.

* Add: option to set query group for adhoc/scheduled Redshift queries

* Scheduled might not be set for already enqueued queries.
2019-09-02 16:01:05 +03:00
swfz
1f1f853297 Display data source icon in query editor (#4119) 2019-09-02 14:42:41 +03:00
Arik Fraimovich
43f63b1b57 Add ability to use Ant's Table loading property when using ItemsTable (#4117) 2019-09-02 14:38:28 +03:00
Gabriel Dutra
5ae80835b1 Fix Dropdown parameter options appearing behind Dialog (#4109) 2019-09-01 21:55:37 -03:00
Arik Fraimovich
df3da82afd Fix: allow users with view only acces to use the queries in Query Results (#4112)
* Fix: allow users with view only acces to access the queries

* Add tests

* Update error message

* Update error message. Take 2
2019-09-01 22:17:53 +03:00
Ran Byron
98e33b7780 Fix widget bottom element alignment (#4110) 2019-09-01 16:59:11 +03:00
Omer Lachish
8a3f6f90eb Update badge in README.md to link to CircleCI (#4104)
* Update README.md

* Update README.md

* Update README.md

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* Update README.md
2019-09-01 10:50:14 +03:00
shinsuke-nara
cab011def9 Migrate with SQL statements. (#4105) 2019-08-30 14:08:22 +03:00
Omer Lachish
31c888ea8e Dashboard: when updating parameters, run only relevant queries (#3804)
* refresh only affected queries in dashboard when parameters are changed

* rename pendingParameters to updatedParameters

* select which widgets to update according to their mapping as a dashboard-level parameter

* use lodash's include
2019-08-30 07:03:51 +03:00
Sandeep Belagavi
443054428f [Qubole] - Adding support to process Quantum query types. (#4066)
* [Qubole] - Adding support to process Quantum query types.

Quantum is a serverless interactive service that offers
direct SQL access to user's data lake. Changes are made
to accept `quantum` query type from user which makes
`Cluster Label` as optional.

* -Making quantum as defult query.
-Dictionary safe access to connection parmeters

* keeping pep8 standards

* Maintainig pep8 std

* Use latest version of qds-sdk

* Use qds-sdk v1.13.0

* Use qds-sdk v1.12.0

* Use qds-sdk v1.13.0

* Updating SDK with verified version

* hive as default query type

* qds-sdk : Locking most recent release version

* qds-sdk : Locking recent release version

* falling back to original version of qds-sdk
2019-08-29 19:22:52 +03:00
Gleb Lesnikov
ef9a4d5eed [Data Sources] Add: Azure Data Explorer (Kusto) query runner (#4091)
* [Data Sources] Add: Azure Data Explorer (Kusto) query runner

* CodeClimate fixes

* Remove TODO

* Fixed configuration properties names for Azure Kusto

* Azure Kusto: get_schema in one query

* azure-kusto-data update to 0.0.32

* Add Kusto to the default query runners list
2019-08-26 10:17:49 +03:00
Arik Fraimovich
a2b68a3569 Make sure we always pass a list to _get_column_lists (#4095)
(some data sources might return None as the columns list)
2019-08-25 17:39:15 +03:00
Ran Byron
e7b707eb25 Removed redash-newstyle.less (#4017) 2019-08-22 08:06:54 +03:00
Arik Fraimovich
1786273344 Fix: MySQL connections without SSL are failing (#4090)
* Move connection logic into a single method & make sure not to pass ssl value if not used.

* Remove wildcard import and format file.
2019-08-21 14:31:17 +03:00
Christian Clauss
d38ca803c5 Add more flake8 tests and fail build if any test fails (#4055)
* Add more flake8 tests and fail build if any test fails

Run all flake8 E9xx + F63x + F7xx + F82x tests.

* long = long in Python 2
2019-08-18 11:27:44 +03:00
Gabriel Dutra
a1f11cb8d9 Migrate Parameters component to React (#4006)
* Start Parameters Migration

* Add dirtyCount

* Use workaround with setState

* Apply Changes

* Add EditSettingsDialog

* Add Cmd/Ctrl + Enter behavior

* Remove isApplying

* Delete Angular version of parameters

* Update tests

* Remove angular stuff

* Update jest

* Drag placeholder

* Update events

* Use old button styling and move css

* Reviewing code

* Add parameter rearrange test

* Add Parameter Settings title change test

* Update Parameter Settings button styling

* Move parameter url logic back to Parameters

* Disable url update when query is new

* Styling changes (#4019)

* Ran's title width styling

* Update drag test

* Improve sizing for Number inputs

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* Fix issue with dragged parameter wrapping

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* Don't reevaluate dirtyParamCount

* Allow multiple values :)

* Fix parameter alignments

* Fix Select width on search

* Update client/app/components/Parameters.less

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* Humanize param.name

* Make sure angular updates Execute disabled status
2019-08-18 11:27:20 +03:00
Vladimir Ponarevsky
b426e4fdc4 Fix clickhouse password leak (#4078)
* Fix clickhouse password leak

* Fix after review
2019-08-18 11:05:41 +03:00
Arik Fraimovich
e5e926bac5 Pin kombu version (#4075)
kombu is a dependency of Celery and usually we let them declare the version, but their version is pinned and the most recent release (4.6.4) has a severe regression where workers stop responding to inspect commands.
2019-08-16 19:27:24 +03:00
Arik Fraimovich
24d68008fa Format target value as a number with reasonable default (#4073) 2019-08-15 15:54:32 +03:00
Arik Fraimovich
0e90b89acc ParameterizedQuery: handle the case where a value is null (#4072) 2019-08-15 15:18:40 +03:00
Jannis Leidel
2c2f241671 Require a more up-to-date version of importlib-metadata. (#4069) 2019-08-15 11:50:27 +03:00
Jakdaw
d49514abe9 When we fork a query, make sure we create the new visualizations in the same order as per the source query (#4067) 2019-08-14 11:08:56 +03:00
Arik Fraimovich
934a145ced Switch to mysqlclient from Python-MySQL (#4061) 2019-08-14 10:11:53 +03:00
Omer Lachish
f7c70c2b91 Add parameter dialog doesn't work when query has selected text (#4032)
* debounce updateQuery to prevent pasting parameters over selected texts failing parseQuery (see #4032)

* drop defer
2019-08-14 07:47:34 +03:00
The Alchemist
69ba165565 [Data Sources] Initial commit for adding Dgraph support (#3987)
* Initial commit for adding Dgraph support

* Made suggestions from https://codeclimate.com/github/getredash/redash/pull/3964

* feedback from @arikfr

* added logo for Dgraph from Twitter

* Better conversion of Dgraph JSON to Redash's internal JSON

* made recommendations from @arikfr

* removed unused function
2019-08-13 13:14:37 +03:00
Jannis Leidel
7b5696dc75 Fix loading of periodic tasks and clean up extension loading. (#4064)
* Fix loading of periodic tasks and clean up extension loading.

This does a few things:

- add tests for extension loading
- refactor the extension and periodic task loading
- better handle assertions raised by extensions (e.g. when an extension tries to override an already registered view)
- attach exception traceback to error log during loading for improved debugging

* Use site.addsitedir instead of calling pip.

* Use sys.path instead of site.addsitedir and also the setup.py egg_info command.
2019-08-13 13:11:59 +03:00
Gabriel Dutra
4698408a08 Cypress: Fix cy.clock not freezing time (#4060) 2019-08-13 07:08:59 -03:00
Ievgen Aleinikov
be142d60df Add assume role as a credential source for AWS Athena Query runner (#4028)
* allowing to specify a custom work group for AWS Athena queries

* Fixing title + adding correct position in the UI

* Adding assume role configuration to Athena query runner.

* removing extra blank lines

* fixes based on comments to the PR
2019-08-12 16:45:56 +03:00
Arik Fraimovich
aceea6516f Change the required Docker Compose version to 3.2 (#4059)
With the default Docker installed from sources on Ubuntu 19.04 it failed starting the project when asking for Compose version 3.7, but everything worked fine with 3.2.
2019-08-12 13:26:29 +03:00
Arik Fraimovich
685b53672e Prevent CSP violations by not having script URLs (#4062)
* Fix: remove inline script to avoid CSP violation

Closes #4039.

* Restore eslint rule that prevents javascript href attributes.

* Remove all inline script links.
2019-08-12 13:25:07 +03:00
Arik Fraimovich
7dd62ef948 Add option to control whether to format target value. (#4063) 2019-08-12 13:24:11 +03:00
Evghenii Goncearov
7c2acc34c9 Dont send password reset link to disabled users (#2631)
* Dont send password reset link to disabled users

* Update email subject

* Update blocked email text.

* Update blocked email text (plain text version).

* Remove debug print.
2019-08-11 17:29:26 +03:00
Arik Fraimovich
c5a90876f3 Add Cassandra to the list of default enabled query runners (#4058) 2019-08-11 17:17:57 +03:00
Takuya Arita
8abaf89394 Add tag management commands (#3168) 2019-08-11 16:30:48 +03:00
PengYuan Lai
aa2bd0042e check float if scale > 0 in snowflake query result (#3876) 2019-08-11 16:21:57 +03:00
Yoshiken
a7b14bfb9a Fix according to pycodestyle format (#4011)
* Fix W292 no newline at end of file

* Fix extra whitespace

* Fix E305 expected 2 blank lines after class or function definition

* Fix W391 blank line at end of file

* Fix E231 missing whitespace after

* Fix E303 too many blank lines

* Fix E302 expected 2 blank lines

* Fix E128 continuation line under-indented for visual indent
2019-08-11 16:09:04 +03:00
Oluwafemi Sule
4e5f55a4b7 Align content vertically in restricted widget type (#4056) 2019-08-11 15:28:46 +03:00
Omer Lachish
76fbe858ba refresh_queries requires Request Context (#4045)
* avoid using 'abort' in parameterized query - raise an exception instead

* when facing invalid parameters or detached dropdown queries - continue to refresh the rest of the outdated queries

* test that dropdown queries detached from data source raise an exception when fetch values is attempted

* test that queries with invalid parameters arent refreshed

* test that queries with dropdown query parameters which are detached from the data source are skipped

* fix stale test double name

* newlines. newlines everywhere.

* pass org into dropdown_values

* pass in org in every ParameterizedQuery usage

* Update redash/tasks/queries.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>

* reduce refresh_queries log noise

* track failure count for queries that failed to apply parameters, and also notify the failures

* Update redash/tasks/queries.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>

* newlines. newlines everywhere.
2019-08-09 15:26:31 +03:00
Omer Lachish
cf7aef1e16 Make sure there is an event for any query execution (#4051)
* move event recording for query executions inside run_query

* include indication of cache hit or miss inside execute_query events
2019-08-09 15:24:17 +03:00
Jannis Leidel
77625b2a13 Remove duplicate base_url function. (#4043) 2019-08-08 10:44:44 +03:00
Omer Lachish
c4dcf01b3c avoid variable shadowing (#4050) 2019-08-07 22:43:04 +03:00
Ran Byron
a167c590b6 Added arrow to multi-select component (#4044) 2019-08-06 16:46:53 +03:00
Gabriel Dutra
8e23f93433 Allow dynamic values dropdown to scroll with the page (#4040) 2019-08-06 08:55:25 -03:00
Levko Kravets
e41d40bbe0 getredash/redash#4036 Visualisation editor crashes out when changing datetype to non-HTML text (#4037) 2019-08-05 12:37:21 +03:00
Gabriel Dutra
6fc4d5b551 Focus DatePicker after selecting dynamic values (#4033) 2019-08-04 22:24:33 -03:00
Gabriel Dutra
f0576a3623 Support multi-select in parameters (#3952)
* Allow multiple values for enum parameter

* Allow multi-select for Query dropdown parameters

* CR + make sure list values are allowed

* Add prefix, suffix and separator

* Rename multipleValues and cast options as strings

* Replicate serialization logic on frontend

* Add Quote Option Select

* Make sure it's enum or query before join

* Add a couple of tests

* Add help to quote option

* Add min-width and normalize empty array

* Improve behavior when changing parameter settings
- Set parameter value again to pass through checks
- Add setValue check for multi values

* Validate enum values on setValue + CodeClimate

* Ran wording suggestions

* Updates after Apply Changes

* Fix failing Cypress tests

* Make sure enumOptions exists before split

* Improve propTypes for QueyBasedParameterInput

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* CR

* Cypress: Test for multi-select Enum

* Fix multi-selection Cypress spec

* Update Refresh Schedule
2019-08-04 15:47:30 +03:00
Levko Kravets
9eabf89771 getredash/redash#4031 Counter visualization: formatting not applied to target value (#4035) 2019-08-04 15:22:53 +03:00
Arik Fraimovich
11cc274c1c Update Snowflake connector version to latest (#4029) 2019-08-04 08:55:02 +03:00
Ran Byron
8ad08a566a Revert "Revoked widget refresh button spinners" (#4027)
This reverts commit ab5494a8fd.
2019-08-01 08:23:17 +03:00
Levko Kravets
ef31d0d768 Fix: don't update dashboard's version when adding a widget (#4026) 2019-07-31 22:28:12 +03:00
Levko Kravets
4640c33387 Bug fix: error when trying to collect dashboard-level filters for a textbox widget (#4024) 2019-07-31 18:03:40 +03:00
Levko Kravets
9b290913a6 Migrate Table visualization to React Part 1: Renderer (#3963) 2019-07-31 17:33:33 +03:00
Ran Byron
db89c4f7bc Turned off max asset size warning (#4023) 2019-07-31 11:34:52 +03:00
Gabriel Dutra
eae1fb7d73 Force readonly inputs click (#4016) 2019-07-30 11:16:34 +03:00
Arik Fraimovich
4f742aeaac Fix: support for unicode in DynamoDB queries (#4015) 2019-07-30 11:14:57 +03:00
Ran Byron
5ddad862be Updated timeago strings (#4012)
* Updated timeago strings

* Moved moment config to app/config
2019-07-29 18:03:59 +03:00
Ran Byron
6f811f163a Added widget header refresh indicator (#3970) 2019-07-29 16:43:44 +03:00
Omer Lachish
7fb33e3ebb Failed Scheduled Queries Report (#3798)
* initial work on e-mail report for failed queries

* send failure report only for scheduled queries and not for adhoc queries

* add setting to determine if to send failure reports

* add setting to determine interval of aggregated e-mail report

* html templating of scheduled query failure report

* break line

* support timeouts for failure reports

* aggregate errors within message and warn if approaching threshold

* handle errors in QueryExecutor.run instead of on_failure

* move failure report to its own module

* indicate that failure count is since last report

* copy changes

* format with <code>

* styling, copy and add a link to the query instead of the query text

* separate reports with <hr>

* switch to UTC

* move <h2> to actual e-mail subject

* add explicit message for SoftTimeLimitExceeded

* fix test to use soft time limits

* default query failure threshold to 100

* use base_url from utils

* newlines. newlines everywhere.

* remove redundant import

* apply new design for failure report

* use jinja to format the failure report

* don't show comment block if no comment is provided

* don't send emails if, for some reason, there are no available errors

* subtract 1 from failure count, because the first one is represented by 'Last failed'

* don't show '+X more failures' if there's only one

* extract subject to variable

* format as text, while we're at it

* allow scrolling for long exception messages

* test that e-mails are scheduled only  when beneath limit

* test for indicating when approaching report limits + refactor

* test that failures are aggregated

* test that report counts per query and reason

* test that the latest failure occurence is reported

* force sending reports for testing purposes

* Update redash/templates/emails/failures.html

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* Update redash/templates/emails/failures.html

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* Update redash/tasks/failure_report.py

* add org setting for email reports

* remove logo from failure report email

* correctly use the organization setting for sending failure reports

* use user id as key for failure reports data structure

* Update redash/tasks/failure_report.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>

* build comments while creating context for e-mail templates

* figure out the base url when creating the e-mail

* no need to expire pending failure report keys as they are deleted anyway when sent

* a couple of CodeClimate changes

* refactor key creationg to a single location

* refactor tests to send e-mail from a single function

* use beat to schedule a periodic send_aggregated_errors task instead of using countdown per email

* remove pending key as it is no longer required when a periodic task picks up the reports to send

* a really important blank line. REALLY important.

* Revert "a really important blank line. REALLY important."

This reverts commit c7d8ed8972.

* a really important blank line. REALLY important. It is the best blank line.

* don't send failure emails to disabled users
2019-07-28 12:40:54 +03:00
Omer Lachish
f165168860 recycle gunicorn workers (#4013) 2019-07-28 11:39:14 +03:00
Gabriel Dutra
86b0608fde Fix Apply Changes is lost when query is edited (#4010)
Co-Authored-By: Ran Byron <ranbena@gmail.com>
2019-07-27 19:05:49 -03:00
Gabriel Dutra
cd4daf8823 Add Dynamic Values to Date and Date Range Parameters (#3904)
* Draft for Date Dynamic values

* Use value with prefix instead of specific attr

* Fix not possible to select static value

* Update antd version

* Cleanup and DateRangeParameter

* Dynamic DateTimeRange

* Add Dynamic options to Date Parameters

* UI refinements

* Add getDynamicValue function

* Add 'This' options and prevent text clipping

* Make allowClear available

* Update ScheduleDialog snapshot

* Add some protections and separate Date/DateRange

* Accept null values on date or daterange parameters

* Handle undefined values on Moment propType

* Move export to end of files

* Remove Today/Now option

* Update with Apply Changes

* Show name instead of value for dynamic values

* Add comment about supporting useCurrentDateTime

* Cypress Tests: Date Parameters

* Cypress Tests: Date Range Parameters

* Don't put null params in the url

* Add workaround comments to Cypress tests

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* Fix Dynamic Value as default for global parameters

* Update Back to Static Value

* Add isValid to value on Date and DateRange inputs

* CR suggestions

* Fix Back to Static Value for Dates

* Update Dynamic Value Styling

* Fix failing Date tests

* Fix selectedDynamicValue

* Parameter spec: Remove date range clickThrough

* Add transition

* Fix failing Cypress tests

* Back with 'width: auto'

* Check value is valid on Back to Static value

* CR

* Update Date Range width
2019-07-26 22:40:13 +03:00
Gabriel Dutra
78cae474e0 Cypress: Specify widgets position on sharing spec (#4009) 2019-07-26 13:15:39 -03:00
Naoyuki Kataoka
c518c7a4bc Modified PagerDuty destination to avoid an error for multi-byte characters (#4008) 2019-07-24 09:06:25 +03:00
Gabriel Dutra
8c2f51d09d Percy: Fix shared dashboard inconsistent snapshots (#4002) 2019-07-23 11:55:24 -03:00
Gabriel Dutra
6f6c68bd79 Cypress: Separate dashboard spec (#4003) 2019-07-22 11:09:08 -03:00
Ran Byron
64f274f58e Disable execute when params are dirty (#4001)
* Disable execute when params dirty

* Removed special apply handling for query page

* Updated tests
2019-07-22 12:13:34 +03:00
Omer Lachish
dd89bd885f Add "deprecated" flag to query runners (and alert destinations) (#3972)
* add a deprecated flag to query runners and show only non-deprecated query runners when adding a new data source

* add a deprecated flag to alert destinations and show only non-deprecated alert destinations when adding a new alert destination

* add a deprecated() decorator for a more succint way to deprecate

* deprecate URL query runner and HipChat alert destination

* use class properties instead of class methods for deprecation

* I <3 newlines
2019-07-22 10:36:31 +03:00
Ran Byron
b2295197cf Added publish notification to query rename (#3998) 2019-07-21 15:01:08 +03:00
Omer Lachish
ea0e411053 Return unsafe sharing error from backend (#3990)
* return message explaining unsafe sharing

* use backend-generated message for public dashboards

* use backend-generated message for embeds

* Update redash/handlers/query_results.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>

* refactor simple (non-interpolated) query result handler error messages to a single location

* use error_messages to test out unsafe error messages (along with a couple of others)

* Update redash/handlers/query_results.py

Co-Authored-By: Ran Byron <ranbena@gmail.com>

* Update redash/handlers/query_results.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>
2019-07-21 09:21:45 +03:00
Arik Fraimovich
9bdb3412a5 Move query runners/destinations import from redash.app to redash. (#3993)
* Move query runners/destinations import from redash.app to redash.

* Add missing argument
2019-07-21 09:05:29 +03:00
Fumiya Karasawa
ad4a760545 Search dropdown parameters (#3796) 2019-07-20 16:07:03 +03:00
Omer Lachish
c1f4147807 Avoid committing it.only (#3995)
* remove it.only, left by mistake

* use no-only-tests

* 'off' should be used instead of 'none'

* Dedup jest/only rule

* always error for .only
2019-07-19 18:30:38 +03:00
Ran Byron
c054ae8be0 Fixed filter style issue (#3996) 2019-07-18 13:49:37 +03:00
Omer Lachish
d1edd3d068 Query Result API response shouldn't include query information for non authenticated users (#3985)
* avoid catching errors on text widgets' load(), as they don't have a visualization and therefore do not return any promise

* throw error when failing to load widgets on public dashboards - in case something needs to be done with it at a later time, and it's the right thing to do anyway

* use Promise.resolve instead of checking for undefined

* call serialize_query_result instead of directly calling to_dict

* filter unneeded query result fields for unauthenticated users

* test for serialization filtering

* lint

* use project instead of list comprehension
2019-07-18 12:12:49 +03:00
Arik Fraimovich
4989bfae60 Remove custom Redis connection code in favor of redis.from_url (#3992) 2019-07-18 12:03:52 +03:00
Gabriel Dutra
f20a020003 Use AceEditor for Query Snippets (#3973)
Co-Authored-By: Ran Byron <ranbena@gmail.com>
2019-07-17 13:47:31 -03:00
Ran Byron
01da8c158a Parameter “Apply Changes” button (#3907) 2019-07-17 17:17:39 +03:00
Omer Lachish
c83e40b047 Celery doesn't auto reload in development (#3898)
* pick up *.py file changes and restart scheduler

* only watch /redash in order to avoid reloading on other file changes (e.g. tests)

* add dev_scheduler entrypoint

* use exec

* Update bin/docker-entrypoint

* rename dev_scheduler to dev_worker

* use same defaults as worker
2019-07-17 10:38:56 +03:00
Ran Byron
c3cc65a21d Viz embed logo alignment (#3956) 2019-07-16 11:37:31 +03:00
Omer Lachish
5929139ab8 A couple of parameters-on-public-dashboards loose ends (#3988)
* avoid catching errors on text widgets' load(), as they don't have a visualization and therefore do not return any promise

* throw error when failing to load widgets on public dashboards - in case something needs to be done with it at a later time, and it's the right thing to do anyway

* use Promise.resolve instead of checking for undefined
2019-07-16 10:48:37 +03:00
Ran Byron
66794acd1f Added loading indicator to public dashboard (#3984) 2019-07-16 10:31:19 +03:00
Arik Fraimovich
bce0832e48 Show error in case of failing to load a dashboard (#3983) 2019-07-15 22:13:46 +03:00
Yuri Grishaev
9f006997a0 mattermost needs whitespace to use h4 heading (#3981)
#### Even Smaller Heading - good
####Even Smaller Heading - bad
2019-07-15 21:13:17 +03:00
Omer Lachish
51d8131db5 Allow Parameters on Public Dashboards (#3659)
* change has_access and require_access signatures to work with the objects that require access, instead of their groups

* use the textless endpoint (/api/queries/:id/results) for pristine
queriest

* Revert "use the textless endpoint (/api/queries/:id/results) for pristine"

This reverts commit cd2cee7738.

* go to textless /api/queries/:id/results by default

* change `run_query`'s signature to accept a ParameterizedQuery instead of
constructing it inside

* raise HTTP 400 when receiving invalid parameter values. Fixes #3394

* enqueue jobs for ApiUsers

* rename `id` to `user_id`

* support executing queries using Query api_keys by instantiating an ApiUser that would be able to execute the specific query

* show deprecation messages for ALLOW_PARAMETERS_IN_EMBEDS. Also, move
other message (email not verified) to use the same mechanism

* add link to forum message regarding embed deprecation

* change API to /api/queries/:id/dropdowns/:dropdown_id

* split to 2 different dropdown endpoints and implement the second

* add test cases for /api/queries/:id/dropdowns/:id

* use new /dropdowns endpoint in frontend

* first e2e test for sharing embeds

* Pleasing the CodeClimate overlords

* All glory to CodeClimate

* remove residues from bad rebase

* add query id and data source id to serialized public dashboards

* add global parameters directive to public dashboards page

* allow access to a query by the api_key of the dashboard which includes
it

* rename `object` to `obj`

* simplify permission tests once `has_access` accepts groups

* support global parameters for public dashboards

* change has_access and require_access signatures to work with the objects that require access, instead of their groups

* rename `object` to `obj`

* simplify permission tests once `has_access` accepts groups

* no need to log `is_api_key`

* send parameters to public dashboard page

* allow access to a query by the api_key of the dashboard which includes it

* disable sharing if dashboard is associated with unsafe queries

* remove cypress test added in the wrong place due to a faulty rebase

* add support for clicking buttons in cy.clickThrough

* Cypress test which verifies that dashboards with safe queries can be shared

* Cypress test which verifies that dashboards with unsafe queries can't be shared

* remove duplicate tests

* use this.enabled and negate when needed

* remove stale comment

* add another Cypress test to verify that unauthenticated users have access to public dashboards with parameters

* obviously, I commit 'only' the first time I use it

* search for query access by query id and not api_key

* no need to fetch latest query data as it is loaded by frontend from the textless endpoint

* test that queries associated with dashboards are accessible when supplying the dashboard api_key

* propagate `isDirty` down to `QueryBasedParameterInput`

* go to /api/:id/dropdown while editing a query, since dropdown queries might still not be associated with the parent. see #3711

* show helpful error message if dropdown values cannot be fetched

* use backticks instead of line concatenation

* remove requirement to have direct access to dropdown query in order validate it. parent query association checks are sufficient

* remove isDirty-based implementation and allow dropdown queries through nested ACL even if they aren't associated yet (given that the user has _direct_ access to the dropdown query)

* fix tests to cover all cases for /api/queries/:id/dropdowns/:id

* fix indentation

* require access to the query, not the data source

* resolve dashboard user by query id

* apply new copy to Cypress tests

* if only something would have prevented me from commiting an 'only' call 🤔

* very important handling of whitespace

* respond to parameter's Apply button

* text widgets are safe for sharing

* remove redundant event

* add a safety check that object has dashboard_api_keys before calling it

* supply a parameter value for text parameters to have it show up

* add parameter values for date and datetime

* use the current year and month to avoid pagination

* use Cypress.moment() instead of preinstalled moment()

* explicitly create parameters

* refresh query data if a  querystring parameter is provided

* avoid sending a data_source_id - it's only relevant to unsaved queries, since a saved query's data_source is available in the backend

* remove empty query text workaround

* provide default value to parameter

* add a few more dashboard sharing specs

* lint

* wait for DynamicTable to appear to reveal that actual results are displaying

* override error message for unsafely shared widgets
2019-07-15 15:09:30 +03:00
Arik Fraimovich
c793b5dd11 Remove explicit kombu dependency (#3978)
We used an explicit kombu dependency to target the correct Redis version, but current version of Celery supposed to use it by default.
2019-07-14 08:47:15 +03:00
Levko Kravets
4e9da3f116 [Bug fix] Plotly legend overlaps plot on small screens (when legend clicked) (#3976) 2019-07-13 18:27:53 +03:00
Arik Fraimovich
15a8eecdde JSON Data Source (#3805)
* WIP: JSON Data Source

* Add JSON data source to default list
2019-07-11 14:23:38 +03:00
k-tomoyasu
a8ff2500be Build custom alert message (#3137)
* build custom alert message

* fit button color tone

* pass existing test

* fix typos

* follow code style

* add webhook alert description and avoid key error

* refactor: create alert template module

* follow code style

* use es6 class, fix template display

* use alerts.options, use mustache

* fix email description

* alert custom subject

* add alert state to template context, sanitized preview

* remove console.log 🙇

* chatwork custom_subject

* add alert custom message. pagerduty, mattermost, hangoutschat

* Pass custom subject in webhook destination

* Add log message when checking alert.

* Add feature flag for extra alert options.
2019-07-11 13:23:06 +03:00
Ran Byron
7bf84e856c Workaround fixes for datepicker display bug in Cypress tests (#3967) 2019-07-10 17:47:46 +03:00
Levko Kravets
5149bf67ca [Bug fix] Archiving a dashboard cause widgets to show reload spinner forever (#3968) 2019-07-10 13:35:15 +03:00
Arik Fraimovich
93449db325 Improvements to Query Result serialization code (#3960)
* Fix: allow serializing empty or bad dates

* Improve date serialization performance

* Remove duplicate assertion.
2019-07-10 10:51:34 +03:00
Arik Fraimovich
df57d22e81 Add explicit route for dashboards to allow embedding in iframes. (#3957)
* Add explicit route for dashboards to allow embedding in iframes.

* Add missing blank lines
2019-07-10 10:25:08 +03:00
Gabriel Dutra
de0a44ee85 Migrate Query Snippets to React (#3627) 2019-07-09 09:27:39 -03:00
Tomoki Sekiyama
261062d491 Support multi-byte search for query names and descriptions (#3908)
* Support multi-byte search for query names and descriptions

* add multi_byte_support_enabled option to organization settings

* add `ilike %...%` to query search conditions when the option is enabled

* Improve description for multi_byte_search_enabled option

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>

* Remove tsvector from search when multi_byte_search_enabled

* Add a multi-byte search test case
2019-07-08 10:01:47 +03:00
Arik Fraimovich
1878e8bf90 Add additional Celery config options (#3961) 2019-07-08 08:32:18 +03:00
Arik Fraimovich
47fc8a942a Add options to hide different parts of embed UI (parameters, title, link to query) (#3955)
* Move closing tag to correct location

* Add options to hide elements in query embed UI

* Fix for headless top padding (#3959)
2019-07-07 14:34:00 +03:00
Arik Fraimovich
addecbdd8f Allow calling query results endpoint without parameters. (#3958)
* Allow calling query results endpoint without parameters.

* Fix: allow serializing empty or bad dates

* Revert "Fix: allow serializing empty or bad dates"

This reverts commit cc49319d9e.
2019-07-07 14:22:08 +03:00
Gabriel Dutra
baec5d56f5 Remove time from Date column in filters (#3953) 2019-07-05 18:13:12 -03:00
Levko Kravets
1f4325ba8d Migrate Box Plot visualization to React (#3948) 2019-07-04 22:25:09 +03:00
Arik Fraimovich
5e5b56ed6a Fix: render date/time values as strings and not epoch time (#3951) 2019-07-04 20:49:59 +03:00
Arik Fraimovich
45a3b72730 Update fsevents to v1.2.9 (#3950) 2019-07-04 15:43:43 +03:00
Levko Kravets
cc48de0d8f Migrate Word Cloud visualization to React (#3930) 2019-07-03 13:29:05 +03:00
Arik Fraimovich
300f3f6780 Fix: waiting tasks are not shown in admin view (#3942)
* Fix: waiting tasks are not shown properly

* Added a comment.
2019-07-03 11:09:42 +03:00
Omer Lachish
2e4a69cba4 Parameter spec fixes (#3932)
* supply a parameter value for text parameters to have it show up

* add parameter values for date and datetime

* use the current year and month to avoid pagination

* use Cypress.moment() instead of preinstalled moment()

* capture time before clicking on Now

* use now from input

* use now from input for another test
2019-07-01 09:56:55 +03:00
Arik Fraimovich
6748e9a15d Add option to hide Pivot Table totals (#3943)
* Add option to hide Pivot Table totals

* Simplify implementation using DEFAULT_OPTIONS.

* Flip hide pivot controls to show pivot controls

* Update client/app/visualizations/pivot/Editor.jsx

Co-Authored-By: Ran Byron <ranbena@gmail.com>
2019-06-30 15:43:18 +03:00
Arik Fraimovich
7ceb68a468 Visualization: details view (#3778)
* Details visualization

* Add PropTypes and guard against no rows
2019-06-30 15:34:02 +03:00
Levko Kravets
3c1d1e3d4e Explicitly mark default visualization (#3944) 2019-06-30 14:09:00 +03:00
Levko Kravets
92391e3cbc [Bug fix] Toggling Use Dashboard Level Filter cause widgets to show reload spinner forever (#3939) 2019-06-28 15:02:07 +03:00
Levko Kravets
17438002d7 [Bug fix] Adding widget from query page is broken (#3921) 2019-06-25 20:06:36 +03:00
Jianchao Yang
a00c5a8857 Dockerfile front end stage copies client side files only (#3924)
So that changing other files will not trigger the
very expensive rebuild process.
2019-06-23 11:33:52 +03:00
John Karahalis
a696fa55f3 Set unique class name for Query Control Dropdown (#3922)
This will help me target the Query Control Drodpwon in my extension.
2019-06-23 10:01:46 +03:00
Arik Fraimovich
27259b5abe Add support for int/float values in guess_type (#3913) 2019-06-20 08:55:31 +03:00
Ran Byron
9ee393ec75 Fix schedule dialog needless confirm saves (#3919) 2019-06-20 08:54:53 +03:00
Ran Byron
cfafa97218 Fixed boolean filter (#3915) 2019-06-19 14:54:27 +03:00
deecay
be580b24a5 Expose celery job timeout setting to env var (#3912)
* Expose celery job timeout to env

* Change variable name
2019-06-19 14:41:12 +03:00
Arik Fraimovich
a6960c5f19 Fix: time format option was wrong (#3916) 2019-06-19 14:37:02 +03:00
Arik Fraimovich
6dd321beeb Rockset: handle query errors (#3910) 2019-06-18 14:10:25 +03:00
Arik Fraimovich
27c64b42ac Add keyboard shortcut for format query (Ctrl/Cmd+Shift+F) (#3911)
* Add keyboard shortcut for format query

* Added to button tooltip
2019-06-18 14:10:05 +03:00
deecay
99bf6d122c Custom Map Markers (#3840) 2019-06-18 09:50:09 +03:00
Ran Byron
d617f57f7d Increase celery job timeout (#3903) 2019-06-17 08:35:02 +03:00
Guy Cohen
21a27ee0b1 Fix OverflowError on celery worker (#3899) 2019-06-16 11:34:29 +03:00
YOSHIDA Katsuhiko
ac293c7f92 Add alert deletion confirmation dialog (#3902) 2019-06-15 14:28:55 +03:00
YOSHIDA Katsuhiko
8e38dcd244 Support regenerating Query API Key (#3764)
* Add regenerate function of query's API Key

* Add regenerate API Key button

* Add regenerate Query API Key tests

* Fix too long line

* Replace  with this

* Return a simple version query

* Update only API Key

* Update API Key via query
2019-06-12 13:09:21 +03:00
Aidarbek Suleimenov
2bab144107 Celery task to clear schedule was added (#3801)
* Celery task to clear schedule was added

* fix formating

* empty_schedules task was put in separate task

* worker interval changed, new tests added

* past artifact deleted

* test queries moved to right class, lambda was used to filter data

* unnecessary changes eliminated

* more unnecessary files deleted

* line shortened

* Line shortened more

* codeclimate changes

* Unused test deleted, logs added
2019-06-12 13:07:15 +03:00
Mike Nason
4e0a251034 Add support ssl connections to redis (#3848)
* Add support ssl connections to redis

* Fix line length

* Update redash/__init__.py w suggestion

Co-Authored-By: Omer Lachish <omer@rauchy.net>

* Cleanup init after suggestion

* Move redis SSL config to settings

* Do not pass celery SSL config unless necessary

* Fix typo
2019-06-12 13:04:34 +03:00
Levko Kravets
7a9f4b07e0 Force a Choose account step for Google OAuth (#3884) 2019-06-12 11:48:25 +03:00
Arik Fraimovich
1630cbb904 Google Sheets: friendlier error message in case of an API error and more reliable test connection (#3883)
* Google Sheets: friendlier error message in case of an APIError and more reliable test connection.

* Pleasing the pep8 gods
2019-06-12 11:46:59 +03:00
Levko Kravets
f8d05dda9f getredash/redash#3879 Plotly legent overlaps plot on small screens (FF only) (#3882) 2019-06-12 11:46:34 +03:00
Omer Lachish
2af8b39d21 Authorize according to API key (if given) over cookies (#3877)
* remove legacy session identifier support

* remove redundant test

* redirect to login to support any invalid session identifiers

* be more specific with caught errors

* use authorization according to api_key (if provided) over session
2019-06-12 11:45:28 +03:00
dependabot[bot]
3faed0fdfe Bump pyopenssl from 16.2.0 to 17.5.0 (#3872)
Bumps [pyopenssl](https://github.com/pyca/pyopenssl) from 16.2.0 to 17.5.0.
- [Release notes](https://github.com/pyca/pyopenssl/releases)
- [Changelog](https://github.com/pyca/pyopenssl/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/pyopenssl/compare/16.2.0...17.5.0)
2019-06-12 11:38:47 +03:00
dependabot[bot]
e45f49b86e Bump cryptography from 2.0.2 to 2.3 (#3870)
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.0.2 to 2.3.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.0.2...2.3)
2019-06-12 11:38:38 +03:00
Omer Lachish
e33ad3b164 Query Results: querying a column with a dictionary or array fails (#3887)
* flatten lists and dicts to json to be used with SQLite's json_extract functions

* add test that verifies that lists and dicts are saved

* add test that verifies that lists and dicts are saved
2019-06-11 17:41:15 +03:00
Omer Lachish
6605f62f3a add api_key to embed download urls (#3896) 2019-06-11 14:02:02 +03:00
Omer Lachish
ed2ac407ab Remove schema after deleting data source (#3894)
* remove schema from redis after deleting data sources

* switch to _pause_key to property
2019-06-10 22:39:26 +03:00
Ran Byron
dda75cce24 Drawer menu with recreated close button (#3889)
* Drawer menu with recreated close button

* Added “Open in new window” drawer menu button (#3890)
2019-06-09 12:21:53 +03:00
Omer Lachish
5b780ac460 Refresh Public Dashboards (#3881)
* remove legacy session identifier support

* remove redundant test

* redirect to login to support any invalid session identifiers

* be more specific with caught errors

* fix refresh for public dashboards
2019-06-06 11:07:12 +03:00
koooge
c0e8ef3000 Upgrade gspread 3.1.0 for supporting team drive (#3838)
* Upgrade gspread 3.1.0 for supporting team drive

Signed-off-by: koooge <koooooge@gmail.com>

* Revert "Upgrade gspread 3.1.0 for supporting team drive"

This reverts commit e53e8cb75b.

* Upgrade gspread 3.1.0 for supporting team drive

Signed-off-by: koooge <koooooge@gmail.com>

* Update Sheets query runner name
2019-06-06 11:02:08 +03:00
Gabriel Dutra
a82fd0cabc Cypress: Fix date parameters false positive (#3873) 2019-06-04 12:19:55 -03:00
Ran Byron
0e3e2eaf38 Restrict dynamic-table internal scroll only when pagination appears (#3875) 2019-06-04 09:11:19 -06:00
Omer Lachish
05f6ef0fb6 Remove legacy session identifier support (#3866)
* remove legacy session identifier support

* remove redundant test

* redirect to login to support any invalid session identifiers

* be more specific with caught errors
2019-06-03 22:18:24 +03:00
dependabot[bot]
e433efebc4 Bump flask from 0.11.1 to 0.12.3 (#3871)
* Bump flask from 0.11.1 to 0.12.3

Bumps [flask](https://github.com/pallets/flask) from 0.11.1 to 0.12.3.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/0.11.1...0.12.3)

* Bump to Flask 0.12.4 to fix an issue
2019-06-03 18:04:43 +03:00
Arik Fraimovich
a9588eac79 Update version to 8.0.0-beta. (#3869) 2019-06-02 14:37:16 +03:00
Arik Fraimovich
090b570a71 Rearrange README badges. 2019-06-02 14:01:09 +03:00
Arik Fraimovich
60b12e3121 Update PromiseRejectionError to show error message from API response (#3868)
* Update PromiseRejectionError to show error message from API response

* Update version to 8.0.0-beta.

* Revert "Update version to 8.0.0-beta."

This reverts commit c8fa74967f.
2019-06-02 11:47:26 +03:00
Arik Fraimovich
3f8c7333be Use the debian flavor of the redash/base image (#3240) 2019-06-02 11:42:19 +03:00
Arik Fraimovich
be8dec5f04 Add Collapse component (#3867) 2019-06-02 11:12:37 +03:00
Levko Kravets
10b3b50f3d getredash/redash#3862 Widget menu should not be available on public dashboards (#3863) 2019-06-02 11:00:10 +03:00
Levko Kravets
6f290ddfa1 Use more specific CSS for public dashboard page to avoid conflicts with other components (#3864) 2019-05-31 23:41:43 +03:00
Ran Byron
10b62ebe02 Beautify autoheight code a bit (#3865) 2019-05-31 14:09:29 -06:00
Ran Byron
04453409da Fix widget autoHeight related exception (#3858) 2019-05-31 05:57:26 -06:00
Gabriel Dutra
b27df216f4 Cypress tests for query parameters (#3810) 2019-05-30 10:01:44 -03:00
Levko Kravets
a0c76d777b getredash/redash#3851 Disable filter which does not have values (#3852) 2019-05-30 15:53:28 +03:00
Levko Kravets
2e96e2fb98 getredash/redash#3849 Fix initialization of dashboard-level parameters (#3853) 2019-05-30 15:51:58 +03:00
Gabriel Dutra
c2e31f040d Fix table isn't displayed with date filter (#3842) 2019-05-29 09:40:25 -03:00
Arik Fraimovich
816f4d912f Capitalize "elsewhere" (#3844) 2019-05-29 14:47:17 +03:00
Arik Fraimovich
9292ae8d3f CSV: correctly serialize booleans and dates. (#3841)
* CSV: correctly serialize booleans and dates.

Closes #3736, closes #2751.

* pep8 fixes

* Move column iteration to a helper function.

* Use elif, as types are mutually exclusive.

* Refactor parsing implementation.

* Move the csv generation fucntion
2019-05-29 10:45:29 +03:00
Levko Kravets
9480d89e4c [Feature] Migrate CreateDashboardDialog to React (#3826) 2019-05-27 23:12:52 +03:00
Ran Byron
5dff5b929c Unsupported browser redirect script outputted to file (#3832) 2019-05-27 13:18:04 -06:00
Gabriel Dutra
28e9740e2f Update Data Source Lifecycle Events (#3828) 2019-05-27 19:28:16 +03:00
Ran Byron
7679df63ba Fix for Mac browser’s scrollbar obscuring content (#3830) 2019-05-27 18:31:02 +03:00
Jannis Leidel
07c9530984 Decouple extensions from Flask app. (#3569)
* Decouple extensions from Flask app.

This separates the extension registry from the Flask app and also introduces a separate registry for preriodic tasks.

Fix #3466.

* Address review feedback.

* Update redash/extensions.py

Co-Authored-By: jezdez <jannis@leidel.info>

* Minor comment in requirements.

* Refactoring after getting feedback.

* Uncoupled bin/bundle-extensions from Flas app instance.

* Load bundles in bundle script and don’t rely on Flask.

* Upgraded to importlib-metadata 0.9.

* Add missing requirement.

* Fix TypeError.

* Added requirements for bundle_extension script.

* Install bundles requirement file correctly.

* Decouple bundle loading code from Redash.

* Install bundle requirements from requirements.txt.

* Use circleci/node for build-docker-image step, too.
2019-05-26 14:56:02 +03:00
Rueian
aecd0bf37a include bigquery_gce.png in db-logos (#3825) 2019-05-26 13:27:29 +03:00
Omer Lachish
4143bd3f20 when authenticated, the query shouldn't be sent over to the /jobs endpoint (#3831) 2019-05-26 12:19:32 +03:00
Arik Fraimovich
020dc35faf Create SECURITY.md (#3823)
* Create SECURITY.md

* Update SECURITY.md

Co-Authored-By: Gabriel Dutra <nesk.frz@gmail.com>
2019-05-26 09:32:41 +03:00
Gabriel Dutra
d7b03bac02 Add CircleCI env vars to Cypress docker (#3827) 2019-05-23 22:33:23 +03:00
Omer Lachish
29875e66d4 Plug custom Celery tasks via dynamic settings (#3819)
* plug custom celery tasks via dynamic settings

* an extra blank line
2019-05-22 11:37:18 +03:00
taminif
d97ce15837 refactor format semi-colon (#3812) 2019-05-22 11:10:16 +03:00
Gabriel Dutra
b263bb7077 [Bug fix] Fix "Now" in DateTime parameter not working (#3808) 2019-05-16 18:42:48 +03:00
Ran Byron
606cf12e74 Dashboard grid React migration #1 (#3722)
* Dashboard grid React migration

* Updated tests

* Fixes comments

* One col layout

* Tests unskipped

* Test fixes

* Test fix

* AutoHeight feature

* Kebab-cased

* Get rid of lazyInjector

* Replace react-grid-layout with patched fork to fix performance issues

* Fix issue with initial layout when page has a scrollbar

* Decrease polling interval (500ms is too slow)

* Rename file to match it's contents

* Added some notes and very minor fixes

* Fix Remove widget button (should be visible only in editing mode); fix widget actions menu

* Fixed missing grid markings

* Enhanced resize handle

* Updated placeholder color

* Render DashboardGrid only when dashboard is loaded
2019-05-16 15:43:46 +03:00
Levko Kravets
4508975749 [Bug fix] Plotly modebar appears above modals (#3799) 2019-05-15 10:43:34 +03:00
Gabriel Dutra
c76955be28 Refresh query when parameters update (#3737)
* Add touch state to parameters and autoupdate query

* Use values change event instead of $watch

* Remove getQueryResultDebounced

* Add Apply button

* Remove Input Number spinners for Parameters

* Make Apply Button optional

* Update share_embed_spec

* Change debounce to the Parameters component

* Remove unnecessary click on Execute query

* Add apply button to the remaining places

* Update dashboard_spec

* Use onKeyUp for InputNumber

* Simplify onParametersValuesChanged

* Update DateTime onChange function

* Don't apply when modifier key is pressed

* Remove refresh Button from Parameters

* Update apply button styling

* Update apply right distance

* Remove debounce for testing

* Use data-dirty instead of classNames for styling

* Make sure $apply runs before calling onChange
2019-05-15 08:57:06 +03:00
Gabriel Dutra
4f402379e8 Migrate Embed Query Dialog to React (#3783)
* Update Antd

* Migrate Embed Query Dialog to React

* Update jest ScheduleDialog snapshot

* Add Alert for unsafe queries

* Add CodeBlock

* Add inputs to change iframe size

* Undo ant update

* Update share embed spec

* Update styling

* Change border-radius to 2px

* Update margin between Public URL and IFrame Embed
2019-05-15 08:38:40 +03:00
Ran Byron
733b60102d Fixed visual-card alignment (#3795) 2019-05-14 14:10:35 -06:00
Levko Kravets
b9b30a39d2 [Bug fix] Edit parameter mapping: error when trying to change mapping type to Static; cannot change static value (#3800)
* Edit parameter mapping: error when trying to change mapping type to Static

* Parameter mapping editor: cannot change static value
2019-05-14 19:10:02 +03:00
Levko Kravets
c74d469181 resize-event: take into account transformations and transitions (#3794) 2019-05-13 22:51:05 +03:00
Ran Byron
95f11e6686 Loading indicator till app inits (#3788) 2019-05-13 12:11:22 -06:00
Jakdaw
ad6f7109de Fix support for calling MySQL Stored Procedures and allow queries to be cancelled (#3003)
* If MySQL returns multiple resultSets (eg when executing multiple statements, or calling stored procedures) then use the last resultSet that has columns

* Make cancellation of a MySQL query work (the same way the C client does it)

* Address code climate moans
2019-05-13 18:51:51 +03:00
taminif
b09ae46a9f filtered tag remove empty name at edit query (#3784)
* filtered tag remove empty name at edit query

* use filter
2019-05-13 17:57:45 +03:00
Arik Fraimovich
0cda0369f0 [BigQuery] Fix: in some queries there is no mode field (#3786)
Happened with INSERT/UPDATE queries.
2019-05-13 17:08:18 +03:00
Arik Fraimovich
50f11069ce Presto: ignore blank passwords (#3791)
PyHive expects only None as no password.
2019-05-13 12:36:07 +03:00
Arik Fraimovich
6bf764be07 Update query to bring only name to make sure screenshots are consistent. (#3790) 2019-05-12 20:43:32 +03:00
Ran Byron
3159410694 Restrict markdown image dimensions (#3789) 2019-05-12 20:23:10 +03:00
Gabriel Dutra
76bd2e3c50 Migrate Organization Settings to React (#3728)
* Migrate Organization Settings to React

* Fix failing spec and replace default values from inputs

* Add HelpTrigger and handleChange to SAML options

* Undo changes to ant-variables.less

* Add time format to OrganizationSettings
2019-05-12 14:23:22 +03:00
Omer Lachish
50a6f723b1 Fix Ability to Add Query-based Parameters to Existing Queries (#3716)
* propagate `isDirty` down to `QueryBasedParameterInput`

* go to /api/:id/dropdown while editing a query, since dropdown queries might still not be associated with the parent. see #3711

* show helpful error message if dropdown values cannot be fetched

* use backticks instead of line concatenation

* remove requirement to have direct access to dropdown query in order validate it. parent query association checks are sufficient

* remove isDirty-based implementation and allow dropdown queries through nested ACL even if they aren't associated yet (given that the user has _direct_ access to the dropdown query)

* fix tests to cover all cases for /api/queries/:id/dropdowns/:id

* fix indentation

* require access to the query, not the data source

* use require_access instead of has_access
2019-05-12 12:48:01 +03:00
Omer Lachish
0ee20797c8 Fix embeds without parameters (#3775)
* provide queryId when fetching query results in order to allow query-based api-key authentication to work properly

* cypress test to verify that embeds without parameters are shared succesfully

* rename Percy snapshot
2019-05-12 12:28:31 +03:00
taminif
d7515562a4 Fix: Filter empty tags (#3780) 2019-05-10 09:55:53 -06:00
Osmo Salomaa
feafbbe318 Avoid error with duplicate log lines (#3777)
https://docs.angularjs.org/error/ngRepeat/dupes
2019-05-07 22:07:39 +03:00
deecay
b7b345dacd [Feature] Choropleth customize (added new map: Japanese Prefectures) (#3154) 2019-05-07 12:04:17 +03:00
Arik Fraimovich
0b22aa55a1 DynamoDB: safe implementation of schema loading (#3774)
* Safe implementation of describe_all.

* autopep8.
2019-05-06 20:13:45 +03:00
Arik Fraimovich
3eddea6e88 Show non relative timestamp when printing an embed. (#3773)
(Also used for the Slack snapshots)
2019-05-06 20:12:57 +03:00
yoavbls
c85e097f8a [Bug fix] Fix dashboard filters to collect options too (#3759) 2019-05-06 11:40:21 +03:00
YOSHIDA Katsuhiko
81bc4ef58b [Feature] Add direction option in Pie Chart (#3762) 2019-05-06 11:30:48 +03:00
Omer Lachish
9fec3ca9ea Poll for results in parameterized embeds (#3752)
* add an endpoint for fetching job using a query's api_key

* when unauthenticated, use api_key to get job, and fetch the latest query
result (as opposed to fetching the query result by ID)

* add 'refresh dataset' button to parameters directive

* fix scope error introduced by earlier commit

* show timer when refreshing results

* Show input for missing parameters in embedded visualizations (#3741)

* Redirect to default parameter values when parameters are missing in
embedded visualizations

* Revert "Redirect to default parameter values when parameters are missing in"

This reverts commit 43c65500b7.

* load all data after page is loaded

* return no data only when parameters are missing

* data binding no longer required

* show an error on embeds that fail to load

* data binding no longer required

* present full-page error when dealing with unsafe queries

* don't render the execute button for each parameter

* show 'missing parameter value' error

* Don't reload the whole page when parameter value changes.

* Set API key and load config before rendering.

* Add Query#hasParameters method.

* Don't show download controls for parameterized queries (they won't work).

* Use getUrl to construct a correct query link.

* WIP: have a single way to load results

1. This preloads the query before rendering the page, so we can benefit from using default parameters & make the logic in component simpler.
2. Use a single way to load results, to make sure we do polling when try to load the query results for the first time.

* Show persistent errors and finish loading logic.

* Check if query is safe and show message otherwise.

* Fix test for unsafe parameters embed.

* wait for query results to return before taking snapshot
2019-05-06 09:14:56 +03:00
Arik Fraimovich
ee29cf9efc Fix: pie chart not rendering when series doesn't exist in options. (#3756) 2019-05-05 09:04:52 +03:00
Arik Fraimovich
17aba39636 Fix: default value for Presto password should be None (#3757) 2019-05-05 09:04:42 +03:00
Yusuke Goto
2cd1b07a41 Add: organization setting for time format (#3754)
* Support for time format

* Add selects test

* Rename into date_time_format_config
2019-05-05 09:03:27 +03:00
taminif
72d00314a4 [Code style] Add semi-colons (#3755) 2019-05-02 22:30:05 +03:00
Aidarbek Suleimenov
5b077ab083 Support for Presto password (#3619) 2019-05-01 17:25:59 +03:00
Takuya Arita
da2d6bc3a8 Move is_url_key method to function for testability. (#3750) 2019-05-01 13:52:41 +03:00
Takuya Arita
33930a5b9c Remove unused import statements (#3751) 2019-05-01 13:51:56 +03:00
John Karahalis
fbff4f9219 Convert query control dropdown button to React (#3698) 2019-05-01 07:20:54 +03:00
Jannis Leidel
30f725f1e1 Add missing parameter to new BigQuery query runner method. (#3747) 2019-04-30 21:16:58 +02:00
Gabriel Dutra
47cd05b48e Cypress: Fix Stuck E2E test - create_query_spec (#3748) 2019-04-30 14:21:26 -03:00
Levko Kravets
9a4433bf68 Migrate visualizations registry/renderer/editor to React (#3493) 2019-04-30 16:34:00 +03:00
Ran Byron
d0b2151b4d Fix query page height (#3744) 2019-04-29 23:29:17 +03:00
Omer Lachish
21e22a2d0d add get_by_id to Organization (#3712) 2019-04-29 21:58:29 +03:00
Gabriel Dutra
f3a653c57f Fix query based parameter has value null when created (#3707)
* Fix query based parameter value null when created

* Use toString to avoid having 'null' string
2019-04-29 21:50:04 +03:00
guwenqing
c9bf412240 Update npm run to fix hpe_header_overflow (#3732)
Nodejs has set max header size to 8k in http_parser,
need to provide a larger header size to make the proxy work.
2019-04-29 21:23:06 +03:00
Osmo Salomaa
48955b5fa1 Use monospace font in query output log (#3743)
Closes #3739
2019-04-29 21:21:51 +03:00
Ran Byron
24a5748528 Dashboard grid markings (#3656) 2019-04-29 15:49:09 +03:00
Arik Fraimovich
8758279b14 Use REDASH_BASE_PATH everywhere instead of hardcoded path (#3740)
Closes #3727
2019-04-29 14:28:16 +03:00
Jannis Leidel
99bb24d899 Make creating the BigQuery job data pluggable. (#3742)
This would for example allow adding custom job labels (https://cloud.google.com/bigquery/docs/adding-using-labels#job-label) for easier accounting.
2019-04-29 14:18:36 +03:00
Omer Lachish
c93a905c1d Fix Ability to save with Multiple Dropdown Parameters (#3717)
* support multiple associations of the same query-based dropdown parameter

* include several query-based parameters in association tests
2019-04-28 14:25:26 +03:00
AntonZ
a1e75d2f0b feature: add couchbase query runner (#3658)
* feature: add couchbase query runner

* fix style

* fix style

* fix style

* fix naming due to convention

* extracting protocol as parameter
2019-04-24 20:13:59 +03:00
Ran Byron
fb48bc374a Refactored dashboard drag/resize testing (#3726) 2019-04-22 10:07:22 +03:00
Ran Byron
10a6ccbbcd Dashboard save fail indication (#3715) 2019-04-19 21:41:35 +03:00
Gabriel Dutra
fea082ec77 Update Percy network idle timeout (#3724) 2019-04-19 10:58:37 -03:00
Jannis Leidel
aa9d2466cd Split redash/__init__.py to prevent import time side-effects. (#3601)
## What type of PR is this? (check all applicable)
<!-- Please leave only what's applicable -->

- [x] Refactor
- [x] Bug Fix

## Description

This basically makes sure that when import the redash package we don't accidentally trigger import-time side-effects such as requiring Redis.

Refs #3569 and #3466.
2019-04-18 18:39:38 +02:00
Arik Fraimovich
97492d7aa0 Fix: update default CSP policy to allow KB iframe. (#3714)
## What type of PR is this? (check all applicable)

- [x] Bug Fix

## Description

Without this change the Help Drawer couldn't load content anymore.

## Related Tickets & Documents

#3404
2019-04-17 10:13:45 +02:00
Ran Byron
18761cf07b Dashboard auto-saving (#3653) 2019-04-17 10:07:48 +03:00
Arik Fraimovich
9b3dd82ec0 Sync PyAthena/botocore versions with requirements_all_ds.txt. (#3713) 2019-04-17 09:43:33 +03:00
Arik Fraimovich
e485c964c5 Add rate limits to user creation/update (#3709)
* Add rate limits for user resources.

* Disable rate limiting in tests (except for tests that need it).

* Update strings to unicode to avoid SQLA warnings
2019-04-15 13:58:30 +03:00
Omer Lachish
5b30d081d7 Dynamic query time limits (#3702)
* extract time limit decisions to a dynamic settings function

* introduce environment variable for scheduled query time limits

* pass in org_id to query_time_limit

* add an interaction test that verifies that time limits are applied to
jobs

* really important newlines according to CodeClimate
2019-04-15 12:06:37 +03:00
Omer Lachish
b96094b878 add a test to make sure reset password form are displayed correctly (#3678) 2019-04-14 14:59:21 +03:00
Gabriel Dutra
1f43537304 Update CardsList to use visual-card styling (#3679)
* Update CardsList to use old markup

* CR
2019-04-14 13:10:40 +03:00
Aidarbek Suleimenov
01e64db0dc Fix Decimal128 error (#3684) 2019-04-14 13:07:12 +03:00
Arik Fraimovich
3ab46bb39a BigQuery: support for NaN values. (#3701) 2019-04-14 11:23:14 +03:00
Jakdaw
af168c69b9 Fix search ordered by best match (#3706)
* Don't force an order by created date - any usecases that want
this already request it explicitly and it breaks the search
function that wants to order by best match.

* Fix the logic so that we fall back to a default search order when there's
no search term, rather than when there is one and we should use the
best-match ordering.

* Remove accidentially added blank line
2019-04-14 10:44:28 +03:00
Jakdaw
63e052c3a3 Support LDAP servers where one doesn't first have to bind to the LDAP server with a username/password (#3002)
* Support LDAP servers where one doesn't first have to bind to the LDAP server with a username/password

* Address code climate things
2019-04-14 10:36:41 +03:00
Ran Byron
563e34a816 Fixed public dashboard footer (#3703) 2019-04-14 10:19:12 +03:00
Gabriel Dutra
1524d06149 Percy: Introduce hide-in-percy and hide diff problematic elements (#3689) 2019-04-11 11:49:39 -03:00
Ran Byron
e9711a0b9c Bye footer (#3697) 2019-04-10 11:42:36 +03:00
Omer Lachish
9fcf510ffd add package.json after including qs (#3695) 2019-04-10 11:25:56 +03:00
Ran Byron
70227f2e43 Changed viz embed download menu to drop up (#3696) 2019-04-10 11:02:03 +03:00
Ran Byron
1babd01f38 Bolder markdown in textbox (#3686) 2019-04-09 10:25:03 +03:00
Ran Byron
768bfb3525 Cypress Dashboard Service (#3683) 2019-04-09 08:49:10 +03:00
Ran Byron
fc5a624efb Dashboard one column mode test (#3621) 2019-04-08 07:51:18 +03:00
Omer Lachish
47bf91e150 Fix: support date ranges for parameterized embeds (#3681)
* support date ranges for parameterized embeds

* add qs

* remove hideous implementation and use qs

* get rid of apiKey querystring parameter and introduce query-string
module
2019-04-07 20:34:14 +03:00
Ran Byron
8f4288583e Updated Cypress default timeout values (#3685) 2019-04-07 16:40:06 +03:00
Omer Lachish
595af3bce8 avoid erroring when creating embed links for queries that don't have any parameters (#3680) 2019-04-06 13:49:40 +03:00
HirokiTanaka
dba7efe030 refs https://github.com/getredash/redash/issues/3675 (#3676) 2019-04-04 09:27:07 +03:00
Omer Lachish
1b142b33f1 reduce volatility in embed percy snapshots (#3672) 2019-04-02 13:40:28 +03:00
Gabriel Dutra
13814c752d Add max-width to Notification (#3667) 2019-04-02 11:53:44 +03:00
Omer Lachish
dd477d49ec Sharing embeds with safe parameters (#3495)
* change has_access and require_access signatures to work with the objects that require access, instead of their groups

* change has_access and require_access signatures to work with the objects that require access, instead of their groups

* use the textless endpoint (/api/queries/:id/results) for pristine
queriest

* Revert "use the textless endpoint (/api/queries/:id/results) for pristine"

This reverts commit cd2cee7738.

* go to textless /api/queries/:id/results by default

* change `run_query`'s signature to accept a ParameterizedQuery instead of
constructing it inside

* raise HTTP 400 when receiving invalid parameter values. Fixes #3394

* support querystring params

* extract coercing of numbers to function, along with a friendlier
implementation

* wire embeds to textless endpoint

* allow users with view_only permissions to execute queries on the
textless endpoint, as it only allows safe queries to run

* enqueue jobs for ApiUsers

* add parameters component for embeds

* include existing parameters in embed code

* fetch correct values for json requests

* remove previous embed parameter code

* rename `id` to `user_id`

* support executing queries using Query api_keys by instantiating an ApiUser that would be able to execute the specific query

* bring back ALLOW_PARAMETERS_IN_EMBEDS (with link on deprecation coming up)

* show deprecation messages for ALLOW_PARAMETERS_IN_EMBEDS. Also, move
other message (email not verified) to use the same mechanism

* add link to forum message on setting deprecation

* rephrase deprecation message

* add link to forum message regarding embed deprecation

* change API to /api/queries/:id/dropdowns/:dropdown_id

* split to 2 different dropdown endpoints and implement the second

* add test cases for /api/queries/:id/dropdowns/:id

* use new /dropdowns endpoint in frontend

* first e2e test for sharing embeds

* Pleasing the CodeClimate overlords

* All glory to CodeClimate

* change has_access and require_access signatures to work with the objects that require access, instead of their groups

* split has_access between normal users and ApiKey users

* remove residues from bad rebase

* allow access to safe queries via api keys

* rename `object` to `obj`

* support both objects and group dicts in `has_access` and `require_access`

* simplify permission tests once `has_access` accepts groups

* change has_access and require_access signatures to work with the objects that require access, instead of their groups

* rename `object` to `obj`

* support both objects and group dicts in `has_access` and `require_access`

* simplify permission tests once `has_access` accepts groups

* fix bad rebase

* send embed parameters through POST data

* no need to log `is_api_key`

* move query fetching by api_key to within the Query model

* fetch user by adding a get_by_id function on the User model

* pass parameters as POST data (fixes test failure introduced by switching
from query string parameters to POST data)

* test the right thing - queries with safe parameters should be embeddable

* introduce cy.clickThrough

* add another Cypress test to make sure unsafe queries cannot be embedded

* serialize Parameters into query string

* set is_api_key as the last parameter to (hopefully) avoid
backward-dependency problems

* Update redash/models/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* attempt to fix empty percy snapshots

* snap percies after DOM is fully loaded
2019-04-02 11:45:38 +03:00
Ran Byron
5decd2624a Fixed wrong width assertion (#3665) 2019-04-01 13:49:24 +03:00
Justin Clift
6f9aee42a7 Update to modern Redis for the docker images (#3640) 2019-04-01 11:21:06 +03:00
Omer Lachish
1333aae7fb Handle dropdown queries which are detached from data source (#3453)
* handle an edge case where dropdown queries are connected to data sources
that no longer exist

* Rethinking it, an empty result set makes no sense and it's better to
throw an error

* remove redundant import
2019-04-01 11:19:52 +03:00
Omer Lachish
33ad89a381 in case of a parameter type mismatch, show the actual message to the user (#3664) 2019-04-01 11:19:18 +03:00
Ran Byron
02a5852072 Widget size and position test (#3628) 2019-03-29 21:47:26 +03:00
Gabriel Dutra
12782e4daf Fix Percy diff due to Api Key secret (#3654) 2019-03-29 07:50:30 -03:00
Levko Kravets
704b78a003 [Feature, Bug fix] Migrate Timer component to React; update TimeAgo component (#3648) 2019-03-28 20:33:05 +02:00
Omer Lachish
ec4f77c8b7 Change has_access and require_access signatures (#3611)
* change has_access and require_access signatures to work with the objects that require access, instead of their groups

* rename `object` to `obj`

* support both objects and group dicts in `has_access` and `require_access`

* simplify permission tests once `has_access` accepts groups
2019-03-28 15:01:06 +02:00
Ran Byron
1871287a1f Fixed notification alignment (#3645) 2019-03-28 10:08:13 +02:00
Gabriel Dutra
f9cc230227 Migrate Data Sources and Alert Destinations pages to React (#3470)
* Migrate TypePicker to React

* Migrate DataSources and Destinations List

* Fixes to DestinationsList

* Add CreateDataSource (testing with Steps)

* Render the form after type selection

* Add HELP_LINKS to CreateDataSource

* Add Done behavior

* Add scrollToTop to CreateDataSource

* TypePicker styling adjusts

* Add CreateDestination

* Update resouce gets to componentDidMount

* Create EditForm components

* Migrate Edit pages

* Remove angular logic from DynamicForm

* Add actions to EditPages

* TypePicker title style adjustments

* Add Empty and Loading state

* UX improvements

* Review changes

* Styling updates on TypePicker, forms background fix

* Add blank line removed by mistaken

* Reorganize TypePicker

* Hide Search on List Pages

* Fix spacing in Forms

* Update Create Data Source and Destination to be a Dialog

* Remove max-height from the form

* Fix DynamicForm import in CreateUserDialog

* Route /new to open CreateSourceDialog

* Add HelpTrigger + refine styling and Edit Pages

* Remove help links from data source resource

* Update Cypress specs

* TypePicker -> CardsList

* Remove old TypePicker styling and change CardsList styling to less

* Test if Percy shows Dialogs

* Personal review cleanup

* CR

* Remove unnecessary query on dialog success

* Handle resource errors in Edit Pages

* Add CreateDestination policy

* Add placeholder and separator to the Name field

* Use cy.click instead of cy.wait

* Revert "Use cy.click instead of cy.wait" (Didn't work)

This reverts commit 77285d9fa3.

* Align help trigger on the right and rename Steps

* Refine behavior for long names

* Update toastr calls to use notification instead

* Redirect to target after creation

* Remove autoFocus on DynamicForm for Edit Pages

* Add eslint-disable for cy.wait
2019-03-28 10:06:46 +02:00
Ran Byron
fe4a7b65e7 Widget resize tests (#3620) 2019-03-28 05:55:03 +02:00
Allen Short
b3819de878 Treat repeated BigQuery fields as arrays (#3480)
* Treat repeated BigQuery fields as arrays

* handle untransformed field types and None
2019-03-27 22:00:09 +02:00
Gabriel Dutra
2699d24441 Manage user groups in UserEdit (#3450) 2019-03-27 16:29:48 -03:00
Jannis Leidel
1933dee8ca Fix Celery worker --max-tasks-per-child for Celery 4.x. (#3625)
* Fix Celery worker CLI parameter name that was changed in Celery 4.x.

* Set Celery worker --max-memory-per-child to 1/4th of total system memory.

* Review fixes.

* Review fixes.
2019-03-27 21:08:20 +02:00
Gabriel Dutra
375e61f263 Add error message when destination name already exists (#3597)
* Return 400 when destination name already exists

* Remove whitespace

* Unicode 1

Co-Authored-By: gabrieldutra <nesk.frz@gmail.com>

* Unicode 2

Co-Authored-By: gabrieldutra <nesk.frz@gmail.com>
2019-03-27 18:09:56 +02:00
shinsuke-nara
872d0ca5e6 Show accessible tables only in New Query view for PostgreSQL (#3599)
* Show accessible tables only.

* Get table information from information_schema.columns.

* Union old query.
2019-03-27 18:08:38 +02:00
Justin Clift
973ad565cd Update PostgreSQL version to always use latest in the 9.5 series (#3639) 2019-03-27 18:06:40 +02:00
ialeinikov
7a7fdf9c99 allowing to specify a custom work group for AWS Athena queries (#3592)
* allowing to specify a custom work group for AWS Athena queries

* Fixing title + adding correct position in the UI
2019-03-27 17:58:48 +02:00
Omer Lachish
49ffaae3ec Fix email shows as unverified when no email server is configured (#3613)
* check that e-mail server is configured before marking the email address
as not verified and sending out a verification e-mail

* use helper method in `invite_user`

* move email_server_configured helper to settings

* add test to verify that email addresses arent marked as unverified if
there's no e-mail server to verify them

* simplify a couple of tests with patch

* combine conditions into single variable

* Booleans, gotta love 'em
2019-03-27 17:57:51 +02:00
Allen Short
d5494cff08 Fail query task properly even if error message is empty (#3499) 2019-03-27 17:50:39 +02:00
Byunghwa Yun
71afc99ec3 Add phoenix query runner. (#3153)
* Add phoenix query runner.

* Improved error handling.
2019-03-27 17:48:49 +02:00
Ran Byron
b5d97e25b7 Browser support config (#3609)
* Browser support config

* Removed some offending code

* Added unsupported html page and redirect for IE

* Typo in regex

* Made html page static

* Added redirect script to multi_org

* Moved static html page to client/app
2019-03-27 17:47:12 +02:00
Jannis Leidel
6c26aa7a99 Render LDAP and remote auth login links correctly when multi org mode is enabled. (#3530)
* Make LDAP auth handler org scoped.

* Render LDAP and remote auth login links correctly when multi org mode is enabled.
2019-03-27 17:26:00 +02:00
Jannis Leidel
712fc63f93 Use flask-talisman for handling backend response headers (#3404)
* Normalize Flask initialization API use.

* Use Flask-Talisman.

* Enable HSTS when HTTPS is enforced.

* More details about how CSP is formatted and write CSP directives as a string.

* Use CSP frame-ancestors directive and not X-Frame-Options for embedable endpoints.

* Add link to flask-talisman docs.

* set remember_token cookie to be HTTP-Only and Secure

* Reorganize secret key configuration to be forward thinking and backward compatible.
2019-03-27 17:24:15 +02:00
Jannis Leidel
77c53130a4 Fix a few more inconsistencies when loading and dumping JSON. (#3626)
* Fix a few more inconsistencies when loading and dumping JSON.

Refs #2807. Original work in: #2817

These change have been added since c2429e92d2.

* Review fixes.
2019-03-27 17:14:32 +02:00
Levko Kravets
73c8e3096d [Feature] Migrate Admin pages to React (#3568) 2019-03-27 09:48:50 +02:00
Ran Byron
8230098f50 Migrated Textbox edit dialog to React (#3632) 2019-03-26 19:23:00 +02:00
Arik Fraimovich
fd42091f87 Add Lint step to CircleCI (#3642) 2019-03-26 16:40:26 +02:00
Ran Byron
ec4b36b178 Cypress eslint fixes and config (#3636) 2019-03-25 22:14:51 +02:00
Ran Byron
0995dfbf43 Widget drag tests (#3598) 2019-03-25 19:16:41 +02:00
Gabriel Dutra
70d4c724c2 Add env var to skip Flask rate limits (#3622) 2019-03-25 13:15:20 -03:00
Justin Clift
1d7378f84b Update docker compose with the stable Redash v7 tag (#3638) 2019-03-25 14:50:40 +02:00
Gabriel Dutra
b4a4ee212e Replace toastr with Ant Notification (#3610) 2019-03-24 19:08:35 -03:00
Gabriel Dutra
25910e7655 Move cypress to client folder (#3566) 2019-03-24 11:24:59 -03:00
Jannis Leidel
8e5ba804f6 Fix a DeprecationWarning about the Flask.static_path parameter. (#3624)
Code: d1d82ca8ce/flask/app.py (L347-L351)
2019-03-24 15:57:35 +02:00
Arik Fraimovich
173f9ba7e8 Fix: triggers not created for queries.search_vector (#3631) 2019-03-24 15:35:59 +02:00
Arik Fraimovich
e712c19bbe E2E test for query search (#3633)
* Apply prettier to app-header.html.
* Add: E2E test for query search
2019-03-24 15:20:08 +02:00
Ran Byron
aea3c9dbaa Fix for time based mongodb test (#3630) 2019-03-24 11:29:44 +02:00
Ran Byron
2f8aade697 Added a skipped test for issue #3202 (#3616) 2019-03-23 22:02:39 +02:00
Ran Byron
a7b930a422 Widget tests - add, remove, auto height (#3590) 2019-03-23 14:27:43 +02:00
Levko Kravets
4e69b73b0f [Bug fix] Query Results fails to use query which has double quotes in column names (#3618) 2019-03-21 19:39:22 +02:00
Omer Lachish
c47dd05095 Nest query ACL to dropdowns (#3544)
* change API to /api/queries/:id/dropdowns/:dropdown_id

* extract  property

* split to 2 different dropdown endpoints and implement the second

* make access control optional for dropdowns (assuming it is verified at a
different level)

* add test cases for /api/queries/:id/dropdowns/:id

* use new /dropdowns endpoint in frontend

* require access to dropdown queries when creating or updating parent
queries

* rename Query resource dropdown endpoints

* check access to dropdown query associations in one fugly query

* move ParameterizedQuery to models folder

* add dropdown association tests to query creation

* move group by query ids query into models.Query

* use bound parameters for groups query

* format groups query

* use new associatedDropdowns endpoint in dashboards

* pass down parameter and let it return dropdown options. Go Levko!

* change API to /api/queries/:id/dropdowns/:dropdown_id

* split to 2 different dropdown endpoints and implement the second

* use new /dropdowns endpoint in frontend

* pass down parameter and let it return dropdown options. Go Levko!

* fix bad rebase

* add comment to clarify the purpose of checking the queryId
2019-03-20 09:16:10 +02:00
Arik Fraimovich
15c815fb5e Remove node_modules before creating tarball (#3603)
* Update pack

* Remove node_modules before packing
2019-03-18 12:16:31 +02:00
Arik Fraimovich
9de676acee Fix: make sure that only the top level node_modules directory is excluded (#3600)
* Fix: make sure that only the top level node_modules directory is excluded

* Remove old unused packing script
2019-03-18 11:13:42 +02:00
Arik Fraimovich
ff0967f0d8 Update v7 CHANGELOG and version (#3595) 2019-03-17 22:05:55 +02:00
Ran Byron
e5d082b9b3 Textbox testing - add, remove, edit (#3589) 2019-03-17 18:26:01 +02:00
Arik Fraimovich
93aa6b5b80 Fix: accept integer values in dropdowns. (#3596) 2019-03-17 15:56:23 +02:00
Gabriel Dutra
1f74c0bad5 [Bug fix] Update user list when an user is created (#3594) 2019-03-15 20:56:10 +02:00
Feng
a8cb70910e [Codebase improvement] Reuse handlers base require_fields (#3577) 2019-03-15 13:21:48 +02:00
Bernhard Mäser
852636f07c update to latest stable version (#3588) 2019-03-14 18:13:18 +02:00
Arik Fraimovich
cf5c2c5ba2 Revert "Add SAML scheme override env var (#2947)" (#3587)
This reverts commit 4768fd081e.
2019-03-14 13:54:14 +02:00
Levko Kravets
10f4b99cd3 Widget title link not updated when parameter value changes (#3586) 2019-03-14 11:20:28 +02:00
Jannis Leidel
8456bbf762 Revert "Schema Viewer Drawer (#3291)" (#3585)
This reverts commit cb4d81d6ad.
2019-03-14 10:51:30 +02:00
Ran Byron
ab39242cc4 Cypress test - dashboard create/archive (#3565) 2019-03-14 08:08:56 +02:00
Ran Byron
b799ab6f0b Added alt+enter key binding (#3479) 2019-03-14 08:06:39 +02:00
Marina Samuel
cb4d81d6ad Schema Viewer Drawer (#3291)
* Process extra column metadata for a few sql-based data sources.

* Add Table and Column metadata tables.

* Periodically update table and column schema tables in a celery task.

* Fetching schema returns data from table and column metadata tables.

* Add tests for backend changes.

* Front-end shows extra table metadata and uses new schema response.

* Delete datasource schema data when deleting a data source.

* Process and store data source schema when a data source is first created or after a migration.

* Tables should have a unique name per datasource.

* Addressing review comments.

* Update migration file for mixins.

* Appease PEP8

* Upgrade migration file for rebase.

* Cascade delete.

* Adding org_id

* Remove redundant column and table prefixes.

* Non-existing tables and columns should be filtered out on the server side not client side.

* Fetching table samples should be optional and should happen in a separate task per table.

* Allow users to force a schema refresh.

* Use updated_at to help prune old schema metadata periodically.

* Using settings.SCHEMAS_REFRESH_QUEUE
2019-03-13 18:08:00 +01:00
Ran Byron
adf935b1df Fix for parameter mapping bug #3581 (#3582)
* Fix for parameter mapping bug #3581

* Must run original snapshot with original dashboard params
2019-03-13 16:41:03 +02:00
Arik Fraimovich
f1cb0101b9 👋 goodbye, similar-code false positives. (#3578) 2019-03-13 11:04:02 +01:00
Leo Palmer Sunmo
4768fd081e Add SAML scheme override env var (#2947)
* Add SAML scheme override env var

* Make it pretty, please the linter
2019-03-13 11:39:02 +02:00
Levko Kravets
4a8d9a7fb0 Fork query does not fork tables but instead adds default table (#3580)
* getredash/redash#3572 Fork query does not fork tables but instead adds default table

* Fix code style

* CR1
2019-03-13 11:29:54 +02:00
Arik Fraimovich
ba62b46a45 Append "UTC" to timestamp on embeds (in print view) (#3574)
To communicate what timezone the timestamp is.
2019-03-13 08:26:12 +02:00
Levko Kravets
fbf4dae001 Fix webpack config to work with symlinks (#3573) 2019-03-12 21:24:21 +02:00
Omer Lachish
5943bf04d5 change the order of configuration of the Elasticsearch data source to (#3571)
make sense
2019-03-12 09:42:17 +02:00
Ran Byron
93ec19b93f Prevent blank edit-in-place value (#3557) 2019-03-11 23:24:38 +02:00
Omer Lachish
63d3f22c93 Convert all dropdown values to strings to support parameter lookup (#3563)
* convert all dropdown values to strings to support parameter lookup.
solves #3562

* unicode all the way down

* show correct default values in QueryBasedParameterInput by converting
them to strings
2019-03-11 17:54:56 +02:00
Gabriel Dutra
685c7713e4 Update Amazon Elasticsearch Service image (#3567) 2019-03-11 06:43:03 +02:00
Levko Kravets
4cfa26a55e [Bug fix] Handle errors on Group members, Group datasources and User profile pages (#3564) 2019-03-10 19:34:54 +02:00
Ran Byron
5dc74e1ef7 npm audit fixes (#3561) 2019-03-10 13:35:27 +02:00
Arik Fraimovich
b703f7a3c4 Create weekly-digest.yml 2019-03-10 11:39:13 +02:00
Arik Fraimovich
26f0ce0749 New Celery/Queries Execution Status API (#3057)
* Remove QueryTaskTracker

* Remove scheudling of cleanup_tasks

* Add Celery introspection tools

* First iteration of updating the admin API.

* Show more details

* Add option to skip building npm in Dockerfile

* Show started_at

* update the refresh schedule, as it's too fast

* Update Celery monitor to report on all active tasks.

* Update task parsing for new format

* WIP: improved celery status screen

* Fix property name.

* Update counters

* Update tab name

* Update counters names

* Move component to its own file and fix lint issues

* Add migratin to remove Redis keys

* Improve columns layout

* Remove skip_npm_build arg as it's not used anymore.

* Convert query from SQL to Python

* Simplify column definition.

* Show alert on error.
2019-03-10 11:19:31 +02:00
Levko Kravets
12d2a04946 Download Query Result links: use query name for downloaded filename (#3559)
* getredash/redash#3554 Download Query Result links: use query name for downloaded filename

* CR1
2019-03-10 10:32:08 +02:00
koooge
5501f3e61c Upgrade jest & babel (#3405) 2019-03-10 09:29:44 +02:00
Arik Fraimovich
61f143dfd3 Snowflake: add support for regions and enable by default (#3550)
* Bring back Snowflake from its exile.

* Snowflake: add support for regions.
2019-03-07 23:40:24 +02:00
Arik Fraimovich
8737e8032e Add: Docker entrypoint to do Celery healthchecks. (#3548) 2019-03-07 22:32:27 +02:00
Arik Fraimovich
dfa48caf63 Fix: order dashboard favorites (#3552)
## What type of PR is this? (check all applicable)

- [x] Refactor
- [x] Bug Fix

## Description

Move favorites list handlers to their relevant modules (`redash.handlers.queries` and `redash.handlers.dashboards`) and applied `order_results` to dashboards.
2019-03-07 15:30:11 +01:00
Arik Fraimovich
e4c933af55 Update PULL_REQUEST_TEMPLATE.md (#3549) 2019-03-07 14:35:27 +02:00
Levko Kravets
be1bd2863f [Bug fix] Wrong behavior when clicking table rows on list pages (#3540) 2019-03-07 13:59:39 +02:00
Ran Byron
507ea61151 Fix long tag labels breaking table layout (#3545) 2019-03-07 11:53:28 +02:00
Arik Fraimovich
4f79c86c0e Pin pymapd version to 0.7.1 (#3543)
Newer versions dropped support for Python 2. Closes #3542.
2019-03-07 09:02:40 +02:00
Ran Byron
160c3c1048 Param fix (#3528)
* Name help text for date range only

* Autofocus on name input

* Form acts on enter key

* Fixed range check

* Fixed startsWith
2019-03-06 10:31:33 +02:00
Jannis Leidel
8eb751f0c3 Remove docker-compose.production.yml in favor of setup/docker-compose.yml. (#3533)
Fix #3251.
2019-03-06 08:49:35 +02:00
Paul Graff
75bc469708 Remove duplicate column information for late-binding views (#3537)
Since the svv_columns system view supports them now https://docs.aws.amazon.com/redshift/latest/dg/r_SVV_COLUMNS.html
2019-03-06 08:41:48 +02:00
Jannis Leidel
21082fbe0e Make the "celery" queue the default instead of "schema" to stay backward-compatible. (#3534)
Fix #3325.
2019-03-06 08:37:54 +02:00
Jannis Leidel
4e7d16b642 Remove Flask-Admin. (#3532) 2019-03-06 08:36:46 +02:00
pieter-venter
b68051d3c5 Add Hangouts Chat as alert destination (#3525)
* Add support for Google Hangouts Chat as alert destination

* Remove redundant imports

* Remove code used for debugging

* Fix pep8 warnings

* Update redash/destinations/hangoutschat.py

Add friendly name by separating type and description

Co-Authored-By: pieter-venter <pieterventer@geotab.com>

* Fix pep8 warnings. Rename image to match desitnation type.

* Show message for unknown alert state in default color
2019-03-05 22:06:25 +02:00
Levko Kravets
bc22797009 [Refactor] Refine New user modal (#3529) 2019-03-05 14:17:59 +02:00
Ran Byron
7a4fe5055d Added UTC display to scheduler dialog (#3517) 2019-03-05 11:54:33 +02:00
Gabriel Dutra
6a75ac4a57 Migrate User Pages to React (#3506)
* Create React version for the EmailSettingsWarning

* Migrate the Create User Page

* Migrate UserProfile to React

* Add /users/me to the routes (Percy ftw)

* Fix UserShow test spec

* Remove Error Messages component

* Show invitation link if email server not setup (#3519)

* return invite link to client if e-mail server is not set up

* add a couple of tests to make sure invite links are only returned when neccessary

* show invite link when e-mail is not configured

* remove "an e-mail has been sent" when there's no e-mail configured

* return invite_url in re-invites as well. Also refactor to reuse the code.

* Use CreateUserDialog instead of Page

* Render invite link on Resend Invitation click

* Add email validation to DynamicForm

* Fix EmailWarning position + update user list with user creation success

* Fix console error on UserProfile

* Redirect from /users/new  + rename createUser -> showCreateUserDialog

* Use alert instead of toastr for user creation errors

* Remove logic from CreateUserDialog

* CR

* Use Promise.reject instead of throw to avoid console error
2019-03-04 18:26:51 -03:00
Ran Byron
34da15fd6a Migrated AddTextboxDialog to AntD (#3524) 2019-03-04 21:51:48 +02:00
Ran Byron
dd0fab7275 Moved widget and dashboard save logic out of dialog (#3522) 2019-03-04 16:31:31 +02:00
Gabriel Dutra
ade3cc72a7 Fix eslint error on AlertsList (#3518) 2019-03-03 00:28:17 +02:00
Omer Lachish
02e82a7658 Fix verification_email endpoint when in MULTI_ORG mode (#3502)
* append slug to /verification_email endpoint when in MULTI_ORG mode

* Revert "append slug to /verification_email endpoint when in MULTI_ORG mode"

This reverts commit 817fb034c4.

* fix for /email_verification in MULTI_ORG setups
2019-03-02 14:12:41 +02:00
Ran Byron
6e3b9c2977 Fixed navbar responsiveness (#3510)
* Fixed navbar responsiveness

* Adjustments so that logo should never hide
2019-02-28 16:53:42 +02:00
Ran Byron
34e03b01bb Migrated query edit/add param dialog to React/AntD/Hooks (#3488) 2019-02-28 16:31:34 +02:00
Ran Byron
dab35acd2c QuerySelector in Alert page (#3501) 2019-02-28 15:56:12 +02:00
Arik Fraimovich
a93741e64b CircleCI build improvements (#3511)
* Make sure master builds tarball/docker image only when backend and frontend tests pass.

* Build a redash/preview image alongside redash/redash image.

* Fix version variable
2019-02-28 15:23:47 +02:00
Ran Byron
549f878c98 Added <QuerySelector /> component (#3494)
* Updated npm to support react hooks

* Added <QuerySelector />

* Changed selectQuery to also clear, completed 2->3 dots in msg, avoiding setSearching on stale rejection.

* Removed unused highlight lib
2019-02-28 15:07:57 +02:00
Gabriel Dutra
194f45263b [Feature] Migrate Alerts List Page to React (#3505) 2019-02-28 12:33:03 +02:00
G. Tsirkas
83668a6840 LDAP Authentication. Create two envars REDASH_LDAP_USE_SSL and REDASH_LDAP_AUTH_BIND (#2776)
* Add two new envars. REDASH_LDAP_USE_SSL which determines if the connection will use ssl and LDAP_AUTH_BIND which determines if the binding is SIMPLE or ANONYMOUS

* Add use_ssl paremeter

* Rename LDAP_AUTH_BIND to LDAP_AUTH_METHOD and modify LDAP_SSL using parse_boolean

* Fix typo

* import ANONYMOUS constant from ldap3

* Add NTLM authentication

* Add comment to authentication method envar
2019-02-28 10:05:41 +02:00
Toshimitsu Takahashi
c9a4f07a7a Support AWS IAM profile for Amazon Elasticsearch (#3005) 2019-02-28 09:57:33 +02:00
Omer Lachish
e9c88ea176 Verify address when users change their e-mail (#3504)
* re-verify e-mail address on change

* send verification e-mail to the new address
2019-02-27 12:17:20 +02:00
ialeinikov
fbaded4548 adding gevent worker in requirements.txt, adding some gunicorn config… (#3333)
* adding gevent worker in requirements.txt, adding some gunicorn configurable parameters with defaults

* reverting the change as it's going to be set via env variable(s)
2019-02-27 11:15:31 +02:00
Omer Lachish
570e8d9f23 set invitation as not-pending in render_token_login_page only when (#3500)
handling invites (as opposed to password reset links)
2019-02-27 09:06:41 +02:00
Omer Lachish
0d76c036cb Be more permissive when parameters are safe (#3383)
* use the textless endpoint (/api/queries/:id/results) for pristine
queriest

* reverse conditional. not not is making me the headaches.

* add ParameterizedQuery#is_safe with an inital naive implementation which
treats any query with a text parameter as not safe. This will be
remedied later when DB drivers will handle these parameters.

* allow getting new query results even if user has only view permissions
to the data source (given that the query is safe)

* fix lint error - getDerivedStateFromProps should be placed after state

* Revert "use the textless endpoint (/api/queries/:id/results) for pristine"

This reverts commit cd2cee7738.

* move execution preparation to a different function, which will be soon
reused

* go to textless /api/queries/:id/results by default

* let the query view decide if text or textless endpoint is needed

* allow safe queries to be executed in the UI even if the user has no
permission to execute and create new query results

* change `run_query`'s signature to accept a ParameterizedQuery instead of
constructing it inside

* use dict#get instead of a None guard

* use ParameterizedQuery in queries handler as well

* test that /queries/:id/results allows execution of safe queries even if
user has view_only permissions

* lint

* raise HTTP 400 when receiving invalid parameter values. Fixes #3394

* remove unused methods

* avoid cyclic imports by importing only when needed

* verify that a ParameterizedQuery without any parameters is considered
safe

* introduce query.parameter_schema

* encapsulate ParameterizedQuery creation inside Query
2019-02-26 20:55:01 +02:00
Gabriel Dutra
138c55cf54 Fix DynamicForm ignoring default value for checkboxes (#3487) 2019-02-26 15:10:14 +02:00
Gabriel Dutra
60cd8812a9 Update Percy token (#3492) 2019-02-25 21:22:46 +02:00
Arik Fraimovich
5c5bfbdbbe Make sure Flask app created in Celery's worker process (#3465)
* Make sure Flask app created in worker process

* Add reference to GitHub issue
2019-02-25 19:11:03 +02:00
Sergei Beregov
75c34bf18d Add custom JSON encoder for PostgreSQL (#3442)
To handle columns with [range types][1] and display them as a
string custom JSON encoder for PostgreSQL was added.

Merging this PR will fix issue #1764

[1]:https://www.postgresql.org/docs/9.3/rangetypes.html
2019-02-25 17:52:45 +02:00
Arik Fraimovich
b56cc1cd16 Pin SQLAlchemy-Utils version (#3490)
Pin the version of SQLAlchemy-Utils following the discussion in #2970.
2019-02-25 11:22:48 +01:00
Wei
1a357df9b3 Fix prometheus query runner: get_schema and query range (#3471) 2019-02-25 11:40:35 +02:00
Yoshiken
d36e5acaea Fix update logo (#3489) 2019-02-25 10:12:02 +02:00
Arik Fraimovich
f4f34d02fb Create PULL_REQUEST_TEMPLATE.md (#3485) 2019-02-25 10:11:21 +02:00
Allen Short
3fdd3080c1 Use series name as pie chart label (#3484)
It was unconditionally using the column name; this uses the series name instead
if specified in the chart editor.
2019-02-25 10:10:27 +02:00
taminif
5d525b80b6 fix broken link in CONTRIBUTING.md (#3483) 2019-02-22 14:28:13 -03:00
Levko Kravets
5e5b0d69d8 [Feature, Tech debt] Improve list pages layout (#3482) 2019-02-22 17:26:29 +02:00
Levko Kravets
33b8bd27eb [Feature] Migrate Group List and Details pages to React (#3411) 2019-02-22 14:47:48 +02:00
Subhi Al Hasan
8679b8756e Cleaner approach for _is_collection_a_view (#3113)
* Fix collection fields retreival bug when Views are present in MongoDB

* fixing _is_collection_a_view function

* Update redash/query_runner/mongodb.py

Co-Authored-By: jodevsa <jodevsa@gmail.com>

* using options() instead of try/except on collstats  to detect if a collection  is a view
2019-02-21 23:39:36 +02:00
Omer Lachish
2a37cb31d9 Fix max-age issues on textless endpoint (#3477)
* max_age should default to -1

* pass maxAge along to `execute`
2019-02-21 16:02:06 +02:00
Ran Byron
4ad303b358 Fix some flex layout issue (#3476) 2019-02-21 14:21:54 +02:00
MURAOKA Taro
8fe1d33068 monitor "schemas" queue to run refresh_schema (#3459)
* monitor "schemas" queue to run refresh_schema

`refresh_schema` tasks won't run because "schemas" queue isn't consumed
with default settings.
and it cause leaking redis storage, a "schemas" list is growing with time.

this PR fix it, adds "schemas" queue to monitor by celery.

* use scheduled_worker for "schemas" queue

instead of "adhoc_worker"
2019-02-21 12:06:25 +02:00
Arik Fraimovich
4999ab5de7 Provide default value for .pop to avoid KeyError exception (#3474) 2019-02-21 11:17:07 +02:00
Ran Byron
8b19f16430 Help trigger dynamic component (#3472) 2019-02-20 17:55:35 +02:00
Omer Lachish
a17eb14cdf support e-mail verification for multi org setups (#3468) 2019-02-20 13:45:09 +02:00
Omer Lachish
1ad0fa6a9b avoid Flask debug error message about strict slashes (#3469) 2019-02-20 13:19:06 +02:00
Arik Fraimovich
77dcc80522 Fix: ParameterizedQuery: support for upper cases column names. (#3461)
* Fix: ParameterizedQuery: support for upper cases column names.

* Fix test name
2019-02-20 12:08:38 +02:00
Arik Fraimovich
fe10b06928 Fix: JS Map needs a set call rather than assignment (#3464) 2019-02-20 12:07:46 +02:00
Arik Fraimovich
e35f2b8f51 Fix: when max_age is None the handler fails (#3462) 2019-02-19 20:47:29 +02:00
Omer Lachish
0bca2d8920 when working with a schema, fail in the case that there are parameters (#3452)
which are not part of the schema
2019-02-19 20:46:30 +02:00
Arik Fraimovich
f421119f9d Remove options NullPool does not support (#3460) 2019-02-19 16:04:00 +02:00
Arik Fraimovich
ebef0efe06 Fix: timedelta values were not JSON serialized properly (#3463)
.
2019-02-19 14:27:37 +01:00
Ran Byron
8fc2ecf55c [Bug fix] Widget oblivious to updated parameter values (#3445) 2019-02-18 22:55:46 +02:00
Ran Byron
3147a0bd98 Version data - footer -> header menu (#3458) 2019-02-18 22:15:51 +02:00
Gabriel Dutra
2c705712fc Fixes to Percy (#3440)
* Add check for repository url

* Use CIRCLE_REPOSITORY_URL directly

* Change percy waiting to be with resources instead of time

* Add data sources types resource to Edit Data Source + eslint fixes

* Separate Page Screenshots in different spec files
2019-02-18 16:30:48 -03:00
Levko Kravets
d483785098 [Codebase improvement] Refine ItemsList base component (previously LiveItemsList) (#3415) 2019-02-18 20:48:26 +02:00
Ran Byron
298fe6a779 HelpTrigger in header (#3457)
* Moved component from services->components

* Added help trigger to header

* Reverted tooltip-anchor swap

* Moved trigger location in html (to mirror saas)

* Removed white space

* Changed tooltip text to “Help”
2019-02-18 19:52:10 +02:00
Arik Fraimovich
f07e613631 Fix: ScheduleDialog won't render for "30 days" interval with no time value (#3447) 2019-02-17 15:12:07 +02:00
Arik Fraimovich
60472e2fe0 Add support for Amazon ES service with IAM authentication (#3446)
* Add support for Amazon ES service with IAM authentication

* Add required dependency.
2019-02-17 15:11:40 +02:00
Ran Byron
81c950407d HelpTrigger to open in drawer (#3436)
* HelpTrigger to open in drawer

* Fixed “typo”

* Simplified version - removed postMessage

* Changed some wording
2019-02-17 15:11:16 +02:00
Arik Fraimovich
a34269cc7d Change: encrypt data source options. 🔓 (#2970)
* Change: encrypt data source options
* Implement migration
2019-02-17 13:54:19 +02:00
Omer Lachish
a8f74a1078 remove the word "type" from error message, as enum out-of-range errors (#3449)
have nothing to do with types.
2019-02-17 13:42:44 +02:00
Arik Fraimovich
58a53e3470 Fix: remove widgets when deleting a visualization. (#3423)
Closes #3257.
2019-02-17 10:30:23 +02:00
Ran Byron
fba2a35cef [Feature] Sharing disabled if dashboard has query params (#3439) 2019-02-16 17:06:09 +02:00
Gabriel Dutra
b9644b7456 React version of UserEdit (#3354)
* Update DynamicForm export

* Move UserShow to users folder

* Migrate User profile header and create DynamicForm for basic data

* Update UserShow to use UserProfile prop

* Add API Key input

* Add handler to regenerate API Key button

* Handle user profile save

* Add readOnly prop to DynamicForm and begin disabled user behavior

* Add Change Password Modal

* Remove action buttons for disabled users

* Add send password reset behavior

* Add minLength and password comparison to Password Modal

* Resend Invitation button

* Add Convert User Info

* Fix UserShow test

* Some code updates

* Add enable/disable user button

* Add UserPolicy as an idea

* Remove UserPolicy

* Create Edit Profile spec

* Move User profile screenshot to Edit Profile Spec

* Add tests for saving user and changing password errors

* CC is back :) - Fix trailing spaces

* Add test for succesful password update

* A few improvements from code review

* Remove Toggle User button when seeing your own profile

* Create InputWithCopy

* Fix possible errors when network is off and improve Email not sent alert

* Add default response object for $http possible errors

* Changes in UserEdit
- removed onClick from methods name
- regenerate API Key now uses InputWithCopy
- Password title added

* Update UserEdit render behavior and styling
- Password title changed to h5
- change rendering rules for actions
- Password modal is now closed when password is changed
- change DynamicForm readOnly to the fields and add hideSubmitButton

* Create ChangePasswordDialog and update UserEdit

* Fix possible console error

* Remove password match assertion from spec

* Fix typo
2019-02-14 14:08:30 -02:00
swfz
afaedb9062 [Feature] Table visualization: Raise the upper limit of MAX_JSON_SIZE (#3310)
* move constant value to clientConfig
* change name maxJsonSize to tableCellMaxJSONSize
* value from environment. default is 50000
2019-02-13 11:42:40 +02:00
Ran Byron
f2df7170d2 HelpTrigger (#3431)
* Moved to HelpTrigger

* Moved share dialog “Learn more” to HelpTrigger
2019-02-13 10:38:25 +02:00
Arik Fraimovich
d6827e3601 Version update time (#3429)
* Version update time 

* Need more 
2019-02-13 09:51:07 +02:00
Omer Lachish
c028e49bfd send ip and user id to sentry (#3430) 2019-02-13 09:41:41 +02:00
Ran Byron
9b1f277530 [Widget Params] Updated help url and tooltip (#3428) 2019-02-13 09:00:48 +02:00
Ran Byron
901f28a79f Pre-commit hook to run on modified files only (#3410)
* Pre-commit hook to run on  modified files only

* Removed git add, fixed script dup

* Removed pre-push, testing related files only in pre-commit
2019-02-13 08:21:42 +02:00
Levko Kravets
3fed697c37 [Bug fix] Query Parameters: don't save urlPrefix (#3427) 2019-02-12 21:10:53 +02:00
Levko Kravets
d567765a3c [Bug fix] Notifications randomly shown with visible page or not shown with inactive page (#3426) 2019-02-12 20:07:36 +02:00
Ran Byron
4dbc17572a Converted Share modal to Ant (#3424) 2019-02-12 16:11:08 +02:00
Omer Lachish
330c5a85f1 Enable remote debugging with ptvsd (#3419)
* open port 3000 for remote debugging

* add ptvsd

* use port 5678 to avoid changes in VSCode's default config

* attach to ptvsd

* no need to wait for attach

* actually, --debugger seems to be working

* create a new docker entry point for remote debugging

* alternative method to switch to debugging
2019-02-12 09:10:18 +02:00
Levko Kravets
2c1400d323 [Feature] Alternative implementation of dashboard param title editing (#3417) 2019-02-11 17:17:05 +02:00
Arik Fraimovich
cb22764d68 Bug fix] Saving a new query removes reference to last query result (#3421)
* Correctly test if the current query result is for the current query.
* Serialize a new query with its visualizations.
2019-02-11 14:13:01 +02:00
Arik Fraimovich
eee77a1c9b [Bug fix] Show query result footer only when there is a query result. (#3422) 2019-02-11 13:46:18 +02:00
Omer Lachish
71fb1442f1 Upgrade Sentry SDK (#3418)
* replace raven with sentry-sdk

* use sentry-sdk in celery

* use sentry-sdk with flask

* unify Flask and Celery initializations for Sentry

* extract sentry stuff to own module

* it's time for Sentry 0.7.2
2019-02-10 21:56:16 +02:00
Jannis Leidel
23908edc28 Handle InterruptException in Athena query runnner like in the Presto query runner. (#3403) 2019-02-10 13:41:16 +02:00
Ran Byron
df4ca86d35 Added short modal specific styling (#3366) 2019-02-10 13:39:55 +02:00
Omer Lachish
03f040da0e Unify query based dropdown population (#3337)
* stop testing `collect_query_parameters`, it's an implementation detail

* add tests for `missing_query_params`

* rename SQLQuery -> ParameterizedSqlQuery

* rename sql_query.py to parameterized_query.py

* split to parameterized queries and parameterized SQL queries, where
parameterized queries only do templating and parameterized SQL queries
add tree validation on top of it

* move missing parameter detection to ParameterizedQuery

* get rid of some old code

* fix tests

* set syntax to `custom`

* revert the max-age-related refactoring

* 👋 tree validations 😢

* BaseQueryRunner is no longer a factory for ParameterizedQuery, for now

* add an endpoint for running a query by its id and (optional) parameters
without having to provide the query text

* adds parameter schema to ParameterizedQuery

* adds parameter schema validation (currently for strings)

* validate number parameters

* validate date parameters

* validate parameters on POST /api/queries/<id>/results

* validate enum parameters

* validate date range parameters

* validate query-based dropdowns by preprocessing them at the handler
level and converting them to a populated enum

* change _is_date_range to be a tad more succinct

* a single assignment with a `map` is sufficiently explanatory

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/handlers/query_results.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* build error message inside the error

* support all types of numbers as number parameters

* check for permissions when populating query-based dropdowns

* check for access to query before running it

* check for empty rows when populating query-based enums

* don't bother loading query results if user doesn't have access

* 💥 on unexpected parameter types

* parameter schema default is a list, not a dictionary

* fix a totally unrelated typo

* remove redundant null guards

* introduce /dropdown.json endpoint with dummy data

* wire frontend to /dropdown.json

* always return name/value combos from /dropdown.json

* load actual data into /dropdown.json

* pluck correct values for `name` and `value`

* reuse dropdwon plucking logic in QueryResultResource

* simplify _get_dropdown_values

* when doing parameter validation, we only care about the value and not
the display name

* rename dropdown to dropdownOptions

* move dropdown_values to utils/parameterized_query.py

* stop converting queries to enums and encapsulate the work inside
ParameterizedQuery (almost - /dropdown.json would still access the
dropdown_values method)

* re-order arguments by importance

* test query parameter validation

* tests for dropdown_values logic

* remove `.json` suffix to the dropdown endpoint

* allow `BaseResource` to handle JSON stuff

* move _pluck_name_and_value outside its containing method

* case-insensitive lookup when plucking name and value

* separate concerns and simplify test isolation for `dropdown_values`

* pick the default column according to the order specified in the query
result columns attribute

* use `current_org` instead of passing `org`

* test that user has access to the query when calling the /dropdown
endpoint
2019-02-10 13:10:39 +02:00
Levko Kravets
e21bbcc6fe [UI/UX Improvement] Use Ant's Button component on users list page (#3416) 2019-02-08 17:48:48 +02:00
Levko Kravets
23f5dde488 [Codebase Improvement] Refine dialog wrapper and use it for all existing dialogs (#3407) 2019-02-08 10:00:22 +02:00
Ran Byron
29326f3610 [Widget Params] Title edit fixes (#3413) 2019-02-08 08:45:46 +02:00
Ran Byron
593ebde211 Fix: “Add TextBox” dialog not opening (#3414) 2019-02-08 01:01:50 +02:00
Levko Kravets
11507c5e5e Show active and pending users separately (for admins) (#3400) 2019-02-07 20:30:55 +02:00
Jannis Leidel
c49dccf254 Work around a resizing issue. (#3412)
* Work around a resizing issue.

Fix #3353.

* Add comment to remove this when we delete Angular.

Co-Authored-By: jezdez <jannis@leidel.info>
2019-02-07 16:05:39 +02:00
Marina Samuel
029bee18fb Coerce to moment when 'datetime' selected by user. (#3150) 2019-02-07 14:42:30 +01:00
Levko Kravets
ec475e4b7b [Bug fix] Few small bugs on Queries list page (#3402)
* Link to query page
* Sidebar menu item title: `Archive` -> `Archived`
* Whitespaces in empty state block
2019-02-06 00:19:31 +02:00
Levko Kravets
045c171bb4 Refactor TagsControl; fix TagsEditorModal animation (#3399)
* Refactor TagsControl; fix TagsEditorModal animation

* Update tooltip text

Co-Authored-By: kravets-levko <levko.ne@gmail.com>

* Update tooltip text

Co-Authored-By: kravets-levko <levko.ne@gmail.com>

* CR1
2019-02-05 23:29:09 +02:00
Arik Fraimovich
21341132f6 Fix: cohorts get stuck when passing strings instead of numbers. (#3397)
* Fix: cohorts get stuck when passing strings instead of numbers.

Parse the value to get a number.

* Use parseInt for stage

* Remove redundant parseInt
2019-02-05 21:20:17 +02:00
Levko Kravets
ac68fe1a6d Migrate Dashboards/Queries/Users list pages to React (#3381)
* Refine existing implementation of dashboards/queries/users lists and a common base controller

* Migrate common list page controller to React and refactor it's logic

* Migrate Dashboard list page to React

* Migrate Queries list page to React

* Migrate Users list page to React

* Remove react-timeago dependency

* Use composition instead of inheritance

* Refine implementation

* Merge sidebar into single component

* Refine column definitions

* Use simple controller instead of React context

* Refine implementation

* Restore changes from getredash/redash#2888

* Tweak Users list page

* Ability to render dynamically defined components

* Tweak users list page

* User list page for non-admins

* Fix: ItemsTable ignores isAvailable field

* Refine implementation

* Refine implementation

* Implement LiveItemsList as higher order component

* Some fixes

* Move some definitions to a better place

* Some fixes

* Refine components

* Refine UsersList page

* More comments for a god of comments

* Fix wrong tables size on smaller screens

* Tweak tables
2019-02-05 21:13:32 +02:00
Arik Fraimovich
13855934f9 Add YAML support in QueryEditor (#3395) 2019-02-05 20:37:54 +02:00
Ran Byron
5b62883c1c [Widget Params] Switched parameter list to table style (all parts) (#3332)
* [Widget Params] Split title and mapping editing

* [Widget Params] Restyled source editing

* [Widget Params] Switched parameter list to table style

* Displaying different labels and help phrases when changing type
Added link to knowledge base
Fixed issue with existing param default select value
2019-02-05 20:36:15 +02:00
Ran Byron
c9681d55bf Added pre-push hook (#3390) 2019-02-05 16:16:49 +02:00
Arik Fraimovich
7cfea8a6a0 Fix: only login user when it's the current user. (#3396)
Otherwise it would login the admin as the user...
2019-02-05 15:53:51 +02:00
Ran Byron
2011864fdb Fix: Selected item in dropdown unreadable (#3398) 2019-02-05 15:50:31 +02:00
Omer Lachish
8f0cffe424 Use textless endpoint for pristine queries (#3367)
* use the textless endpoint (/api/queries/:id/results) for pristine
queriest

* Revert "use the textless endpoint (/api/queries/:id/results) for pristine"

This reverts commit cd2cee7738.

* move execution preparation to a different function, which will be soon
reused

* go to textless /api/queries/:id/results by default

* let the query view decide if text or textless endpoint is needed

* lint
2019-02-05 12:08:12 +02:00
Ran Byron
3df372434f [Widget Params] Migrated edit params + new widget dialog to Ant Modal (#3387) 2019-02-04 21:00:59 +02:00
Arik Fraimovich
933dd753a8 Make the logic around schedule['until'] easier to read (#3376) 2019-02-03 21:13:27 +02:00
koooge
3992bcda9b Ignore to copy some files onto docker container (#3388)
* Ignore to copy some files onto docker container

Signed-off-by: koooge <koooooge@gmail.com>

* Dockerignore venv/

Signed-off-by: koooge <koooooge@gmail.com>
2019-02-03 20:30:08 +02:00
Jannis Leidel
69e34f048a Add archived queries section to queries list. (#2888)
* Add archived queries section to queries list.

* Refactor route building for list based controllers.

This also fixes the dashboard empty state page.
2019-02-03 14:35:25 +02:00
Omer Lachish
b0a11983fa fix lint error - getDerivedStateFromProps should be placed after state (#3391) 2019-02-03 11:13:04 +02:00
Levko Kravets
807e6aaaa6 Migrate "time ago" components to React (#3385)
* Replace <am-time-ago> (angular-moment) and <rd-timer> with React component

* PropTypes: Moment validation

* Increase polling interval

* Refine component implementation

* Add tooltip with formatted date/time

* Refine component implementation
2019-02-02 18:46:48 +02:00
Levko Kravets
324a1f55cc Merge pull request #3384 from getredash/step-component
EmptyState alternative implementation with a Step component
2019-02-02 18:29:21 +02:00
Levko Kravets
abccff03f7 Fix Add datasource step; EmptyState.icon is optional 2019-02-02 18:12:27 +02:00
Levko Kravets
aa619c453f Merge branch 'master' into step-component 2019-02-02 17:56:11 +02:00
Levko Kravets
10b5c03248 Merge pull request #3389 from getredash/cypress
Fix Cypress E2E failing in CI
2019-02-02 17:14:21 +02:00
Gabriel Dutra
fde52f5d84 Fix Cypress E2E failing in CI 2019-02-02 12:44:33 -02:00
Arik Fraimovich
78df7e7cc9 Last refinements:
* Update Step implementation to be easier to read.
* Set some props to required to remove default value.
2019-02-01 10:16:17 +02:00
Levko Kravets
e314715335 Refine implementation, fix 'shouldShow' condition, fix eslint warnings 2019-02-01 08:37:09 +02:00
Arik Fraimovich
a1cf065ec6 No need to export Step 2019-02-01 00:04:03 +02:00
Arik Fraimovich
f9570556c5 Bring back data sources step for non admins 2019-02-01 00:00:19 +02:00
Arik Fraimovich
9859610e80 Alternative implementation: Step component 2019-01-31 23:55:40 +02:00
Marina Samuel
feab2a040b BigQuery should correctly handle tmp tables that do not have a schema field. (#3382) 2019-01-31 23:20:13 +02:00
Marina Samuel
35c390a2f9 Show disabled unpublished queries for alert and dashboard modals. (#3347) 2019-01-31 19:58:47 +02:00
Ran Byron
ebb96d7ad7 Widget param url prefix p to p_w (#3380) 2019-01-31 17:03:13 +02:00
Levko Kravets
3d58860f6f Merge pull request #3374 from kravets-levko/fix-eslint-errors
Fix eslint errors
2019-01-31 14:33:28 +02:00
Levko Kravets
c223566302 Merge branch 'master' into fix-eslint-errors 2019-01-31 14:04:05 +02:00
Levko Kravets
1439714fa6 Migrate EmptyState component to React (#3373)
* Migrate EmptyState component to React

* CR1

* CR2
2019-01-31 14:02:45 +02:00
Levko Kravets
9c06e9a0bd CR1 2019-01-31 13:50:05 +02:00
Levko Kravets
f98cf7812b Merge branch 'master' into fix-eslint-errors 2019-01-31 11:25:41 +02:00
Levko Kravets
ee0e81e795 Fix eslint errors 2019-01-31 11:21:45 +02:00
Jannis Leidel
bd559b6eeb Fix some incompatible dependencies (#3348)
* Pin requests-oauthlib to work around incompatible deptree.

* Update boto3/botocore to fix incompatible deptree.
2019-01-31 09:50:47 +02:00
Arik Fraimovich
c51191aaf0 Tune CodeClimate's config to make it less annoying (#3370) 2019-01-31 07:34:31 +02:00
Levko Kravets
4a2645d4c6 Merge pull request #3368 from kravets-levko/feature/react-favorites-and-tags-list
React migration: FavoritesControl and TagsList components
2019-01-30 21:09:05 +02:00
Levko Kravets
3ad1709a0a Merge branch 'master' into feature/react-favorites-and-tags-list 2019-01-30 20:29:07 +02:00
Ran Byron
cc135398e2 Fix: static param text value is [object Object] (#3371) 2019-01-30 20:27:59 +02:00
Levko Kravets
067472643d CR3 2019-01-30 20:21:22 +02:00
Levko Kravets
225c98c52a Merge branch 'master' into feature/react-favorites-and-tags-list 2019-01-30 19:23:03 +02:00
Ran Byron
00e991ecfc Fix: Static param value not editable for Text/Number (#3369) 2019-01-30 19:18:57 +02:00
Levko Kravets
a362e97dfe CR2 2019-01-30 18:54:53 +02:00
Levko Kravets
1ea532fe26 CR1 2019-01-30 18:45:06 +02:00
Levko Kravets
9a1c8290e4 Migrate TagsList component to React 2019-01-30 17:40:42 +02:00
Levko Kravets
0d959116d8 Migrate FavoritesControl component to React 2019-01-30 17:22:54 +02:00
Aidarbek Suleimenov
0b9f575dab Fix: make ClickHouse password and username truly optional (#3362)
* clickhouse optional password

* clickhouse URL and user made optional
2019-01-30 11:17:43 +02:00
koooge
13bc910d7c Update CodeClimate configuration format to Version 2 (#3286)
* codeclimate: Update format v2
* codeclimate: Ignore generated files
2019-01-30 10:51:32 +02:00
Ran Byron
9e2f8e2461 Fix: Escape button in tag edit modal (#3363) 2019-01-30 10:43:38 +02:00
Aidarbek Suleimenov
61e7cdaa81 Filename set when /results called directly (#3359)
* filename set when /results called directly

* /results filename changed from query name to id

* Long line shortened
2019-01-29 19:47:42 +02:00
Vladislav Denisov
53aecdc607 yandex_metrica: changed auth from params to headers (#3360) 2019-01-29 18:17:13 +02:00
koooge
2da511021e Frontend lint update (#3253)
* client: Add lint command

Signed-off-by: koooge <koooooge@gmail.com>

* client: Override eslint rule object-curly-newline to keep current style

Signed-off-by: koooge <koooooge@gmail.com>

* client: Override eslint rule no-else-return to keep current style

Signed-off-by: koooge <koooooge@gmail.com>

* client: Fix eslint import/named

Signed-off-by: koooge <koooooge@gmail.com>

* client: eslint-5

Signed-off-by: koooge <koooooge@gmail.com>

* codeclimate: Delete the old setting

Signed-off-by: koooge <koooooge@gmail.com>

* client: Downgrade eslint 5 to 4 in codeclimate

Signed-off-by: koooge <koooooge@gmail.com>

* client: npx install-peerdeps --dev eslint-config-airbnb

Signed-off-by: koooge <koooooge@gmail.com>

* client: Enbale .jsx lint

Signed-off-by: koooge <koooooge@gmail.com>

* client: Set warn

Signed-off-by: koooge <koooooge@gmail.com>

* client: Fix lint indent, implicit-arrow-linebreak, lines-between-class-members

Signed-off-by: koooge <koooooge@gmail.com>

* client: Disable eslint operator-linebreak

Signed-off-by: koooge <koooooge@gmail.com>

* Revert "client: Downgrade eslint 5 to 4 in codeclimate"

This reverts commit f0fb0f0059.

* client: Fix react/button-has-type

Signed-off-by: koooge <koooooge@gmail.com>

* client: Disable an eslint rule react/jsx-one-expression-per-line

Signed-off-by: koooge <koooooge@gmail.com>

* codeclimate: Disable no-multiple-empty-lines

Signed-off-by: koooge <koooooge@gmail.com>

* client: Disable eslint react/destructuring-assignment

Signed-off-by: koooge <koooooge@gmail.com>
2019-01-29 17:25:58 +02:00
Omer Lachish
371b319e92 Server-side parameter validation (#3315)
* stop testing `collect_query_parameters`, it's an implementation detail

* add tests for `missing_query_params`

* rename SQLQuery -> ParameterizedSqlQuery

* rename sql_query.py to parameterized_query.py

* split to parameterized queries and parameterized SQL queries, where
parameterized queries only do templating and parameterized SQL queries
add tree validation on top of it

* move missing parameter detection to ParameterizedQuery

* get rid of some old code

* fix tests

* set syntax to `custom`

* revert the max-age-related refactoring

* 👋 tree validations 😢

* BaseQueryRunner is no longer a factory for ParameterizedQuery, for now

* add an endpoint for running a query by its id and (optional) parameters
without having to provide the query text

* adds parameter schema to ParameterizedQuery

* adds parameter schema validation (currently for strings)

* validate number parameters

* validate date parameters

* validate parameters on POST /api/queries/<id>/results

* validate enum parameters

* validate date range parameters

* validate query-based dropdowns by preprocessing them at the handler
level and converting them to a populated enum

* change _is_date_range to be a tad more succinct

* a single assignment with a `map` is sufficiently explanatory

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/handlers/query_results.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/utils/parameterized_query.py

Co-Authored-By: rauchy <omer@rauchy.net>

* build error message inside the error

* support all types of numbers as number parameters

* check for permissions when populating query-based dropdowns

* check for access to query before running it

* check for empty rows when populating query-based enums

* don't bother loading query results if user doesn't have access

* 💥 on unexpected parameter types

* parameter schema default is a list, not a dictionary

* remove redundant null guards
2019-01-29 09:18:07 +02:00
Arik Fraimovich
ff42ec2cc6 Cypress tests: preset the admin API key to a static value (#3358) 2019-01-28 17:54:24 +02:00
Levko Kravets
7278d4b1fc Refactor Policy and OrganizationStatus services (#3345)
* Refactor Policy and OrganizationStatus services
2019-01-28 16:46:26 +02:00
Levko Kravets
6930106380 getredash/redash#3355 Widget params: Date/Date range value empty in static param input (#3357) 2019-01-28 15:59:49 +02:00
Zsolt Kocsmárszky
c0859642fd WIP: Add dashboard details section for dashboard owner and more (#2934)
Show dashboard creator on dashboard page
2019-01-28 14:20:55 +02:00
Gabriel Dutra
37821ee008 Add Percy Page Screenshots (#3338)
* Add Percy Page Screenshots

* Add missing space
2019-01-28 10:21:42 +02:00
Arik Fraimovich
c31cb01065 Move BigQueryGCE to its own file (#3356)
* Move BigQueryGCE to its own file

* Add missing import
2019-01-28 09:37:47 +02:00
Levko Kravets
1fa58674f3 Refine SettingsMenu service and <settings-screen> component (#3339)
* Refine SettingsMenu service and <settings-screen> component

* Rename services/settingsMenu file to match default export name

* CR1
2019-01-25 17:29:35 +02:00
Jannis Leidel
d204c158a2 Allow query owners to hard-overwrite query content in case of overlap with other user (#2370)
* Hard overwrite on conflict for query owners (re #283)

* Use AlertDialog instead of custom global function.
2019-01-25 11:28:09 +01:00
Levko Kravets
b0b4d5e26a Convert Angular services to CommonJS-style and use them in React components instead of injecting (#3331)
* Refine Auth service: remove dead code and fix race condition
* Export services in CommonJS style
* Refine Users, Events and OfflineListener services
* Refactor Notifications service - rewrite to CommonJS
* Replace Angular service injection with imports in React components
* Fix Footer tests
* Events service -> recordEvent function
* CR1
2019-01-24 16:24:58 +02:00
Levko Kravets
c2c722e12e Migrate PageHeader component to React (#3324)
* Migrate PageHeader component to React

* CR1
2019-01-23 20:10:52 +02:00
Vibhor Kumar
1a61ee3ec0 Add: Uptycs query runner (#3319)
* adding uptycs query_runner in redash

* as per comment from Arik comment fixed the code

* fixed function_name

* fixed some indentation issues

* fixed the indentation issue and taken out customer_id from secret

* fixed the dependency of urllib3

* fixed the indententaton issue

* remved the urllib3 from requirements

* fixed the indentation issues

* added the new square image for Uptycs. Removed unnecessary variable and made ssl as an option

* fixed indentation issue

* Renamed SSL to verify_ssl and also added verify_ssl validate in verify in missing places
2019-01-23 20:07:40 +02:00
Ran Byron
d5afa1815e Filtering out incompatible dashboard params (#3330) 2019-01-23 16:27:49 +02:00
Arik Fraimovich
87667676e6 Remove link to roadmap (#3329)
It's no longer maintained 😢
2019-01-23 13:48:11 +02:00
Arik Fraimovich
bfeb015d71 Add configuration for the Support probot. (#3327) 2019-01-23 13:38:08 +02:00
Omer Lachish
a9c514aaf7 Textless query result endpoint (#3311)
* add an endpoint for running a query by its id and (optional) parameters
without having to provide the query text

* check for access to query before running it
2019-01-23 11:10:04 +02:00
Levko Kravets
7fa6665445 Use Ant's Paginator component; migrate SortIcon to React (#3317) 2019-01-22 17:26:11 +02:00
Miles Maddox
ff6b20b69c support for fetching all JQL results by way of pagination (#3304) 2019-01-22 15:52:13 +02:00
YOSHIDA Katsuhiko
c4bf44677a Fix an error of exporting dict value as Excel (#3323) 2019-01-22 14:43:52 +02:00
Gabriel Dutra
8bdcfb06c5 add wait time before percy data source page snapshot (#3320) 2019-01-22 08:52:23 +02:00
YOSHIDA Katsuhiko
b3643ffbb7 Add regenerate function of user's API key (#3224)
* Add regenerate function of user's API Key

* Update client/app/pages/users/show.js

Co-Authored-By: kyoshidajp <claddvd@gmail.com>

* Remove unused error message

* Refactoring: Inline temp

* Update client/app/pages/users/show.js

Co-Authored-By: kyoshidajp <claddvd@gmail.com>

* Change action event of regenerate user API key
2019-01-20 13:38:20 +02:00
Eric Chang
b91d4bdcaf override default integer/float formatting with environment variables (#3307) 2019-01-20 10:10:36 +02:00
Eric Chang
8bc8e2dadf Allow execution of highlighted subquery (#3288)
* allow execution of selected subquery
* fix query save while highlighted
* don't modify queryText and update UI when running selected
* code style and transition
* Fix query selection execution background color
* make naming consistent
2019-01-20 10:06:17 +02:00
Gabriel Dutra
84d5becf2a Update form text colors (#3296)
* Create ant variables and update form colors

* Remove less extension from imports in ant.less

* Update font-weight for labels

* Add percy snapshot for create data source page

* Remove bold in labels only for checkboxes and radio buttons
2019-01-20 09:41:52 +02:00
Arik Fraimovich
e8120c5f79 Use None as "not scheduled" default value of a query (#3277)
* Use null as the default scheduled value.

* Don't serialize None to json, so we can use SQL is not null predicate.

* Fix warning about unicode in tests

* Handling empty query.schedule in UI (#3283)

* Add migration to convert empty schedules to null and drop the not null contraint.
2019-01-18 11:30:45 +02:00
Levko Kravets
40c6a2621c Merge pull request #3299 from kravets-levko/fix/multifilter-dropdown
Multifilter's dropdown cropped when visualization container is too small
2019-01-17 15:37:26 +02:00
Levko Kravets
06887f6ff1 Multifilter's dropdown cropped when visualization container is too small 2019-01-17 15:14:46 +02:00
Omer Lachish
7847cf7d63 Fix invitation pending for older invitations (#3298)
* explicitly look for a False under details['is_invitation_pending'] and
not any falsey result, to avoid locking out invitations which were
created before the Pending Invitation feature was introduced. Solves https://github.com/getredash/redash/issues/3297

* test that old invites (that do not have any is_invitation_pending flag set in their details object) are still acceptable
2019-01-17 11:56:16 +02:00
Omer Lachish
121a44ef15 Remove tree validations and introduce ParameterizedQuery (#3230) 2019-01-17 10:26:00 +02:00
Gabriel Dutra
823e4ccdd6 Migrate DynamicForm to React (#3209)
* create DynamicForm React component

* Render fields based on target in DynamicForm

* Add missing title property to fields

* Fix style properties in DynamicForm

* Render File fields in DynamicForm

* Use React for middle component instead of Angular

* Functional save button

* Update label style

* Render functional actions

* Handle file inputs

* Update render methods to fix code climate issues

* Fix ant input number showing duplicate arrows

* Update DynamicForm style to be vertical

* Separate imports from antd in DynamicForm

* Add Feedback Icons to DynamicForm

* Change Action props on DynamicForm
- use type and pullRight instead of class prop
- update data sources and destinations pages accordingly

* Remove setDefaults method from DynamicForm fields

* Update antd version

* Remove unnecessary class selectors

* Remove another unnecessary class selector
2019-01-15 14:23:33 +02:00
Levko Kravets
0c45d69662 Dashboard Parameters (#2756)
* getredash/redash#2641 Step 1: split Add Widget/Add Textbox buttons

* Convert Add widget/textbox dialogs to React components

* getredash/redash#2641 Step 2: Implement new dashboard parameters logic

* Resolve conflicts and fix build errors

* getredash/redash#2641 Refactoring and improve code quality

* Add Edit parameter mappings dialog to the widget

* getredash/redash#2641 Changes after code review

* Use Ant's Select component instead on <select> tags

* Fix Antd imports

* Fix Antd imports

* Fix Cannot read property 'getParametersDefs' of undefined

* Fix widgets static params bugs (don't show input, don't init from URL)

* Minor UI/UX fixes
2019-01-15 13:14:54 +02:00
Gabriel Dutra
df23842c57 Separate Bootstrap/Ant styling (#3279)
* Separate Ant less dependency tree

* Change order between variables and ant imports

* Remove inc/variables from ant.less

* Update input-height-base for antd

* Set same input-color for Ant and Bootstrap
2019-01-15 11:40:38 +02:00
Arik Fraimovich
d68a4dce5f Pin version of pyparsing (#3282) 2019-01-14 17:17:23 +02:00
Levko Kravets
db86e394cf Update Antd to latest version + fix tests (#3281) 2019-01-14 16:25:57 +02:00
koooge
4c9326a9da handlers: Fix post users (#3273) 2019-01-13 15:52:56 +02:00
Ran Byron
200fea952a Pleasant alert-warning colors (#3276)
* Pleasant alert-warning colors

* Fix for json viewer primitive color
2019-01-13 15:27:26 +02:00
Ran Byron
90a0a7d39b Scheduler tests (jest/enzyme) (#3269)
* Setup enzyme and initial ScheduleDialog test

* Added tests for each schedule setting

* Added refreshOptions tests

* Added count out-of-range tests

* Added modal confirm/cancel tests

* Fixed tests failing due to server timezone difference

* Rebased to master
2019-01-13 15:26:44 +02:00
Omer Lachish
26252be75a Verify admin email address (#3267)
* add an  bit

* prompt on homepage when user's email hasn't been verified

* set e-mail as verified for new setups and invited users

* 👋 copy & paste invite links, it's time for verified e-mails!

* default `is_invitation_pending` to false and actively set it to true
when inviting users, so that existing users won't show "Invitation
Pending"

* fix tests that broke due to default is_invitation_pending value

* treat admin's e-mail address as verified

* add verification endpoint

* send verification e-mail

* Update client/app/components/empty-state/empty-state.html

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/authentication/account.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/handlers/authentication.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/templates/emails/verify.html

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/authentication/account.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/templates/verify.html

Co-Authored-By: rauchy <omer@rauchy.net>

* Update redash/templates/emails/verify.txt

Co-Authored-By: rauchy <omer@rauchy.net>

* add link in case redirects are disabled

* POSTing to /email_verification makes more sense than GETting /send_verification

* avoid sending invitations when no_invite is passed along

* Update client/app/pages/users/new.html

Co-Authored-By: rauchy <omer@rauchy.net>

* move e-mail verification prompt to home-page

* get rid of redundant $scope

* return JSON

* flip is_email_verified's default value so that existing users do not
show as not-verified

* e-mail verification propmt isn't dangerous, it just wants to warn you
2019-01-13 13:57:12 +02:00
Ran Byron
6c6366e6f0 Fix: Refresh schedule durations not pluralized sufficiently (#3268)
* Fix: Refresh schedule durations not pluralized sufficiently

* Allows omitting single value number in durationHumanize (#3274)
2019-01-13 13:31:41 +02:00
Ran Byron
de04a403d7 Fix: Refresh schedule interval count doesn't adhere to permission rules (#3265)
* Fix: Refresh schedule interval count doesn't adhere to permission rules

* Fix “4.28 weeks” to “30 days”

* Merge interval type and count into one <Select>
2019-01-13 11:39:57 +02:00
Ilya Ruzakov
0b6f1fc21b [Data Sources] Implement Apache Drill (#3188)
* Added support for Apache Drill datasource

* Improvements in `Drill` query runner and minor refactoring

1. Drill query runner now inherits from `BaseHTTPQueryRunner`, because they both have a lot of common code.
2. `BaseHTTPQueryRunner.get_response` method now accepts `http_method` argument (original implementation was only capable of sending `GET` HTTP requests).
3. Added `order` to `BaseHTTPRequestRunner` configuration schema to fix order of UI elements based on the schema.
4. Eliminated duplicate method `_guess_type` in `GoogleSpreadsheet`, `Results` and `Drill` query runners, moved `guess_type` to `redash.query_runner`.
5. Removed tests for `_guess_type` in `GoogleSpreadsheet`, `Results` and `Drill` query runners, merged them into single test case and moved to `tests.query_runner.test_utils`.
6. Various minor changes (code style, imports, etc).
2019-01-10 09:12:35 +02:00
Omer Lachish
445f8e5c36 Fix invitation pending for existing users (#3261)
* default `is_invitation_pending` to false and actively set it to true
when inviting users, so that existing users won't show "Invitation
Pending"

* fix tests that broke due to default is_invitation_pending value

* update Flask-OAuthLib
2019-01-09 13:48:47 +02:00
Omer Lachish
a29136037c update Flask-OAuthLib (#3262) 2019-01-09 13:48:21 +02:00
Arik Fraimovich
08953cc919 Redis based implementation of user active_at timestamp update (#3256)
* Switch to simpler implementation
* Fix active_at update code
* Fix sync test
2019-01-08 14:03:49 +02:00
koooge
22f835d3cb client: Remove estraverse (#3254)
Signed-off-by: koooge <koooooge@gmail.com>
2019-01-08 12:29:24 +02:00
Omer Lachish
823f172a9f Invitation Pending changes (#3229)
* determine invitation_pending according to empty password. This commit will be reverted, I'm just deferring the implementation

* show '(Invitation Pending)' to users who haven't accepted their invitation yet

* allow resending invitations

* allow deletion of pending users from user list

* set invitation as not pending when following invite link

* prevent deleting activated users

* test that users who follow invitation links are set as non-pending invitations

* prevent re-using invitations

* invitees who use SSO will now also be marked as "non-pending"

* lint
2019-01-08 08:52:48 +02:00
Jannis Leidel
44dff83046 Add "Active at" column to user list. (#3026)
* add last_active_at to users page

* Use our JSON encoder as the SQLAlchemy JSON serializer.

* Fixed some inconsistencies in the user query class methods.

* Minor cosmetic fixes.

* Add some make tasks for easier development.

* Add user detail sync system based on Redis backend.

There is a periodic Celery task that updates a new “details” JSONB column in the “user” table with the data from Redis.

Currently this is only used for tracking the date of last activity of a user but can be extended with other user information later.

Updates a few dependencies.

* Normalize a few Flask extension API names.

* Reduce implementation complexity of JSONEncoder.

* Use request_started signal to make sure we have a request context.

Otherwise loading the user based on the request won’t work.

* Fix test that checks if disabled users can login.

This correctly uses a URL path that includes the current organization and checks for the error message.

The previous test seems to have been a red herring.

* Minor cosmetic fixes.

* Remove needs_sync in favor of just deleting things.

* Misc review fixes.

* Ignore line length.

* Split redash.models import several modules.

* Move walrus UTC DateTimeField into redash.models.types.

* Restore distinctly loading dashboards.

* Simplify default values for user details.

* Define __repr__ methods generically.

* Consistently have underscore methods at the top of model methods.

* Fix tests.

* Split redash.models import several modules.

* Update to latest walrus and redis-py.

* Update kombu to 4.2.2 for redis-py 3.x compatibility.

* Remove redis-cli container after running Make task.

* Move buffer condition after datetime/time conditions.

* Update walrus to 0.7.1.

* Refactor some query APIs.

This uses the flask-sqlalchemy helpers consistently and makes more use of mixins.

* Post rebase fixes.

* Use correct kombu version

* Fix migration down revision
2019-01-07 10:30:42 +02:00
Ran Byron
569430e5cd Fix: Refresh schedule phrase overlaps title (#3250) 2019-01-06 12:46:55 +02:00
Ran Byron
07a1c23df5 Fix: Able to set out-of-range refresh interval 2019-01-06 12:27:50 +02:00
Ran Byron
b97b8477ad Feature: Refresh schedule - styling (#3247) 2019-01-06 12:14:00 +02:00
Ran Byron
9b72dfe076 Feature: Refresh schedule - save/cancel actions 2019-01-06 11:33:35 +02:00
Ran Byron
3ee83a4c4a Feature: Refresh schedule - code optimizations 2019-01-06 11:17:43 +02:00
Marina Samuel
cdd2259d08 Closes #2396: Add finer-grained scheduling. (#2426)
* Closes #187: Add finer-grained scheduling - backend.

* Closes #2396 - Add finer-grained scheduling - frontend.

* Fix linting issues

* Rename ScheduleDialgo to .jsx
2019-01-06 10:59:50 +02:00
Vincentoo
fc368ee425 Support overriding the default Celery schedule database file via SCHEDULE_DB environment variable. (#3056)
By default Celery will use a file celerybeat-schedule in the current directory.
This is an issue in a Kubernetes/Openshift environment as the file may be lost or even impossible to write.
2019-01-03 20:51:18 +02:00
YOSHIDA Katsuhiko
7a2e08c3eb Upgrade requests package (#3245) 2019-01-03 18:59:58 +02:00
Levko Kravets
ba0d069283 getredash/redash#3213 Scatter charts can have category Y axis (similar to Bubble) (#3243) 2019-01-03 17:15:51 +02:00
Omer Lachish
670d86eb5f Simple user view (#3244)
* show a simple user details page when viewing a user who isn't you (or you arent the admin)

* add a snapshot test

* lint
2019-01-03 15:23:40 +02:00
Ran Byron
63f38b7acd Fix: Query editor duplicates keystrokes [#2972] (#3239) 2019-01-01 17:40:48 +02:00
Arik Fraimovich
8b5ffc6f84 Handle the case when a QueryTracker is None and change order. (#3238) 2019-01-01 15:57:58 +02:00
Arik Fraimovich
cce2052e79 request.view_args might be None and add org_id to ApiUser (#3237) 2019-01-01 15:44:34 +02:00
Arik Fraimovich
8ea6283430 Send argsrepr value with execute_query task (#3235) 2019-01-01 15:32:02 +02:00
Arik Fraimovich
08b86c1c6d Fix: forked query wasn't opening in MULTI_ORG env (#3236) 2019-01-01 15:31:41 +02:00
koooge
0449a3ff31 Delete an unused global (#3231)
Signed-off-by: koooge <koooooge@gmail.com>
2019-01-01 08:58:31 +02:00
Arik Fraimovich
4ea46f197e It's 2019 now ! 🎉 2019-01-01 08:40:51 +02:00
Omer Lachish
d7edaa3ba2 Tests for find_missing_params (#3225)
* stop testing `collect_query_parameters`, it's an implementation detail

* add tests for `missing_query_params`
2018-12-31 12:34:57 +02:00
YOSHIDA Katsuhiko
632fc5aace Merge pull request #3232 from koooge/fix_warn_tapable
Update webpack-build-notifier to dismiss warn
2018-12-31 10:09:23 +09:00
koooge
b9abb36799 Update webpack-build-notifier to dismiss warn
Signed-off-by: koooge <koooooge@gmail.com>
2018-12-30 17:37:42 +00:00
Levko Kravets
d7e7b99a76 Merge pull request #3228 from kyoshidajp/fix_trailing_spaces_error
Fix front-end compile error
2018-12-28 20:43:10 +02:00
Katsuhiko YOSHIDA
db87c8740e Fix front-end compile error 2018-12-29 01:36:16 +09:00
Arik Fraimovich
5f2b54a320 Root folder cleanup (#3220)
* Remove old_migrations folder

* Move Dockerfile.cypress into .circleci
2018-12-26 18:09:41 +02:00
Arik Fraimovich
f62d0e1300 Use lower cased names for groups: (#3221)
Otherwise sorting depends on the Postgres collation and causes tests
to fail on different envoirnments.
2018-12-26 17:16:13 +02:00
Omer Lachish
9e156c1c30 Fix: missing param fails for object values (like date range) (#3218)
* fix: range params not recognized

* Handle parameters with unicode

* Remove debug prints

* DRY up missing_params
2018-12-26 17:06:30 +02:00
Gabriel Dutra
26965b4948 Add dot behavior to autocomplete (#3092)
* Add dot behavior to autocomplete
* Transform the Keyword Builder in an external js
* Remove methods from QueryEditor constructor
2018-12-26 17:04:11 +02:00
Omer Lachish
7a03928f48 we've noticed users with integer legacy session identifiers, so it doesn't hurt to convert to string anyway (#3219) 2018-12-26 16:24:59 +02:00
Omer Lachish
8f14efdaff Avoid exploding sql parse (#3216)
* fail silently when sql_parse explodes

* Update upstream/redash/handlers/query_results.py

Co-Authored-By: rauchy <omer@rauchy.net>

* Update upstream/redash/handlers/query_results.py

Co-Authored-By: rauchy <omer@rauchy.net>
2018-12-26 10:43:00 +02:00
deecay
03a7e24204 Show Sort Y only when type is Heatmap (#3206) 2018-12-24 17:10:16 +02:00
ialeinikov
2f7cb1bc8a [Athena] Fix: missing databases (apply pagination) (#2503)
* adding paginator on databases in glue

* reduce number of nested loops

* fixing indentation

* double for-loop instead of generator

* removing unused generator
2018-12-24 14:02:08 +02:00
koooge
64783b7f06 Switch to MULTI FROM Dockerfile and use Node 10 for builds (#3199) 2018-12-23 15:17:54 +02:00
Takuya Arita
8ed872756c Add test case for redash.utils.generate_token (#3211) 2018-12-23 15:13:00 +02:00
Arik Fraimovich
83ea472d37 Merge pull request #3093 from getredash/backend-parameter-templating
Remove Mustache templating from frontend
2018-12-20 22:24:11 +02:00
Arik Fraimovich
0505163ff9 Merge pull request #3174 from getredash/invalidate-sessions-after-email-or-password-change
Invalidate sessions after email or password change
2018-12-19 15:49:54 +02:00
Arik Fraimovich
3d38bb478f Merge pull request #3205 from kravets-levko/bug/wrong-query-link-in-widget
Widget: fix url parameters in query link
2018-12-19 15:47:30 +02:00
Levko Kravets
654e906f6b getredash/redash#3203 Widget: fix url parameters in query link 2018-12-19 15:13:58 +02:00
Omer Lachish
54da6c69ab Merge branch 'invalidate-sessions-after-email-or-password-change' of github.com:getredash/redash into invalidate-sessions-after-email-or-password-change 2018-12-19 14:36:08 +02:00
Omer Lachish
8284e829fb explain why we call on identity changes 2018-12-19 14:35:42 +02:00
Omer Lachish
bcfff469de Merge branch 'master' into invalidate-sessions-after-email-or-password-change 2018-12-19 14:23:35 +02:00
Omer Lachish
b5ceb268ef Merge branch 'master' into invalidate-sessions-after-email-or-password-change 2018-12-17 12:52:17 +02:00
Arik Fraimovich
8583eaa8ad Merge pull request #3173 from kyoshidajp/golineup
Make it possible to move up one line by Ctrl+P on macOS
2018-12-17 12:08:04 +02:00
Arik Fraimovich
ef66da7d94 V6 release (#3195)
* V6 release

* Remove "-beta"

* Update package.json

* Update package-lock.json

* Update CHANGELOG.md
2018-12-16 16:01:20 +02:00
Omer Lachish
1b4e0f5de7 rename safely_apply_parameters to apply_parameters 2018-12-16 10:58:20 +02:00
Omer Lachish
479247b60c Merge branch 'master' into backend-parameter-templating 2018-12-16 10:22:29 +02:00
Arik Fraimovich
57c8fbe14e README updates
1. Remove link to Slack channel.
2. Update number of data sources.
2018-12-16 09:55:34 +02:00
Arik Fraimovich
938a20e7c0 Use multiple issue templates instead of a single one (#3194)
* Switch to issue templates

* Apply a label to non bugs
2018-12-16 09:42:32 +02:00
Katsuhiko YOSHIDA
dc842e9201 Fix can't open new parameter dialog by Ctrl+P on Windows and Linux 2018-12-14 18:58:33 +09:00
Arik Fraimovich
f5dbdf245a Safely create_app in Celery code (try to fetch current_app first). (#3187)
Closes #3181.
2018-12-13 15:10:31 +02:00
Omer Lachish
35357afb90 transform legacy session identifiers into new session identifiers 2018-12-13 13:02:11 +02:00
Omer Lachish
419877b364 explain the motivation behind support for legacy session identifiers 2018-12-13 13:02:03 +02:00
Omer Lachish
143d515bfc use login_user instead of manually updating user_id in the session 2018-12-13 12:30:21 +02:00
Gabriel Dutra
8481dacff4 Fix eslint issues on user.js (#3186) 2018-12-12 23:32:12 +02:00
Omer Lachish
94905a287a tests for legacy session user identifiers 2018-12-12 13:03:50 +02:00
Katsuhiko YOSHIDA
34af780264 Golineup only macOS 2018-12-12 19:00:13 +09:00
Omer Lachish
3c8a3caa1d backward compatibility so users who have the old session identifier don't get logged out 2018-12-12 10:10:13 +02:00
Omer Lachish
9d566ef302 Merge branch 'master' into invalidate-sessions-after-email-or-password-change 2018-12-12 09:49:11 +02:00
Omer Lachish
e23a07af03 Remove missing coverage from pytest terminal output (#3180)
* Remove missing coverage from pytest terminal output

* move coverage reporting to CI
2018-12-12 08:30:46 +02:00
Omer Lachish
2312db46f2 test that other sessions are invalidated when changing an e-mail. I had
to resort to comments in code in order to explain this. I'm a failure
today. 😭
2018-12-11 15:14:43 +02:00
Arik Fraimovich
52434a837f Make refresh_queries less noisey in logs (#3183) 2018-12-11 15:03:29 +02:00
Arik Fraimovich
230ad33f02 [Redshift] Fix: support for schema names with dots. (#3182) 2018-12-11 14:57:42 +02:00
Omer Lachish
b3495b8c00 test that user does not get logged out when changing email or password 2018-12-11 12:25:51 +02:00
Omer Lachish
dec790a9f3 Merge branch 'master' into invalidate-sessions-after-email-or-password-change 2018-12-11 10:41:27 +02:00
Gabriel Dutra
cfe12c5a5d Add DB Seed to Cypress and setup Percy (#3155)
* Update Cypress element selectors

* Add seed data function to Cypress

* Change Cypress setup to be part of db-seed

* Add DatabaseSource selector to Create Data Source spec

* Add getElement command to Cypress

* Fix eslint issues

* Change Cypress getElement to getByTestId

* Add Percy and test it with the CI

* Change Percy dependency for CI to Cypress' Dockerfile

* Change Percy's execution to the docker container
- add --no-save to avoid errors on Dockerfile.cypress
 - pass PERCY_TOKEN from the CI to docker container

* Fix missed char on CircleCI config file

* Move Percy execution back to host on the CI

* Test adding PERCY_TOKEN to frontend-e2e-tests on CI config

* Undo add PERCY_TOKEN to config.yml

* Add Percy token and .git folder to Cypress

* Remove Percy install from config.yml

* Ignore .git folder again and use Percy env vars instead

* Update PERCY_PULL_REQUEST to be CIRCLE_PR_NUMBER

* Update cypress-server.js to handle other cypress commands
- cypress-server.js -> cypress.js
- new commands added to cypress.js
- CircleCI config updated accordingly
- added a Homepage screenshot

* Remove trailing spaces

* Add Create Query spec

* Disable Cypress videos

* Update run browser to Chrome

* Add missing --browser chrome
2018-12-10 22:29:36 +02:00
Omer Lachish
944bee6101 update identity only after succesfully updating user information 2018-12-10 14:25:04 +02:00
Omer Lachish
38ed046c9f Fix disable error message (#3175)
* display correct error message when attempting to disable yourself
* 403 (Forbidden) feels like a better status code than 400 (Bad Request)
* fix broken test
* remove redundant error title
2018-12-10 14:02:50 +02:00
Takuya Arita
1acf063755 FIX: Reject empty query name (#3171) 2018-12-10 12:35:25 +02:00
Omer Lachish
c426c826f7 fix tests that rely on sessions 2018-12-10 12:27:39 +02:00
Omer Lachish
4b1275ae56 don't sign out the current session when changing email or password 2018-12-09 11:07:42 +02:00
Katsuhiko YOSHIDA
b3c3134a86 Make it possible to move up one line by Ctrl+P 2018-12-09 15:26:01 +09:00
Omer Lachish
c311c12bcf invalidate session when email or password changes - currently not
backwards compatible
2018-12-05 23:49:55 +02:00
Omer Lachish
76321937d7 Remove API permissions for users who have been disabled (#3162) 2018-12-05 12:21:18 +02:00
Arik Fraimovich
c9ca2b99f6 Fix: Alert.evaluate failing when the column is missing. (#3167) 2018-12-05 11:28:05 +02:00
Arik Fraimovich
d42f0b2d40 Directly using record_event task requires timestamp (#3166)
Using the helper instead.
2018-12-05 10:11:08 +02:00
Vladislav Denisov
e530c23d4c clickhouse: fixed int() conversion error (#3161) 2018-12-05 09:29:47 +02:00
Omer Lachish
0973ee8abb Include correct version in production builds (#3163)
* take the first 8 characters for frontend version, not backend version

* run `npm run build` after version has been updated in CI

* `pack` should run last
2018-12-04 22:14:32 +02:00
Arik Fraimovich
3ee7537a6c WIP: Update CHANGELOG (#3159) 2018-12-03 22:07:20 +02:00
Omer Lachish
d769afab6f Merge branch 'master' into backend-parameter-templating 2018-12-03 13:22:44 +02:00
Omer Lachish
cf86509a0b remove leftovers of SQLQuery from utils 2018-12-03 13:17:40 +02:00
Omer Lachish
54894c3a26 track sql injections using an event to detect false positives 2018-12-03 13:12:34 +02:00
Arik Fraimovich
9c12b04578 json_dumps: add support for serializing buffer objects. (#3156) 2018-12-03 10:57:36 +02:00
Omer Lachish
1519849219 use SQLQuery's text property instead of method 2018-12-03 10:03:45 +02:00
Omer Lachish
202b93d8be use SQLQuery in run_query 2018-12-03 09:53:17 +02:00
Omer Lachish
0a62bee3a1 Merge branch 'master' into backend-parameter-templating 2018-12-03 09:44:52 +02:00
Omer Lachish
9579f12a83 Protect against SQL injections by using tree comparisons (#3109)
* add SQLQuery class with tests for safe queries and non-safe tautology attacks

* add test for union query injections

* split .apply calls to newline

* add tests for comment attacks

* remove double underscore

* extract complex children check to variable

* inherit from object because I'm not a lamer

Co-Authored-By: rauchy <omer@rauchy.net>

* simplify cognitive complexity

* check that additional columns are not injected

* detect appended queries

* inline .apply calls

* move SQLQuery to it's own module

* move SQLQuery tests to their own module

* serialize SQLQuery instances

* raise an exception when attempting to serialize an unsafe query

* queries without parameters are safe

* remove redundant parentheses

* use cached properties

* rename SQLInjectionException to SQLInjectionError

* support multiple word params and param negations

* refactor out methods that don't involve any state

* don't cache text()

* reduce cognitive complexity
2018-12-02 21:51:06 +02:00
Zsolt Kocsmárszky
463d4ce518 Fix label positioning on no found screen (#3148)
* Fix label positioning on no found screen

* Use TagsControl component on not found screen
2018-12-02 10:42:30 +02:00
Zsolt Kocsmárszky
2e4d196452 Add and improve recent db logos that didn't fit in size properly (#3147)
* Add and improve recent db logos that didn't fit in size properly

* Update mongodb logo

* Remove Athena Direct as requested
2018-12-02 10:27:01 +02:00
Zsolt Kocsmárszky
4078af2996 Update, replace and fix new alert destination logos so it fits better (#3146) 2018-11-29 21:04:35 +02:00
Zsolt Kocsmárszky
73825ea266 Improve tag link colors and fix group tags on Users page (#3149) 2018-11-29 21:02:54 +02:00
Zsolt Kocsmárszky
b2a0d61844 Better manage permissions modal (#3139)
* Improved design for manage permissions

* Show Owner on Permission modal, remove owner from dropdown options

* Pass owner to Permissions modal
2018-11-29 15:40:44 +02:00
Omer Lachish
1774edabc0 take the first 8 characters for frontend version, not backend version (#3145) 2018-11-29 15:20:30 +02:00
Omer Lachish
54b8e7c136 Merge pull request #3144 from getredash/display-frontend-version
Display only the first 8 characters of frontend version
2018-11-29 15:17:14 +02:00
Omer Lachish
54f09f73db take the first 8 characters for frontend version 2018-11-29 15:03:37 +02:00
Omer Lachish
35aca1d4cf Merge branch 'master' into display-frontend-version 2018-11-29 15:03:11 +02:00
Levko Kravets
757333c2d6 When editing a dashboard title results in the visualizations being replaced by the loading markers (#3142)
* getredash/redash#3015 When editing a dashboard title results in the visualizations being replaced by the loading markers

* CR1

Co-Authored-By: kravets-levko <levko.ne@gmail.com>
2018-11-29 14:48:21 +02:00
Omer Lachish
92728de04c Display frontend version (#3105)
* add git-revision-webpack-plugin

* configure git-revision-webpack-plugin

* add commit to footer

* rename version and commit to backendVersion and frontendVersion

* rename version and commit to backendVersion and frontendVersion

* disable lint error due to use of globals

* fix snapshot test

* read frontend version from VERSION file instead latest git revision

* directly require from version.json file instead of going through WebPack's DefinePlugin

* run snapshots
2018-11-29 14:24:23 +02:00
Omer Lachish
407f14ffca run snapshots 2018-11-29 13:07:04 +02:00
Arik Fraimovich
ecb8a5c244 Hive/Databricks related improvements (#3143)
* Hive: fix issues in building options.

* Hive: add missing import.

* Split Hive into two query runners: one for http and a regular one.

* Upgrade pyhive to support http.

* Specific implementation for databricks:

* Different schema loader, because column names are different (or Hive's schema loader is broken).
* Simpler configuration.

* Simplify Databricks setup even more by removing username.
2018-11-29 13:01:23 +02:00
Omer Lachish
0e8fab4872 directly require from version.json file instead of going through WebPack's DefinePlugin 2018-11-29 13:00:13 +02:00
Omer Lachish
c15fa0c592 read frontend version from VERSION file instead latest git revision 2018-11-29 11:57:53 +02:00
Levko Kravets
09ab00e360 Migrate all tags components to React (#3138) 2018-11-29 11:35:17 +02:00
Truong Hoang Phuoc, Robert
1728f924cf Fix schema refresh to work on MySQL 8 (#3141) 2018-11-29 09:19:36 +02:00
Omer Lachish
8dc10fbd9a Merge branch 'master' into display-frontend-version 2018-11-29 09:13:41 +02:00
Jannis Leidel
a16170e701 Fix tag counts for dashboards and queries. (#3120)
* Fix tag counts for dashboards to be distinct.

This also makes use of the Dashboard.all base query.

Fix #3108.

* Use Query.all_queries as the base query for Query.all_tags.

* Add test case for Dashboard.all_tags.
2018-11-28 14:06:15 +02:00
Arik Fraimovich
07c0bba568 Delete now.json (#3134) 2018-11-28 10:36:33 +02:00
Arik Fraimovich
d36d18f85b Support unicode in Postgres/Redshift schema (#3124) 2018-11-27 09:06:44 +02:00
Arik Fraimovich
bd20ce12ac Don't allow updating user's email to blacklisted domain. (#3127) 2018-11-26 21:22:14 +02:00
Arik Fraimovich
1cdfcfaa3c Vertica: update driver & add support for connection timeout (#3125)
* Update Vertica driver version

* Vertica: add support for connection timeout
2018-11-26 21:21:49 +02:00
Arik Fraimovich
2fdace518a Use lower timeout for the first 5 seconds when polling for results. (#3128) 2018-11-26 21:21:07 +02:00
Igor Canadi
3516e4ef45 Add Rockset query runner (#3068)
* Add Rockset query runner

Per REST API documented here: https://docs.rockset.com/rest/

* Update rockset.py

* Add Rockset logo

* Refactor Rockset qury runner:

* More idomatic names for configuration.
* Move API code to separate class to make it easier removing it when we
  switch to official library.
* Make Test Connection work.

* apply autopep8 to rockset.py
2018-11-26 21:20:37 +02:00
Arik Fraimovich
d842968142 MongoDB: add support for sorting columns. (#3126) 2018-11-26 16:08:04 +02:00
Arik Fraimovich
600741620a Remove (Beta) from Query Results query runner name (#3123) 2018-11-26 15:31:39 +02:00
YOSHIDA Katsuhiko
45f4277eb4 Fix forked query is opened in the same tab (#3121) 2018-11-26 14:23:55 +02:00
Jannis Leidel
bcf3041c91 Show menu divider only if query is archived. (#3122)
Fix #3117.
2018-11-26 14:02:52 +02:00
Zsolt Kocsmárszky
da423340ec Fix mobile padding issues on Query results (#3111) 2018-11-26 13:41:07 +02:00
Arik Fraimovich
4003d4f1aa Add event tracking to autocomplete toggle & trackEvent helper function (#3114)
* Add non Angular version of Events.

* Add event tracking for autocomplete toggle

* Fix lint error in QueryEditor
2018-11-26 09:58:39 +02:00
YOSHIDA Katsuhiko
a6b782e0ce Add get_current_user() into Python Data Source (#3088) 2018-11-25 14:11:27 +02:00
YOSHIDA Katsuhiko
5648de9ba8 Open new tab when forking a query (#3089)
* Open new tab when forking a query

* Delete old fork menu item and add icon
2018-11-25 14:09:52 +02:00
Jannis Leidel
13eb365f7b Update changelog for v6.0.0-beta. (#3112)
* Add v6.0.0-beta changelog entry.

* Update CHANGELOG.md
2018-11-25 14:08:25 +02:00
Udomomo
8257d9d037 Add permissions to the result of "manage.py groups list" command (#3007)
* Add permissions to the result of "groups list" command

* added permissions to test case

* removed setting for debug
2018-11-25 13:47:25 +02:00
Allen Short
babbeb79f0 keep query text in local state for now (#3107) (#3110)
* keep query text in local state for now (#3107)

This will be unnecessary once the queryText prop isn't managed by Angular.

* Fix: make formatQuery work
2018-11-23 15:28:30 +02:00
Omer Lachish
8028397f27 Merge branch 'master' into display-frontend-version 2018-11-22 12:52:43 +02:00
Subhi Al Hasan
e05c8e6060 Fix collection fields retreival bug when Views are present in MONGO DB (#3097)
* Fix collection fields retreival bug when Views are present in MongoDB

* fixing _is_collection_a_view function

* Update redash/query_runner/mongodb.py

Co-Authored-By: jodevsa <jodevsa@gmail.com>
2018-11-21 17:13:12 +02:00
Omer Lachish
ef8839aafa add tests for comment attacks 2018-11-21 13:52:08 +02:00
Omer Lachish
14860f6a8b split .apply calls to newline 2018-11-21 13:51:19 +02:00
Omer Lachish
a52c783857 add test for union query injections 2018-11-21 13:45:52 +02:00
Omer Lachish
5e7c785891 add SQLQuery class with tests for safe queries and non-safe tautology attacks 2018-11-21 13:45:29 +02:00
Omer Lachish
b242cefaa0 Merge branch 'master' into backend-parameter-templating 2018-11-21 10:51:44 +02:00
Omer Lachish
fae2b70866 Merge branch 'display-frontend-version' of github.com:getredash/redash into display-frontend-version 2018-11-21 10:49:29 +02:00
Omer Lachish
1119fce44c Merge branch 'master' into display-frontend-version 2018-11-21 10:48:03 +02:00
Omer Lachish
bfb7edc0eb fix snapshot test 2018-11-21 10:47:54 +02:00
Omer Lachish
a39a739473 disable lint error due to use of globals 2018-11-21 10:44:34 +02:00
Omer Lachish
c9dfac5b1d rename version and commit to backendVersion and frontendVersion 2018-11-21 10:44:18 +02:00
Omer Lachish
1b66fff3be rename version and commit to backendVersion and frontendVersion 2018-11-20 23:34:39 +02:00
Arik Fraimovich
0fe1b5f9d4 Fix: registerAll fails after minification (#3106) 2018-11-20 23:34:37 +02:00
Levko Kravets
143db90a50 Fix query page header (#3046)
* getredash/redash#3017 Improve query page header

* getredash/redash#3017 Resolve conflicts

* getredash/redash#3017 CR1 (fix margins/paddings)
2018-11-20 18:48:41 +02:00
Arik Fraimovich
bac90db3ee Autocomplete toggle improvements (#3091)
* Autocomplete toggle improvements:

* Refactor to its own component.
* Show state in tooltip (enabled/disabled).
* Disable the toggle if autocomplete is not possible (no schema/too many tokens).

* Remove unsued code.

* Custom icons font (currently has only two icons).

Generated with Icomoon. If we extend its use, we should probably automate this and move to its own package.

* Don't disable live autocomplete for data sources without schema.

It can still be useful to autocomplete from local keywords.

* Differentiate between autocomplete toggle states with an icon.

Also added explicit message for the disabled state.

* Remember thes state of autocomplete.

* Only auto register init functions.
2018-11-20 18:45:33 +02:00
Omer Lachish
649d46de89 add commit to footer 2018-11-20 15:25:07 +02:00
Omer Lachish
0163e85eda configure git-revision-webpack-plugin 2018-11-20 15:24:55 +02:00
Omer Lachish
f25beb3fb7 add git-revision-webpack-plugin 2018-11-20 15:24:41 +02:00
Omer Lachish
c66f63d7a5 Prevent Query's updated_at from changing when it is linked to new query results (#3082)
* avoid Query's updated_at from changing when it is linked to new query results

* move comment to previous line

* move QueryResult tests to their own module

* add test which verifies that updated_at is not changed on query data
updates

* tests were false positives - they compared HH:MM:SS, but that never
changed because the original time was 1 week behind.

* remove redundant constructor

* remove hack and use a proper event to prevent updated_at from changing

* use self.assertEqual instead of assert
2018-11-20 12:22:15 +02:00
Levko Kravets
16ae0aa3d8 getredash/redash#2901 Fix docs links (#3102) 2018-11-20 11:06:09 +02:00
Arik Fraimovich
68ada7b590 UI for the feature flag of the share edit permissions feature (#3077)
* Remove unused settings.

* Add: UI feature flag for sharing permissions

* Revise feature flag message
2018-11-20 10:04:42 +02:00
San
9e745ef648 Delete redundant regex segment (#3100) 2018-11-20 09:48:24 +02:00
Allen Short
ee0d7f5ec9 force angular to update query editor properly (re #3098) (#3099) 2018-11-20 08:06:32 +02:00
Omer Lachish
1b3bbb6c3b swap parameters so their order makes more sense 2018-11-19 22:56:51 +02:00
Omer Lachish
7bee07c9da include parameters (and query_id) in the recorded event 2018-11-19 22:54:22 +02:00
Omer Lachish
74ab7a5a42 Merge branch 'master' into backend-parameter-templating 2018-11-19 21:59:14 +02:00
Levko Kravets
e36853ca84 Tags autocomplete: some tags not shown on search (#3094)
* getredash/redash#3052 Tags autocomplete: some tags not shown on search

* getredash/redash#3052 CR1
2018-11-19 12:33:05 +02:00
Omer Lachish
bc65b62776 remove Mustache templating from frontend and send all parameters to the
API (in the POST body)
2018-11-19 10:50:00 +02:00
YOSHIDA Katsuhiko
d43b35ba6f Change Standard SQL as the default (#3085) 2018-11-18 11:21:00 +02:00
Topher Cyll
6e4f0ccee8 Bubble chart marker size override was clobbering seriesColor. (#3063)
Colors can now be set for bubble charts in UI.
2018-11-18 11:05:18 +02:00
Vladislav Denisov
0ce7772aa3 clickhouse: added WITH TOTALS option support (#3083) 2018-11-15 22:11:43 +02:00
San
f6ef38479c support tel, sms, mailto links in the query result (#3084) 2018-11-15 22:08:02 +02:00
Arik Fraimovich
bf85ddaaff Always use basic autocomplete. (#3079) 2018-11-15 08:58:30 +02:00
Arik Fraimovich
8bb96c8c91 Fix: URL data source shouldn't require URL. (#3078)
Closes #2919.
2018-11-14 15:43:34 +02:00
Filipe Veloso
42b05cee00 Update docker-compose.yml (#2905)
* Update docker-compose.yml

jut updating docker-compose dev to version 3, any special reason to keep redis on 3? and pg on 9.5? I could also add a volume to pg, any reason not to do so?

* rollback to redis 3 and pg 9.5 due to consistency in project defaults

* Configure volume directly in worker service.
2018-11-14 14:27:19 +02:00
Anton Burnashev
d0fd02123a Add white-space padding to separators in the footer (#3076) (#3076)
Closes #3075
2018-11-14 10:44:38 +02:00
Takuya Arita
e34203dac3 Remove only Redash containers (#3073) 2018-11-13 16:45:40 +02:00
koooge
c2bd8518a6 Makefile: Add make targets for test (#3032) 2018-11-12 09:06:25 +01:00
Levko Kravets
46363ccc70 Table visualization horizontal scrollbar should not be always visible (#3061) 2018-11-12 07:50:44 +01:00
Levko Kravets
5e1512e777 Mustache: don't html-escape query parameters values (#3058) 2018-11-08 21:54:08 +01:00
Arik Fraimovich
188c045fdb Add Kylin logo (#3054) 2018-11-08 11:20:05 +01:00
Omer Lachish
57d921dc2b Druid query runner (#3047)
* add Druid query runner skeleton

* enable Druid only if package is available

* add Druid

* remove redundant  override

* correct configuration schema

* implements run_query

* implement get_schema

* remove username and password

* fix small lint issues

* proper indentation

* add correct type mapping
2018-11-08 10:48:45 +01:00
Xin Bai
df0804c8fd Add Kylin plugin for SQL query (#2936) 2018-11-08 10:24:05 +01:00
Alexander Leibzon
c289dde806 Google analytics fix fixes #2965 (#3008)
* add PagerDuty as an Alert Destination

* remove comments

* add unknown state handling

* fixes

* revert setup.sh

* Remove test method.

* resolves #2965

* more elegant, as per Arik's suggestion

* Add missing whitespace.
2018-11-08 10:18:33 +01:00
Levko Kravets
b7cadca3b7 Edit-in-place component ignored isEditable flag and didn't work on Groups page (#3049) 2018-11-08 10:17:18 +01:00
Sami Jaktholm
43f8200707 feat(redshift): hide tables the configured user cannot access (#2866)
The SVV_COLUMNS table used to determine the tables of a
Redshift database includes all tables, even those the
current user cannot access, by default. These tables clutter
the schema browser and make it harder for users to determine
which tables they should have access to.

These changes modify the Redshift query runner so that
tables the configured user cannot access are filtered
out from the database schema. The checks are two-fold:

* First, the query uses HAS_SCHEMA_PRIVILEGE to check if the
  current user has USAGE rights on a schema the given table
  belongs to. This privilege is required to access any of
  the tables in a schema.

* Second, the query tries to determine if the current user
  has SELECT access to the given table. Two cases need to
  be considered here:

  * First, we need to check if the table is part of an
    external schema. Access to tables in external schema
    is controlled at schema level - you cannot grant or
    revoke access to specific external tables. Additionally,
    the HAS_TABLE_PRIVILEGE returns an error if it is asked
    to give a verdict for an external table.

    Hence, the query checks if the schema a specific table
    belongs to is an external schema and if it is, the table
    is included in the list (if we got here the user already
    had USAGE on the given schema). This check short-circuits
    the table-level access check for external tables which
    means they are never passed to HAS_TABLE_PRIVILEGE().

  * Then, if the table was not part of an external schema,
    the HAS_TABLE_PRIVILEGE() function is used to determine
    if the user has SELECT access to the given table. The
    table is included in the schema if this check passes.

Together this condition ensures that tables the user definitely
cannot access are not included in the schema browser.

These changes have been tested to work in an environment that
includes normal and external schemas, normal and late-binding
views, and normal and external tables.
2018-11-08 09:53:04 +01:00
Arik Fraimovich
a1b580bba6 Fix Docker Compose version number in Cypress config (#3051)
* Update Docker compose version

* Experiment with Docker-Composeless CI build

* Switch back to Docker compose based tests
2018-11-07 17:21:31 +01:00
Zsolt Kocsmárszky
19d0313ea2 Fixing tag issues (#3006)
* Add title="" for tags

* Fix lines

* Fix long tag and overlaying tag issues on queries
2018-11-07 16:58:15 +01:00
Arik Fraimovich
667fe43e23 Revert "address tag display on query list page" (#3050)
* Revert "remove pytest_watch (#3048)"

This reverts commit 096eba3876.

* Revert "address tag display on query list page (#2803)"

This reverts commit 99115a12e6.
2018-11-07 16:57:37 +01:00
Omer Lachish
096eba3876 remove pytest_watch (#3048) 2018-11-07 16:49:41 +01:00
Alison
99115a12e6 address tag display on query list page (#2803)
* address tag display on query list page

* character limit tags in css

* updates to tags on levko's feedback
2018-11-07 16:12:31 +01:00
Gabriel Dutra
7d601cbbc9 Cypress based E2E tests (#3019) 2018-11-07 14:37:08 +01:00
GitSumito
bf6a09c5aa CLI sort (#3041) 2018-11-06 16:45:39 +01:00
Yossi-a
99967e720f Sort columns with undefined values (#2745)
* sort should treat undefine value as the minimal value

* explicit undefined check
2018-11-05 04:47:42 +02:00
Arik Fraimovich
27f489de20 Build docker image on master branch. (#3039) 2018-11-04 12:12:13 +02:00
yoavbls
46941d3aa1 Update Flask-Admin to 1.5.2 (#3036)
I don't know if someone uses flask-admin but I upgraded it because of this bug:
https://github.com/flask-admin/flask-admin/issues/1588
In 1.4.2 you cant add and edit records/
2018-11-01 15:58:50 +02:00
Levko Kravets
60c230add7 getredash/redash#3034 Postgres query runner: handle NaN/Infinity values (#3035) 2018-11-01 15:57:39 +02:00
Takuya Arita
0784a0c6f5 Add some tests for Query Results (#3031) 2018-10-31 11:05:17 +02:00
Zsolt Kocsmárszky
9288d89248 Fix query result section (#2980) 2018-10-29 22:09:49 +02:00
Levko Kravets
391fbe130b getredash/redash#2998 Charts lose responsive features after refreshing the dashboard (#3024) 2018-10-29 22:08:35 +02:00
Levko Kravets
e25c8c4145 getredash/redash#3022 Toolbox covers part of the chart (#3023) 2018-10-29 11:38:29 +02:00
Arik Fraimovich
57353d1b40 Add -beta to version 2018-10-28 15:58:20 +02:00
Arik Fraimovich
7f4e08154f Bump version 2018-10-28 15:56:32 +02:00
Arik Fraimovich
500c82815b Add netlify config (#2999) 2018-10-28 15:31:27 +02:00
Arik Fraimovich
4a846f04e9 Add settings to import 2018-10-28 11:11:11 +02:00
Takuya Arita
b1e9d87e2a Apply query format options from settings (#2342)
* Apply query format options from settings

* Apply sqlparse format options via env-vars
2018-10-28 10:40:07 +02:00
Arik Fraimovich
ab6ed7da34 Fix: setup.sh fails when run as root. (#2996)
Closes #2979
2018-10-23 09:49:24 +03:00
GitSumito
2e6883c527 Add "Users" users are belong to into groups list (#2991) 2018-10-21 11:40:07 +03:00
YOSHIDA Katsuhiko
4c44999b2c Fix an invalid prop type warning (#2992) 2018-10-21 11:39:37 +03:00
deecay
34c118cf83 Add: Heatmap chart visualization by Plotly (#2080) 2018-10-21 11:39:06 +03:00
Arik Fraimovich
38a89b9783 Table visualization: change default size to 25 and add more size options. (#2982) 2018-10-21 11:38:47 +03:00
YOSHIDA Katsuhiko
6e836795b2 Fix url scheme (#2994) 2018-10-21 11:38:11 +03:00
YOSHIDA Katsuhiko
719fc41dd1 Add page size settings (#2993)
Add page size settings.

| name | default | description |
| :---- | :------ | :---------- |
| `REDASH_PAGE_SIZE` | 20 | How many items are displayed in one page as default. |
| `REDASH_PAGE_SIZE_OPTIONS` | 5,10,20,50,100 | How many steps as page_size. |

This feature has requested at the meetup in Japan.

https://redash-meetup.connpass.com/event/101420/
2018-10-20 14:33:31 +02:00
Arik Fraimovich
467ec201da Add Jest based tests to our stack (#2985)
* Add Jest packages
* Add first test
* Install eslint rules for jest & move deps to dev
* Configure cirlce to run jest
* package.json: Remove dev command
* package.json: clean command
* Don't autoload test files.
* Fix: webpack-dev-server was recompiling all the files on every change
* Update CircleCI step names
2018-10-19 19:04:02 +03:00
koooge
5ab143de41 Rearrange make target (#2989) 2018-10-19 11:25:24 +02:00
Arik Fraimovich
284e497483 Databricks updates: logo, name and enable by default (#2983)
* Add Databricsk logo.
* Enable it by default.
* Rename to Databricks.
2018-10-19 10:00:33 +02:00
dmonego
c5613dddf1 Chnage: switch to Webpack 4 (#2933) 2018-10-18 21:21:47 +03:00
Arik Fraimovich
34fb3ac79f Change: add timeout to destination requests. (#2960) 2018-10-18 17:33:58 +03:00
Arik Fraimovich
5f58c328f1 MongoDB: skip system collections when loading schema. (#2961) 2018-10-18 17:33:24 +03:00
Arik Fraimovich
7d1dbb87db Change: update MongoDB requirements to support srv. (#2962) 2018-10-18 17:32:43 +03:00
GitSumito
45f4d46245 Add "Groups" users are belong to into users list (#2967) 2018-10-18 17:32:21 +03:00
Arik Fraimovich
44d05c35ac Presto query runner improvements (#2968)
* Presto: support for setting protocol (http/https).

* Presto: safe loading error message.
2018-10-18 17:31:48 +03:00
Arik Fraimovich
edd2cb85f7 Update CHANGELOG.md 2018-10-18 14:59:00 +03:00
Hiroka Zaitsu
6c364369bb Fix: TreasureData data source - deduplicate column names (#2867)
* Fix: TreasureData data source - deduplicate column names

* Maping types
2018-10-18 09:43:28 +03:00
YOSHIDA Katsuhiko
869841b2ac Preventing open redirection (#2906)
* Prevent open redirection attack

* Add redirection url after logging in test

* Sanitize url just before redirecting it

* Consider when next parameter is None
2018-10-17 21:55:58 +03:00
Arik Fraimovich
c71f722552 Query Results query runner improvements: (#2969)
- Show meaningful error when failing to create table.
- Quote column names to allow more characters types.
2018-10-16 15:23:00 +03:00
Jannis Leidel
af3a1e00c6 Fix #2757 - Use full text search ranking when searching in list views. (#2798)
This applies to the queries, dashboard and users views.
2018-10-16 10:38:37 +02:00
Gabriel Dutra
5b2ec81e65 Fix no tags shown when having empty set (#2964) 2018-10-15 23:08:18 +03:00
Vladislav Denisov
0008e5803b clickhouse: move timeout to params (#2956)
* clickhouse: timeout moved to params

* clickhouse: use get() method for timeout
2018-10-15 20:06:16 +03:00
Arik Fraimovich
e1c1f67abb Add: option to auto reload widget data in shared dashboards. (#2959) 2018-10-15 20:05:40 +03:00
Marina Samuel
30283235a4 Fix tarball build failure. (#2963) 2018-10-15 20:05:07 +03:00
Levko Kravets
845e33b396 Query page layout improvements for small screens (#2922)
* getredash/redash#2796 Make entire page scrollable on small screens; improve metadata block

* getredash/redash#2796 Improve query page header layout; fix small bugs (margins, etc.)
2018-10-15 19:59:05 +03:00
Arik Fraimovich
17baa66188 Show "Add description" only after saving the query. (#2958)
Closes #2897
2018-10-15 17:45:22 +03:00
Arik Fraimovich
5df7bd12c9 Fix: apply missing CSS classes to EditInPlace component. (#2957) 2018-10-15 17:38:22 +03:00
Nicolas Ferrandini
e14c8b61a0 Add DB2 as a data source using ibm-db python package (#2848)
* Add DB2 as a data source using ibm-db python package

* fix some codeclimate issue

* fix long line and missing white space

* Manage case of bad import

* Add DB2 query_runner as default query runner

* Fixed minor PEP8 rules
2018-10-15 17:13:39 +03:00
Arik Fraimovich
a8a3ec66fd Bring back fix to Box plot hover. (#2941) 2018-10-15 16:01:38 +03:00
GitSumito
a4b9c2da12 fixed https://github.com/getredash/redash/issues/2950 (#2951)
* fixed https://github.com/getredash/redash/issues/2950

* fixed test code

* Effective -> Active. thank you @kravets-levko
2018-10-15 15:57:51 +03:00
Vladislav Denisov
e6146dae0f Clickhouse fixes (#2953)
* clickhouse: avoid last line with comment in query

* clickhouse: add request timeout
2018-10-15 15:03:02 +03:00
Levko Kravets
bd3fe880a4 Add missing default "extensions" directory (webpack fails to build without it) (#2952) 2018-10-15 13:51:13 +02:00
Marina Samuel
02e919c39b Closes #2565: Add frontend extension capability. (#2799) 2018-10-14 15:53:39 +03:00
Arik Fraimovich
99c73aef2d Update snowflake_connector_python version (#2946) 2018-10-14 14:39:52 +03:00
Ralphilius
be377b5f59 Add Counter label (#2900)
* Add Counter label

* Update index.js

* Added visualization name as placeholder

* Backward-compatible for visualization name as label
2018-10-14 11:23:20 +03:00
Zsolt Kocsmárszky
6b11ae4312 Design refinements (#2927)
* Fix search size on smaller tablet size

* Less prominent tag counter

* Fix hiding logo

* Add missing space between icon and button text

* Different embed icon

* Revert embed icon to its original

* Better edit source icon + markup cleanup
2018-10-14 11:00:27 +03:00
YOSHIDA Katsuhiko
9021977a54 Fix admin api recording (#2937) 2018-10-14 10:49:11 +03:00
Sami Jaktholm
9c8d06578a feat: add support for expanding dashboard visualizations (#2824)
* feat: add support for expanding dashboard visualizations

These changes implement support for expanding a dashboard visualization
into a larger modal dialog.

This is useful if you have a dashboard with lots of small widgets and
want to inspect one of the widgets more closely. In the past, this
would've required you to navigate to the query page to see a larger
version of the visualization. With these changes, visualizations can
be expanded right from the dashboard.

The implementation is simple as it just renders the visualization into
a modal dialog. Other parts of the widget (e.g. parameters) are not
included in this dialog.

* chore(widget-dialog): use query-link widget to render title

This reduces code duplication a bit. The link is made read-only
as navigation doesn't close the modal dialog.

* fix: make ui-select dropdown z-index > modal dialog z-index in dashboard page

Otherwise the dropdown renders behind the modal dialog if filter value
is changed from the modal view of a widget.
2018-10-14 10:42:31 +03:00
YOSHIDA Katsuhiko
114beb2480 Auto focus tag input (#2938) 2018-10-14 10:39:08 +03:00
Alexander Leibzon
e97a5cbb29 add PagerDuty as an Alert Destination (#2903) 2018-10-14 10:35:39 +03:00
Alexander Leibzon
e87efc8bc3 fixes #2924 (#2931)
Google Spreadsheets: support for open by url
2018-10-11 21:07:20 +03:00
Arik Fraimovich
be7f601d21 Speed up builds by skipping installing requirements_all_ds.txt in CI unit tests (#2928)
* Speed up builds by skipping requirements_all_ds.txt

* Update docker compose file version

* Start services before running commands

* Add boto and Athena dependencies to requirements_dev.txt
2018-10-11 14:12:28 +03:00
Levko Kravets
9b59d10677 Use Plotly's function to clean y-values (x may be category or date/time) (#2872) 2018-10-11 12:27:28 +03:00
Levko Kravets
a40669e07f getredash/redash#2875 Update plotly.js; some cleanup; fix chart legend issue in horizontal mode (#2902) 2018-10-11 11:23:40 +03:00
Levko Kravets
0bcf5d4be7 Merge pull request #2929 from combineads/fix-date-filter
Fix: date value in a filter is duplicated.
2018-10-11 09:08:31 +03:00
combineads
8bc96764a6 Fix: date value in a filter is duplicated. 2018-10-11 14:56:57 +09:00
Niko Eckerskorn
6ea03e58b4 Address edgecase when retrieving Glue schemas for Athena query runner. (#2868)
Fixes getredash/redash#2858
2018-10-10 19:13:48 +03:00
Gabriel Dutra
94801665ab Fix output file name not changing after rename query (#2917) 2018-10-10 15:07:11 +03:00
Gabriel Dutra
aa12151e19 Fix export query results output file name (#2916)
- regexp `/ /g` will seek for all space ocurrences, not only the first
2018-10-10 14:56:31 +03:00
Jannis Leidel
c2429e92d2 Consistently use simplejson to loading and dumping JSON. (#2817)
* Consistently use simplejson to loading and dumping JSON.

This introduces the new functions redash.utils.json_dumps and redash.utils.json_loads and simplifies the custom encoder setup.

UUIDs are now handled by the default encoder, too.

Fixes #2807.

Use string comparison in parse_boolean instead of the (simple)json module.
2018-10-09 15:38:06 +02:00
Jannis Leidel
5ffc85c066 Extend menu item text a bit for visual consistency. 2018-10-08 20:08:07 +02:00
Jannis Leidel
fad757c878 Don’t show “Add to dashboard” in dropdown to unsaved queries. 2018-10-08 20:08:07 +02:00
Jannis Leidel
3351a281ee Fix webpack build error about BigMessage. (#2910) 2018-10-08 12:03:54 +02:00
Arik Fraimovich
1f0053f531 MySQL: hide sys tables (#2909) 2018-10-08 10:05:16 +03:00
Arik Fraimovich
935dc38360 Update setup files: (#2908)
* Remove use of newgrp
* Updated packer configuration
2018-10-08 09:41:15 +03:00
Arik Fraimovich
bfef7fae93 Remove unused dependencies. (#2907)
Closes #2782
2018-10-08 09:39:57 +03:00
cclauss
da6d456f6f CircleCI: Flake8 tests passing on Legacy Python and Python 3 (#2881) 2018-10-05 13:48:01 +03:00
Arik Fraimovich
c19199c2fb Add margin between format and autocomplete buttons (#2899) 2018-10-04 12:34:03 +03:00
Arik Fraimovich
1e78861f85 Move Ant styles into a central location. (#2898)
This is to ensure that we include our override after loading Ant's styles.
2018-10-04 12:27:36 +03:00
Arik Fraimovich
10bc5a0bf6 Remove misplaced bracket. (#2894) 2018-10-04 12:01:38 +03:00
Marina Samuel
313af904df Add ability for extensions to add periodic tasks. (#2740) 2018-10-04 09:07:58 +03:00
Allen Short
8c478087a9 Rewrite query editor to React (#2636) 2018-10-03 22:25:19 +03:00
Arik Fraimovich
ccac41c6d4 Fix: JS build breaks because registerAll tries to run EditInPlace component (#2886) 2018-10-02 16:22:47 +03:00
Jannis Leidel
69635f2c40 Rename Yandex Metrika to Metrica. (#2884)
Fix #2874.
2018-10-02 16:11:01 +03:00
yoavbls
1867ea50bb Add option to query cached results (#2855) 2018-10-02 16:05:41 +03:00
Jannis Leidel
c64d5ef6c0 Fix #2876 - Remove accidental query-result-link component from 'Add to dashboard link.' (#2883) 2018-10-01 22:29:20 +03:00
Alison
e3a63899d3 Add ability to search table column names in schema browser (#2681) 2018-10-01 11:11:32 +02:00
Jannis Leidel
4685887fe5 Fix name of edit-in-place React component. 2018-09-29 10:14:48 +02:00
Arik Fraimovich
f103357e60 Fix: wrong reference (EditInPlaceText -> EditInPlace) 2018-09-28 21:51:36 +02:00
Jannis Leidel
11738f73ac Removed redundant exception handling since execute_query task handles that. 2018-09-28 21:31:49 +02:00
Allen Short
d07c4f969b Support authentication for the URL query runner.
Adds a new BaseHTTPQueryRunner class and tests.
2018-09-28 21:31:49 +02:00
Allen Short
505aafbce3 Convert edit-in-place component to React (#2637) 2018-09-28 22:30:10 +03:00
Marina Samuel
b765693879 Upgrade Celery to 4.2.1. (#2773) 2018-09-28 21:28:30 +02:00
Jannis Leidel
4620fed0cf Use server side sort order for tag list and show count of tagged items. (#2833)
* Use tag list ordering from backend.

This basically stops resorting the tag list on the client side and use the already existing (and correct) descending sort order bu tag usage count from the backend.

* Show count of tagged items in tag list.
2018-09-28 17:24:13 +03:00
Arik Fraimovich
48ad1d2dce Add v5.0.1 to the CHANGELOG. 2018-09-28 17:18:41 +03:00
Arik Fraimovich
f2c323a089 Disable integration tests
The integration tests are currently not failing and providing false positives when running them. I'm disabling this until the test suite is more stable.

@jrbenny35 @jezdez
2018-09-28 11:52:14 +03:00
Levko Kravets
ec17cc7eab getredash/redash#2854 Widget titles wrong rendering on public dashboards (#2870) 2018-09-28 11:26:37 +03:00
Arik Fraimovich
6c7bbe9041 Merge branch 'master' of github.com:getredash/redash 2018-09-27 21:47:56 +03:00
Arik Fraimovich
551b0222c4 Cleanup packer configuration 2018-09-27 21:47:45 +03:00
Jannis Leidel
2b0e6e9e79 Refactor list based controllers. (#2790)
This reduces the code duplication between the dashboard, user and queries list pages and normalizes many of the APIs between them.

This also:
- allows sorting query favorites
- adds a pagination size select to the dashboard list
- fixes a bunch of UI inconsistencies between the queries and dashboards list (e.g. margins)

The new ListCtrl class is subclassed in the various specific page controllers and extended as needed. New list pages can make use of the same pattern in the future.

This also adds some missing event recordings from 34e39eda4a.
2018-09-27 17:06:26 +02:00
Levko Kravets
4727c19253 getredash/redash#2796 Improve counter text scaling (#2840) 2018-09-27 13:27:10 +03:00
Arik Fraimovich
2ff4d07e83 Change placement (right/bottom) of chart legend depending on chart width (#2852)
Closes getredash/redash#2796.
2018-09-27 12:34:28 +03:00
Arik Fraimovich
1997f53f40 Fix CircleCI setup for release branches. (#2859) 2018-09-27 10:36:48 +03:00
Jannis Leidel
c03b5d51b7 Simplified data source resource. Refs #2856. 2018-09-27 09:20:07 +02:00
yoavbls
197665bb6a Fix bug in DataSourceResource load (#2857) 2018-09-27 09:15:36 +02:00
Levko Kravets
28fbc2ae62 getredash/redash#2796 Change placement (right/bottom) of chart legend depending on chart width 2018-09-27 10:14:58 +03:00
Alexey Korobkov
ea1c4ca85c Add auth via JWT providers (#2768)
* authentication via JWT providers
* add support for IAP JWT auth
* remove jwt_auth Blueprint and /headers endpoint
* fix pep8: imports
2018-09-26 21:17:48 +03:00
Alison
588e0cce43 Add autocomplete toggle (#2780) 2018-09-26 17:32:38 +02:00
Alison
8a50351520 Add ability to add viz to dashboard from query edit page (#2767) 2018-09-26 17:29:38 +02:00
Alison
34e39eda4a Port moving events serverside (#2766) 2018-09-26 17:17:46 +02:00
Alison
28a8525ce3 Add databricks query runner (#2747)
Fixes #2685.
2018-09-26 17:07:03 +02:00
Arik Fraimovich
5e70f9c04a Update README.md 2018-09-25 21:08:46 +03:00
Arik Fraimovich
a05b5ba68d Docker based setup scripts (#2850) 2018-09-25 21:08:24 +03:00
Dan VerWeire
40ba66c58e Fix invalid reference to alert.to_dict() in webhook (#2849) 2018-09-25 19:12:04 +03:00
Arik Fraimovich
3e4adaba9a Update CircleCI config to use release branches 2018-09-24 11:52:38 +03:00
1350 changed files with 119078 additions and 41643 deletions

View File

@@ -0,0 +1,12 @@
FROM cypress/browsers:node14.0.0-chrome84
ENV APP /usr/src/app
WORKDIR $APP
COPY package.json package-lock.json $APP/
COPY viz-lib $APP/viz-lib
RUN npm ci > /dev/null
COPY . $APP
RUN ./node_modules/.bin/cypress verify

View File

@@ -1,6 +1,26 @@
version: 2.0 version: 2.0
build-docker-image-job: &build-docker-image-job
docker:
- image: circleci/node:12
steps:
- setup_remote_docker
- checkout
- run: sudo apt update
- run: sudo apt install python3-pip
- run: sudo pip3 install -r requirements_bundles.txt
- run: .circleci/update_version
- run: npm run bundle
- run: .circleci/docker_build
jobs: jobs:
unit-tests: backend-lint:
docker:
- image: circleci/python:3.7.0
steps:
- checkout
- run: sudo pip install flake8
- run: ./bin/flake8_tests.sh
backend-unit-tests:
environment: environment:
COMPOSE_FILE: .circleci/docker-compose.circle.yml COMPOSE_FILE: .circleci/docker-compose.circle.yml
COMPOSE_PROJECT_NAME: redash COMPOSE_PROJECT_NAME: redash
@@ -13,114 +33,145 @@ jobs:
name: Build Docker Images name: Build Docker Images
command: | command: |
set -x set -x
docker-compose build --build-arg skip_ds_deps=true --build-arg skip_frontend_build=true
docker-compose up -d docker-compose up -d
sleep 10 sleep 10
- run: - run:
name: Create Test Database name: Create Test Database
command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;" command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;"
- run:
name: List Enabled Query Runners
command: docker-compose run --rm redash manage ds list_types
- run: - run:
name: Run Tests name: Run Tests
command: docker-compose run --name tests redash tests --junitxml=junit.xml tests/ command: docker-compose run --name tests redash tests --junitxml=junit.xml --cov-report xml --cov=redash --cov-config .coveragerc tests/
- run: - run:
name: Copy Test Results name: Copy Test Results
command: | command: |
mkdir -p /tmp/test-results/unit-tests mkdir -p /tmp/test-results/unit-tests
docker cp tests:/app/coverage.xml ./coverage.xml docker cp tests:/app/coverage.xml ./coverage.xml
docker cp tests:/app/junit.xml /tmp/test-results/unit-tests/results.xml docker cp tests:/app/junit.xml /tmp/test-results/unit-tests/results.xml
when: always
- store_test_results: - store_test_results:
path: /tmp/test-results path: /tmp/test-results
- store_artifacts: - store_artifacts:
path: coverage.xml path: coverage.xml
build-tarball: frontend-lint:
environment:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker: docker:
- image: circleci/node:8 - image: circleci/node:12
steps: steps:
- checkout - checkout
- run: npm install - run: mkdir -p /tmp/test-results/eslint
- run: npm run build - run: npm ci
- run: .circleci/update_version - run: npm run lint:ci
- run: .circleci/pack - store_test_results:
- store_artifacts: path: /tmp/test-results
path: /tmp/artifacts/ frontend-unit-tests:
build-docker-image: environment:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker: docker:
- image: circleci/buildpack-deps:xenial - image: circleci/node:12
steps:
- checkout
- run: sudo apt update
- run: sudo apt install python3-pip
- run: sudo pip3 install -r requirements_bundles.txt
- run: npm ci
- run: npm run bundle
- run:
name: Run App Tests
command: npm test
- run:
name: Run Visualizations Tests
command: (cd viz-lib && npm test)
- run: npm run lint
frontend-e2e-tests:
environment:
COMPOSE_FILE: .circleci/docker-compose.cypress.yml
COMPOSE_PROJECT_NAME: cypress
PERCY_TOKEN_ENCODED: ZGRiY2ZmZDQ0OTdjMzM5ZWE0ZGQzNTZiOWNkMDRjOTk4Zjg0ZjMxMWRmMDZiM2RjOTYxNDZhOGExMjI4ZDE3MA==
CYPRESS_PROJECT_ID_ENCODED: OTI0Y2th
CYPRESS_RECORD_KEY_ENCODED: YzA1OTIxMTUtYTA1Yy00NzQ2LWEyMDMtZmZjMDgwZGI2ODgx
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker:
- image: circleci/node:12
steps: steps:
- setup_remote_docker - setup_remote_docker
- checkout
- run: .circleci/update_version
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: docker build -t redash/redash:$(.circleci/docker_tag) .
- run: docker push redash/redash:$(.circleci/docker_tag)
integration-tests:
working_directory: ~/redash
machine: true
environment:
REDASH_SERVER_URL : "http://127.0.0.1:5000/"
DOCKER_IMAGE: mozilla/redash-ui-tests
steps:
- checkout - checkout
- run: - run:
name: Install Docker Compose name: Enable Code Coverage report for master branch
command: | command: |
set -x if [ "$CIRCLE_BRANCH" = "master" ]; then
pip install --upgrade pip echo 'export CODE_COVERAGE=true' >> $BASH_ENV
pip install docker-compose>=1.18 source $BASH_ENV
docker-compose --version fi
- run: - run:
name: Pull redash images name: Install npm dependencies
command: | command: |
set -x npm ci
docker-compose -f docker-compose.yml up --no-start
sleep 10
- run: - run:
name: Pull redash-ui-tests name: Setup Redash server
command: docker pull "${DOCKER_IMAGE}":latest
- run:
name: Setup redash instance
command: | command: |
set -x npm run cypress build
docker-compose run --rm --user root server create_db npm run cypress start -- --skip-db-seed
docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests" docker-compose run cypress npm run cypress db-seed
docker-compose run --rm --user root server /app/manage.py users create_root root@example.com "rootuser" --password "IAMROOT" --org default
docker-compose run --rm --user root server /app/manage.py ds new "ui-tests" --type "url" --options '{"title": "uitests"}'
docker-compose run -d -p 5000:5000 --user root server
docker-compose start postgres
docker-compose run --rm --user root server npm install
docker-compose run --rm --user root server npm run build
- run: - run:
name: Run tests name: Execute Cypress tests
command: npm run cypress run-ci
- run:
name: "Failure: output container logs to console"
command: | command: |
set -x docker-compose logs
docker run --net="host" --env REDASH_SERVER_URL="${REDASH_SERVER_URL}" "${DOCKER_IMAGE}" when: on_fail
- run:
name: Copy Code Coverage results
command: |
docker cp cypress:/usr/src/app/coverage ./coverage || true
when: always
- store_artifacts: - store_artifacts:
path: report.html path: coverage
build-docker-image: *build-docker-image-job
build-preview-docker-image: *build-docker-image-job
workflows: workflows:
version: 2 version: 2
integration_tests:
jobs:
- integration-tests:
filters:
branches:
only: master
build: build:
jobs: jobs:
- unit-tests - backend-lint
- build-tarball: - backend-unit-tests:
requires: requires:
- unit-tests - backend-lint
filters: - frontend-lint
tags: - frontend-unit-tests:
only: /v[0-9]+(\.[0-9\-a-z]+)*/ requires:
branches: - backend-lint
only: - frontend-lint
- master - frontend-e2e-tests:
- release requires:
- frontend-lint
- build-preview-docker-image:
requires:
- backend-unit-tests
- frontend-unit-tests
- frontend-e2e-tests
filters:
branches:
only:
- master
- hold:
type: approval
requires:
- backend-unit-tests
- frontend-unit-tests
- frontend-e2e-tests
filters:
branches:
only:
- /release\/.*/
- build-docker-image: - build-docker-image:
requires: requires:
- unit-tests - hold
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9\-a-z]+)*/

View File

@@ -1,4 +1,4 @@
version: '2' version: '2.2'
services: services:
redash: redash:
build: ../ build: ../

View File

@@ -0,0 +1,71 @@
version: "2.2"
x-redash-service: &redash-service
build:
context: ../
args:
skip_dev_deps: "true"
skip_ds_deps: "true"
code_coverage: ${CODE_COVERAGE}
x-redash-environment: &redash-environment
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
REDASH_RATELIMIT_ENABLED: "false"
REDASH_ENFORCE_CSRF: "true"
services:
server:
<<: *redash-service
command: server
depends_on:
- postgres
- redis
ports:
- "5000:5000"
environment:
<<: *redash-environment
PYTHONUNBUFFERED: 0
scheduler:
<<: *redash-service
command: scheduler
depends_on:
- server
environment:
<<: *redash-environment
worker:
<<: *redash-service
command: worker
depends_on:
- server
environment:
<<: *redash-environment
PYTHONUNBUFFERED: 0
cypress:
ipc: host
build:
context: ../
dockerfile: .circleci/Dockerfile.cypress
depends_on:
- server
- worker
- scheduler
environment:
CYPRESS_baseUrl: "http://server:5000"
CYPRESS_coverage: ${CODE_COVERAGE}
PERCY_TOKEN: ${PERCY_TOKEN}
PERCY_BRANCH: ${CIRCLE_BRANCH}
PERCY_COMMIT: ${CIRCLE_SHA1}
PERCY_PULL_REQUEST: ${CIRCLE_PR_NUMBER}
COMMIT_INFO_BRANCH: ${CIRCLE_BRANCH}
COMMIT_INFO_MESSAGE: ${COMMIT_INFO_MESSAGE}
COMMIT_INFO_AUTHOR: ${CIRCLE_USERNAME}
COMMIT_INFO_SHA: ${CIRCLE_SHA1}
COMMIT_INFO_REMOTE: ${CIRCLE_REPOSITORY_URL}
CYPRESS_PROJECT_ID: ${CYPRESS_PROJECT_ID}
CYPRESS_RECORD_KEY: ${CYPRESS_RECORD_KEY}
redis:
image: redis:3.0-alpine
restart: unless-stopped
postgres:
image: postgres:9.5.6-alpine
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped

17
.circleci/docker_build Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
VERSION=$(jq -r .version package.json)
VERSION_TAG=$VERSION.b$CIRCLE_BUILD_NUM
docker login -u $DOCKER_USER -p $DOCKER_PASS
if [ $CIRCLE_BRANCH = master ] || [ $CIRCLE_BRANCH = preview-image ]
then
docker build --build-arg skip_dev_deps=true -t redash/redash:preview -t redash/preview:$VERSION_TAG .
docker push redash/redash:preview
docker push redash/preview:$VERSION_TAG
else
docker build --build-arg skip_dev_deps=true -t redash/redash:$VERSION_TAG .
docker push redash/redash:$VERSION_TAG
fi
echo "Built: $VERSION_TAG"

View File

@@ -1,5 +0,0 @@
#!/bin/bash
VERSION=$(jq -r .version package.json)
FULL_VERSION=$VERSION.b$CIRCLE_BUILD_NUM
echo $FULL_VERSION

View File

@@ -6,4 +6,4 @@ FILENAME=$NAME.$FULL_VERSION.tar.gz
mkdir -p /tmp/artifacts/ mkdir -p /tmp/artifacts/
tar -zcv -f /tmp/artifacts/$FILENAME --exclude="optipng*" --exclude=".git*" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" --exclude="node_modules" * tar -zcv -f /tmp/artifacts/$FILENAME --exclude=".git" --exclude="optipng*" --exclude="cypress" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" *

View File

@@ -2,4 +2,5 @@
VERSION=$(jq -r .version package.json) VERSION=$(jq -r .version package.json)
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM
sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py
sed -i "s/dev/$CIRCLE_SHA1/" client/app/version.json

View File

@@ -1,22 +0,0 @@
engines:
pep8:
enabled: true
eslint:
enabled: true
channel: "eslint-3"
config:
config: client/.eslintrc.js
checks:
import/no-unresolved:
enabled: false
ratings:
paths:
- "redash/**/*.py"
- "client/**/*.js"
exclude_paths:
- tests/**/*.py
- migrations/**/*.py
- old_migrations/**/*.py
- setup/**/*
- bin/**/*

View File

@@ -1,4 +1,15 @@
client/.tmp/ client/.tmp/
client/dist/
node_modules/ node_modules/
viz-lib/node_modules/
.tmp/ .tmp/
.venv/
venv/
.git/ .git/
/.codeclimate.yml
/.coverage
/coverage.xml
/.circleci/
/.github/
/netlify.toml
/setup/

View File

@@ -9,6 +9,6 @@ trim_trailing_whitespace = true
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
[*.{js,css,html}] [*.{js,jsx,css,less,html}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2

View File

@@ -1,34 +0,0 @@
<!--
#####################################################################
#
# Need support? USE THE FORUM! https://discuss.redash.io/c/support.
#
# Don't have steps to reproduce and actually not sure it's a bug?
# Use the forum! https://discuss.redash.io/c/support.
#
#####################################################################
**Got an idea for a new feature?** Check if it isn't on the roadmap already: http://bit.ly/redash-roadmap and start a new discussion in the features category: https://discuss.redash.io/c/feature-requests 🌟.
Found a bug? Please fill out the sections below... thank you 👍
Found a security vulnerability? Please email security@redash.io to report any security vulnerabilities. We will acknowledge receipt of your vulnerability and strive to send you regular updates about our progress. If you're curious about the status of your disclosure please feel free to email us again. If you want to encrypt your disclosure email, you can use this PGP key.
-->
### Issue Summary
A summary of the issue and the browser/OS environment in which it occurs.
### Steps to Reproduce
1. This is the first step
2. This is the second step, etc.
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
### Technical details:
* Redash Version:
* Browser/OS:
* How did you install Redash:

34
.github/ISSUE_TEMPLATE/---bug_report.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: "\U0001F41B Bug report"
about: Report reproducible software issues so we can improve
---
<!--
We use GitHub only for bug reports 🐛
Anything else should be posted to https://discuss.redash.io 👫
🚨For support, help & questions use https://discuss.redash.io/c/support
💡For feature requests & ideas use https://discuss.redash.io/c/feature-requests
**Found a security vulnerability?** Please email security@redash.io to report any security vulnerabilities. We will acknowledge receipt of your vulnerability and strive to send you regular updates about our progress. If you're curious about the status of your disclosure please feel free to email us again. If you want to encrypt your disclosure email, you can use this PGP key.
-->
### Issue Summary
A summary of the issue and the browser/OS environment in which it occurs.
### Steps to Reproduce
1. This is the first step
2. This is the second step, etc.
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
### Technical details:
* Redash Version:
* Browser/OS:
* How did you install Redash:

View File

@@ -0,0 +1,17 @@
---
name: "\U0001F4A1Anything else"
about: "For help, support, features & ideas - please use https://discuss.redash.io \U0001F46B "
labels: "Support Question"
---
We use GitHub only for bug reports 🐛
Anything else should be posted to https://discuss.redash.io 👫
🚨For support, help & questions use https://discuss.redash.io/c/support
💡For feature requests & ideas use https://discuss.redash.io/c/feature-requests
Alternatively, check out these resources below. Thanks! 😁.
- [Forum](https://disucss.redash.io)
- [Knowledge Base](https://redash.io/help)

15
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,15 @@
## What type of PR is this? (check all applicable)
<!-- Please leave only what's applicable -->
- [ ] Refactor
- [ ] Feature
- [ ] Bug Fix
- [ ] New Query Runner (Data Source)
- [ ] New Alert Destination
- [ ] Other
## Description
## Related Tickets & Documents
## Mobile & Desktop Screenshots/Recordings (if there are UI changes)

23
.github/support.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
# Configuration for Support Requests - https://github.com/dessant/support-requests
# Label used to mark issues as support requests
supportLabel: Support Question
# Comment to post on issues marked as support requests, `{issue-author}` is an
# optional placeholder. Set to `false` to disable
supportComment: >
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports
and planned work. However, this issue appears to be a support request.
Please use [our forum](https://discuss.redash.io) to get help.
# Close issues marked as support requests
close: true
# Lock issues marked as support requests
lock: false
# Assign `off-topic` as the reason for locking. Set to `false` to disable
setLockReason: true
# Repository to extend settings from
# _extends: repo

7
.github/weekly-digest.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
# Configuration for weekly-digest - https://github.com/apps/weekly-digest
publishDay: mon
canPublishIssues: true
canPublishPullRequests: true
canPublishContributors: true
canPublishStargazers: true
canPublishCommits: true

5
.gitignore vendored
View File

@@ -5,11 +5,12 @@ venv/
.coveralls.yml .coveralls.yml
.idea .idea
*.pyc *.pyc
.nyc_output
coverage
.coverage .coverage
coverage.xml coverage.xml
client/dist client/dist
.DS_Store .DS_Store
celerybeat-schedule*
.#* .#*
\#*# \#*#
*~ *~
@@ -24,3 +25,5 @@ node_modules
.sass-cache .sass-cache
npm-debug.log npm-debug.log
client/cypress/screenshots
client/cypress/videos

63
.restyled.yaml Normal file
View File

@@ -0,0 +1,63 @@
enabled: true
auto: false
# Open Restyle PRs?
pull_requests: true
# Leave comments on the original PR linking to the Restyle PR?
comments: true
# Set commit statuses on the original PR?
statuses:
# Red status in the case of differences found
differences: true
# Green status in the case of no differences found
no_differences: true
# Red status if we encounter errors restyling
error: true
# Request review on the Restyle PR?
#
# Possible values:
#
# author: From the author of the original PR
# owner: From the owner of the repository
# none: Don't
#
# One value will apply to both origin and forked PRs, but you can also specify
# separate values.
#
# request_review:
# origin: author
# forked: owner
#
request_review: author
# Add labels to any created Restyle PRs
#
# These can be used to tell other automation to avoid our PRs.
#
labels: ["Skip CI"]
# Labels to ignore
#
# PRs with any of these labels will be ignored by Restyled.
#
# ignore_labels:
# - restyled-ignore
# Restylers to run, and how
restylers:
- name: black
image: restyled/restyler-black:v19.10b0
include:
- redash
- tests
- migrations/versions
- name: prettier
image: restyled/restyler-prettier:v1.19.1-2
include:
- client/app/**/*.js
- client/app/**/*.jsx
- client/cypress/**/*.js

View File

@@ -1,56 +1,613 @@
# Change Log # Change Log
## v9.0.0-beta - 2020-06-11
This release was long time in the making and has several major changes:
- Our backend code was updated to support Python 3 and we no longer support Python 2. If you're using our Docker images, this should be a transparent change for you.
- We replaced Celery with RQ for background jobs processing. This will require some setup updates -- see instructions below.
- The frontend code is now 100% React and we removed all the Angular dependencies.
This release was made possible by contributions from over 50 people: @ari-e, @ariarijp, @arihantsurana, @arikfr, @atharvai, @cemremengu, @chulucninh09, @citrin, @daniellangnet, @DavidHernandez, @deecay, @dmudro, @erans, @erels, @ezkl, @gabrieldutra, @gstaykov, @ialeinikov, @ikenji, @Jakdaw, @jezdez, @juanvasquezreyes, @koooge, @kravets-levko, @kykrueger, @leibowitz, @leosunmo, @lihan, @loganprice, @mickeey2525, @mnoorenberghe, @monicagangwar, @NicolasLM, @p-yang, @Ralnoc, @ranbena, @randyzwitch, @rauchy, @rxin, @saravananselvamohan, @satyamkrishna, @shinsuke-nara, @stefan-mees, @stevebuckingham, @susodapop, @taminif, @thewarpaint, @tsuyoshizawa, @uncletimmy3, @wengkham.
### Upgrading
Typically, if you are running your own instance of Redash and wish to upgrade, you would simply modify the Docker tag in your `docker-compose.yml` file. Since RQ has replaced Celery in this version, there are a couple extra modifications that need to be done in your `docker-compose.yml`:
1. Under `services/scheduler/environment`, omit `QUEUES` and `WORKERS_COUNT` (and omit `environment` altogether if it is empty).
2. Under `services`, add a new service for general RQ jobs:
```yaml
worker:
<<: *redash-service
command: worker
environment:
QUEUES: "periodic emails default"
WORKERS_COUNT: 1
```
Following that, force a recreation of your containers with `docker-compose up --force-recreate --build` and you should be good to go.
### UX
- Redesigned Query Results page:
- Completely new layout is easier to read for non-technical Redash users.
- Empty query results are clearly displayed. User is now prompted to edit or execute the query.
- Mobile Experience Improvements:
- UI element spacing has been redesigned for clarity
- Admin pages now honor max-width. Tables scroll independent of the top menu.
- Large legends no longer shrink the visualization on small screens.
- Fix: it was sometimes impossible to scroll pages with dashboards because the visualizations captured every touch event.
- Fix: Visualizations on small screens would not always show horizontal scroll bars.
- Dashboards can now be un-archived using the API.
- Dashboard UI performance was improved.
- List pages were changed to show a user's name instead of avatar.
- Search-enabled tables now show a prompt for which columns will be searched.
- In the visualization editor, the settings pane now scrolls independent of the visualization preview.
- Tokens in the schema viewer now sort alphabetically.
- Links to settings panes that require Admin privileges are now hidden from non-Admins.
- The Admin page now remembers which tab you were viewing after a page reload.
### Visualizations
- Feature: Allow bubble size control with either coefficient or sizemode.
- Feature: Table visualization now treats Unix timestamps in query results as timestamps.
- Feature: It's now possible to provide a description to each Table column, appearing in UI as a tooltip.
- Feature: Added tooltip and popover templating to the map with markers visualization.
- Feature: Added an organization setting to hide the Plotly mode bar on all visualizations.
- Feature: Cohort visualization now has appearance settings.
- Feature: Add option to explicitly set Chart legend position.
- Change: Deprecated visualizations are now hidden.
- Change: Table settings editor now extends vertically instead of horizontally.
- Change: The maximum table pagination is now 500.
- Change: Pie chart labels maintain contrast against lighter slices.
- Fix: Chart series switched places when picking Y axis.
- Fix: Third column was not selectable for Bubble and Heatmap charts.
- Fix: On the counter visualizations, the “count rows” option showed an empty string instead of 0.
- Fix: Table visualization with column named "children" rendered +/- buttons.
- Fix: Sankey visualization now correctly occupies all available area even with fewer stages.
- Fix: Pie chart ignores series labels.
### Data Sources
- New Data Sources: Amazon Cloudwatch, Amazon CloudWatch Logs Insights, Azure Kusto, Exasol.
- Athena:
- Added the option to specify a base cost in settings, displaying a price for each query when executed.
- BigQuery:
- Fix: large jobs continued running after the user clicked “Cancel” query execution.
- Cassandra:
- Updated driver to 3.21.0 which dramatically reduces Docker build times.
- SSL options are now available.
- Clickhouse:
- You can now choose whether to verify the SSL certificate.
- Databricks:
- Databricks now use an ODBC-based connector.
- Fix: Date column was coerced to DateTime in the front-end.
- Druid:
- Added username and password authentication option.
- Microsoft SQL Server
- Added support for ODBC connections via pyodbc. There are now two MSSQL data source types. One using TDS. The other is using ODBC.
- MongoDB:
- Added support for running queries on secondary in replicaset mode.
- Fix: Connection test always succeeded.
- Oracle:
- Fix: Connection would fail if username or password contained special characters.
- Fix: Comparisons would fail if scale was None.
- RDS:
- Updated rds-combined-ca-bundle.pem to the latest CA.
- Redshift:
- Added the ability to use IAM Roles and Users.
- Fix: Redshift was unable to have its schema refreshed.
- Rockset:
- Fix: Allow Redash to load collections in all workspaces.
- Snowflake:
- You can now refresh the snowflake schema without waking the cluster.
- Added support for all of Snowflakes datetime types. Otherwise certain timestamps would only appear as strings in the front-end.
- TreasureData:
- Fix: API calls would fail when setting a non-default region.
### Alerts
- Feature: Added ability to mute alerts without deleting them.
- Fix: numerical comparisons failed if value from query was a string.
### Parameters
- Added Last x Days options for date range parameters.
- Fix: Parameters added in empty queries were always added as text parameters
### Bug Fixes
- Fix: Alembic migration schema was preventing v4 users from upgrading. In v5 we started encrypting data source credentials in the database.
- Fix: System admin dashboard would not show correct database size if non-default name was used.
- Fix: refresh_queries job would break if any query had a bad schedule object.
- Fix: Orgs with LDAP enabled couldnt disable password login.
- Fix: SSL mode was sometimes sent as an empty string to the database instead of omitted entirely.
- Fix: When creating new Map visualization with clustering disabled, map would crash on save.
- Fix: It was possible on the New Query page to click “Save” multiple times, causing multiple new query records to be created.
- Fix: Visualization render errors on a dashboard would crash the entire page.
- Fix: A scheduled execution failure would modify the querys “updated_at” timestamp.
- Fix: Parameter UI would wrap awkwardly during some drag operations.
- Fix: In dashboard edit mode, users couldnt modify widgets.
- Fix: Frontend error when parsing a NaN float.
### Other
- Added TSV as a download format (in addition to CSV and Excel).
- Added maildev settings (helps with automated settings).
- Refine permissions usage in Redash to allow for guest users
- The query results API now explicitly handles 404 errors.
- Forked queries now retain the tags of the original query.
- We now allow setting custom Sentry environments.
- Started using Black linter for our Python source code
- Added CLI command to re-encrypt data source details with new secret key.
- Favorites list is now loaded on menu click instead of on page load.
- Administrators can now allow connections to private IP addresses.
## v8.0.0 - 2019-10-27
There were no changes in this release since `v8.0.0-beta.2`. This is just to mark a stable release.
## v8.0.0-beta.2 - 2019-09-16
This is an update to the previous beta release, which includes:
- Add options for users to share anonymous usage information with us (see [docs](https://redash.io/help/open-source/admin-guide/usage-data) for details).
- Visualizations:
- Allow the user to decide how to handle null values in charts.
- Upgrade Sentry-SDK to latest version.
- Make horizontal table scroll visible in dashboard widgets without scrolling.
- Data Sources:
- Add support for Azure Data Explorer (Kusto).
- MySQL: fix connections without SSL configuration failing.
- Amazon Redshift: option to set query group for adhoc/scheduled queries.
- Hive: make error message more friendly.
- Qubole: add support to run Quantum queries.
- Display data source icon in query editor.
- Fix: allow users with view only acces to use the queries in Query Results
- Dashboard: when updating parameters refersh only widgets that use those parameters.
This release had contributions from 12 people: @arikfr, @cclauss, @gabrieldutra, @justinclift, @kravets-levko, @ranbena, @rauchy, @sandeepV2, @shinsuke-nara, @spacentropy, @sphenlee, @swfz.
## v8.0.0-beta - 2019-08-18
After months of being heads down with hard work, it's finally time to wrap up the V8 release 🤩 This release includes many long awaited improvements to parameters, UX improvements, further React migration and other changes, fixes and improvements.
While this version is already running on the hosted platform to make sure it's stable, we're excited to put this in the hands of our Open Source users.
Starting from this release we will no longer build a tarball distribution of the codebase and recommend everyone to switch over to using our Docker images. We're planning on dropping Python 2 support towards its EOL this year and switching over to the Docker image will make this transition much simpler.
This release was made possible by contributions from over 40 people: @aidarbek, @AntonZarutsky, @ariarijp, @arikfr, @combineads, @deecay, @fmy, @gabrieldutra, @guwenqing, @guyco33, @ialeinikov, @Jakdaw, @jezdez, @justinclift, @k-tomoyasu, @katty0324, @koooge, @kravets-levko, @ktmud, @KumanoTanaka, @kyoshidajp, @nason, @oldPadavan, @openjck, @osule, @otsaloma, @ranbena, @rauchy, @rueian, @sekiyama58, @shinsuke-nara, @taminif, @The-Alchemist, @vv-p, @washort, @wudi-ayuan, @ygrishaev, @yoavbls, @yoshiken, @yusukegoto and the support of over 500 organizations who subscribed to our hosted version and by that sponsor the team's work.
### Parameters
- Parameter UI improvements:
- Support for multi-select in dropdown (and query dropdown) parameters.
- Support for dynamic values in date and date-range parameters.
- Search dropdown parameter values.
- New UX for applying parameter changes in queries and dashboards.
- Allow using Safe Parameters in visualization embeds and public dashboards. Safe Parameters are any parameter type except for the a text parameter (dropdowns are safe).
### Data Sources
- New Data Sources: Couchbase, Phoenix and Dgraph.
- New JSON data source (and deprecated old URL data source).
- Snowflake: update connector to latest version.
- PostgreSQL: show only accessible tables in schema.
- BigQuery:
- Correctly handle NaN values.
- Treat repeated fields as rrays.
- [BigQuery] Fix: in some queries there is no mode field
- DynamoDB:
- Support for Unicode in queries.
- Safe loading of schema.
- Rockset: better handling of query errors.
- Google Sheets:
- Support for Team Drive.
- Friendlier error message in case of an API error and more reliable test connection.
- MySQL:
- Support for calling Stored Procedures and better handling of query cancellation.
- Switch to using `mysqlclient` (a maintained fork of `Python-MySQL`).
- MongoDB: Support serializing Decimal128 values.
- Presto: support for passwords in connection settings.
- Amazon Athena: allow to specify custom work group.
- Query Results: querying a column with a dictionary or array fails
- Clickhouse: make sure we don't show password in error messages.
- Enable Cassandra support by default.
### Visualizations
- Charts:
- Fix: legend overlapping chart on small screens.
- Fix: Pie chart not rendering when series doesn't exist in options.
- Pie Chart: add option to set direction of slices.
- WordCloud: rewritten to support new options (provide frequency in query, limits), scale when resizing, handle long words and more.
- Pivot Table: support hiding totals.
- Counters: apply formatting to target value.
- Maps:
- Ability to customize marker icon and color.
- Customization options for Choropleth maps.
- New Visualization: Details View.
### **UX**
- Replace blank screen with a loading indicator when the application is doing its first load.
- Multiple improvements to dashboards editing: auto-save, grid markings and better refresh indicator.
- Admin can now edit user's groups from the user page.
- Add keyboard shortcut (Ctrl/Cmd+Shift+F) to trigger query formatting.
### API
- Query Result API response minimized to only required fields when called with a non user API key.
- Prefer API key over cookies in authentication.
- User can now regenerate Query API Key.
### Other Changes
- Sends CSP headers to prevent various kinds of security attacks via the browser. Might break unusual usages and embeds of Redash.
- New Failed Scheduled Queries email report (can be enabled from organization settings screen).
- Deprecated HipChat Alert Destination.
- Add options to hide different parts of a Visualization embed UI (parameters, title, link to query).
- Support multi-byte search for query names and descriptions (needs to be enabled in Organization settings screen).
- CSV query results download: correctly serialize booleans and date values.
- Dashboard filters now collect values from all widgets with the same filter.
- Support for custom message and description in alert notifications (currently disabled behind a feature flag until we improve the alert UX).
### Bug Fixes
- Fix: adding widget to dashboard from a query page is broken.
- Fix: default time format option was wrong.
- Fix: when too many errors of a scheduled queries occur it causes an OverflowError.
- Fix: when forking a query maintain the same visualizations order.
## v7.0.0 - 2019-03-17
We're trying a new format for the CHANGELOG in this release. Focusing on the bigger changes, but for whoever interested, you can see all the changes [here](https://github.com/getredash/redash/compare/v6.0.0...master).
Besides all the features, bug fixes and improvements listed below we managed to convert a large portion of Redash's frontend code from Angular.js to React. You can see status in [#3071](https://github.com/getredash/redash/issues/3071).
This release was made possible with the help of 34 contributors. 🙇‍♂️
### Data Sources
- **All data source options are now encrypted in the database.** By default the encryption uses the `REDASH_COOKIE_SECRET` value (`redash.settings.COOKIE_SECRET`), but you can specify a different value by setting the `REDASH_SECRET_KEY` environment variable value. Note that you need to set this _before_ doing the upgrade.
- New Data Sources: Uptycs and Apache Drill.
- Snowplow: is now enabled by default & supports region setting.
- Elasticsearch: add support for Amazon Elasticsearch IAM authentication (with IAM profile or key/secret pair).
- PostgreSQL: add support for serializing range values.
- Redshift: remove duplicate column information for late-binding views.
- Athena: load all databases (using pagination).
- BigQuery: correctly handle temp tables with no schema field.
- Jira (JQL): support for fetching all records with pagination.
- Prometheus: fix schema loading and add support for query range.
### In-app Help
You can now open the [Knowledge Base](https://redash.io/help) inside the application. We also added a few "help triggers" in the app, that will open the Knowledge Base in context of what you're currently doing.
### Parameters
- **Dashboard Parameters**: We improved the flow of adding queries with parameters to dashboards and now give you full control over how parameters are mapped. You no longer have to make sure all parameters have the same name or use the `Global` checkbox. We also added new options, like keeping the parameter local to the widget or setting a static value. [Read more in our Knowledge Base →](https://redash.io/help/user-guide/querying/query-parameters#Parameter-Mapping-on-Dashboards)
- We added server side validation of parameter values for all parameter types, except for parameters of `text` type. All validated parameter types are considered safe. When a query is using safe parameters (or no parameters at all), View Only users can refresh it.
- Refreshing safe queries is done using the new results API endpoint, which takes only a query ID (and optionally parameter values) and does not need the query text.
### Query Editor Improvements
- Run only the highlighted query text: hit Execute after highlighting a portion of your query and only the selected portion will be sent to the database. This is useful for testing sub-SELECT statements and CTE's.
- Improved auto complete: add a dot . after a table name in the query editor and auto complete will only suggest columns on that table.
- Autosave parameter configuration changes.
- YAML syntax support (for data sources like Yandex Metrica).
### Improved Query Scheduler
The Query Scheduler got a face lift and some new options: you can pick a day for a weekly schedule to run on and also set an end date after which the query will no longer execute on schedule.
### Data Sources
We added Apache Drill, Uptycs and a new JSON data source. Also fixed a few bugs in Athena's query runner and others.
### User Management
The users page got revamped with a new look and feel and few new features:
- An indication when a user was last active.
- Show if an invited user hasn't finished the setup process yet (Pending Invitations section).
- You can now generate a new API key for users, if there's a concern it was compromised.
### Admin
- New Celery queues status screens, replacing the old Queries Status and better reflecting the status of running queries.
- Make the queue name for schema refresh job configurable. The default used to be hard coded `schemas`, which is not available on all setups. Now it's `celery`.
- The `gevent` library is installed by default, and you can now setup gunicorn to use `gevent` based workers.
- New Docker entrypoint command to do a health check for a worker process.
- Flask-Admin is no longer setup or supported.
### Other Changes
- New Alert destination: Google Hangouts Chat.
- When downloading results from the results API it will set a user friendly filename for the downloaded file.
- Archived Queries section added to the queries list.
### Bug Fixes
- Fixed: fork query does not fork tables but instead adds default table.
- Fixed: when deleting a visualization, any widget using it was left empty on the dashboard.
- Fixed: issues with Query Editor resizing on new versions of Chrome.
- Fixed: issues with exporting dictionaries to Excel.
- Fixed: Cohort visualization gets stuck when passing string values.
- Fixed: use series name for Pie chart label.
- Make sure Flask app created in Celery's worker process (could cause some query runners to get stuck while running queries).
## v6.0.0 - 2018-12-16
v6.0.0 release version. Mainly includes fixes for regressions from the beta version.
This release had contributions from 5 people: @rauchy, @denisov-vlad, @arikfr, @ariarijp, and @gabrieldutra. Thank you, everyone 🙏
### Changed
- #3183 Make refresh_queries less noisey in logs. @arikfr
### Fixed
- #3163 Include correct version in production builds. @rauchy
- #3161 Clickhouse: fix int() conversion error. @denisov-vlad
- #3166 Directly using record_event task requires timestamp. @arikfr
- #3167 Alert.evaluate failing when the column is missing. @arikfr
- ##3162 Remove API permissions for users who have been disabled. @rauchy
- #3171 Reject empty query name. @ariarijp
- #3175, #3186 Fix disable error message. @rauchy, @gabrieldutra
- #3182 [Redshift] support for schema names with dots. @arikfr
- #3187 Safely create_app in Celery code (try to fetch current_app first). @arikfr
### Other
- #3155 Add DB Seed to Cypress and setup Percy. @gabrieldutra
- #3180 Remove coverage from pytest terminal output. @rauchy
## v6.0.0-beta - 2018-12-03
This release was 2 months in the making and it is full with good stuff!
- We have 5 new data sources: Databricks, IBM DB2, Kylin, Druid and Rockset. ⌗
- There are fixes and improvements to 11 existing data sources (MySQL, Redshift, Postgres, MongoDB, Google BigQuery, Vertica, TreasureData, Presto, ClickHouse, Google Sheets and Google Analytics).
- The Query Results data source can now load cached results, just use the `cached_query_` prefix instead of `query_`.
- On the visualizations front we added a Heatmap visualization and did updated the table and counter visualizations.
- Alerts got some fixes and a new destination: PagerDuty.
- If the live autocomplete in the code editor annoys you, you can disable it now (although we're working to make it better, see #3092).
- Fast queries will now load faster. 🏃‍♂️
- We improved the layout of visualizations and content on smaller screen sizes. 📱
- For those of you who like sharing, you can now enable the ability to share ownership of queries and dashboards and let others to edit them. Check the Settings page to enable this feature.
There were also important changes to the code and infrastructure:
- More components moved to React.
- We switched to Webpack 4 with the help of @dmonego.
- We upgraded to Celery 4 with the help of @emtwo, @jezdez, @mashrikt and @atharvai.
- We started moving towards Python 3 for our backend. The first step was to make sure our code pass basic sanity tests with Flake 8, which was implemented by @cclauss.
- We improved our testing on the frontend by adding setup for Jest tests and E2E testing using Cypress (@gabrieldutra).
- Each pull request now gets a deploy preview using Netlify to easily test frontend changes.
This is just a summary, you're welcome to review the full list below. ⬇
This release had contributions from 38 people: @arikfr, @kravets-levko, @jezdez, @kyoshidajp, @kocsmy, @alison985, @gabrieldutra, @washort, @GitSumito, @emtwo, @rauchy, @alexanderlz, @denisov-vlad, @ariarijp, @yoavbls, @zhujunsan, @sjakthol, @koooge, @SakuradaJun, @dmonego, @Udomomo, @cclauss, @combineads, @zaimy, @Trigl, @ralphilius, @jodevsa, @deecay, @igorcanadi, @pashaxp, @hoangphuoc25, @toph, @burnash, @wankdanker, @Yossi-a, @Rovel, @kadrach, and @nicof38. Thank you, everyone 🙏
### Added
- #2747, #3143 Add a new Databricks query runner. @alison985, @jezdez, @arikfr
- #2767 Add ability to add viz to dashboard from query edit page. @alison985, @jezdez
- #2780 Add a query autocomplete toggle. @alison985, @jezdez, @arikfr
- #2768 Add authentication via JWT providers. @SakuradaJun
- #2790 Add the ability to sort favorited queries, paginate the dashboard list and improve UI inconsistencies. @jezdez
- #2681 Add ability to search table column names in schema browser. @alison985
- #2855 Add option to query cached results. @yoavbls
- #2740 Add ability for extensions to add periodic tasks. @emtwo
- #2924 Google Spreadsheets: Add support for opening by URL. @alexanderlz
- #2903 Add PagerDuty as an Alert Destination. @alexanderlz
- #2824 Add support for expanding dashboard visualizations. @sjakthol
- #2900 Add ability to specify a counter label. @ralphilius
- #2565 Add frontend extension capabilities. @emtwo
- #2848 Add IBM Db2 as a data source using the ibm-db Python package. @nicof38
- #2959 Add option to auto reload widget data in shared dashboards. @arikfr
- #2993 Add page size settings. @kyoshidajp
- #2080 New Heatmap chart visualization with Plotly. @deecay
- #2991 Show users in CLI group list. @GitSumito
- #2342 New SQLPARSE_FORMAT_OPTIONS setting to configure query formatter. @ariarijp
- #3031 Add some tests for Query Results. @ariarijp
- #2936 Add Kylin data source. @Trigl
- #3047 Add Druid data source. @rauchy
- #3077 New user interface for the feature flag of the share edit permissions feature. @arikfr
- #3007 Add permissions to the result of "manage.py groups list" command. @Udomomo
- #3088 Add get_current_user() fuction for the Python query runner. @kyoshidajp
- #3114 Add event tracking to autocomplete toggle. @arikfr
- #3068 Add Rockset query runner. @igorcanadi, @arikfr
- #3105 Display frontend version. @rauchy
### Changed
- #2636 Rewrite query editor with React. @washort, @arikfr
- #2637 Convert edit-in-place component to React. @washort, @arikfr
- #2766 Suitable events are now being recorded server side instead of in the frontend. @alison985, @jezdez
- #2796 Change placement (right/bottom) of chart legend depending on chart width. @kravets-levko
- #2833 Uses server side sort order for tag list and show count of tagged items. @jezdez
- #2318 Support authentication for the URL data source. @jezdez
- #2884 Rename Yandex Metrika to Metrica. @jezdez
- #2909 MySQL: hide sys tables. @arikfr
- #2817 Consistently use simplejson for loading and dumping JSON. @jezdez
- #2872 Use Plotly's function to clean y-values (x may be category or date/time). @kravets-levko
- #2938 Auto focus tag input. @kyoshidajp
- #2927 Design refinements for queries pages. @kocsmy
- #2950 Show activity status in CLI user list. @GitSumito
- #2968 Presto data source: setting protocol (http/https), safe loading of error messages. @arikfr
- #2967 Show groups in CLI user list. @GitSumito
- #2603 MongoDB: Update requirements to support srv. @arikfr
- #2961 MongoDB: Skip system collections when loading schema. @arikfr
- #2960 Add timeout to various HTTP requests. @arikfr
- #2983 Databricks: New logo, updated name and enabled by default. @arikfr
- #2982 Table visualization: change default size to 25 and add more size options. @arikfr
- #2866 Redshift: Hide tables the configured user cannot access. @sjakthol
- #3058 Mustache: don't html-escape query parameters values. @kravets-levko
- #3079 Always use basic autocomplete, as well as the live autocomplete. @arikfr
- #3084 Support tel://, sms://, mailto:// links in query results. @zhujunsan
- #3083 Clickhouse: Add WITH TOTALS option support. @denisov-vlad
- #3063 Allow setting colors for bubble charts. @toph
- #3085 BigQuery: Switch to Standard SQL as the default. @kyoshidajp
- #3094 Tags autocomplete: Show note when creating a new label. @kravets-levko
- #2984 Autocomplete toggle improvements. @arikfr
- #3089 Open new tab when forking a query. @kyoshidajp
- #3126 MongoDB: add support for sorting columns. @arikfr
- #3128 Improve backoff algorithm of query results polling to speed it up. @arikfr
- #3125 Vertica: update driver & add support for connection timeout. @arikfr
- #3124 Support unicode in Postgres/Redshift schema. @arikfr
- #3138 Migrate all tags components to React. @kravets-levko
- #3139 Better manage permissions modal. @kocsmy
- #3149 Improve tag link colors and fix group tags on Users page. @kocsmy
- #3146 Update, replace and fix new alert destination logos so it fits better. @kocsmy
- #3147 Add and improve recent db logos that didn't fit in size properly. @kocsmy
- #3148 Fix label positioning on no found screen. @kocsmy
- #3156 json_dumps: add support for serializing buffer objects. @arikfr
### Fixed
- #2849 Fix invalid reference to alert.to_dict() in webhook. @wankdanker
- #2840 Improve counter visualization text scaling. @kravets-levko
- #2854 Widget titles are no longer rendered wrong on public dashboards. @kravets-levko
- #2318 Removed redundant exception handling in data sources since that's handled in the query backend. @jezdez
- #2886 Fix Javascript build that broke because registerAll tried to run EditInPlace component. @arikfr
- #2911 Dont show “Add to dashboard” in dropdown to unsaved queries. @jezdez
- #2916 Fix export query results output file name. @gabrieldutra
- #2917 Fix output file name not changing after rename query. @gabrieldutra
- #2868 Address edge case when retrieving Glue schemas for Athena data source. @kadrach
- #2929 Fix: date value in a filter is duplicated. @combineads
- #2875 Unbreak charts with long legend break in horizontal mode. Update plotly.js. @kravets-levko
- #2937 Fix event recording in admin API backend. @kyoshidajp
- #2953 Minor fixes for the Clickhouse data source. @denisov-vlad
- #2941 Bring back fix to Box plot hover. @arikfr
- #2957 Apply missing CSS classes to EditInPlace component. @arikfr
- #2897 Show "Add description" only after saving the query. @arikfr
- #2922 Query page layout improvements for small screens. @kravets-levko
- #2956 Clickhouse: move timeout to params. @denisov-vlad
- #2964 Fix no tags shown when having empty set. @gabrieldutra
- #2757 Use full text search ranking when searching in list views. @jezdez
- #2969 Query Results data source: improved errors, quoted column names. @arikfr
- #2906 Preventing open redirection in loging process. @kyoshidajp
- #2867 TreasureData: Deduplicate column names. @zaimy
- #2994 Fix scheme of various URLs from http to https. @kyoshidajp
- #2992 Fix an invalid prop type warning in new version notifier. @kyoshidajp
- #3022 Fix Toolbox covering part of a chart. @kravets-levko
- #2998 Fix charts losing responsive features after refreshing the dashboard. @kravets-levko
- #3034 Postgres: handle NaN/Infinity values. @kravets-levko
- #2745 Sort columns with undefined values. @Yossi-a
- #3041 Sort CLI output of lists. @GitSumito
- #2803, #3006 Address various tag display issues on query list page. @kocsmy, @alison985
- #3049 Fix edit-in-place component which ignored isEditable flag and didn't work on Groups page. @kravets-levko
- #2965 Google Analytics: Fix crash when no results are returned. @alexanderlz
- #3061 Fix table visualization so that the horizontal scrollbar is not be always visible. @kravets-levko
- #3076 Add white-space padding to separators in the footer. @burnash
- #2919 Fix URL data source to not require a URL. @arikfr
- #3098 Force AngularJS to update query editor properly. @washort
- #3100 Delete redundant regex segment in query result frontend. @zhujunsan
- #2978 Prevent the query update timestamp from changing when it is linked to new query results. @rauchy
- #3046 Fix query page header. @kravets-levko
- #3097 Mongo: Fix collection fields retreival bug when Views are present. @jodevsa
- #3107 Keep query text in local state for now. @washort
- #3111 Fix mobile padding issues on Query results. @kocsmy
- #3122 Show menu divider only if query is archived. @jezdez
- #3120 Fix tag counts for dashboards and queries. @jezdez
- #3141 Fix schema refresh to work on MySQL 8. @hoangphuoc25
- #3142 Fix: editing dashboard title results in the visualizations being replaced by the loading markers. @kravets-levko
### Other
- #2850 The setup scripts are now based on Ubuntu 18.04 LTS and Docker. @pashaxp, @arikfr
- #2985 Add Jest based tests to our stack. @arikfr
- #2999 Add netlify configuration. @arikfr
- #3000 Initial Cypress based E2E test infrastructure. @gabrieldutra
- #2898 Move Ant styles into a central location. @arikfr
- #2910 Fix webpack build error about BigMessage. @jezdez
- #2928 Speed up builds by skipping installing requirements_all_ds.txt in CI unit tests. @arikfr
- #2963 Fix tarball build failure. @emtwo
- #2996 Fix setup.sh failures when run as root. @arikfr
- #2989 Rearrange make targets. @koooge
- #3036 Update Flask-Admin to 1.5.2. @yoavbls
- #2901 Fix documentation links. @kravets-levko
- #3073 Remove only Redash containers in clean Make task. @ariarijp
- #3048 Remove pytest-watch dependency to workaround an issue with watchdog. @rauchy
- #2905 Update development docker-compose.yml file to use latest Redis and Postgres servers and specify working volume explictly. @Rovel
- #3032 Makefile: Add make targets for test. @koooge
- #2933 Switch to Webpack 4. @dmonego
- #2908 Update setup files. @arikfr
- #2946 Update snowflake_connector_python version. @arikfr
- #2773 Upgrade to Celery 4.2.1. @emtwo, @jezdez
- #2881 CircleCI: Make flake8 tests pass on Legacy Python and Python 3. @cclauss
- #2907 Remove unused dependencies (honcho, wsgiref). @arikfr
- #3039 Build docker image on master branch. @arikfr
- #3106 Fix registerAll failures after minification. @arikfr
## v5.0.2 - 2018-10-18
### Security
- Fix: prevent Open Redirect vulnerability.
## v5.0.1 - 2018-09-27
### Added
- Added support for JWT authentication (for services like Cloudflare Access or Google IAP).
### Changed
- Upgraded Celery version to 3.1.26 to make upgrade to Celery 4 easier.
## v5.0.0 - 2018-09-21 ## v5.0.0 - 2018-09-21
Final release for V5. Most of the changes were already in the beta release of V5, but this includes several fixes along Final release for V5. Most of the changes were already in the beta release of V5, but this includes several fixes along
with UI improvements. with UI improvements.
🙏 Thanks to @arikfr, @jezdez, @kravets-levko, @alison985, @kocsmy, @yossi-a, @tdsmith, @nasmithan, @jrbenny35, @sjakthol, @ariarijp and @combineads who contributed to this release. 🙏 Thanks to @arikfr, @jezdez, @kravets-levko, @alison985, @kocsmy, @yossi-a, @tdsmith, @nasmithan, @jrbenny35, @sjakthol, @ariarijp and @combineads who contributed to this release.
### Security ### Security
* Fix: don't expose Google OAuth client secret. @arikfr - Fix: don't expose Google OAuth client secret. @arikfr
### Changed ### Changed
* Improve mobile rendering of dashboards and queries. @kocsmy - Improve mobile rendering of dashboards and queries. @kocsmy
* UI improvements for favorites and empty state. @arikfr - UI improvements for favorites and empty state. @arikfr
* Remove unnecessary X at the end of the query search. @kocsmy - Remove unnecessary X at the end of the query search. @kocsmy
* Add server-side sorting to dashboard list. @jezdez - Add server-side sorting to dashboard list. @jezdez
* Sort queries in descending order. @jezdez - Sort queries in descending order. @jezdez
* Throw error when non-owner tries to add a user to dashboard permissions. @alison985 - Throw error when non-owner tries to add a user to dashboard permissions. @alison985
* Propagate query execution errors from Celery tasks properly. @alison985 - Propagate query execution errors from Celery tasks properly. @alison985
* Reload the route when using the app header search input. @jezdez - Reload the route when using the app header search input. @jezdez
### Fixed ### Fixed
* Fix: BigQuery default location is null and not US. @arikfr - Fix: BigQuery default location is null and not US. @arikfr
* Fix: query embeds are broken. @arikfr - Fix: query embeds are broken. @arikfr
* Fix: typo in Celery log foramt. @ariarijp - Fix: typo in Celery log foramt. @ariarijp
* Use QuerySerializer in outdated queries list. @jezdez - Use QuerySerializer in outdated queries list. @jezdez
* Fix: sometimes widgets are getting zero height. @kravets-levko - Fix: sometimes widgets are getting zero height. @kravets-levko
* Athena: Switch to simple_json to serialize NaN/Infinity values as nulls. @kravets-levko, @jezdez - Athena: Switch to simple_json to serialize NaN/Infinity values as nulls. @kravets-levko, @jezdez
* Fix: queries with parameters with no value breaking the scheduler. @arikfr - Fix: queries with parameters with no value breaking the scheduler. @arikfr
* Fix: MongoDB query results parser didn't support unicode keys. @arikfr - Fix: MongoDB query results parser didn't support unicode keys. @arikfr
* Fix: Google Analytics schema wasn't loading in some cases. @arikfr - Fix: Google Analytics schema wasn't loading in some cases. @arikfr
* Fix: date/time parameters not working as global param @kravets-levko. - Fix: date/time parameters not working as global param @kravets-levko.
* Fix: Widgets crumble when trying to move / resize a widget. @kravets-levko - Fix: Widgets crumble when trying to move / resize a widget. @kravets-levko
* Fix: handling rows with "length" field with forOwn method. @yossi-a - Fix: handling rows with "length" field with forOwn method. @yossi-a
* Fix: query selection not working on alert page. @sjakthol - Fix: query selection not working on alert page. @sjakthol
* Fix: query_results for Embedded Parameters (removed deprecated to_dict function). @nasmithan - Fix: query_results for Embedded Parameters (removed deprecated to_dict function). @nasmithan
* Fix: unicode not supported in dashboard search. @combineads - Fix: unicode not supported in dashboard search. @combineads
* Fix: unicode not supported in users search. @arikfr - Fix: unicode not supported in users search. @arikfr
### Other ### Other
* Add test for using saved parameters in scheduled queries. @alison985 - Add test for using saved parameters in scheduled queries. @alison985
* Minor code smell cleanup. @jezdez - Minor code smell cleanup. @jezdez
* Update QueryResultListResource docstring. @tdsmith - Update QueryResultListResource docstring. @tdsmith
* Switch to CirlceCI 2.0 @jrbenny35, @arikfr - Switch to CirlceCI 2.0 @jrbenny35, @arikfr
* Remove unnecessary init methods. @jezdez - Remove unnecessary init methods. @jezdez
## v5.0.0-Beta - 2018-08-06 ## v5.0.0-Beta - 2018-08-06
@@ -58,19 +615,19 @@ This is the first beta of the V5 release (and hopefully the last one). This vers
Some notable changes: Some notable changes:
* Extensive work on parameters UI: - Extensive work on parameters UI:
* New Date Range parameter type. - New Date Range parameter type.
* UI for creating new parameters. - UI for creating new parameters.
* Support for Now/Today as default value of date/time parameter. - Support for Now/Today as default value of date/time parameter.
* Tagging and favorites ⭐️ support for queries and dashboards. - Tagging and favorites ⭐️ support for queries and dashboards.
* Users list page was improved (search, additional information) and you can now disable users. - Users list page was improved (search, additional information) and you can now disable users.
* Query editor improvements: additional keyboard shortcuts and support for searching in query text. - Query editor improvements: additional keyboard shortcuts and support for searching in query text.
* Visualizations improvements: option to select colors of pie chart sectors, X Axis type auto detect and option to format values, labels and tooltips. - Visualizations improvements: option to select colors of pie chart sectors, X Axis type auto detect and option to format values, labels and tooltips.
* Data Sources: - Data Sources:
* Support for Yandex Metrika and AppMetrika. - Support for Yandex Metrika and AppMetrika.
* BigQuery: location property support and schema will load all tables now. - BigQuery: location property support and schema will load all tables now.
* Elasticsearch: stop sending source_content_type parameter which wasn't supported in older versions. - Elasticsearch: stop sending source_content_type parameter which wasn't supported in older versions.
* Started migrating the frontend codebase to React. - Started migrating the frontend codebase to React.
And much more! And much more!
@@ -78,82 +635,82 @@ And much more!
### Added ### Added
* #2712: Date/Time Range parameter type (@kravets-levko) - #2712: Date/Time Range parameter type (@kravets-levko)
* #2482: Add support for ChatWork Alert Destination. (@matsumo) - #2482: Add support for ChatWork Alert Destination. (@matsumo)
* #2678: Explicit "Add Parameter" Button in Query Editor. (@kravets-levko) - #2678: Explicit "Add Parameter" Button in Query Editor. (@kravets-levko)
* #2513: Add location property to BigQuery data source settings. (@kyoshidajp) - #2513: Add location property to BigQuery data source settings. (@kyoshidajp)
* #2616: Pie chart: support setting pie chart sector colors. (@kravets-levko) - #2616: Pie chart: support setting pie chart sector colors. (@kravets-levko)
* #2697: Date/Time parameters: support for "Now" as default value. (@kravets-levko) - #2697: Date/Time parameters: support for "Now" as default value. (@kravets-levko)
* #2693: Enable search function in Query Editor. (@arikfr) - #2693: Enable search function in Query Editor. (@arikfr)
* #2573: Tagging and favorites for Queries and Dashboards (@arikfr) - #2573: Tagging and favorites for Queries and Dashboards (@arikfr)
* #2640: Keyboard shortcut to collapse query editor/schema browser (@kravets-levko) - #2640: Keyboard shortcut to collapse query editor/schema browser (@kravets-levko)
* #2674: Add support for the Chrome Logger extension (@arikfr) - #2674: Add support for the Chrome Logger extension (@arikfr)
* #2653: Add redash db size to status page (@alison985) - #2653: Add redash db size to status page (@alison985)
* #2669: Store Athena query id with result metadata (@tdawber) - #2669: Store Athena query id with result metadata (@tdawber)
* #2546: Configuration for incorporating React components (@washort) - #2546: Configuration for incorporating React components (@washort)
* #2533: New datasource: Yandex Metrika & AppMetrika (@denisov-vlad) - #2533: New datasource: Yandex Metrika & AppMetrika (@denisov-vlad)
* #2536: Chart: formats for values, labels and tooltips (@kravets-levko) - #2536: Chart: formats for values, labels and tooltips (@kravets-levko)
* #2560: Introduce Policy object (@arikfr) - #2560: Introduce Policy object (@arikfr)
* #2380: Admin should be able to disable a user (@kravets-levko) - #2380: Admin should be able to disable a user (@kravets-levko)
* #2509: Show custom date format on settings page (@kyoshidajp) - #2509: Show custom date format on settings page (@kyoshidajp)
### Changed ### Changed
* #2715: Improve users list page (@arikfr) - #2715: Improve users list page (@arikfr)
* #2710: Update Ant variables to fit Redash's style (@kocsmy) - #2710: Update Ant variables to fit Redash's style (@kocsmy)
* #2709: Move format button next Add New Param button. (@arikfr) - #2709: Move format button next Add New Param button. (@arikfr)
* #2664: Dashboard shows a spinner when query failed to load (@kravets-levko) - #2664: Dashboard shows a spinner when query failed to load (@kravets-levko)
* #2626: Show real status when loading cached query result (@kravets-levko) - #2626: Show real status when loading cached query result (@kravets-levko)
* #2663: Set column name implicitly when column name is blank (@ariarijp) - #2663: Set column name implicitly when column name is blank (@ariarijp)
* #2695: Improve Date/DateTime type parameters (@kravets-levko) - #2695: Improve Date/DateTime type parameters (@kravets-levko)
* #2694: Block users with disposable email addresses (@arikfr) - #2694: Block users with disposable email addresses (@arikfr)
* #2687: YAML: changed load to safe_load (@denisov-vlad) - #2687: YAML: changed load to safe_load (@denisov-vlad)
* #2514: Update value parsing for google spreadsheets source (@atharvai) - #2514: Update value parsing for google spreadsheets source (@atharvai)
* #2570: fixes query pagination alignment (@alison985) - #2570: fixes query pagination alignment (@alison985)
* #2584: keep query result pagination out of scroll (@alison985) - #2584: keep query result pagination out of scroll (@alison985)
* #2647: Improve Script Query Runner (@ariarijp) - #2647: Improve Script Query Runner (@ariarijp)
* #2583: Query header improvements on widgets (@kocsmy) - #2583: Query header improvements on widgets (@kocsmy)
* #2671: Save some space (@kocsmy) - #2671: Save some space (@kocsmy)
* #2658: delaying schema filtering to improve responsiveness (@alison985) - #2658: delaying schema filtering to improve responsiveness (@alison985)
* #2648: Update datasource documentation links (@Pablohn26) - #2648: Update datasource documentation links (@Pablohn26)
* #2613: Improve Script Query Runner (@ariarijp) - #2613: Improve Script Query Runner (@ariarijp)
* #2619: data source sort case insensitive (@alison985) - #2619: data source sort case insensitive (@alison985)
* #2604: Improve Google Spreadsheets Query Runner (@ariarijp) - #2604: Improve Google Spreadsheets Query Runner (@ariarijp)
* #2542: Closes #2541: x-axis improvements. (@emtwo) - #2542: Closes #2541: x-axis improvements. (@emtwo)
* #2590: Remove redundant variables (@ariarijp) - #2590: Remove redundant variables (@ariarijp)
* #2585: Show data only mode: allow to add and delete visualizations (@kravets-levko) - #2585: Show data only mode: allow to add and delete visualizations (@kravets-levko)
* #2549: Allow get_tables to see views and v10-style partitioned tables (@coreyhuinker) - #2549: Allow get_tables to see views and v10-style partitioned tables (@coreyhuinker)
* #2568: sort datasources alphabetically (@alison985) - #2568: sort datasources alphabetically (@alison985)
* #2444: feat: show error if saml response cannot be parsed (@sjakthol) - #2444: feat: show error if saml response cannot be parsed (@sjakthol)
* #2554: Display name to be delete (@kyoshidajp) - #2554: Display name to be delete (@kyoshidajp)
* #2510: Display confirmation dialog when deleting a item (@kyoshidajp) - #2510: Display confirmation dialog when deleting a item (@kyoshidajp)
* #2518: Design improvements (@kocsmy) - #2518: Design improvements (@kocsmy)
* #2520: Filter data sources in a data source input area (@kyoshidajp) - #2520: Filter data sources in a data source input area (@kyoshidajp)
### Fixed ### Fixed
* #2722: Elasticsearch: Don't send source_content_type parameter. (@arikfr) - #2722: Elasticsearch: Don't send source_content_type parameter. (@arikfr)
* #2719: Remove closing input tags (@maxv) - #2719: Remove closing input tags (@maxv)
* #2458: Get all tables in the BigQuery (@kyoshidajp) - #2458: Get all tables in the BigQuery (@kyoshidajp)
* #2698: Make sure we return distinct data source values (@arikfr) - #2698: Make sure we return distinct data source values (@arikfr)
* #2315: Fix: pyHive type matches (@yuua) - #2315: Fix: pyHive type matches (@yuua)
* #2638: Dashboard stops rendering when adding widget with empty query (@kravets-levko) - #2638: Dashboard stops rendering when adding widget with empty query (@kravets-levko)
* #2610: Fix export query results output file name (@gabrieldutra) - #2610: Fix export query results output file name (@gabrieldutra)
* #2574: commit query result to db before evaluating alerts (@mtrbean) - #2574: commit query result to db before evaluating alerts (@mtrbean)
* #2580: add break-word wrap to add/edit text box on dashboard (@alison985) - #2580: add break-word wrap to add/edit text box on dashboard (@alison985)
* #2578: Fix connection error when you run "create_tables" (@ariarijp) - #2578: Fix connection error when you run "create_tables" (@ariarijp)
* #2572: remove extra menu line if query is archived (@alison985) - #2572: remove extra menu line if query is archived (@alison985)
* #2526: Fix pivot hide control in dashboards (@deecay) - #2526: Fix pivot hide control in dashboards (@deecay)
* #2511: Fixing signed_out.html template (@kocsmy) - #2511: Fixing signed_out.html template (@kocsmy)
* #2523: Frontend: fix boolean field with null value display as null. (@innovia) - #2523: Frontend: fix boolean field with null value display as null. (@innovia)
### Other ### Other
* #2682: Add Zeit's now support to have preview builds for every PR (@arikfr) - #2682: Add Zeit's now support to have preview builds for every PR (@arikfr)
* #2668: Upgrade bootstrap script to Redash 4.0.1 (@ariarijp) - #2668: Upgrade bootstrap script to Redash 4.0.1 (@ariarijp)
* #2639: Add tests for SpreadSheets (@ariarijp) - #2639: Add tests for SpreadSheets (@ariarijp)
* #2635: Add tests for Query Results (@ariarijp) - #2635: Add tests for Query Results (@ariarijp)
* #2537: Remove trailing semicolon (@sieben) - #2537: Remove trailing semicolon (@sieben)
## v4.0.1 - 2018-05-02 ## v4.0.1 - 2018-05-02
@@ -345,7 +902,6 @@ And much more!
- Handling whitespace characters in Query Results data source. @ariarijp - Handling whitespace characters in Query Results data source. @ariarijp
- [MySQL] Close cursor when cancellig the query. @jasonsmithj - [MySQL] Close cursor when cancellig the query. @jasonsmithj
## v3.0.0 - 2017-11-13 ## v3.0.0 - 2017-11-13
### Added ### Added
@@ -391,7 +947,7 @@ And much more!
- Salesforce: improve error messages we receive from the API. @akiray03 - Salesforce: improve error messages we receive from the API. @akiray03
- Custom JS code visualization improvements. @deecay - Custom JS code visualization improvements. @deecay
- DQL: Update version to 0.5.24. @aterreno - DQL: Update version to 0.5.24. @aterreno
- Cassandra: get_schema support for both C* 2.x and 3.x, support for SortedSet type serialization. (@mfouilleul)) - Cassandra: get_schema support for both C\* 2.x and 3.x, support for SortedSet type serialization. (@mfouilleul))
- Replace deprecated ng-annotate with babel plugin. @44px - Replace deprecated ng-annotate with babel plugin. @44px
- Update Python dependencies to recent versions. @alison985 - Update Python dependencies to recent versions. @alison985
- Bootstrap script: create /opt/redash directory only if it doesn't exist. @isomura - Bootstrap script: create /opt/redash directory only if it doesn't exist. @isomura
@@ -427,7 +983,6 @@ And much more!
This is a patch release, that adds support for Redshift ACM certificates (see #2044 for details). This is a patch release, that adds support for Redshift ACM certificates (see #2044 for details).
## v2.0.0 - 2017-08-08 ## v2.0.0 - 2017-08-08
### Added ### Added
@@ -437,7 +992,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
- Add the propertyOrder field to specify order of data source settings. @rmakulov - Add the propertyOrder field to specify order of data source settings. @rmakulov
- Add Plotly based Boxplot visualization. @deecay - Add Plotly based Boxplot visualization. @deecay
- [Presto] Add: query cancellation support. @fbertsch - [Presto] Add: query cancellation support. @fbertsch
- [MongoDB] add $oids JSON extension. - [MongoDB] add \$oids JSON extension.
- [PostgreSQL] support for loading materialized views in schema. - [PostgreSQL] support for loading materialized views in schema.
- [MySQL] Add option to hide SSL settings. - [MySQL] Add option to hide SSL settings.
- [MySQL] support for RDS MySQL and SSL. - [MySQL] support for RDS MySQL and SSL.
@@ -507,7 +1062,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
- [Google Spreadsheets] handle distant future dates. - [Google Spreadsheets] handle distant future dates.
- [SQLite] better handle utf-8 error messages. - [SQLite] better handle utf-8 error messages.
- Fix: don't remove locks for queries with task status of PENDING. - Fix: don't remove locks for queries with task status of PENDING.
- Only split columns with __/:: that end with filter/MultiFilter. - Only split columns with \_\_/:: that end with filter/MultiFilter.
- Alert notifications fail (sometime) with a SQLAlchemy error. - Alert notifications fail (sometime) with a SQLAlchemy error.
- Safeguard against empty query results when checking alert status. @danielerapati - Safeguard against empty query results when checking alert status. @danielerapati
- Delete data source doesn't work when query results referenced by queries. - Delete data source doesn't work when query results referenced by queries.
@@ -526,7 +1081,6 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
- PostgreSQL passwords with spaces were not supported. (#1056) - PostgreSQL passwords with spaces were not supported. (#1056)
- PivotTable wasn't updating after first save. - PivotTable wasn't updating after first save.
## v1.0.3 - 2017-04-18 ## v1.0.3 - 2017-04-18
### Fixed ### Fixed
@@ -573,7 +1127,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
- Fix: query embed dialog close button wasn't working @r0fls - Fix: query embed dialog close button wasn't working @r0fls
- Fix: make errors from Presto runner JSON-serializable @washort - Fix: make errors from Presto runner JSON-serializable @washort
- Fix: race condition in query task status reporting @washort - Fix: race condition in query task status reporting @washort
- Fix: remove $$hashKey from Pivot table - Fix: remove \$\$hashKey from Pivot table
- Fix: map visualization had severe performance issue. - Fix: map visualization had severe performance issue.
- Fix: pemrission dialog wasn't rendering. - Fix: pemrission dialog wasn't rendering.
- Fix: word cloud visualization didn't show column names. - Fix: word cloud visualization didn't show column names.
@@ -590,7 +1144,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
### Changed ### Changed
- [#1563](https://github.com/getredash/redash/pull/1563) Send events to webhook as JSON with a schema. - [#1563](https://github.com/getredash/redash/pull/1563) Send events to webhook as JSON with a schema.
- [#1601] [Presto] friendlier error messages. (@aslotnick) - [#1601][presto] friendlier error messages. (@aslotnick)
- Move the query runner unavailable log message to be DEBUG level instead of WARNING, as it was mainly confusing people. - Move the query runner unavailable log message to be DEBUG level instead of WARNING, as it was mainly confusing people.
- Remove "Send to Cloud" button from Plotly based visualizations. - Remove "Send to Cloud" button from Plotly based visualizations.
- Change Plotly's default hover mode to "Compare". - Change Plotly's default hover mode to "Compare".
@@ -599,7 +1153,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
### Fixed ### Fixed
- [#1564] Fix: map visualization column picker wasn't populated. (@janusd) - [#1564] Fix: map visualization column picker wasn't populated. (@janusd)
- [#1597] [SQL Server] Fix: schema wasn't loading on case sensitive servers. (@deecay) - [#1597][sql server] Fix: schema wasn't loading on case sensitive servers. (@deecay)
- Fix: dashbonard owner couldn't edit his dashboard. - Fix: dashbonard owner couldn't edit his dashboard.
- Fix: toggle_publish event wasn't logged properly. - Fix: toggle_publish event wasn't logged properly.
- Fix: events with API keys were not logged. - Fix: events with API keys were not logged.
@@ -614,7 +1168,7 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
- Fix: extra whitespace created by the filters component. - Fix: extra whitespace created by the filters component.
- Fix: query results cleanup task was trying to delete query objects. - Fix: query results cleanup task was trying to delete query objects.
- Fix: alert subscriptions were not triggered. - Fix: alert subscriptions were not triggered.
- [DynamoDB] Fix: count(*) queries were broken. (@kopanitsa)) - [DynamoDB] Fix: count(\*) queries were broken. (@kopanitsa))
- Fix: Redash is using too many database connections. - Fix: Redash is using too many database connections.
- Fix: download links were not working in dashboards. - Fix: download links were not working in dashboards.
- Fix: the first selection in multi filters was broken in dashboards. - Fix: the first selection in multi filters was broken in dashboards.
@@ -631,9 +1185,9 @@ This is a patch release, that adds support for Redshift ACM certificates (see #2
This version has two big changes behind the scenes: This version has two big changes behind the scenes:
* Refactor the frontend to use latest (at the time) Angular version (1.5) along with better frontend pipeline based on) - Refactor the frontend to use latest (at the time) Angular version (1.5) along with better frontend pipeline based on)
WebPack. WebPack.
* Refactor the backend code to use SQLAlchemy and Alembic, for easier migrations/upgrades.) - Refactor the backend code to use SQLAlchemy and Alembic, for easier migrations/upgrades.)
Along with that we have many fixes, additions, new data sources (Google Analytics, ClickHouse, Amazon Athena, Snowflake) Along with that we have many fixes, additions, new data sources (Google Analytics, ClickHouse, Amazon Athena, Snowflake)
and fixes to the existing ones (mainly ElasticSearch and Cassandra). and fixes to the existing ones (mainly ElasticSearch and Cassandra).
@@ -716,7 +1270,7 @@ We're releasing a new upgrade script -- see [here](https://redash.io/help-onprem
### Added ### Added
- 61fe16e #1374: Add: allow '*' in REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN (Allen Short) - 61fe16e #1374: Add: allow '\*' in REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN (Allen Short)
- 2f09043 #1113: Add: share modify/access permissions for queries and dashboard (whummer) - 2f09043 #1113: Add: share modify/access permissions for queries and dashboard (whummer)
- 3db0eea #1341: Add: support for specifying SAML nameid-format (zoetrope) - 3db0eea #1341: Add: support for specifying SAML nameid-format (zoetrope)
- b0ecd0e #1343: Add: support for local SAML metadata file (zoetrope) - b0ecd0e #1343: Add: support for local SAML metadata file (zoetrope)
@@ -780,7 +1334,6 @@ We're releasing a new upgrade script -- see [here](https://redash.io/help-onprem
- 5d43cbe #1198: Change: add support for Standard SQL in BigQuery query runner (mystelynx) - 5d43cbe #1198: Change: add support for Standard SQL in BigQuery query runner (mystelynx)
- 84d0c22 #1193: Change: modify the argument order of moment.add function call (Kenya Yamaguchi) - 84d0c22 #1193: Change: modify the argument order of moment.add function call (Kenya Yamaguchi)
### Fixed ### Fixed
- d6febb0 #1375: Fix: Download Dataset does not work when not logged in (Joshua Dechant) - d6febb0 #1375: Fix: Download Dataset does not work when not logged in (Joshua Dechant)
@@ -834,7 +1387,7 @@ The main features of this release are:
Also, this release includes numerous smaller features, improvements, and bug fixes. Also, this release includes numerous smaller features, improvements, and bug fixes.
A big thank you goes to all who contributed code and documentation in this release: @AntoineAugusti, @James226, @adamlwgriffiths, @alexdebrie, @anthony-coble, @ariarijp, @dheerajrav, @edwardsharp, @machira, @nabilblk, @ninneko, @ordd, @tomerben, @toru-takahashi, @vishesh92, @vorakumar and @whummer. A big thank you goes to all who contributed code and documentation in this release: @AntoineAugusti, @James226, @adamlwgriffiths, @alexdebrie, @anthony-coble, @ariarijp, @dheerajrav, @edwardsharp, @machira, @nabilblk, @ninneko, @ordd, @tomerben, @toru-takahashi, @vishesh92, @vorakumar and @whummer.
### Added ### Added
@@ -849,7 +1402,7 @@ A big thank you goes to all who contributed code and documentation in this relea
- f64622d #1089: Add support for serialising UUID type within MSSQL #961 (@James226) - f64622d #1089: Add support for serialising UUID type within MSSQL #961 (@James226)
- 857caab #1085: Feature: API to pause a data source (@arikfr) - 857caab #1085: Feature: API to pause a data source (@arikfr)
- 214aa3b #1060: Feature: support configuring user's groups with SAML (@vorakumar) - 214aa3b #1060: Feature: support configuring user's groups with SAML (@vorakumar)
- e20a005 #1007: Issue#1006: Make bottom margin editable for Chart visualization (@vorakumar) - e20a005 #1007: Issue#1006: Make bottom margin editable for Chart visualization (@vorakumar)
- 6e0dd2b #1063: Add support for date/time Y axis (@tomerben) - 6e0dd2b #1063: Add support for date/time Y axis (@tomerben)
- b5a4a6b #979: Feature: Add CLI to edit group permissions (@ninneko) - b5a4a6b #979: Feature: Add CLI to edit group permissions (@ninneko)
- 6d495d2 #1014: Add server-side parameter handling for embeds (@whummer) - 6d495d2 #1014: Add server-side parameter handling for embeds (@whummer)
@@ -895,7 +1448,7 @@ A big thank you goes to all who contributed code and documentation in this relea
- e10ecd2 #1058: Bring back filters if dashboard filters are enabled (@AntoineAugusti) - e10ecd2 #1058: Bring back filters if dashboard filters are enabled (@AntoineAugusti)
- 701035f #1059: Fix: DynamoDB having issues when setting host (@arikfr) - 701035f #1059: Fix: DynamoDB having issues when setting host (@arikfr)
- 2924d4f #1040: Small fixes to visualizations view (@arikfr) - 2924d4f #1040: Small fixes to visualizations view (@arikfr)
- fec0d5f #1037: Fix: multi filter wasn't working with __ syntax (@dheerajrav) - fec0d5f #1037: Fix: multi filter wasn't working with \_\_ syntax (@dheerajrav)
- b066ce4 #1033: Fix: only ask for notification permissions if wasn't denied (@arikfr) - b066ce4 #1033: Fix: only ask for notification permissions if wasn't denied (@arikfr)
- 960c416 #1032: Fix: make sure we return dashboards only for current org only (@arikfr) - 960c416 #1032: Fix: make sure we return dashboards only for current org only (@arikfr)
- b3844d3 #1029: Hive: close connection only if it exists (@arikfr) - b3844d3 #1029: Hive: close connection only if it exists (@arikfr)

View File

@@ -6,10 +6,9 @@ The following is a set of guidelines for contributing to Redash. These are guide
## Quick Links: ## Quick Links:
- [Feature Roadmap](https://trello.com/b/b2LUHU7A/redash-roadmap)
- [Feature Requests](https://discuss.redash.io/c/feature-requests) - [Feature Requests](https://discuss.redash.io/c/feature-requests)
- [Documentation](https://redash.io/help/) - [Documentation](https://redash.io/help/)
- [Blog](http://blog.redash.io/) - [Blog](https://blog.redash.io/)
- [Twitter](https://twitter.com/getredash) - [Twitter](https://twitter.com/getredash)
--- ---
@@ -47,8 +46,8 @@ When creating a new bug report, please make sure to:
If you would like to suggest an enhancement or ask for a new feature: If you would like to suggest an enhancement or ask for a new feature:
- Please check [the roadmap](https://trello.com/b/b2LUHU7A/redash-roadmap) for existing Trello card for what you want to suggest/ask. If there is, feel free to upvote it to signal interest or add your comments. - Please check [the forum](https://discuss.redash.io/c/feature-requests/5) for existing threads about what you want to suggest/ask. If there is, feel free to upvote it to signal interest or add your comments.
- If there is no existing card, open a thread in [the forum](https://discuss.redash.io/c/feature-requests) to start a discussion about what you want to suggest. Try to provide as much details and context as possible and include information about *the problem you want to solve* rather only *your proposed solution*. - If there is no open thread, you're welcome to start one to have a discussion about what you want to suggest. Try to provide as much details and context as possible and include information about *the problem you want to solve* rather only *your proposed solution*.
### Pull Requests ### Pull Requests
@@ -56,23 +55,23 @@ If you would like to suggest an enhancement or ask for a new feature:
- Include screenshots and animated GIFs in your pull request whenever possible. - Include screenshots and animated GIFs in your pull request whenever possible.
- Please add [documentation](#documentation) for new features or changes in functionality along with the code. - Please add [documentation](#documentation) for new features or changes in functionality along with the code.
- Please follow existing code style: - Please follow existing code style:
- Python: we use PEP8 for Python. - Python: we use [Black](https://github.com/psf/black) to auto format the code.
- Javascript: we use Airbnb's style guides for [JavaScript](https://github.com/airbnb/javascript#naming-conventions) and [React](https://github.com/airbnb/javascript/blob/master/react) (currently we don't follow Airbnb's convention for naming files, but we're gradually fixing this). To make it automatic and easy, we recommend using [Prettier](https://github.com/prettier/prettier). - Javascript: we use [Prettier](https://github.com/prettier/prettier) to auto-format the code.
### Documentation ### Documentation
The project's documentation can be found at [https://redash.io/help/](https://redash.io/help/). The [documentation sources](https://github.com/getredash/website/tree/master/website/_kb) are hosted on GitHub. To contribute edits / new pages, you can use GitHub's interface. Click the "Edit on GitHub" link on the documentation page to quickly open the edit interface. The project's documentation can be found at [https://redash.io/help/](https://redash.io/help/). The [documentation sources](https://github.com/getredash/website/tree/master/src/pages/kb) are hosted on GitHub. To contribute edits / new pages, you can use GitHub's interface. Click the "Edit on GitHub" link on the documentation page to quickly open the edit interface.
## Additional Notes ## Additional Notes
### Release Method ### Release Method
We publish a stable release every ~2 months, although the goal is to get to a stable release every month. You can see the change log on [GitHub releases page](http://github.com/getredash/redash/releases). We publish a stable release every ~3-4 months, although the goal is to get to a stable release every month.
Every build of the master branch updates the latest *RC release*. These releases are usually stable, but might contain regressions and therefore recommended for "advanced users" only. Every build of the master branch updates the *redash/redash:preview* Docker Image. These releases are usually stable, but might contain regressions and therefore recommended for "advanced users" only.
When we release a new stable release, we also update the *latest* Docker image tag, the EC2 AMIs and GCE images. When we release a new stable release, we also update the *latest* Docker image tag, the EC2 AMIs and GCE images.
## Code of Conduct ## Code of Conduct
This project adheres to the Contributor Covenant [code of conduct](http://redash.io/community/code_of_conduct). By participating, you are expected to uphold this code. Please report unacceptable behavior to team@redash.io. This project adheres to the Contributor Covenant [code of conduct](https://redash.io/community/code_of_conduct). By participating, you are expected to uphold this code. Please report unacceptable behavior to team@redash.io.

View File

@@ -1,14 +1,94 @@
FROM redash/base:latest FROM node:12 as frontend-builder
# Controls whether to build the frontend assets
ARG skip_frontend_build
ENV CYPRESS_INSTALL_BINARY=0
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
RUN useradd -m -d /frontend redash
USER redash
WORKDIR /frontend
COPY --chown=redash package.json package-lock.json /frontend/
COPY --chown=redash viz-lib /frontend/viz-lib
# Controls whether to instrument code for coverage information
ARG code_coverage
ENV BABEL_ENV=${code_coverage:+test}
RUN if [ "x$skip_frontend_build" = "x" ] ; then npm ci --unsafe-perm; fi
COPY --chown=redash client /frontend/client
COPY --chown=redash webpack.config.js /frontend/
RUN if [ "x$skip_frontend_build" = "x" ] ; then npm run build; else mkdir -p /frontend/client/dist && touch /frontend/client/dist/multi_org.html && touch /frontend/client/dist/index.html; fi
FROM python:3.7-slim
EXPOSE 5000
# Controls whether to install extra dependencies needed for all data sources.
ARG skip_ds_deps
# Controls whether to install dev dependencies.
ARG skip_dev_deps
RUN useradd --create-home redash
# Ubuntu packages
RUN apt-get update && \
apt-get install -y \
curl \
gnupg \
build-essential \
pwgen \
libffi-dev \
sudo \
git-core \
wget \
# Postgres client
libpq-dev \
# ODBC support:
g++ unixodbc-dev \
# for SAML
xmlsec1 \
# Additional packages required for data sources:
libssl-dev \
default-libmysqlclient-dev \
freetds-dev \
libsasl2-dev \
unzip \
libsasl2-modules-gssapi-mit && \
# MSSQL ODBC Driver:
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql17 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ARG databricks_odbc_driver_url=https://databricks.com/wp-content/uploads/2.6.10.1010-2/SimbaSparkODBC-2.6.10.1010-2-Debian-64bit.zip
ADD $databricks_odbc_driver_url /tmp/simba_odbc.zip
RUN unzip /tmp/simba_odbc.zip -d /tmp/ \
&& dpkg -i /tmp/SimbaSparkODBC-*/*.deb \
&& echo "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini \
&& rm /tmp/simba_odbc.zip \
&& rm -rf /tmp/SimbaSparkODBC*
WORKDIR /app
# Disalbe PIP Cache and Version Check
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
# We first copy only the requirements file, to avoid rebuilding on every file # We first copy only the requirements file, to avoid rebuilding on every file
# change. # change.
COPY requirements.txt requirements_dev.txt requirements_all_ds.txt ./ COPY requirements.txt requirements_bundles.txt requirements_dev.txt requirements_all_ds.txt ./
RUN pip install -r requirements.txt -r requirements_dev.txt -r requirements_all_ds.txt RUN if [ "x$skip_dev_deps" = "x" ] ; then pip install -r requirements.txt -r requirements_dev.txt; else pip install -r requirements.txt; fi
RUN if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi
COPY . ./ COPY . /app
RUN npm install && npm run build && rm -rf node_modules COPY --from=frontend-builder /frontend/client/dist /app/client/dist
RUN chown -R redash /app RUN chown -R redash /app
USER redash USER redash
ENTRYPOINT ["/app/bin/docker-entrypoint"] ENTRYPOINT ["/app/bin/docker-entrypoint"]
CMD ["server"] CMD ["server"]

View File

@@ -1,4 +1,4 @@
Copyright (c) 2013-2018, Arik Fraimovich. Copyright (c) 2013-2020, Arik Fraimovich.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,

57
Makefile Normal file
View File

@@ -0,0 +1,57 @@
.PHONY: compose_build up test_db create_database clean down bundle tests lint backend-unit-tests frontend-unit-tests test build watch start redis-cli bash
compose_build:
docker-compose build
up:
docker-compose up -d --build
test_db:
@for i in `seq 1 5`; do \
if (docker-compose exec postgres sh -c 'psql -U postgres -c "select 1;"' 2>&1 > /dev/null) then break; \
else echo "postgres initializing..."; sleep 5; fi \
done
docker-compose exec postgres sh -c 'psql -U postgres -c "drop database if exists tests;" && psql -U postgres -c "create database tests;"'
create_database:
docker-compose run server create_db
clean:
docker-compose down && docker-compose rm
down:
docker-compose down
bundle:
docker-compose run server bin/bundle-extensions
tests:
docker-compose run server tests
lint:
./bin/flake8_tests.sh
backend-unit-tests: up test_db
docker-compose run --rm --name tests server tests
frontend-unit-tests: bundle
CYPRESS_INSTALL_BINARY=0 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm ci
npm run bundle
npm test
test: lint backend-unit-tests frontend-unit-tests
build: bundle
npm run build
watch: bundle
npm run watch
start: bundle
npm run start
redis-cli:
docker-compose run --rm redis redis-cli -h redis
bash:
docker-compose run --rm server bash

View File

@@ -1,45 +1,92 @@
<p align="center"> <p align="center">
<img title="Redash" src='https://redash.io/assets/images/logo.png' width="200px"/> <img title="Redash" src='https://redash.io/assets/images/logo.png' width="200px"/>
</p> </p>
<p align="center">
<img title="Build Status" src='https://circleci.com/gh/getredash/redash.png?circle-token=8a695aa5ec2cbfa89b48c275aea298318016f040'/>
</p>
[![Documentation](https://img.shields.io/badge/docs-redash.io/help-brightgreen.svg)](https://redash.io/help/) [![Documentation](https://img.shields.io/badge/docs-redash.io/help-brightgreen.svg)](https://redash.io/help/)
[![Datree](https://s3.amazonaws.com/catalog.static.datree.io/datree-badge-20px.svg)](https://datree.io/?src=badge)
[![Build Status](https://circleci.com/gh/getredash/redash.png?style=shield&circle-token=8a695aa5ec2cbfa89b48c275aea298318016f040)](https://circleci.com/gh/getredash/redash/tree/master)
**_Redash_** is our take on freeing the data within our company in a way that will better fit our culture and usage patterns. Redash is designed to enable anyone, regardless of the level of technical sophistication, to harness the power of data big and small. SQL users leverage Redash to explore, query, visualize, and share data from any data sources. Their work in turn enables anybody in their organization to use the data. Every day, millions of users at thousands of organizations around the world use Redash to develop insights and make data-driven decisions.
Prior to **_Redash_**, we tried to use traditional BI suites and discovered a set of bloated, technically challenged and slow tools/flows. What we were looking for was a more hacker'ish way to look at data, so we built one. Redash features:
**_Redash_** was built to allow fast and easy access to billions of records, that we process and collect using Amazon Redshift ("petabyte scale data warehouse" that "speaks" PostgreSQL). 1. **Browser-based**: Everything in your browser, with a shareable URL.
Today **_Redash_** has support for querying multiple databases, including: Redshift, Google BigQuery, PostgreSQL, MySQL, Graphite, Presto, Google Spreadsheets, Cloudera Impala, Hive and custom scripts. 2. **Ease-of-use**: Become immediately productive with data without the need to master complex software.
3. **Query editor**: Quickly compose SQL and NoSQL queries with a schema browser and auto-complete.
**_Redash_** consists of two parts: 4. **Visualization and dashboards**: Create [beautiful visualizations](https://redash.io/help/user-guide/visualizations/visualization-types) with drag and drop, and combine them into a single dashboard.
5. **Sharing**: Collaborate easily by sharing visualizations and their associated queries, enabling peer review of reports and queries.
1. **Query Editor**: think of [JS Fiddle](http://jsfiddle.net) for SQL queries. It's your way to share data in the organization in an open way, by sharing both the dataset and the query that generated it. This way everyone can peer review not only the resulting dataset but also the process that generated it. Also it's possible to fork it and generate new datasets and reach new insights. 6. **Schedule refreshes**: Automatically update your charts and dashboards at regular intervals you define.
2. **Visualizations and Dashboards**: once you have a dataset, you can create different visualizations out of it, and then combine several visualizations into a single dashboard. Currently Redash supports charts, pivot table, cohorts and [more](https://redash.io/help/user-guide/visualizations/visualization-types). 7. **Alerts**: Define conditions and be alerted instantly when your data changes.
8. **REST API**: Everything that can be done in the UI is also available through REST API.
9. **Broad support for data sources**: Extensible data source API with native support for a long list of common databases and platforms.
<img src="https://raw.githubusercontent.com/getredash/website/8e820cd02c73a8ddf4f946a9d293c54fd3fb08b9/website/_assets/images/redash-anim.gif" width="80%"/> <img src="https://raw.githubusercontent.com/getredash/website/8e820cd02c73a8ddf4f946a9d293c54fd3fb08b9/website/_assets/images/redash-anim.gif" width="80%"/>
## Getting Started ## Getting Started
* [Setting up Redash instance](https://redash.io/help/open-source/setup) (includes links to ready made AWS/GCE images). * [Setting up Redash instance](https://redash.io/help/open-source/setup) (includes links to ready-made AWS/GCE images).
* [Documentation](https://redash.io/help/). * [Documentation](https://redash.io/help/).
## Supported Data Sources ## Supported Data Sources
Redash supports more than 25 [data sources](https://redash.io/help/data-sources/supported-data-sources). Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help/data-sources/supported-data-sources). It can also be extended to support more. Below is a list of built-in sources:
- Amazon Athena
- Amazon DynamoDB
- Amazon Redshift
- Axibase Time Series Database
- Cassandra
- ClickHouse
- CockroachDB
- CSV
- Databricks (Apache Spark)
- DB2 by IBM
- Druid
- Elasticsearch
- Google Analytics
- Google BigQuery
- Google Spreadsheets
- Graphite
- Greenplum
- Hive
- Impala
- InfluxDB
- JIRA
- JSON
- Apache Kylin
- OmniSciDB (Formerly MapD)
- MemSQL
- Microsoft Azure Data Warehouse / Synapse
- Microsoft Azure SQL Database
- Microsoft SQL Server
- MongoDB
- MySQL
- Oracle
- PostgreSQL
- Presto
- Prometheus
- Python
- Qubole
- Rockset
- Salesforce
- ScyllaDB
- Shell Scripts
- Snowflake
- SQLite
- TreasureData
- Vertica
- Yandex AppMetrrica
- Yandex Metrica
## Getting Help ## Getting Help
* Issues: https://github.com/getredash/redash/issues * Issues: https://github.com/getredash/redash/issues
* Discussion Forum: https://discuss.redash.io/ * Discussion Forum: https://discuss.redash.io/
* Slack: http://slack.redash.io/
## Reporting Bugs and Contributing Code ## Reporting Bugs and Contributing Code
* Want to report a bug or request a feature? Please open [an issue](https://github.com/getredash/redash/issues/new). * Want to report a bug or request a feature? Please open [an issue](https://github.com/getredash/redash/issues/new).
* Want to help us build **_Redash_**? Fork the project, edit in a [dev environment](https://redash.io/help-onpremise/dev/guide.html), and make a pull request. We need all the help we can get! * Want to help us build **_Redash_**? Fork the project, edit in a [dev environment](https://redash.io/help-onpremise/dev/guide.html) and make a pull request. We need all the help we can get!
## Security ## Security

5
SECURITY.md Normal file
View File

@@ -0,0 +1,5 @@
# Security Policy
## Reporting a Vulnerability
Please email security@redash.io to report any security vulnerabilities. We will acknowledge receipt of your vulnerability and strive to send you regular updates about our progress. If you're curious about the status of your disclosure please feel free to email us again. If you want to encrypt your disclosure email, you can use [this PGP key](https://keybase.io/arikfr/key.asc).

115
bin/bundle-extensions Executable file
View File

@@ -0,0 +1,115 @@
#!/usr/bin/env python3
"""Copy bundle extension files to the client/app/extension directory"""
import logging
import os
from pathlib import Path
from shutil import copy
from collections import OrderedDict as odict
import importlib_metadata
import importlib_resources
# Name of the subdirectory
BUNDLE_DIRECTORY = "bundle"
logger = logging.getLogger(__name__)
# Make a directory for extensions and set it as an environment variable
# to be picked up by webpack.
extensions_relative_path = Path("client", "app", "extensions")
extensions_directory = Path(__file__).parent.parent / extensions_relative_path
if not extensions_directory.exists():
extensions_directory.mkdir()
os.environ["EXTENSIONS_DIRECTORY"] = str(extensions_relative_path)
def entry_point_module(entry_point):
"""Returns the dotted module path for the given entry point"""
return entry_point.pattern.match(entry_point.value).group("module")
def load_bundles():
""""Load bundles as defined in Redash extensions.
The bundle entry point can be defined as a dotted path to a module
or a callable, but it won't be called but just used as a means
to find the files under its file system path.
The name of the directory it looks for files in is "bundle".
So a Python package with an extension bundle could look like this::
my_extensions/
├── __init__.py
└── wide_footer
├── __init__.py
└── bundle
├── extension.js
└── styles.css
and would then need to register the bundle with an entry point
under the "redash.bundles" group, e.g. in your setup.py::
setup(
# ...
entry_points={
"redash.bundles": [
"wide_footer = my_extensions.wide_footer",
]
# ...
},
# ...
)
"""
bundles = odict()
for entry_point in importlib_metadata.entry_points().get("redash.bundles", []):
logger.info('Loading Redash bundle "%s".', entry_point.name)
module = entry_point_module(entry_point)
# Try to get a list of bundle files
try:
bundle_dir = importlib_resources.files(module).joinpath(BUNDLE_DIRECTORY)
except (ImportError, TypeError):
# Module isn't a package, so can't have a subdirectory/-package
logger.error(
'Redash bundle module "%s" could not be imported: "%s"',
entry_point.name,
module,
)
continue
if not bundle_dir.is_dir():
logger.error(
'Redash bundle directory "%s" could not be found or is not a directory: "%s"',
entry_point.name,
bundle_dir,
)
continue
bundles[entry_point.name] = list(bundle_dir.rglob("*"))
return bundles
bundles = load_bundles().items()
if bundles:
print("Number of extension bundles found: {}".format(len(bundles)))
else:
print("No extension bundles found.")
for bundle_name, paths in bundles:
# Shortcut in case not paths were found for the bundle
if not paths:
print('No paths found for bundle "{}".'.format(bundle_name))
continue
# The destination for the bundle files with the entry point name as the subdirectory
destination = Path(extensions_directory, bundle_name)
if not destination.exists():
destination.mkdir()
# Copy the bundle directory from the module to its destination.
print('Copying "{}" bundle to {}:'.format(bundle_name, destination.resolve()))
for src_path in paths:
dest_path = destination / src_path.name
print(" - {} -> {}".format(src_path, dest_path))
copy(str(src_path), str(dest_path))

View File

@@ -1,25 +1,38 @@
#!/bin/bash #!/bin/bash
set -e set -e
worker() { scheduler() {
WORKERS_COUNT=${WORKERS_COUNT:-2} echo "Starting RQ scheduler..."
QUEUES=${QUEUES:-queries,scheduled_queries,celery}
echo "Starting $WORKERS_COUNT workers for queues: $QUEUES..." exec /app/manage.py rq scheduler
exec /usr/local/bin/celery worker --app=redash.worker -c$WORKERS_COUNT -Q$QUEUES -linfo --maxtasksperchild=10 -Ofair
} }
scheduler() { dev_scheduler() {
WORKERS_COUNT=${WORKERS_COUNT:-1} echo "Starting dev RQ scheduler..."
QUEUES=${QUEUES:-celery}
echo "Starting scheduler and $WORKERS_COUNT workers for queues: $QUEUES..." exec watchmedo auto-restart --directory=./redash/ --pattern=*.py --recursive -- ./manage.py rq scheduler
}
exec /usr/local/bin/celery worker --app=redash.worker --beat -c$WORKERS_COUNT -Q$QUEUES -linfo --maxtasksperchild=10 -Ofair worker() {
echo "Starting RQ worker..."
export WORKERS_COUNT=${WORKERS_COUNT:-2}
export QUEUES=${QUEUES:-}
exec supervisord -c worker.conf
}
dev_worker() {
echo "Starting dev RQ worker..."
exec watchmedo auto-restart --directory=./redash/ --pattern=*.py --recursive -- ./manage.py rq worker $QUEUES
} }
server() { server() {
exec /usr/local/bin/gunicorn -b 0.0.0.0:5000 --name redash -w${REDASH_WEB_WORKERS:-4} redash.wsgi:app # Recycle gunicorn workers every n-th request. See http://docs.gunicorn.org/en/stable/settings.html#max-requests for more details.
MAX_REQUESTS=${MAX_REQUESTS:-1000}
MAX_REQUESTS_JITTER=${MAX_REQUESTS_JITTER:-100}
exec /usr/local/bin/gunicorn -b 0.0.0.0:5000 --name redash -w${REDASH_WEB_WORKERS:-4} redash.wsgi:app --max-requests $MAX_REQUESTS --max-requests-jitter $MAX_REQUESTS_JITTER
} }
create_db() { create_db() {
@@ -33,11 +46,14 @@ help() {
echo "" echo ""
echo "server -- start Redash server (with gunicorn)" echo "server -- start Redash server (with gunicorn)"
echo "worker -- start Celery worker" echo "worker -- start a single RQ worker"
echo "scheduler -- start Celery worker with a beat (scheduler) process" echo "dev_worker -- start a single RQ worker with code reloading"
echo "scheduler -- start an rq-scheduler instance"
echo "dev_scheduler -- start an rq-scheduler instance with code reloading"
echo "" echo ""
echo "shell -- open shell" echo "shell -- open shell"
echo "dev_server -- start Flask development server with debugger and auto reload" echo "dev_server -- start Flask development server with debugger and auto reload"
echo "debug -- start Flask development server with remote debugger via ptvsd"
echo "create_db -- create database tables" echo "create_db -- create database tables"
echo "manage -- CLI to manage redash" echo "manage -- CLI to manage redash"
echo "tests -- run tests" echo "tests -- run tests"
@@ -67,10 +83,27 @@ case "$1" in
shift shift
scheduler scheduler
;; ;;
dev_scheduler)
shift
dev_scheduler
;;
dev_worker)
shift
dev_worker
;;
celery_healthcheck)
shift
echo "DEPRECATED: Celery has been replaced with RQ and now performs healthchecks autonomously as part of the 'worker' entrypoint."
;;
dev_server) dev_server)
export FLASK_DEBUG=1 export FLASK_DEBUG=1
exec /app/manage.py runserver --debugger --reload -h 0.0.0.0 exec /app/manage.py runserver --debugger --reload -h 0.0.0.0
;; ;;
debug)
export FLASK_DEBUG=1
export REMOTE_DEBUG=1
exec /app/manage.py runserver --debugger --no-reload -h 0.0.0.0
;;
shell) shell)
exec /app/manage.py shell exec /app/manage.py shell
;; ;;
@@ -93,4 +126,3 @@ case "$1" in
exec "$@" exec "$@"
;; ;;
esac esac

9
bin/flake8_tests.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
set -o errexit # fail the build if any task fails
flake8 --version ; pip --version
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

View File

@@ -1,8 +1,10 @@
#!/bin/env python #!/bin/env python3
import sys import sys
import re import re
import subprocess import subprocess
def get_change_log(previous_sha): def get_change_log(previous_sha):
args = ['git', '--no-pager', 'log', '--merges', '--grep', 'Merge pull request', '--pretty=format:"%h|%s|%b|%p"', 'master...{}'.format(previous_sha)] args = ['git', '--no-pager', 'log', '--merges', '--grep', 'Merge pull request', '--pretty=format:"%h|%s|%b|%p"', 'master...{}'.format(previous_sha)]
log = subprocess.check_output(args) log = subprocess.check_output(args)
@@ -32,4 +34,4 @@ if __name__ == '__main__':
changes = get_change_log(previous_sha) changes = get_change_log(previous_sha)
for change in changes: for change in changes:
print change print(change)

View File

@@ -1,8 +0,0 @@
#!/bin/bash
NAME=redash
VERSION=$(python ./manage.py version)
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM
FILENAME=$NAME.$FULL_VERSION.tar.gz
sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py
tar -zcv -f $FILENAME --exclude="optipng*" --exclude=".git*" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" --exclude="node_modules" *

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
# Heroku pre_compile script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd $DIR/..
# heroku requires cffi to be in requirements.txt in order for libffi to be installed.
# https://github.com/heroku/heroku-buildpack-python/blob/master/bin/steps/cryptography
# to avoid making it a requirement for other build systems, we'll inject it now
# into the requirements.txt file
# Remove Heroku unsupported Python packages:
grep -v -E "^(pymssql|thrift|sasl|pyhive)" requirements_all_ds.txt >> requirements.txt
# make the heroku Procfile the active one
cp Procfile.heroku Procfile
popd

View File

@@ -1,10 +1,10 @@
from __future__ import print_function #!/usr/bin/env python3
import os import os
import sys import sys
import json
import re import re
import subprocess import subprocess
import requests import requests
import simplejson
github_token = os.environ['GITHUB_TOKEN'] github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic') auth = (github_token, 'x-oauth-basic')
@@ -17,7 +17,7 @@ def _github_request(method, path, params=None, headers={}):
url = path url = path
if params is not None: if params is not None:
params = json.dumps(params) params = simplejson.dumps(params)
response = requests.request(method, url, data=params, auth=auth) response = requests.request(method, url, data=params, auth=auth)
return response return response

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import urllib import urllib
import argparse import argparse
import os import os
@@ -27,7 +27,7 @@ def run(cmd, cwd=None):
def confirm(question): def confirm(question):
reply = str(raw_input(question + ' (y/n): ')).lower().strip() reply = str(input(question + ' (y/n): ')).lower().strip()
if reply[0] == 'y': if reply[0] == 'y':
return True return True

View File

@@ -1,10 +1,29 @@
{ {
"presets": ["env", "react", "stage-2"], "presets": [
[
"@babel/preset-env",
{
"exclude": ["@babel/plugin-transform-async-to-generator", "@babel/plugin-transform-arrow-functions"],
"corejs": "2",
"useBuiltIns": "usage"
}
],
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [ "plugins": [
"angularjs-annotate", "@babel/plugin-proposal-class-properties",
"transform-object-assign", "@babel/plugin-transform-object-assign",
["babel-plugin-transform-builtin-extend", { [
"globals": ["Error"] "babel-plugin-transform-builtin-extend",
}] {
] "globals": ["Error"]
}
]
],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
} }

View File

@@ -1,3 +1,4 @@
build/*.js build/*.js
dist
config/*.js config/*.js
node_modules client/dist

View File

@@ -1,41 +1,57 @@
module.exports = { module.exports = {
root: true, root: true,
extends: "airbnb", parser: "@typescript-eslint/parser",
extends: [
"react-app",
"plugin:compat/recommended",
"prettier",
// Remove any typescript-eslint rules that would conflict with prettier
"prettier/@typescript-eslint",
],
plugins: ["jest", "compat", "no-only-tests", "@typescript-eslint"],
settings: { settings: {
"import/resolver": "webpack" "import/resolver": "webpack",
}, },
parser: "babel-eslint",
env: { env: {
"browser": true, browser: true,
"node": true node: true,
}, },
rules: { rules: {
// allow debugger during development // allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, "no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
'no-param-reassign': 0,
'no-mixed-operators': 0,
'no-underscore-dangle': 0,
"prefer-destructuring": "off",
"prefer-template": "off",
"no-restricted-properties": "off",
"no-restricted-globals": "off",
"no-multi-assign": "off",
"no-lonely-if": "off",
"consistent-return": "off",
"no-control-regex": "off",
"react/jsx-filename-extension": "off",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/prefer-stateless-function": "warn",
"react/forbid-prop-types": "warn",
"react/prop-types": "warn",
"jsx-a11y/anchor-is-valid": "off", "jsx-a11y/anchor-is-valid": "off",
"max-len": ['error', 120, 2, { "no-restricted-imports": [
ignoreUrls: true, "error",
ignoreComments: false, {
ignoreRegExpLiterals: true, paths: [
ignoreStrings: true, {
ignoreTemplateLiterals: true, name: "antd",
}] message: "Please use 'import XXX from antd/lib/XXX' import instead.",
} },
{
name: "antd/lib",
message: "Please use 'import XXX from antd/lib/XXX' import instead.",
},
],
},
],
},
overrides: [
{
// Only run typescript-eslint on TS files
files: ["*.ts", "*.tsx", ".*.ts", ".*.tsx"],
extends: ["plugin:@typescript-eslint/recommended"],
rules: {
// Do not require functions (especially react components) to have explicit returns
"@typescript-eslint/explicit-function-return-type": "off",
// Do not require to type every import from a JS file to speed up development
"@typescript-eslint/no-explicit-any": "off",
// Do not complain about useless contructors in declaration files
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error",
// Many API fields and generated types use camelcase
"@typescript-eslint/camelcase": "off",
},
},
],
}; };

10
client/app/.eslintrc.js Normal file
View File

@@ -0,0 +1,10 @@
module.exports = {
extends: ["plugin:jest/recommended"],
plugins: ["jest"],
env: {
"jest/globals": true,
},
rules: {
"jest/no-focused-tests": "off",
},
};

View File

@@ -0,0 +1,4 @@
import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
configure({ adapter: new Adapter() });

View File

@@ -0,0 +1,5 @@
import MockDate from "mockdate";
const date = new Date("2000-01-01T02:00:00.000");
MockDate.set(date);

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,13 @@
<svg width="274" height="199" viewBox="0 0 274 199" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.5" d="M57.9111 49.2668L202.769 30" stroke="#F2F2F2" stroke-width="59" stroke-linecap="round"/>
<path opacity="0.5" d="M39.2842 92.7371L244.24 64.886" stroke="#F2F2F2" stroke-width="59" stroke-linecap="round"/>
<path opacity="0.5" d="M30 136.299L232.813 107.734" stroke="#F2F2F2" stroke-width="59" stroke-linecap="round"/>
<path opacity="0.5" d="M86.4541 169.149L234.166 150.596" stroke="#F2F2F2" stroke-width="59" stroke-linecap="round"/>
<path d="M167.829 69.1349H96.458L117.605 51.9531H183.028L167.829 69.1349Z" fill="#C0D5FF"/>
<path d="M171.133 70.4566H92.4933V85.6559V143.149H171.133V70.4566Z" fill="#E8F4FF"/>
<path d="M190.298 48.6489L171.133 70.4566L186.993 94.9076L192.28 89.9514L206.818 73.7608L190.298 48.6489Z" fill="#E8F4FF"/>
<path d="M171.133 70.4566V143.149L192.28 118.037V89.9514L186.993 94.9076L171.133 70.4566Z" fill="#E8F4FF"/>
<path d="M92.4933 70.4566L81.9199 89.9514L92.4933 85.6559V70.4566Z" fill="#E8F4FF"/>
<path d="M92.4933 70.4566H171.133M92.4933 70.4566L118.927 48.6489H190.298M92.4933 70.4566L81.9199 89.9514L92.4933 85.6559M92.4933 70.4566V85.6559M171.133 70.4566V143.149M171.133 70.4566L190.298 48.6489M171.133 70.4566L186.993 94.9076L192.28 89.9514M171.133 143.149H92.4933V85.6559M171.133 143.149L192.28 118.037V89.9514M190.298 48.6489L206.818 73.7608L192.28 89.9514" stroke="black" stroke-width="3" stroke-linejoin="round"/>
<path d="M117.605 89.6208H147.343" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,414 @@
@import "~antd/lib/style/core/iconfont";
@import "~antd/lib/style/core/motion";
@import "~antd/lib/alert/style/index";
@import "~antd/lib/input/style/index";
@import "~antd/lib/input-number/style/index";
@import "~antd/lib/date-picker/style/index";
@import "~antd/lib/modal/style/index";
@import "~antd/lib/tooltip/style/index";
@import "~antd/lib/select/style/index";
@import "~antd/lib/checkbox/style/index";
@import "~antd/lib/upload/style/index";
@import "~antd/lib/form/style/index";
@import "~antd/lib/button/style/index";
@import "~antd/lib/radio/style/index";
@import "~antd/lib/time-picker/style/index";
@import "~antd/lib/pagination/style/index";
@import "~antd/lib/table/style/index";
@import "~antd/lib/popover/style/index";
@import "~antd/lib/tag/style/index";
@import "~antd/lib/grid/style/index";
@import "~antd/lib/switch/style/index";
@import "~antd/lib/empty/style/index";
@import "~antd/lib/drawer/style/index";
@import "~antd/lib/card/style/index";
@import "~antd/lib/steps/style/index";
@import "~antd/lib/divider/style/index";
@import "~antd/lib/dropdown/style/index";
@import "~antd/lib/menu/style/index";
@import "~antd/lib/list/style/index";
@import "~antd/lib/badge/style/index";
@import "~antd/lib/card/style/index";
@import "~antd/lib/spin/style/index";
@import "~antd/lib/skeleton/style/index";
@import "~antd/lib/tabs/style/index";
@import "~antd/lib/notification/style/index";
@import "~antd/lib/collapse/style/index";
@import "~antd/lib/progress/style/index";
@import "~antd/lib/typography/style/index";
@import "~antd/lib/descriptions/style/index";
@import "inc/ant-variables";
// Increase z-indexes to avoid conflicts with some other libraries (e.g. Plotly)
@zindex-modal: 2000;
@zindex-modal-mask: 2000;
@zindex-message: 2010;
@zindex-notification: 2010;
@zindex-popover: 2030;
@zindex-dropdown: 2050;
@zindex-picker: 2050;
@zindex-tooltip: 2060;
@item-hover-bg: #e5f8ff;
.@{drawer-prefix-cls} {
&.help-drawer {
z-index: @zindex-tooltip; // help drawer should be topmost
}
}
// Remove bold in labels for Ant checkboxes and radio buttons
.ant-checkbox-wrapper,
.ant-radio-wrapper {
font-weight: normal;
}
.ant-select-dropdown-menu-item em {
color: @input-color-placeholder;
font-size: 11px;
}
// Fix for disabled button styles inside Tooltip component.
// Tooltip wraps disabled buttons with `<span>` and moves all styles
// and classes to that `<span>`. This resets all button styles and
// turns it into simple inline element (because now it's wrapper is a button)
.btn {
button[disabled] {
-moz-appearance: none !important;
-webkit-appearance: none !important;
appearance: none !important;
border: 0 !important;
outline: none !important;
background: transparent !important;
margin: 0 !important;
padding: 0 !important;
}
}
// Button overrides
.@{btn-prefix-cls} {
transition-duration: 150ms;
&.icon-button {
width: 32px;
padding: 0 10px;
}
}
// Fix ant input number showing duplicate arrows
.ant-input-number-input::-webkit-outer-spin-button,
.ant-input-number-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
// Pagination overrides (based on existing Bootstrap overrides)
.@{pagination-prefix-cls} {
display: inline-block;
margin-top: 18px;
margin-bottom: 18px;
vertical-align: top;
&-item {
background-color: @pagination-bg;
border-color: transparent;
color: @pagination-color;
font-size: 14px;
margin-right: 5px;
a {
color: inherit;
}
&:focus,
&:hover {
background-color: @pagination-hover-bg;
border-color: transparent;
color: @pagination-hover-color;
a {
color: inherit;
}
}
&-active {
&,
&:hover,
&:focus {
background-color: @pagination-active-bg;
color: @pagination-active-color;
border-color: transparent;
pointer-events: none;
cursor: default;
a {
color: inherit;
}
}
}
}
&-disabled {
&,
&:hover,
&:focus {
opacity: 0.5;
pointer-events: none;
}
}
&-prev,
&-next {
.@{pagination-prefix-cls}-item-link {
background-color: @pagination-bg;
border-color: transparent;
color: @pagination-color;
line-height: @pagination-item-size - 2px;
.@{pagination-prefix-cls}.mini & {
line-height: @pagination-item-size-sm - 2px;
}
}
&:focus .@{pagination-prefix-cls}-item-link,
&:hover .@{pagination-prefix-cls}-item-link {
background-color: @pagination-hover-bg;
border-color: transparent;
color: @pagination-hover-color;
}
}
&-prev,
&-jump-prev,
&-jump-next {
margin-right: 5px;
}
&-jump-prev,
&-jump-next {
.@{pagination-prefix-cls}-item-container {
.@{pagination-prefix-cls}-item-link-icon {
color: @pagination-color;
}
}
}
}
// Table
.@{table-prefix-cls} {
color: inherit;
tr,
th,
td {
transition: none !important;
}
&-thead > tr > th {
padding: @table-padding-vertical * 2 @table-padding-horizontal;
}
.@{table-prefix-cls}-column-sorters {
&:before,
&:hover:before {
content: none;
}
}
&-thead > tr > th {
.@{table-prefix-cls}-column-sorter {
&-up,
&-down {
&.on {
color: @table-header-icon-active-color;
}
}
}
}
// Custom styles
&-headerless &-tbody > tr:first-child > td {
border-top: @border-width-base @border-style-base @border-color-split;
}
}
// List
.@{list-prefix-cls} {
&-item {
// custom rule
&.selected {
background-color: #f6f8f9;
}
&.disabled {
background-color: fade(#f6f8f9, 40%);
& > * {
opacity: 0.4;
}
}
}
}
.@{dialog-prefix-cls} {
// styling for short modals (no lines)
&.shortModal {
.@{dialog-prefix-cls} {
&-header,
&-footer {
border: none;
padding: 16px;
}
&-body {
padding: 10px 16px;
}
&-close-x {
width: 46px;
height: 46px;
line-height: 46px;
}
}
}
// fullscreen modals
&-fullscreen {
.@{dialog-prefix-cls} {
position: absolute;
left: 15px;
top: 15px;
right: 15px;
bottom: 15px;
width: auto !important;
height: auto !important;
max-width: none;
max-height: none;
margin: 0;
padding: 0;
.@{dialog-prefix-cls}-content {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
width: auto;
height: auto;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
}
.@{dialog-prefix-cls}-body {
flex: 1 1 auto;
overflow: auto;
}
}
}
}
// description in modal header
.modal-header-desc {
font-size: @font-size-base;
color: @text-color-secondary;
font-weight: normal;
margin-top: 4px;
}
// Notification overrides
.@{notification-prefix-cls} {
// vertical centering
&-notice-close {
top: 20px;
right: 20px;
}
&-notice-description {
max-width: 484px;
}
}
.@{btn-prefix-cls} .@{iconfont-css-prefix}-ellipsis {
margin: 0 -7px 0 -8px;
}
// Collapse
.@{collapse-prefix-cls} {
&&-headerless {
border: 0;
background: none;
.@{collapse-prefix-cls}-header {
display: none;
}
.@{collapse-prefix-cls}-item,
.@{collapse-prefix-cls}-content {
border: 0;
}
.@{collapse-prefix-cls}-content-box {
padding: 0;
}
}
}
// overrides for tall form components such as ace editor
.@{form-prefix-cls}-item {
&-children {
display: block; // so feeback icon positions correctly
}
// no change for short components, sticks to body for tall ones
&-children-icon {
top: auto !important;
bottom: 8px;
// makes the icon white instead of see-through
& svg {
background: white;
border-radius: 50%;
}
}
// for form items that contain text
&.form-item-line-height-normal .@{form-prefix-cls}-item-control {
line-height: 20px;
margin-top: 9px;
}
}
.@{menu-prefix-cls} {
// invert stripe position with class .invert-stripe-position
&-inline.invert-stripe-position {
.@{menu-prefix-cls}-item {
&::after {
right: auto;
left: 0;
}
}
}
}
// overrides for checkbox
@checkbox-prefix-cls: ~"@{ant-prefix}-checkbox";
.@{checkbox-prefix-cls}-wrapper + span,
.@{checkbox-prefix-cls} + span {
padding-right: 0;
}
// make sure Multiple select has room for icons
.@{select-prefix-cls}-multiple {
&.@{select-prefix-cls}-show-arrow,
&.@{select-prefix-cls}-show-search,
&.@{select-prefix-cls}-loading {
.@{select-prefix-cls}-selector {
padding-right: 30px;
}
}
}

View File

@@ -1,7 +1,25 @@
.ace_editor { .ace_editor {
border: 1px solid #eee; border: 1px solid fade(@redash-gray, 15%);
height: 100%; height: 100%;
margin-bottom: 10px; margin-bottom: 10px;
&.ace_autocomplete .ace_completion-highlight {
text-shadow: none !important;
background: #ffff005e;
font-weight: 600;
}
&.ace-tm {
.ace_gutter {
background: #fff !important;
}
.ace_gutter-active-line {
background-color: fade(@redash-gray, 20%) !important;
}
.ace_marker-layer .ace_active-line {
background: fade(@redash-gray, 9%) !important;
}
}
} }

View File

@@ -1,45 +1,49 @@
.alert { .alert-page h3 {
padding-left: 30px; flex-grow: 1;
padding-right: 30px;
input {
span { margin: -0.2em 0;
cursor: pointer; width: 100%;
} min-width: 170px;
}
} }
.alert-dismissable, .btn-create-alert[disabled] {
.alert-dismissible { display: block;
padding-right: 44px; margin-top: -20px;
}
.alert-inverse {
.alert-variant(@alert-inverse-bg; @alert-inverse-border; @alert-inverse-text);
} }
.alert-link { .alert-state {
color: #fff !important; border-bottom: 1px solid @input-border;
font-weight: normal !important; padding-bottom: 30px;
text-decoration: underline;
.alert-state-indicator {
text-transform: uppercase;
font-size: 14px;
padding: 5px 8px;
}
.ant-form-item-explain {
margin-top: 10px;
}
.alert-last-triggered {
color: @headings-color;
}
} }
.growl-animated { .alert-query-selector {
&.alert-inverse { min-width: 250px;
box-shadow: 0 0 5px fade(@alert-inverse-bg, 50%); width: auto !important;
} }
&.alert-info { // allow form item labels to gracefully break line
box-shadow: 0 0 5px fade(@alert-info-bg, 50%); .alert-form-item label {
} white-space: initial;
padding-right: 8px;
&.alert-success { line-height: 21px;
box-shadow: 0 0 5px fade(@alert-success-bg, 50%);
} &::after {
margin-right: 0 !important;
&.alert-warning { }
box-shadow: 0 0 5px fade(@alert-warning-bg, 50%);
}
&.alert-danger {
box-shadow: 0 0 5px fade(@alert-danger-bg, 50%);
}
} }

View File

@@ -1,8 +0,0 @@
a[ng-click] {
cursor: pointer;
}
/* Immediately apply ng-cloak, instead of waiting for angular.js to load: */
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}

View File

@@ -0,0 +1,76 @@
/* --------------------------------------------------------
Colors
-----------------------------------------------------------*/
@lightblue: #03a9f4;
@primary-color: #2196f3;
@redash-gray: rgba(102, 136, 153, 1);
@redash-orange: rgba(255, 120, 100, 1);
@redash-black: rgba(0, 0, 0, 1);
@redash-yellow: rgba(252, 252, 161, 0.75);
/* --------------------------------------------------------
Font
-----------------------------------------------------------*/
@redash-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
sans-serif;
@font-family-no-number: @redash-font;
@font-family: @redash-font;
@code-family: @redash-font;
@font-size-base: 13px;
/* --------------------------------------------------------
Borders
-----------------------------------------------------------*/
@border-color-split: #f0f0f0;
/* --------------------------------------------------------
Typograpgy
-----------------------------------------------------------*/
@text-color: #595959;
/* --------------------------------------------------------
Form
-----------------------------------------------------------*/
@input-height-base: 35px;
@input-color: #595959;
@input-color-placeholder: #b4b4b4;
@border-radius-base: 2px;
@border-color-base: #e8e8e8;
/* --------------------------------------------------------
Pagination
-----------------------------------------------------------*/
@pagination-item-size: 33px;
@pagination-font-family: @redash-font;
@pagination-font-weight-active: normal;
@pagination-bg: fade(@redash-gray, 15%);
@pagination-color: #7e7e7e;
@pagination-active-bg: @lightblue;
@pagination-active-color: #fff;
@pagination-disabled-bg: fade(@redash-gray, 15%);
@pagination-hover-color: #333;
@pagination-hover-bg: fade(@redash-gray, 25%);
/* --------------------------------------------------------
Table
-----------------------------------------------------------*/
@table-border-radius-base: 0;
@table-header-color: #333;
@table-header-bg: fade(@redash-gray, 3%);
@table-header-icon-color: fade(@text-color, 20%);
@table-header-icon-active-color: @text-color;
@table-header-sort-bg: @table-header-bg;
@table-header-sort-active-bg: @table-header-bg;
@table-header-filter-active-bg: @table-header-bg;
@table-body-sort-bg: transparent;
@table-row-hover-bg: fade(@redash-gray, 5%);
@table-padding-vertical: 7px;
@table-padding-horizontal: 10px;
/* --------------------------------------------------------
Notification
-----------------------------------------------------------*/
@notification-padding: @notification-padding-vertical 48px @notification-padding-vertical 17px;
@notification-width: auto;

View File

@@ -1,88 +1,227 @@
*, button, input, i, a { *,
-webkit-font-smoothing: antialiased; button,
input,
i,
a {
-webkit-font-smoothing: antialiased;
} }
*, *,
*:active, *:active,
*:hover { *:hover {
outline: none !important; outline: none !important;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important; -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
} }
html { html {
overflow-x: ~"hidden\0/"; overflow-x: ~"hidden\0/";
-ms-overflow-style: auto; -ms-overflow-style: auto;
} }
html, body { html,
min-height: 100vh; body {
min-height: 100vh;
} }
body { body {
padding-top: @header-height; padding-top: 0;
position: relative; background: #f6f8f9;
padding-bottom: @footer-height; font-family: @redash-font;
&.headless { position: relative;
padding-top: 0;
padding-bottom: 0; #application-root {
.nav.app-header { padding-bottom: 15px;
display: none; }
} }
div#footer {
display: none; #application-root {
} min-height: 100vh;
} }
#application-root,
#app-content {
display: flex;
flex-direction: column;
flex-grow: 1;
} }
strong { strong {
font-weight: 500; font-weight: 500;
} }
#content { #content {
position: relative; position: relative;
padding-top: 30px; padding-top: 30px;
padding-bottom: 30px; padding-bottom: 30px;
@media (min-width: (@screen-sm-min + 1)) { @media (min-width: (@screen-sm-min + 1)) {
padding-right: 15px; padding-right: 15px;
padding-left: 15px; padding-left: 15px;
} }
@media (min-width: (@screen-lg-min + 80px)) { @media (min-width: (@screen-lg-min + 80px)) {
margin-left: @sidebar-left-width; margin-left: @sidebar-left-width;
} }
@media (min-width: @screen-sm-min) and (max-width: (@screen-md-max + 80px)) { @media (min-width: @screen-sm-min) and (max-width: (@screen-md-max + 80px)) {
margin-left: @sidebar-left-mid-width; margin-left: @sidebar-left-mid-width;
} }
@media (max-width: (@screen-sm-min)) { @media (max-width: (@screen-sm-min)) {
margin-left: 0; margin-left: 0;
} }
} }
.container { .container {
&.c-boxed { &.c-boxed {
max-width: @boxed-width; max-width: @boxed-width;
} }
}
.settings-screen,
.home-page,
.page-dashboard-list,
.page-queries-list,
.page-alerts-list,
.alert-page,
.admin-page-layout {
.container {
width: 100%;
max-width: none;
}
} }
.scrollbox { .scrollbox {
overflow: auto; overflow: auto;
position: relative; position: relative;
}
.clickable {
cursor: pointer;
} }
.resize-vertical { .resize-vertical {
resize: vertical !important; resize: vertical !important;
transition: height 0s !important; transition: height 0s !important;
} }
.resize-horizontal { .resize-horizontal {
resize: horizontal !important; resize: horizontal !important;
transition: width 0s !important; transition: width 0s !important;
} }
.resize-both, .resize-both,
.resize-vertical.resize-horizontal { .resize-vertical.resize-horizontal {
resize: both !important; resize: both !important;
transition: height 0s, width 0s !important; transition: height 0s, width 0s !important;
}
.bg-ace {
background-color: fade(@redash-gray, 12%) !important;
}
// resizeable
.rg-top span,
.rg-bottom span {
height: 3px;
border-color: #b1c1ce; // TODO: variable
}
.rg-bottom {
bottom: 15px;
span {
margin: 1.5px 0 0 -10px;
}
}
// Plotly
text.slicetext {
text-shadow: 1px 1px 5px #333;
}
// markdown
.markdown strong {
font-weight: bold;
}
.markdown img {
max-width: 100%;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
background-color: fade(@redash-gray, 15%);
color: #111;
}
.profile__image--sidebar {
border-radius: 100%;
margin-right: 3px;
margin-top: -2px;
}
.profile__image--settings {
border-radius: 100%;
}
.profile__image_thumb {
border-radius: 100%;
margin-right: 3px;
margin-top: -2px;
width: 20px;
height: 20px;
}
// Error state
.error-state {
display: flex;
flex-direction: column;
justify-content: flex-start;
text-align: center;
margin-top: 25vh;
padding: 35px;
font-size: 14px;
line-height: 21px;
.error-state__icon {
.zmdi {
font-size: 64px;
color: @redash-gray;
}
}
@media (max-width: 767px) {
margin-top: 10vh;
}
}
.warning-icon-danger {
color: @red !important;
}
// page
.page-title {
display: flex;
align-items: center;
.label {
margin-top: 3px;
display: inline-block;
}
.favorites-control {
font-size: 19px;
margin-right: 10px;
}
}
.page-header--new {
h3 {
margin: 0.2em 0;
line-height: 1.3;
font-weight: 500;
}
}
.select-option-divider {
margin: 10px 0 !important;
} }

View File

@@ -31,7 +31,7 @@
.collapsing, .collapsing,
.collapse.in { .collapse.in {
padding: 5px 10px; padding: 0;
transition: all 0.35s ease; transition: all 0.35s ease;
} }
@@ -40,3 +40,10 @@
vertical-align: top; vertical-align: top;
margin-left: 0; margin-left: 0;
} }
// Hide URLs next to links when printing (override `bootstrap` rules)
@media print {
a[href]:after {
content: none !important;
}
}

View File

@@ -122,3 +122,21 @@
top: 1px; top: 1px;
position: relative; position: relative;
} }
.btn-default {
background-color: fade(@redash-gray, 15%);
}
.btn-transparent {
background-color: transparent !important;
}
.btn-default:hover, .btn-default:focus, .btn-default.focus, .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default {
background-color: fade(@redash-gray, 25%);
}
.btn-default:active:hover, .btn-default.active:hover, .open > .dropdown-toggle.btn-default:hover, .btn-default:active:focus, .btn-default.active:focus, .open > .dropdown-toggle.btn-default:focus, .btn-default:active.focus, .btn-default.active.focus, .open > .dropdown-toggle.btn-default.focus {
color: #333;
background-color: fade(@redash-gray, 45%);
}

View File

@@ -7,6 +7,7 @@
} }
.edit-in-place span.editable { .edit-in-place span.editable {
display: inline-block;
cursor: pointer; cursor: pointer;
} }
@@ -15,15 +16,6 @@
border-radius: @redash-radius; border-radius: @redash-radius;
} }
.edit-in-place input,
.edit-in-place textarea {
display: none;
}
.edit-in-place.active span {
display: none;
}
.edit-in-place.active input, .edit-in-place.active input,
.edit-in-place.active textarea { .edit-in-place.active textarea {
display: inline-block; display: inline-block;
@@ -32,32 +24,3 @@
.edit-in-place { .edit-in-place {
display: inline-block; display: inline-block;
} }
.edit-in-place {
.rd-form-control {
padding: 0px 6px;
width: 30vw;
}
&.active {
textarea.rd-form-control {
height: 29px;
width: 40vw;
}
}
}
@media (max-width: 880px) {
.edit-in-place {
.rd-form-control {
width: 50vw;
}
&.active {
textarea.rd-form-control {
width: 50vw;
}
}
}
}

View File

@@ -1,48 +0,0 @@
#footer {
position: absolute;
bottom: 0;
text-align: center;
width: 100%;
height: @footer-height;
color: #a2a2a2;
padding-top: 10px;
padding-bottom: 15px;
.f-menu {
display: block;
width: 100%;
.list-inline();
margin-top: 8px;
& > li > a {
color: #a2a2a2;
&:hover {
color: #777;
}
}
}
@media (min-width: (@screen-lg-min + 80px)) {
padding-left: (@sidebar-left-width + @grid-gutter-width);
}
@media (min-width: @screen-sm-min) and (max-width: (@screen-md-max + 80px)) {
padding-left: (@sidebar-left-mid-width + @grid-gutter-width);
}
@media (max-width: (@screen-sm-min)) {
padding-left: @grid-gutter-width/2;
}
}
.footer {
color: #818d9f;
padding-bottom: 30px;
a {
color: #818d9f;
margin-left: 20px;
}
}

View File

@@ -1,9 +1,9 @@
label { label {
font-weight: 500; font-weight: 500;
} }
textarea.v-resizable { textarea.v-resizable {
resize: vertical; resize: vertical;
} }
.form-group { .form-group {
@@ -29,282 +29,266 @@ textarea.v-resizable {
} }
} }
/* light version of bootstrap's form-control */
.rd-form-control {
display: block;
padding: 6px 12px;
line-height: 1.428571429;
color: #555555;
vertical-align: middle;
background-color: #ffffff;
border: 1px solid #cccccc;
border-radius: 4px;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
width: 90%;
}
/* -------------------------------------------------------- /* --------------------------------------------------------
Input Fields Input Fields
-----------------------------------------------------------*/ -----------------------------------------------------------*/
.form-control { .form-control {
.transition(all); .transition(all);
.transition-duration(300ms); .transition-duration(300ms);
resize: none; resize: none;
box-shadow: 0 0 0 40px rgba(0, 0, 0, 0) !important; box-shadow: 0 0 0 40px rgba(0, 0, 0, 0) !important;
border-radius: 0; border-radius: @redash-input-radius;
&:focus { &:focus {
box-shadow: 0 0 1px -2px rgba(121,194,255,0.5) !important; box-shadow: none !important;
} border-color: @blue;
}
&:hover {
border-color: @blue;
}
} }
/* -------------------------------------------------------- /* --------------------------------------------------------
Custom Checkbox + Radio Custom Checkbox + Radio
-----------------------------------------------------------*/ -----------------------------------------------------------*/
.cra-validatation(@color) { .cra-validatation(@color) {
input[type="checkbox"], input[type="radio"] { input[type="checkbox"],
& + .input-helper { input[type="radio"] {
border-color: @color; & + .input-helper {
} border-color: @color;
&:checked + .input-helper:before {
background: @color;
}
} }
&:checked + .input-helper:before {
background: @color;
}
}
} }
.cr-alt { .cr-alt {
position: relative;
padding-top: 0;
margin: 0;
label {
position: relative; position: relative;
padding-top: 0; padding-left: 28px;
}
&.has-success {
.cra-validatation(@green);
}
&.has-warning {
.cra-validatation(@orange);
}
&.has-error {
.cra-validatation(@red);
}
input[type="checkbox"],
input[type="radio"] {
.opacity(0);
width: 20px;
height: 20px;
position: absolute;
z-index: 10;
margin: 0; margin: 0;
top: 0;
left: 0;
cursor: pointer;
label { & + .input-helper {
position: relative; border: 1px solid @input-border;
padding-left: 28px; width: 19px;
height: 19px;
background: #fff;
position: absolute;
left: 0;
top: -1px;
cursor: pointer;
} }
&.has-success { &:checked + .input-helper:before {
.cra-validatation(@green); content: "";
width: 9px;
height: 9px;
background: #31acff;
position: absolute;
left: 4px;
top: 4px;
}
}
input[type="radio"] {
& + i {
border-radius: 50%;
} }
&.has-warning { &:checked + i:before {
.cra-validatation(@orange); border-radius: 50%;
} }
}
&.has-error { &.disabled {
.cra-validatation(@red); .opacity(0.7);
}
}
input[type="checkbox"], input[type="radio"] {
.opacity(0);
width: 20px;
height: 20px;
position: absolute;
z-index: 10;
margin: 0;
top: 0;
left: 0;
cursor: pointer;
& + .input-helper {
border: 1px solid @input-border;
width: 19px;
height: 19px;
background: #fff;
position: absolute;
left: 0;
top: -1px;
cursor: pointer;
}
&:checked + .input-helper:before {
content: "";
width: 9px;
height: 9px;
background: #31ACFF;
position: absolute;
left: 4px;
top: 4px;
}
}
input[type="radio"] {
& + i {
border-radius: 50%;
}
&:checked + i:before {
border-radius: 50%;
}
}
&.disabled {
.opacity(0.7);
}
} }
.checkbox-inline, .checkbox-inline,
.radio-inline { .radio-inline {
padding-left: 27px; padding-left: 27px;
} }
/* -------------------------------------------------------- /* --------------------------------------------------------
Input Addon Input Addon
-----------------------------------------------------------*/ -----------------------------------------------------------*/
.input-group { .input-group {
.input-group-addon {
min-width: 40px;
color: #333;
padding: 0;
}
&:not([class*="input-group-"]) {
.input-group-addon { .input-group-addon {
min-width: 40px; font-size: 15px;
color: #333;
padding: 0;
}
&:not([class*="input-group-"]) {
.input-group-addon {
font-size: 15px;
}
} }
}
} }
/* -------------------------------------------------------- /* --------------------------------------------------------
Toggle Switch Toggle Switch
-----------------------------------------------------------*/ -----------------------------------------------------------*/
.ts-color(@color){ .ts-color(@color) {
input { input {
&:not(:disabled) { &:not(:disabled) {
&:checked { &:checked {
& + .ts-helper { & + .ts-helper {
background: fade(@color, 50%); background: fade(@color, 50%);
&:before { &:before {
background: @color; background: @color;
} }
&:active { &:active {
&:before { &:before {
box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 20px fade(@color, 20%); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 20px fade(@color, 20%);
}
}
}
} }
}
} }
}
} }
}
} }
.toggle-switch { .toggle-switch {
display: inline-block;
vertical-align: top;
.user-select(none);
.ts-label {
display: inline-block; display: inline-block;
margin: 0 20px 0 0;
vertical-align: top; vertical-align: top;
.user-select(none); -webkit-transition: color 0.56s cubic-bezier(0.4, 0, 0.2, 1);
transition: color 0.56s cubic-bezier(0.4, 0, 0.2, 1);
}
.ts-label { .ts-helper {
display: inline-block; display: inline-block;
margin: 0 20px 0 0; position: relative;
vertical-align: top; width: 40px;
-webkit-transition: color 0.56s cubic-bezier(0.4, 0, 0.2, 1); height: 16px;
transition: color 0.56s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 8px;
background: rgba(0, 0, 0, 0.26);
-webkit-transition: background 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transition: background 0.28s cubic-bezier(0.4, 0, 0.2, 1);
vertical-align: middle;
cursor: pointer;
&:before {
content: "";
position: absolute;
top: -4px;
left: -4px;
width: 24px;
height: 24px;
background: #fafafa;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
border-radius: 50%;
webkit-transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
} }
}
&:not(.disabled) {
.ts-helper { .ts-helper {
display: inline-block; &:active {
position: relative;
width: 40px;
height: 16px;
border-radius: 8px;
background: rgba(0,0,0,0.26);
-webkit-transition: background 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transition: background 0.28s cubic-bezier(0.4, 0, 0.2, 1);
vertical-align: middle;
cursor: pointer;
&:before { &:before {
content: ''; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 20px rgba(128, 128, 128, 0.1);
position: absolute;
top: -4px;
left: -4px;
width: 24px;
height: 24px;
background: #fafafa;
box-shadow: 0 2px 8px rgba(0,0,0,0.28);
border-radius: 50%;
webkit-transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
} }
}
} }
}
&:not(.disabled) { input {
.ts-helper { position: absolute;
&:active { z-index: 1;
&:before { width: 46px;
box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 20px rgba(128,128,128,0.1); margin: 0 0 0 -4px;
} height: 24px;
} .opacity(0);
cursor: pointer;
&:checked {
& + .ts-helper {
&:before {
left: 20px;
} }
}
} }
}
input { &:not([data-ts-color]) {
position: absolute; .ts-color(@teal);
z-index: 1; }
width: 46px;
margin: 0 0 0 -4px;
height: 24px;
.opacity(0);
cursor: pointer;
&:checked { &.disabled {
& + .ts-helper { .opacity(0.6);
&:before { }
left: 20px;
}
}
}
}
&:not([data-ts-color]){ &[data-ts-color="red"] {
.ts-color(@teal); .ts-color(@red);
} }
&.disabled { &[data-ts-color="blue"] {
.opacity(0.6); .ts-color(@blue);
} }
&[data-ts-color="red"] { &[data-ts-color="amber"] {
.ts-color(@red); .ts-color(@amber);
} }
&[data-ts-color="blue"] { &[data-ts-color="purple"] {
.ts-color(@blue); .ts-color(@purple);
} }
&[data-ts-color="amber"] { &[data-ts-color="pink"] {
.ts-color(@amber); .ts-color(@pink);
} }
&[data-ts-color="purple"] { &[data-ts-color="lime"] {
.ts-color(@purple); .ts-color(@lime);
} }
&[data-ts-color="pink"] { &[data-ts-color="cyan"] {
.ts-color(@pink); .ts-color(@cyan);
} }
&[data-ts-color="lime"] {
.ts-color(@lime);
}
&[data-ts-color="cyan"] {
.ts-color(@cyan);
}
&[data-ts-color="green"] {
.ts-color(@green);
}
&[data-ts-color="green"] {
.ts-color(@green);
}
} }

View File

@@ -76,6 +76,8 @@
.font-size(20, 8px, 8); .font-size(20, 8px, 8);
.f-inherit { font-size: inherit !important; }
/* -------------------------------------------------------- /* --------------------------------------------------------
Font Weight Font Weight
@@ -146,9 +148,17 @@
Width Width
-----------------------------------------------------------*/ -----------------------------------------------------------*/
.w-100 { width: 100% !important; } .w-100 { width: 100% !important; }
.w-50 { width: 50% !important; }
.w-25 { width: 25% !important; }
/* -------------------------------------------------------- /* --------------------------------------------------------
Border Radius Border Radius
-----------------------------------------------------------*/ -----------------------------------------------------------*/
.brd-2 { border-radius: 2px; } .brd-2 { border-radius: 2px; }
/* --------------------------------------------------------
Alignment
-----------------------------------------------------------*/
.va-top { vertical-align: top; }

View File

@@ -1,28 +0,0 @@
/* angular-growl */
.growl {
position: fixed;
bottom: 10px;
right: 10px;
float: right;
width: 250px;
z-index: 10000;
}
.growl-item.ng-enter,
.growl-item.ng-leave {
-webkit-transition: 0.5s linear all;
-moz-transition: 0.5s linear all;
-o-transition: 0.5s linear all;
transition: 0.5s linear all;
}
.growl-item.ng-enter,
.growl-item.ng-leave.ng-leave-active {
opacity: 0;
}
.growl-item.ng-leave,
.growl-item.ng-enter.ng-enter-active {
opacity: 1;
}

View File

@@ -1,14 +1,37 @@
.label { .label {
border-radius: 1px; border-radius: 2px;
padding: 4px 5px 3px; padding: 3px 6px 4px;
} font-weight: 500;
font-size: 11px;
h1, h2, h3, h4, h5, h6 {
.label {
border-radius: 2px;
}
} }
.badge { .badge {
border-radius: 1px; border-radius: 1px;
}
.label-default {
background: fade(@redash-gray, 85%);
}
.label-tag-unpublished {
background: fade(@redash-gray, 85%);
}
.label-tag-archived {
.label-warning();
}
.label-tag {
background: fade(@redash-gray, 10%);
color: fade(@redash-gray, 75%);
}
.label-tag-unpublished,
.label-tag-archived,
.label-tag {
margin-right: 3px;
display: inline;
margin-top: 2px;
max-width: 24ch;
.text-overflow();
} }

View File

@@ -1,60 +1,84 @@
.list-group { .list-group {
margin-bottom: 0; margin-bottom: 0;
&.lg-alt .list-group-item { &.lg-alt .list-group-item {
border: 0; border: 0;
} }
&:not(.lg-alt) { &:not(.lg-alt) {
&.lg-listview .list-group-item { &.lg-listview .list-group-item {
border-left: 0; border-left: 0;
border-right: 0; border-right: 0;
&:last-child { &:last-child {
border-bottom: 0; border-bottom: 0;
} }
} }
} }
} }
.list-group-item { .max-character {
&.active { .text-overflow();
button { }
color: white;
} .list-group-item {
} &.active {
.cr-alt { button {
line-height: 100%; color: white;
margin-top: 2px; }
} }
} .cr-alt {
line-height: 100%;
.list-group-item-heading { margin-top: 2px;
margin-bottom: 2px; }
color: #333;
&.active, &.active:hover, &.active:focus {
& > small { background-color: #fff;
font-size: 11px; box-shadow: inset 3px 0px 0px @brand-primary;
color: #C5C5C5; }
margin-left: 10px; }
}
} .list-group-item-heading {
margin-bottom: 2px;
.list-group-item-heading, color: #333;
.list-group-item-text {
.text-overflow(); & > small {
} font-size: 11px;
color: #C5C5C5;
.list-group-item-text { margin-left: 10px;
display: block; }
}
&:not(:last-child) {
margin-bottom: 4px; .list-group-item-heading,
} .list-group-item-text {
} .text-overflow();
}
.list-group-img {
width: 38px; .list-group-item-text {
height: 38px; display: block;
border-radius: 2px;
} &:not(:last-child) {
margin-bottom: 4px;
}
}
.list-group-img {
width: 38px;
height: 38px;
border-radius: 2px;
}
.ui-select-choices-row.disabled > span {
background-color: inherit !important;
}
.list-group-item.inactive,
.ui-select-choices-row.disabled {
background-color: #eee !important;
border-color: transparent;
opacity: 0.5;
box-shadow: none;
color: #333;
pointer-events: none;
cursor: not-allowed;
}

View File

@@ -225,4 +225,18 @@
height: 37px; height: 37px;
border-radius: 2px; border-radius: 2px;
width: 37px; width: 37px;
}
/* --------------------------------------------------------
Percy
-----------------------------------------------------------*/
@media only percy {
.hide-in-percy, .pace {
visibility: hidden;
}
// hide tooltips in Percy
.ant-tooltip {
display: none !important;
}
} }

View File

@@ -1,33 +0,0 @@
a.navbar-brand {
padding: 5px 5px 0px 0px;
margin-left: 0px !important;
}
.navbar .fa {
font-size: 18px;
}
.navbar .collapse.in {
background: #222;
}
a.navbar-brand img {
height: 40px;
}
.avatar {
margin-top: 5px;
margin-bottom: 5px;
}
.avatar img {
width: 40px;
height: 40px;
}
#logout {
color: white;
position: relative;
left: -9px;
bottom: -11px;
}

View File

@@ -1,11 +0,0 @@
.overlay {
background-color: #808080;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
padding: 0;
z-index: 1000;
opacity: 0.8;
}

View File

@@ -1,54 +0,0 @@
.pagination {
border-radius: 0;
& > li {
margin: 0 2px;
display: inline-block;
vertical-align: top;
& > a,
& > span {
border-radius: 50% !important;
padding: 0;
width: 40px;
height: 40px;
line-height: 38px;
text-align: center;
font-size: 14px;
z-index: 1;
position: relative;
& > .zmdi {
font-size: 22px;
line-height: 39px;
}
}
&.disabled {
.opacity(0.5);
}
}
}
/* --------------------------------------------------------
Listview Pagination
-----------------------------------------------------------*/
.lv-pagination {
width: 100%;
text-align: center;
padding: 40px 0;
border-top: 1px solid #F0F0F0;
margin-top: 0;
margin-bottom: 0;
}
/* --------------------------------------------------------
Pager
-----------------------------------------------------------*/
.pager li > a, .pager li > span {
padding: 5px 10px 6px;
color: @pagination-color;
}

View File

@@ -1,5 +1,5 @@
.popover { .popover {
box-shadow: 0 2px 30px rgba(0, 0, 0, 0.2); box-shadow: fade(@redash-gray, 25%) 0px 0px 15px 0px;
} }
.popover-title { .popover-title {

View File

@@ -12,7 +12,6 @@
#header, #header,
#footer,
#sidebar, #sidebar,
#chat, #chat,
.growl-animated, .growl-animated,

View File

@@ -6,6 +6,7 @@ div.table-name {
padding: 2px 22px 2px 10px; padding: 2px 22px 2px 10px;
border-radius: @redash-radius; border-radius: @redash-radius;
position: relative; position: relative;
height: 22px;
.copy-to-editor { .copy-to-editor {
display: none; display: none;
@@ -27,10 +28,18 @@ div.table-name {
} }
.schema-browser { .schema-browser {
overflow-y: auto; overflow: hidden;
overflow-x: hidden;
border: none; border: none;
margin-top: 10px; padding-top: 10px;
position: relative;
height: 100%;
.schema-loading-state {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.collapse.in { .collapse.in {
background: transparent; background: transparent;
@@ -55,6 +64,14 @@ div.table-name {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
position: relative; position: relative;
height: 18px;
.column-type {
color: fade(@text-color, 80%);
font-size: 10px;
margin-left: 2px;
text-transform: uppercase;
}
.copy-to-editor { .copy-to-editor {
display: none; display: none;
@@ -72,11 +89,12 @@ div.table-name {
.schema-control { .schema-control {
display: flex; display: flex;
flex-wrap: nowrap;
padding: 0; padding: 0;
.form-control { .ant-btn {
margin-right: 5px; height: auto;
} }
} }
.parameter-label { .parameter-label {

View File

@@ -1,140 +0,0 @@
.tab-nav {
list-style: none;
padding: 0;
white-space: nowrap;
margin: 0 0 10px 0;
overflow: auto;
box-shadow: inset 0 -2px 0 0 #eee;
& > li {
display: inline-block;
vertical-align: top;
& > a {
display: inline-block;
color: #7a7a7a;
text-transform: uppercase;
position: relative;
width: 100%;
font-weight: 500;
&:after {
content: "";
height: 2px;
position: absolute;
width: 100%;
left: 0;
bottom: 0;
display: none;
}
@media (min-width: @screen-sm-min) {
padding: 15px;
}
@media (max-width: @screen-sm-min) {
padding: 15px 8px;
}
}
&.active {
& > a {
color: #000;
&:after {
display: block;
}
}
}
}
&.tab-nav-right {
text-align: right;
}
&.tn-justified {
& > li {
display: table-cell;
width: 1%;
text-align: center;
}
}
&.tn-icon {
& > li {
.zmdi {
font-size: 22px;
line-height: 100%;
min-height: 25px;
}
}
}
&:not([data-tab-color]) {
& > li > a:after {
background: @blue;
}
}
&[data-tab-color="green"] {
& > li > a:after {
background: @green;
}
}
&[data-tab-color="red"] {
& > li > a:after {
background: @red;
}
}
&[data-tab-color="teal"] {
& > li > a:after {
background: @teal;
}
}
&[data-tab-color="amber"] {
& > li > a:after {
background: @amber;
}
}
&[data-tab-color="black"] {
& > li > a:after {
background: @black;
}
}
&[data-tab-color="cyan"] {
& > li > a:after {
background: @cyan;
}
}
}
.tab-content {
padding: 20px 0;
}
.rd-tab {
.remove {
cursor: pointer;
color: #A09797;
padding: 0 3px 1px 4px;
font-size: 11px;
&:hover {
color: white;
background-color: #FF8080;
border-radius: 50%;
}
}
}
.tab-nav {
> li.rd-tab-btn {
float: right;
padding-right: 10px;
padding-top: 10px;
}
}

View File

@@ -1,99 +1,153 @@
.table { .table {
margin-bottom: 0; margin-bottom: 0;
th.sortable-column { th.sortable-column {
cursor: pointer; cursor: pointer;
}
&:not(.table-striped) > thead > tr > th {
background-color: #fafafa;
}
[class*="bg-"] {
& > tr > th {
color: #fff;
border-bottom: 0;
background: transparent !important;
} }
&:not(.table-striped) > thead > tr > th { & + tbody > tr:first-child > td {
background-color: #FAFAFA; border-top: 0;
} }
}
[class*="bg-"] { & > thead > tr > th {
& > tr > th { vertical-align: middle;
color: #fff; font-weight: 500;
border-bottom: 0; color: #333;
background: transparent !important; border-width: 1px;
} text-transform: uppercase;
padding: 15px 10px;
}
& + tbody > tr:first-child > td { & > thead > tr,
border-top: 0; & > tbody > tr,
} & > tfoot > tr {
& > th,
& > td {
&:first-child {
padding-left: 30px;
}
&:last-child {
padding-right: 30px;
}
} }
}
& > thead > tr > th { tbody > tr:last-child > td {
vertical-align: middle; padding-bottom: 20px;
font-weight: 500; }
color: #333;
border-width: 1px;
text-transform: uppercase;
padding: 15px 10px;
}
& > thead > tr,
& > tbody > tr,
& > tfoot > tr {
& > th, & > td {
&:first-child {
padding-left: 30px;
}
&:last-child {
padding-right: 30px;
}
}
}
tbody > tr:last-child > td {
padding-bottom: 20px;
}
} }
.table-bordered { .table-bordered {
border: 0; border: 0;
& > tbody > tr { & > tbody > tr {
& > td, & > th { & > td,
border-bottom: 0; & > th {
border-left: 0; border-bottom: 0;
border-left: 0;
&:last-child { &:last-child {
border-right: 0; border-right: 0;
} }
}
} }
}
& > thead > tr > th { & > thead > tr > th {
border-left: 0; border-left: 0;
&:last-child { &:last-child {
border-right: 0; border-right: 0;
}
} }
}
} }
.table-vmiddle { .table-vmiddle {
td { td {
vertical-align: middle !important; vertical-align: middle !important;
} }
} }
.table-responsive { .table-responsive {
border: 0; border: 0;
} }
.tile .table { .tile .table {
& > thead:not([class*="bg-"]) > tr > th {
& > thead:not([class*="bg-"]) > tr > th { border-top: 1px solid @table-border-color;
border-top: 1px solid @table-border-color; }
}
} }
.table-hover > tbody > tr:hover { .table-hover > tbody > tr:hover {
background-color: #f4f4f4; background-color: #f4f4f4;
} }
.table-data {
thead > tr > th {
white-space: nowrap;
}
tbody > tr > td {
padding-top: 5px !important;
}
.btn-favourite,
.btn-archive {
font-size: 15px;
}
}
.table-main-title {
font-weight: 500;
line-height: 1.7 !important;
}
.btn-favourite {
color: #d4d4d4;
transition: all 0.25s ease-in-out;
&:hover,
&:focus {
color: @yellow-darker;
cursor: pointer;
}
.fa-star {
color: @yellow-darker;
}
}
.btn-archive {
color: #d4d4d4;
transition: all 0.25s ease-in-out;
&:hover,
&:focus {
color: @gray-light;
}
.fa-archive {
color: @gray-light;
}
}
.table > thead > tr > th {
text-transform: none;
}
.table-data .label-tag {
display: inline-block;
max-width: 135px;
}

View File

@@ -2,7 +2,8 @@
background-color: #fff; background-color: #fff;
margin-bottom: @grid-gutter-width; margin-bottom: @grid-gutter-width;
position: relative; position: relative;
box-shadow: @tile-shadow; border-radius: 3px;
box-shadow: fade(@redash-gray, 15%) 0px 4px 9px -3px;
&[class*="bg-"] { &[class*="bg-"] {
color: #fff; color: #fff;
@@ -12,6 +13,10 @@
margin-bottom: @grid-gutter-width/2; margin-bottom: @grid-gutter-width/2;
} }
} }
.tiled {
border-radius: 3px;
box-shadow: fade(@redash-gray, 15%) 0px 4px 9px -3px;
}
.t-header { .t-header {
.th-title { .th-title {
@@ -74,6 +79,15 @@
} }
} }
.t-header:not(.th-alt) {
padding: 15px;
ul {
margin-bottom: 0;
line-height: 2.2;
}
}
.tb-padding { .tb-padding {
padding: 20px 23px 30px; padding: 20px 23px 30px;
} }

View File

@@ -1,29 +0,0 @@
#toast-container .toast {
margin: 0 6px 6px 0;
box-shadow: none;
color: #ffffff;
opacity: 0.75;
border-radius: 2px;
transition: opacity 0.35s ease-in-out;
}
#toast-container .toast:hover {
box-shadow: none;
opacity: 1;
cursor: pointer;
}
.toast {
background-color: #030303;
}
.toast-success {
background-color: #3BD973;
}
.toast-error {
background-color: #E92828;
}
.toast-info {
background-color: #356AFF;
}
.toast-warning {
background-color: #FB8D3D;
}

View File

@@ -17,13 +17,14 @@
Template Variables Template Variables
-----------------------------------------------------------*/ -----------------------------------------------------------*/
@header-height: 60px; @header-height: 60px;
@footer-height: 95px;
@sidebar-left-width: 240px; @sidebar-left-width: 240px;
@sidebar-left-mid-width: 64px; @sidebar-left-mid-width: 64px;
@logo-width: @sidebar-left-width; @logo-width: @sidebar-left-width;
@logo-height: @header-height; @logo-height: @header-height;
@boxed-width: 1170px; @boxed-width: 1170px;
@body-bg: #edecec; @body-bg: #edecec;
@spacing: 15px;
@redash-radius: 3px;
/* -------------------------------------------------------- /* --------------------------------------------------------
@@ -40,6 +41,7 @@
-----------------------------------------------------------*/ -----------------------------------------------------------*/
@font-icon: 'Material-Design-Iconic-Font'; @font-icon: 'Material-Design-Iconic-Font';
@font-family-sans-serif: 'Roboto', sans-serif; @font-family-sans-serif: 'Roboto', sans-serif;
@redash-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
@font-size-base: 13px; @font-size-base: 13px;
@@ -55,10 +57,12 @@
/* -------------------------------------------------------- /* --------------------------------------------------------
Form Form
-----------------------------------------------------------*/ -----------------------------------------------------------*/
@input-color: #595959;
@input-color-placeholder: #b4b4b4; @input-color-placeholder: #b4b4b4;
@input-border: #e8e8e8; @input-border: #e8e8e8;
@input-border-radius: 0; @input-border-radius: 0;
@input-border-radius-large: 0px; @input-border-radius-large: 0px;
@redash-input-radius: 2px;
@input-height-large: 40px; @input-height-large: 40px;
@input-height-base: 35px; @input-height-base: 35px;
@input-height-small: 30px; @input-height-small: 30px;
@@ -94,11 +98,15 @@
@gray-light: #828282; @gray-light: #828282;
@ace: #f8f8f8; @ace: #f8f8f8;
@redash-gray: rgba(102, 136, 153, 1);
@redash-orange: rgba(255, 120, 100, 1);
@redash-black: rgba(0, 0, 0, 1);
@redash-yellow: rgba(252, 252, 161, 0.75);
/** Form States **/ /** Form States **/
@state-success-text: @green; @state-success-text: @green;
@state-info-text: @blue; @state-info-text: @blue;
@state-danger-text: lighten(@red, 5%); @state-danger-text: lighten(@red, 5%);
@state-warning-text: @orange;
/* -------------------------------------------------------- /* --------------------------------------------------------
@@ -106,19 +114,16 @@
-----------------------------------------------------------*/ -----------------------------------------------------------*/
@alert-success-border: transparent; @alert-success-border: transparent;
@alert-info-border: transparent; @alert-info-border: transparent;
@alert-warning-border: transparent;
@alert-danger-border: transparent; @alert-danger-border: transparent;
@alert-inverse-border: transparent; @alert-inverse-border: transparent;
@alert-success-bg: fade(@green, 70%); @alert-success-bg: fade(@green, 70%);
@alert-info-bg: fade(@blue, 70%); @alert-info-bg: fade(@blue, 70%);
@alert-warning-bg: fade(@amber, 70%);
@alert-danger-bg: fade(@red, 70%); @alert-danger-bg: fade(@red, 70%);
@alert-inverse-bg: #333; @alert-inverse-bg: #333;
@alert-success-text: #fff; @alert-success-text: #fff;
@alert-info-text: #fff; @alert-info-text: #fff;
@alert-warning-text: #fff;
@alert-danger-text: #fff; @alert-danger-text: #fff;
@alert-inverse-text: #fff; @alert-inverse-text: #fff;
@@ -196,7 +201,6 @@
@pagination-hover-color: #333; @pagination-hover-color: #333;
@pagination-hover-bg: #d7d7d7; @pagination-hover-bg: #d7d7d7;
@pagination-hover-border: @pagination-border; @pagination-hover-border: @pagination-border;
@pager-border-radius: 5px;
/* -------------------------------------------------------- /* --------------------------------------------------------

View File

@@ -1,125 +0,0 @@
.bootgrid-table {
margin: 0;
box-shadow: none;
}
.bootgrid-footer .infoBar,
.bootgrid-header .actionBar {
text-align: left;
}
.bootgrid-footer .search,
.bootgrid-header .search {
vertical-align: top;
}
.bootgrid-header {
margin: 0;
padding: 25px;
.search {
border: 1px solid @input-border;
.form-control, .input-group-addon {
border: 0;
}
.input-group-addon {
font-size: 18px;
color: #333;
padding-right: 0 !important;
min-width: 26px;
text-align: right;
}
@media (min-width: @screen-xs-min) {
width: 300px;
}
@media (max-width: @screen-xs-min) {
width: 100%;
padding-right: 90px;
}
}
.actions {
box-shadow: none;
.btn-group {
.btn {
height: 37px;
background: #fff;
border-radius: 0;
border: 1px solid @input-border;
}
.dropdown-menu {
@media (min-width: @screen-sm-min) {
left: 0;
margin-top: 1px;
}
.dropdown-item {
padding: 5px 10px;
.input-helper {
top: 5px;
}
}
}
.caret {
display: none;
}
.zmdi {
line-height: 100%;
font-size: 18px;
vertical-align: top;
}
}
@media (max-width: @screen-xs-min) {
position: absolute;
top: 0;
right: 15px;
}
}
}
.bootgrid-footer {
border-top: 1px solid @table-border-color;
margin-top: 0;
.col-sm-6 {
padding: 25px;
@media (max-width: @screen-sm-min) {
text-align: center;
}
}
.infoBar {
@media (max-width: @screen-sm-min) {
display: none;
}
.infos {
border: 1px solid #EEE;
display: inline-block;
float: right;
padding: 7px 30px;
font-size: 12px;
margin-top: 3px;
}
}
}
.select-cell .checkbox {
margin: 0px 0 0 -19px;
top: 3px;
}

View File

@@ -1,215 +0,0 @@
.bootstrap-datetimepicker-widget {
padding: 0 !important;
margin: 0 !important;
width: auto !important;
&:after, &:before { display: none !important; }
table td {
text-shadow: none;
span {
margin: 0;
&:hover { background: transparent; }
}
}
.glyphicon { font-family: @font-icon; font-size: 18px; }
.glyphicon-chevron-left:before { content: "\f2ff"; }
.glyphicon-chevron-right:before { content: "\f301"; }
.glyphicon-time:before { content: "\f337"; }
.glyphicon-calendar:before { content: "\f32e"; }
.glyphicon-chevron-up:before { content: "\f1e5"; }
.glyphicon-chevron-down:before { content: "\f1e4"; }
[data-action="togglePicker"] span {
font-size: 25px;
color: #ccc;
&:hover {
color: #333;
}
}
a[data-action] {
color: @blue;
}
}
.timepicker-picker {
.btn { box-shadow: none !important; }
table {
tbody tr + tr:not(:last-child) {
background: @blue;
color: #fff;
td {
border-radius: 0;
}
}
}
.btn {
background: #fff;
color: #333;
}
}
.datepicker {
&.top {
.transform-origin(0 100%) !important;
}
table {
thead {
tr {
th {
border-radius: 0;
color: #fff;
.glyphicon {
width: 30px;
height: 30px;
border-radius: 50%;
line-height: 29px;
}
&:hover .glyphicon {
background: rgba(0, 0, 0, 0.2);
}
}
&:first-child {
th {
background: @blue;
padding: 20px 0;
&:hover {
background: @blue;
}
&.picker-switch {
font-size: 16px;
font-weight: 400;
text-transform: uppercase;
}
}
}
&:last-child {
th {
&:first-child { padding-left: 20px; }
&:last-child { padding-right: 20px; }
text-transform: uppercase;
font-weight: normal;
font-size: 11px;
}
&:not(:only-child) {
background: darken(@blue, 3%);
}
}
}
}
tbody {
tr {
&:last-child {
td {
padding-bottom: 25px;
}
}
td {
&:first-child {
padding-left: 13px;
}
&:last-child {
padding-right: 13px;
}
}
}
}
td {
&.day {
width: 35px;
height: 35px;
line-height: 20px;
color: #333;
position: relative;
padding: 0;
background: transparent;
&:hover {
background: none;
}
&:before {
content: "";
width: 35px;
height: 35px;
border-radius: 50%;
margin-bottom: -33px;
display: inline-block;
background: transparent;
position: static;
text-shadow: none;
}
&.old, &.new {
color: #CDCDCD;
}
}
&:not(.today):not(.active) {
&:hover:before {
background: #F0F0F0;
}
}
&.today {
color: #333;
&:before {
background-color: #E2E2E2;
}
}
&.active {
color: #fff;
&:before {
background-color: @blue;
}
}
}
}
}
.datepicker-months .month,
.datepicker-years .year,
.timepicker-minutes .minute,
.timepicker-hours .hour {
border-radius: 50%;
&:not(.active) {
&:hover {
background: #F0F0F0;
}
}
&.active {
background: @blue;
}
}
.timepicker-minutes .minute,
.timepicker-hours .hour {
padding: 0;
}

View File

@@ -1,72 +0,0 @@
.bootstrap-select {
.bs-searchbox {
padding: 0 18px;
margin: 5px 0 10px;
position: relative;
&:before {
position: absolute;
left: 14px;
top: 2px;
width: 30px;
height: 100%;
content: "\f1c3";
font-family: @font-icon;
font-size: 25px;
}
input {
padding-left: 25px;
border: 0;
}
}
&.btn-group {
.dropdown-menu li a.opt {
padding-left: 17px;
}
}
.check-mark {
margin-top: -5px !important;
font-size: 19px;
display: none;
position: absolute;
top: 11px;
right: 15px;
&:before {
content: "\f26b";
font-family: @font-icon;
}
}
.selected {
.check-mark {
display: block !important;
}
}
.notify {
bottom: 0 !important;
margin: 0 !important;
width: 100% !important;
border: 0 !important;
background: @red !important;
color: #fff !important;
text-align: center;
}
&:not([class*=col-]):not([class*=form-control]):not(.input-group-btn) {
width: 100%;
}
.btn-default {
background-color: #fff;
border-radius: 0;
border: 1px solid @input-border;
}
}

View File

@@ -1,114 +0,0 @@
.chosen-container {
.chosen-drop {
border-color: @input-border;
border-radius: 0;
}
.chosen-results {
margin: 10px 0 0 0;
padding: 0;
li {
padding: 10px 17px;
width: 100%;
&.highlighted {
background: @dropdown-link-hover-bg;
color: @dropdown-link-hover-color;
}
&.result-selected {
background: @lightblue;
color: @white;
position: relative;
&:before {
content: "\f26b";
font-family: @font-icon;
position: absolute;
right: 15px;
top: 10px;
font-size: 19px;
}
}
&.group-result {
&:not(:first-child) {
border-top: 1px solid #eee;
}
color: #B2B2B2;
font-weight: normal;
padding: 16px 15px 6px;
margin-top: 9px;
}
}
}
}
.chosen-container-single {
.chosen-single {
border-radius: 0;
height: 35px;
padding: 7px 12px 6px;
line-height: 1.42857143;
border-color: @input-border;
}
.chosen-search {
padding: 5px 12px;
&:before {
content: "\f1c3";
font-family: @font-icon;
position: absolute;
left: 25px;
top: 9px;
font-size: 19px;
}
input[type=text] {
border-color: @input-border;
padding: 8px 10px 8px 35px;
}
}
}
.chosen-container-multi {
.chosen-choices {
padding: 0 4px;
border-color: @input-border;
li {
&.search-choice {
border-radius: 0;
margin: 4px 4px 0 0;
background: @blue;
border-color: @blue;
color: #fff;
padding: 5px 23px 5px 8px;
.search-choice-close {
&:before {
display: inline-block;
font-family: @font-icon;
content: "\f135";
position: relative;
top: 1px;
color: #fff;
z-index: 2;
font-size: 12px;
}
}
}
&.search-field {
input[type=text] {
padding: 0 8px;
height: 31px;
}
}
}
}
}

View File

@@ -1,25 +0,0 @@
.cp-container {
position: relative;
& > .input-group {
input.cp-value {
color: #000 !important;
background: transparent !important;
}
.dropdown-menu {
padding: 20px;
margin-top: 30px;
}
}
i.cp-value {
width: 25px;
height: 25px;
border-radius: 50%;
position: absolute;
top: 5px;
right: 5px;
}
}

Some files were not shown because too many files have changed in this diff Show More