Compare commits

...

1254 Commits

Author SHA1 Message Date
github-actions[bot]
db4fdd003e Snapshot: 24.07.0-dev 2024-07-01 00:31:06 +00:00
Ezra Odio
4cb32fc1c3 Map() implementation fix for chart labels (#7022)
Co-authored-by: Ezra Odio <eodio@starfishstorage.com>
Co-authored-by: Eric Radman <eradman@starfishstorage.com>
2024-06-18 18:05:37 +00:00
dependabot[bot]
a6c728b99c Bump ws from 5.2.3 to 5.2.4 (#7021)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 02:25:45 +00:00
dependabot[bot]
01e036d0a9 Bump urllib3 from 1.26.18 to 1.26.19 (#7020)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 01:55:21 +00:00
Eric Radman
17fe69f551 PG: Only list tables where schema has USAGE permission (#7000)
This covers cases where partitioned tables are part of a schema that is
not accessible by the current user.

CREATE SCHEMA xyz;

CREATE TABLE xyz.tab (
   id bigint GENERATED ALWAYS AS IDENTITY,
   ts timestamp NOT NULL
) PARTITION BY LIST ((ts::date));

CREATE TABLE xyz.tab_default PARTITION OF xyz.tab DEFAULT;
2024-06-06 10:49:00 +10:00
Ezra Odio
bceaab0496 Update to Python 3.10 (#6991)
Updated from Python 3.8 to 3.10. Python 3.10 is the default for Ubuntu 22. This change necessitated upgrading to
SQLAlchemy_Utils 0.38.3, and importing the sort_query function from an older version of SQLAlchemy_Utils because it was dropped in newer versions.

Co-authored-by: Ezra Odio <eodio@starfishstorage.com>
2024-06-05 17:41:49 +10:00
Lucas Fernando Cardoso Nunes
70dd05916f ci: bot identity correction (#6997)
Signed-off-by: Lucas Fernando Cardoso Nunes <lucasfc.nunes@gmail.com>
2024-06-02 06:54:08 +10:00
github-actions
60a12e906e Snapshot: 24.06.0-dev 2024-06-01 00:27:53 +00:00
dependabot[bot]
ec051a8939 --- (#6981)
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 06:50:52 +00:00
Arik Fraimovich
60d3c66a8b Merge pull request from GHSA-32fw-wc7f-7qg9 2024-05-18 07:36:29 -07:00
Justin Clift
bd4ba96c43 Typo fix in message (#6979) 2024-05-18 08:18:37 +00:00
Eric Radman
10a46fd33c Revert "show pg and athena column comments and table descriptions as antd tooltip if they are defined (#6582)" (#6971)
This reverts commit c12d45077a.

This commit did not sort tables properly by schema, then name
2024-05-16 11:28:42 +08:00
Eric Radman
c874eb6b11 Revert changes to job status (#6969)
"Query in queue" should switch to "Executing query", but does not.

Commands:

git revert --no-commit bd17662005
git revert --no-commit 5ac5d86f5e
vim tests/handlers/test_query_results.py
git add tests/handlers/test_query_results.py

Co-authored-by: Justin Clift <justin@postgresql.org>
2024-05-14 22:06:45 -04:00
Taehyung Lim
f3a323695f Bump pyodbc from 4.0.28 to 5.1.0 (#6962) 2024-05-14 16:26:28 +00:00
Eric Radman
408ba78bd0 Update MSSQL OBDC driver to v18 (#6968) 2024-05-15 01:55:32 +10:00
Eric Radman
58cc49bc88 Revert build (2 of 2) (#6967) 2024-05-14 12:30:48 +00:00
Eric Radman
753ea846ff Revert CI workflow (1 of 2) (#6965) 2024-05-14 21:54:51 +10:00
Taehyung Lim
1b946b59ec sync .nvmrc with workflow (#6958) 2024-05-10 21:32:52 +10:00
dependabot[bot]
4569191113 Bump jinja2 from 3.1.3 to 3.1.4 (#6951)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 07:14:20 +10:00
Justin Clift
62890c3ec4 Revert "Remove deprecated advocate package (#6944)"
This reverts commit bd115e7f5f, as
it turns out to be a useful security feature.

In order to remove this in a better way, we'll need to replace it
with something that provides equivalent functionality.
2024-05-07 03:20:05 +10:00
Andrii Chubatiuk
bd115e7f5f Remove deprecated advocate package (#6944) 2024-05-06 23:14:13 +10:00
Andrii Chubatiuk
bd17662005 Fixed error serialization (#6937)
* serialize errors

* lint fix

* cover successful case
2024-05-02 13:52:35 +00:00
Jason Cowley
b7f22b1896 Fix 'str' object has no attribute 'pop' error when parsing query (#6941) 2024-05-02 21:31:23 +10:00
Justin Clift
897c683980 pgautoupgrade now does multi-arch builds (#6939)
Thanks to substantial efforts by @andyundso, the Docker Hub
images for pgautoupgrade are now multi-arch (x86_64 and ARM64). :)
2024-05-01 23:03:06 +10:00
github-actions
2b974e12ed Snapshot: 24.05.0-dev 2024-05-01 00:26:34 +00:00
SeongTae Jeong
372adfed6b Downgrade 'codecov-action' version from v4 to v3 (#6930)
The 'codecov-action@v4' requires an organization-level upload token, not
a single repo upload token, so we're temporarily downgrading it until we
can generate an organization-level upload token.

Reference: https://github.com/codecov/codecov-action/issues/1273
2024-04-26 08:28:20 +00:00
Eric Radman
dbab9cadb4 Source .env when running docker containers (#6927)
Restore previous functionality.

Ensure .env exists before building server.

Co-authored-by: github-actions <github-actions@github.com>
2024-04-25 11:36:03 -04:00
Kim Yann
06244716e6 Flatten all level for MongoDB data source (#6844) 2024-04-25 11:37:35 +00:00
Luciano Vitti
f09760389a aggregate Y column values rather than displaying last Y value (#6908) 2024-04-25 06:21:31 +00:00
Eric Radman
84e6d3cad5 Use staticPath var to fetch unsupportedRedirect.js (#6923)
Use Webpack configuration for locating this asset in the same way that
client/app/index.html does.

This code path is when REDASH_MULTI_ORG=true.

Co-authored-by: github-actions <github-actions@github.com>
2024-04-24 10:57:45 +00:00
Andrii Chubatiuk
3399e3761e mssql-odbc-arm64 (#6924)
Co-authored-by: Peter Lee <yankeeguyu@gmail.com>
2024-04-24 10:05:07 +00:00
Peter Lee
1c48b2218b Update widgets.py (#6926) 2024-04-24 19:37:35 +10:00
Andrii Chubatiuk
5ac5d86f5e consistent rq status naming and handling (#6913)
* consistent rq status naming and handling

* test fix

* make scheduled and deferred statuses cancelable
2024-04-24 13:15:04 +10:00
Marko Stankovic
5e4764af9c bugfix: unable to parse elasticsearch index mappings (#6918) 2024-04-23 18:13:05 +08:00
Eric Radman
e2a39de7d1 Remove workaround from check_csrf() (#6919)
This code was supposed to be temporary, and raises an exception if REDASH_MULTI_ORG=true is set.
2024-04-23 13:14:45 +10:00
Justin Clift
6c68b48917 Add pydeps Makefile target for installing Python dependencies (#6890)
This combines the manual steps needed for installing the Python dependencies into a single Makefile target.
2024-04-18 22:35:01 +10:00
Andrii Chubatiuk
7e8a61c73d Rq upgrade (#6902)
* fix(aws-es): fixed es auth

* fixed lock

* rq v1.16
2024-04-17 17:46:32 +10:00
dependabot[bot]
991e94dd6a Bump gunicorn from 21.2.0 to 22.0.0 (#6900)
Bumps [gunicorn](https://github.com/benoitc/gunicorn) from 21.2.0 to 22.0.0.
- [Release notes](https://github.com/benoitc/gunicorn/releases)
- [Commits](https://github.com/benoitc/gunicorn/compare/21.2.0...22.0.0)

---
updated-dependencies:
- dependency-name: gunicorn
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 14:00:59 +10:00
Andrii Chubatiuk
2ffeecb813 fix: aws elasticsearch typo (#6899)
Co-authored-by: Peter Lee <yankeeguyu@gmail.com>
2024-04-17 02:49:39 +00:00
dependabot[bot]
3dd855aef1 Bump sqlparse from 0.4.4 to 0.5.0 (#6895)
Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.4.4 to 0.5.0.
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](https://github.com/andialbrecht/sqlparse/compare/0.4.4...0.5.0)

---
updated-dependencies:
- dependency-name: sqlparse
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 13:06:57 +10:00
Justin Clift
713aca440a Extend make up to automatically initialise the database (#6855) 2024-04-13 14:47:41 +10:00
dependabot[bot]
70bb684d9e Bump dnspython from 2.4.2 to 2.6.1 (#6886)
Bumps [dnspython](https://github.com/rthalley/dnspython) from 2.4.2 to 2.6.1.
- [Release notes](https://github.com/rthalley/dnspython/releases)
- [Changelog](https://github.com/rthalley/dnspython/blob/main/doc/whatsnew.rst)
- [Commits](https://github.com/rthalley/dnspython/compare/v2.4.2...v2.6.1)

---
updated-dependencies:
- dependency-name: dnspython
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-13 13:46:38 +10:00
dependabot[bot]
4034f791c3 Bump pymongo from 4.3.3 to 4.6.3 (#6863)
Bumps [pymongo](https://github.com/mongodb/mongo-python-driver) from 4.3.3 to 4.6.3.
- [Release notes](https://github.com/mongodb/mongo-python-driver/releases)
- [Changelog](https://github.com/mongodb/mongo-python-driver/blob/master/doc/changelog.rst)
- [Commits](https://github.com/mongodb/mongo-python-driver/compare/4.3.3...4.6.3)

---
updated-dependencies:
- dependency-name: pymongo
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-13 03:14:35 +00:00
Justin Clift
b9875a231b Improve the text displayed when using the command line (#6884)
This removes some debugging output, and makes an unexpected text
string useful by explaining what's happening.
2024-04-13 11:51:15 +10:00
Justin Clift
062a70cf20 Change default webUI port back to 5001 (#6883)
This PR changes the default (tcp) port for the web user interface back to port 5001.

The recent change to port 5000 (to match an old default) turned out to be more painful than it's worth.

So, lets keep using port 5001 after all.
2024-04-13 02:02:55 +10:00
Andrii Chubatiuk
c12d45077a show pg and athena column comments and table descriptions as antd tooltip if they are defined (#6582)
* show column comments by default for athena and postgres

* Restyled by prettier

* fixed typo

* fmt fix

* ordered imports

* fixed unit tests

* fixed tests for athena

---------

Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan>
2024-04-12 21:02:15 +10:00
snickerjp
6d6412753d Bump python-oracledb from 2.0.1 to 2.1.2 (#6881) 2024-04-12 10:33:16 +00:00
Andrii Chubatiuk
275e12e7c1 fix: unquote values in compose (#6882) 2024-04-12 20:05:24 +10:00
Andrii Chubatiuk
77d7508cee fixed local setup to run on ARM64 (#6877)
* fixed local setup to run on ARM64

* set local profile in makefile by default

* reverted compose comment for postgres command
2024-04-12 08:10:34 +00:00
Justin Clift
9601660751 Update Node image in Dockerfile to 18-bookworm 2024-04-12 15:08:56 +10:00
dependabot[bot]
45c6fa0591 Bump idna from 3.6 to 3.7 (#6878)
Bumps [idna](https://github.com/kjd/idna) from 3.6 to 3.7.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](https://github.com/kjd/idna/compare/v3.6...v3.7)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-12 14:58:04 +10:00
Andrii Chubatiuk
95ecb8e229 fix for coverage (#6872)
Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan>
2024-04-11 05:35:14 +00:00
dependabot[bot]
cb0707176c Bump tar from 6.1.15 to 6.2.1 (#6866)
Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.15 to 6.2.1.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v6.1.15...v6.2.1)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 06:47:08 +10:00
Andrii Chubatiuk
d7247f8b84 use default docker repo name if variable is not defined (#6870)
Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan>
2024-04-11 06:15:43 +10:00
Andrii Chubatiuk
776703fab7 filter widget results to fix tests during repeatable execution (#6693)
* filter widged results to fix tests during repeatable execution

* minor fix

* made queryName variable

---------

Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-04-10 23:14:47 +10:00
Andrii Chubatiuk
34cde71238 fix percy for a branch (#6868)
Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan>
2024-04-10 21:10:41 +10:00
Andrii Chubatiuk
f631075be3 reverted e2e secrets (#6867)
Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan>
2024-04-10 20:16:31 +10:00
Andrii Chubatiuk
3f19534301 reuse built frontend in ci, merge compose files (#6674)
* reuse built frontend in ci, merge compose files

* pr comments

* added make create_db alias to create_database

* fixed lint

---------

Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan>
2024-04-10 19:53:14 +10:00
Justin Clift
24dec192ee Update yarn to current latest in 1.22.x series (#6858)
* Update yarn to current latest in 1.22.x series

* Use an environment variable for the yarn version

As suggested by @lucydodo:

  https://github.com/getredash/redash/pull/6858#discussion_r1555131358

Thanks heaps. :)
2024-04-08 01:52:45 +00:00
Ran Benita
82d88ed4eb Bump gunicorn from 20.0.4 to 21.2.0 (#6856)
The version 20.0.4 has a security issue:
https://grenfeldt.dev/2021/04/01/gunicorn-20.0.4-request-smuggling/

Changelog:
https://docs.gunicorn.org/en/stable/news.html
2024-04-08 06:26:02 +10:00
Justin Clift
af0773c58a Update "make clean" to remove Redash dev Docker images (#6847)
Also added a "make clean-all" target to remove the related containers
2024-04-07 12:14:38 +10:00
Justin Clift
15e6583d72 Automatically use the latest version of PostgreSQL (#6851) 2024-04-05 10:46:12 -04:00
Justin Clift
4eb5f4e47f Remove version check and all of the data sharing (#6852) 2024-04-06 00:02:31 +10:00
Eric Radman
a0f5c706ff Remove Qubole query runner (#6848)
The qds-sdk-py package along with the rest of the Qubole project is no longer
maintained:

3c6a34ce33

Removing this eliminates these warnings when running Redash management commands:

./qds_sdk/commands.py:1124: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if options.mode is "1":
./qds_sdk/commands.py:1137: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if options.db_update_mode is "updateonly":
./qds_sdk/commands.py:1424: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if (total is 0) or (downloaded == total):

Co-authored-by: github-actions <github-actions@github.com>
2024-04-04 07:52:18 +10:00
Will Lachance
702a550659 Handle timedelta in query results (#6846) 2024-04-03 15:44:08 +00:00
Eric Radman
38a06c7ab9 Autoformat hyperlinks in Slack alerts (#6845)
Format the Slack message using the "mrkdwn" type, which will make
hyperlinks clickable.

New test for Slack destination.

Co-authored-by: github-actions <github-actions@github.com>
2024-04-03 01:31:55 +00:00
Eric Radman
a6074878bb Use setup-python@v5, setup-node@v4 (#6842)
To avoid warnings in the CI pipeline

> Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20

Co-authored-by: github-actions <github-actions@github.com>
2024-04-01 23:37:37 +00:00
github-actions
fb348c7116 Snapshot: 24.04.0-dev 2024-04-01 00:27:13 +00:00
Will Lachance
24419863ec Handle decimal types in query results (#6837)
Since #6687, we don't serialize query results as JSON
before returning them. This is fine, except for the
query results data source which needs to pass the
data directly to sqlite3, and doesn't know how to
do that with the decimal types that are occasionally
returned by (at least) the PostgreSQL query runner:

https://www.psycopg.org/docs/faq.html#problems-with-type-conversions
2024-03-29 17:51:14 +10:00
dependabot[bot]
c4d3d9c683 Bump express from 4.18.2 to 4.19.2 (#6838)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-29 17:14:56 +10:00
dependabot[bot]
1672cd9280 Bump webpack-dev-middleware from 5.3.3 to 5.3.4 (#6829)
Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4.
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.3.3...v5.3.4)

---
updated-dependencies:
- dependency-name: webpack-dev-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-24 10:20:14 +10:00
Eric Radman
6575a6499a BigQuery: use default for useQueryAnnotation option (#6824)
This option may not be set after an upgrade

Co-authored-by: github-actions <github-actions@github.com>
2024-03-21 20:36:09 +00:00
dependabot[bot]
e360e4658e Bump jwcrypto from 1.5.1 to 1.5.6 (#6816)
Bumps [jwcrypto](https://github.com/latchset/jwcrypto) from 1.5.1 to 1.5.6.
- [Release notes](https://github.com/latchset/jwcrypto/releases)
- [Commits](https://github.com/latchset/jwcrypto/compare/v1.5.1...v1.5.6)

---
updated-dependencies:
- dependency-name: jwcrypto
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-20 07:40:23 +10:00
dependabot[bot]
107933c363 Bump follow-redirects from 1.15.5 to 1.15.6 in /viz-lib (#6813)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Peter Lee <yankeeguyu@gmail.com>
2024-03-19 23:38:47 +10:00
Vladislav Denisov
667a696ca5 ClickHouse query runner: fixed error message (#6764)
* Snapshot: 23.11.0-dev

* Snapshot: 23.12.0-dev

* Snapshot: 24.01.0-dev

* Snapshot: 24.02.0-dev

* clickhouse: check for `exception` field in response

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Vladislav Denisov <denisov@sports.ru>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
Co-authored-by: Peter Lee <yankeeguyu@gmail.com>
2024-03-18 02:15:49 +10:00
Robin Edwards
7d0d242072 schedule may not contain an until key (#6771) 2024-03-15 09:00:19 +10:00
Arun Govind M
d554136f70 fix: Uncaught rejection promise error in Edit Visualization Dialog Modal (#6794) 2024-03-07 10:01:51 +10:00
Stefan Negele
34723e2f3e Add RisingWave support (#6776) 2024-03-05 17:29:47 +08:00
dependabot[bot]
11794b3fe3 Bump es5-ext from 0.10.53 to 0.10.63 in /viz-lib (#6782)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.53 to 0.10.63.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.53...v0.10.63)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-02 04:46:01 +00:00
Eric Radman
3997916d77 Always push images to hub.docker.com/u/redash (#6792)
Using github.repository_owner name was convenient for testing this
action, but is not correct since account names do not match.

Git Hub: getredash/
Docker Hub: redash/

Co-authored-by: github-actions <github-actions@github.com>
2024-03-01 21:42:15 +00:00
dependabot[bot]
b09a2256dc Bump es5-ext from 0.10.53 to 0.10.63 (#6784)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.53 to 0.10.63.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.53...v0.10.63)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 18:51:54 +00:00
Eric Radman
95a45bb4dc Snapshot: 24.03.0-dev (#6791)
Co-authored-by: github-actions <github-actions@github.com>
2024-03-02 04:21:22 +10:00
Eric Radman
7cd03c797c Publish preview Docker image when release candidate is tagged (#6787)
* Only respond to new tags ending with -dev
* Use github account name to allow easier testing in a fork
* Allow preview image to be referenced by a specific tag, or by latest tag

redash/preview:24.02.0-dev
redash/redash:preview

Co-authored-by: github-actions <github-actions@github.com>
2024-03-01 16:05:12 +00:00
Eric Radman
1200f9887a Use SSH deployment key to bump version and tag release candiate (#6789)
To allow this workflow to run even though normal contributors
are required to create a pull request.

Steps:

1. Generate SSH key pair: ssh-keygen -t ed25519. No need for passphrases etc.
2. Add public key (.pub one) as a deploy key at Your repo -> Settings ->
   Security -> Deploy keys, check "Allow write access".
3. Add private key as a secret at Your repo -> Settings -> Security -> Secrets
   and variables -> Actions

https://stackoverflow.com/a/76135647/1809872

Co-authored-by: github-actions <github-actions@github.com>
2024-03-02 00:51:51 +10:00
Dirk van Donkelaar
81d22f1eb2 Add limit option for MSSQL query runner (#6704)
* Add limit option for MSSQL query runner

* Fixed linting errors
2024-02-27 06:16:54 +10:00
Eric Radman
2fe0326280 Allow WebPack configuration when building in Docker (#6780)
Co-authored-by: github-actions <github-actions@github.com>
2024-02-27 05:28:39 +10:00
Andrii Chubatiuk
094984f564 Node 18 (#6752)
* Snapshot: 24.02.0-dev

* node-18

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-02-22 22:10:20 +00:00
dependabot[bot]
52cd6ff006 Bump axios from 0.27.2 to 0.28.0 in /viz-lib (#6775)
Bumps [axios](https://github.com/axios/axios) from 0.27.2 to 0.28.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.28.0/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.27.2...v0.28.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-23 04:01:43 +10:00
Andrii Chubatiuk
939bec2114 Load custom encoder only when runner enabled (#6748)
* Snapshot: 24.02.0-dev

* load encoders only for enabled runners

* try importing within init

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2024-02-09 21:49:59 -05:00
Andrii Chubatiuk
320fddfd52 Changed checkout commit (#6749)
* Snapshot: 24.02.0-dev

* changed checkout commit

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-02-07 03:15:13 +10:00
Guido Petri
ab39283ae6 fix linting (#6745) 2024-02-05 19:47:25 -06:00
Eric Radman
6386905616 Revert example message for "Custom rule for hiding filter" (#6709)
Partialy reverts
 Hide filter components on shared pages
 https://github.com/getredash/redash/pull/6115

The "hide_filter" feature is incomplete, and the example text is
confusing, adds clutter to the share dashboard dialog.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2024-02-05 20:38:17 -05:00
Andrii Chubatiuk
d986b976e5 fixed custom json encoders (#6741)
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-02-05 20:34:45 -05:00
Lucas Fernando Cardoso Nunes
a600921c0b feat: avoid npm usage (#6742)
Signed-off-by: Lucas Fernando Cardoso Nunes <lucasfc.nunes@gmail.com>
2024-02-05 20:31:26 -05:00
Lucas Fernando Cardoso Nunes
af2f4af8a2 refactor: use docker compose recommendations (#5854)
Signed-off-by: Lucas Fernando Cardoso Nunes <lucasfc.nunes@gmail.com>
2024-02-04 07:22:40 -06:00
Eric Radman
49a5e74283 Snapshot: 24.02.0-dev (#6740)
Co-authored-by: github-actions <github-actions@github.com>
2024-02-03 01:03:46 +00:00
Andrii Chubatiuk
b98b5f2ba4 Switch to pull_request_target events to hide cypress secrets (#6716)
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2024-01-30 14:51:46 +10:00
Dirk van Donkelaar
d245ff7bb1 Fixed notification template (#6721)
* Fixed notification template

* Made if-clause equal to append

Like Slack and email notification

* Add custom_body attribute to discord test

* Add missing attribute
2024-01-29 22:15:42 -05:00
Andrii Chubatiuk
97db492531 Removed unused configuration class (#6682)
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-01-18 21:50:27 +10:00
Dirk van Donkelaar
30e7392933 Fix UnicodeEncodeError for non-Latin characters (#6715) 2024-01-18 08:15:11 +00:00
Andrii Chubatiuk
a54171f2c2 cast query_results data back to text (#6713)
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-01-18 11:13:47 +10:00
Robin Edwards
cd03da3260 Cast to JSONB type to match altered column type (#6707) 2024-01-16 02:23:35 +10:00
dependabot[bot]
4c47bef582 Bump jinja2 from 3.1.2 to 3.1.3 (#6700)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2024-01-12 10:08:25 +10:00
Andrii Chubatiuk
ec1c4d07de Removed pseudojson class, converted all options and other json columns to jsonb ones (#6687)
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-01-12 09:02:00 +10:00
Andrii Chubatiuk
4d5103978b Removed simplejson (#6685)
* removed simplejson

* minor fix

* fixed lint

---------

Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan>
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-01-11 17:47:33 +10:00
dependabot[bot]
3c2c2786ed Bump follow-redirects from 1.15.2 to 1.15.4 in /viz-lib (#6699)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-10 21:15:45 +00:00
snickerjp
cd482e780a Bump python-oracledb from 1.4.0 to 2.0.1 (#6698) 2024-01-10 20:44:18 +00:00
Eric Radman
4d81c3148d Update query hash with parameters applied (#6683)
This allows queries with parameters to run on a schedule since the hash
used to update the query_result will match.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2024-01-10 03:46:31 +00:00
Eric Radman
1b1b9bd98d Import all Plotly visualizations (#6673)
- Accessible using the Custom chart type
- Disable 'fs' and 'path' modules which are available in node, but not
  on the frontend.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2024-01-07 20:19:58 +00:00
dependabot[bot]
473cf29c9f Bump pycryptodome from 3.19.0 to 3.19.1 (#6694)
Bumps [pycryptodome](https://github.com/Legrandin/pycryptodome) from 3.19.0 to 3.19.1.
- [Release notes](https://github.com/Legrandin/pycryptodome/releases)
- [Changelog](https://github.com/Legrandin/pycryptodome/blob/master/Changelog.rst)
- [Commits](https://github.com/Legrandin/pycryptodome/compare/v3.19.0...v3.19.1)

---
updated-dependencies:
- dependency-name: pycryptodome
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-06 10:33:30 +10:00
Andrii Chubatiuk
cbde237b12 removed explicit object inheritance (#6686)
* removed explicit object inheritance

* minor fix

* pr comments

---------

Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
2024-01-05 19:52:02 +09:00
Eric Radman
998dc31eb0 Snapshot: 24.01.0-dev (#6681)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-03 00:43:01 +10:00
dependabot[bot]
2505e8ab3b Bump jwcrypto from 1.5.0 to 1.5.1 (#6679)
Bumps [jwcrypto](https://github.com/latchset/jwcrypto) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/latchset/jwcrypto/releases)
- [Commits](https://github.com/latchset/jwcrypto/compare/v1.5.0...v1.5.1)

---
updated-dependencies:
- dependency-name: jwcrypto
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-29 11:32:41 +09:00
fabrei
858fc4d78f Adds influxdb v2 query runner as a default query runner. (#6669)
* Adds influxdb v2 query runner as a default query runner.

* Deletes TableList object for typing, because it is possible, that the import of influxdb client fails.

---------

Co-authored-by: Masayuki Takahashi <masayuki038@gmail.com>
2023-12-20 21:46:12 +09:00
dependabot[bot]
3e500ea18e Bump paramiko from 3.3.1 to 3.4.0 (#6670)
Bumps [paramiko](https://github.com/paramiko/paramiko) from 3.3.1 to 3.4.0.
- [Commits](https://github.com/paramiko/paramiko/compare/3.3.1...3.4.0)

---
updated-dependencies:
- dependency-name: paramiko
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-20 19:21:40 +09:00
fabrei
58bf96c298 Adds ssl support for prometheus query runner. (#6657)
* Adds ssl support for prometheus query runner.

- Adds possibilty to upload and use of ssl cert, key and ca file in redash ui

* Extends test cases for prometheus query runner.

- Adds secret attribute to configuration schema.

* Fixes wrong timestamps in different timezones in prometheus' testcases.

- Dynamically calculates timestamps in testcases to be robust in
  different timezones.
- Adds now datetime function to make it more testable.

* Fixes timestamp in prometheus' testcases which can be wrong depending on timezone.

---------

Co-authored-by: Masayuki Takahashi <masayuki038@gmail.com>
2023-12-17 21:58:16 +09:00
fabrei
66ef942572 Adds influxdb v2 query runner. (#6646)
* Adds influxdb v2 query runner.

- Adds test cases
- Adds influxdb v2 icon
- Updates python dependencies

* Fixes import order.

* Fixes code formatting for black tool.

* Adds influxdb version 2 support in readme.

---------

Co-authored-by: Fabian Reiber <reiber@dfn-cert.de>
Co-authored-by: Masayuki Takahashi <masayuki038@gmail.com>
2023-12-12 23:01:50 +09:00
Masayuki Takahashi
9bbdb4b765 Show an error message on "Test Connection" failure for Google Spreadsheet Query Runner (#6652) 2023-12-10 00:42:46 +09:00
Eric Radman
2b4b1cf7e3 Snapshot: 23.12.0-dev (#6638)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-06 09:51:57 +00:00
dependabot[bot]
9b29f26217 Bump cryptography from 41.0.4 to 41.0.6 (#6630)
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.4 to 41.0.6.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.4...41.0.6)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-29 00:39:58 +00:00
Eric Radman
392b930f2d Revert "Switch from numeral to numbro (#6344)" (#6595)
This reverts commit f8934b8312.

Using a format string of '0' does not round to the nearest integer in Numbro
https://github.com/BenjaminVanRyseghem/numbro/issues/745

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-11-25 14:36:08 +00:00
anushae6
9df6f80bb7 update readme to add e6data (#6620) 2023-11-24 05:11:37 -06:00
dependabot[bot]
f7b47c0436 Bump werkzeug from 2.3.6 to 2.3.8 (#6616)
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 2.3.6 to 2.3.8.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/2.3.6...2.3.8)

---
updated-dependencies:
- dependency-name: werkzeug
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-22 21:39:39 -05:00
anushae6
09addaadc3 add e6data query runner with test cases (#6604)
* add e6data query runner with test cases

* added more test cases
2023-11-22 20:59:21 -05:00
Vladislav Denisov
a07b8a6bd3 Yandex.Disk Query runner (#6598)
* Snapshot: 23.11.0-dev

* dataframe_to_result function moved outside python query runner

* added yandex disk query runner

* moved file_extension check

* skip unsupported extensions in schema

* removed unused variable

* added support for xlsx with multiple sheets

* moved pandas-converters to utils file

* added tests

* fixed backend tests

* fixed pandas to redash type conversion

* added more tests

* added tests for pandas

* added tests for pandas converter and yandex disk

* added tests for read_file and multiple sheets

* pandas: do not load if lib is not installed

* added test for yaml read

* fixed test for yaml read

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-11-21 21:16:29 -05:00
Genki Sugawara
8bfc57430d chore: Fix ci.yml typo: ghq -> gha (#6601) 2023-11-15 21:57:50 +09:00
Luka Lovosevic
a8c6dd0043 Update rockset.py - replace default API server URL (#6592)
Replaced default API server URL with new URL in USW2 region
2023-11-14 01:01:52 +09:00
Peter Lee
2d879510e4 add fork dashboard function (#6588)
* add fork dashboard function

* add test

* fix

---------

Co-authored-by: guyu <guyu@fordeal.com>
2023-11-11 20:56:47 +00:00
Luka Lovosevic
13e61fc3a0 Update rockset.py with support for multi-VI (#6584)
* Update rockset.py with support for multi-VI

Rockset introduced compute-compute separation which allows multiple Virtual Instances (VIs) to query data independently. This a commit introduces support for executing queries on specific VIs from Redash.

Changes include:
- added new configuration element (not required): Virtual Instance ID
- if this VI ID is configured, Redash will use that specific VI to execute the query
- if it's not specified, Redash will execute the query on the main/default VI (same behaviour as before)

* Update rockset.py

Removed comment from the query method to pass lint test

* Update rockset.py - for linting

Added more formatting to pass the black lint test

* Update rockset.py - linting update

* Update rockset.py - updated lint
2023-11-10 22:38:47 +09:00
Masayuki Takahashi
de1958e995 Bump snowflake-connector-python 3.4.0 for fixing 'Error detecting the version of libcrypto' (#6581)
* Bump snowflake-connector-python 3.4.0 for fixing 'Error detecting the
version of libcrypto'

* Update poetry.lock and remove .python-version
2023-11-07 20:09:52 -05:00
Masayuki Takahashi
198b422eaf Display catalog information on the schema pane when connecting to Trino (#6578) 2023-11-06 20:58:12 -05:00
Eric Radman
63cef6632e Snapshot: 23.11.0-dev (#6571) 2023-11-01 10:38:23 -04:00
myonlylonely
2611dcc0f1 Bump protobuf from 3.18.3 to 3.20.2 (#6568) 2023-10-31 15:52:41 +00:00
Dominik Sigmund
55193fbf66 Changed asc_url to entity_id (#6202)
Respect the User Setting instead of a hardcoded  value

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-31 11:23:00 +00:00
Eric Radman
8b8dd4f68c Revert "Render counter widgets using relative font size" (#6566) 2023-10-31 10:27:09 +10:00
Guido Petri
ae77e72821 fix falsey comparison to determine whether a dashboard is archived. closes #6560 (#6561) 2023-10-30 01:06:04 +10:00
Guido Petri
39e4ea155c Support multi column results with using mongo query runner (#6558)
* Support multi column results with using mongo query runner

* format

Signed-off-by: del-zhenwu <lizhenxiang@pjlab.org.cn>

* Update test_mongodb.py

update unit test case: nested dict for mongodb runner

* Update test_mongodb.py

* fix formatting

---------

Signed-off-by: del-zhenwu <lizhenxiang@pjlab.org.cn>
Co-authored-by: del-zhenwu <dele.zhenwu@gmail.com>
Co-authored-by: del-zhenwu <lizhenxiang@pjlab.org.cn>
2023-10-28 21:13:17 -04:00
dependabot[bot]
a5b01bf8ee Bump browserify-sign from 4.0.4 to 4.2.2 (#6557)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.0.4 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.0.4...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-27 19:20:36 -04:00
Justin Clift
5516b427d8 Remove pygridgain so Trino data source shows up (#6546)
This also updates the python tzlocal dependency to the 4.x series,
as seems to be required for Trino to work.
2023-10-23 18:34:55 -04:00
deecay
de84c40868 Better Heatmap annotation color (#6543) 2023-10-23 03:25:27 +00:00
Kieran Molloy
39766a2d97 Reset redis pipeline at end of enqueue_query (#6540) 2023-10-20 22:12:55 -05:00
Eric Radman
593b6ae6ed Specify counter widgets font size in pt (#6537)
- prevent scrollbars from appearing
- start with a base font size of 12pt for more even scaling

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-19 02:35:58 +00:00
Adriano Pereira Junior
8bb1767c69 Add new conn options in MySQL (#6538) 2023-10-19 01:11:11 +00:00
Ken Michalak
7b03e60f9d add pagination and base_url to JSON query_runner (#6499) 2023-10-18 08:08:37 -05:00
dependabot[bot]
ac9f24a781 Bump urllib3 from 1.26.17 to 1.26.18 (#6534)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.17 to 1.26.18.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.17...1.26.18)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 20:15:04 -05:00
Justin Clift
54c4a4249a Revert arm64 docker image building in CI (for now) (#6532)
This PR reverts PRs #6525 and #6531, due to problems building
the arm64 images with GitHub Actions
2023-10-17 20:21:30 -04:00
dependabot[bot]
36dd3e9609 Bump @babel/traverse from 7.22.8 to 7.23.2 (#6530)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.8 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-17 14:35:35 +00:00
Genki Sugawara
69d1e03e60 Update yarn network-timeout: 30s(default) -> 600s (#6531) 2023-10-17 11:46:37 +00:00
dependabot[bot]
a2c0c488eb Bump @babel/traverse from 7.22.8 to 7.23.2 in /viz-lib (#6529)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.8 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 03:45:29 +00:00
fukatani
ddbe0f6ce5 Display bigquery subfield of record as schema. (#6522)
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-16 23:04:41 -04:00
Vladislav Denisov
42108089ed Metrica: retry query if quota exceeded (#6459)
* metrica: added retries

* updated poetry.lock

* use poetry v1.6.1

* added simple test

* convert unittest to pytest

* add 429 test

* fix 429 status code response?

---------

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-16 21:53:21 -05:00
Genki Sugawara
d4ade51fba Add linux/arm64 to docker image platforms (#6525)
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-16 12:58:19 +00:00
Genki Sugawara
84d1693419 Update Debian image in Dockerfile (#6524) 2023-10-16 08:51:38 +00:00
Genki Sugawara
12f1050000 chore: Remove "Datree" badge from README (#6526) 2023-10-16 17:38:14 +10:00
Eric Radman
6b981972f0 Allow Query.options to be None (#6519)
* Allow Query.options to be None

Query.options may not have a value on a database created by 10.1.0

* Ensure counter widget is not compressed in query preview tabs

Also bump minimum counter font size to 14
2023-10-16 11:07:30 +10:00
Leandro Lomónaco
eafe30d52c Bigger textarea for query description (#6518) 2023-10-13 15:00:48 +10:00
Ben Best
abbd4d3146 Create sqlalchemy_searchable expressions (#6491)
The required sql expressions for sqlalchemy_searchable are only created
on the sqlalchemy pre_create hook. When upgrading from a previous redash
version no CREATE statements may be run, so these expressions are never
created.

Add a migration to manually execute the sql_expressions DDL from
sqlalchemy_searchable.
2023-10-12 17:43:20 +00:00
Eric Radman
1d350853bd Commit version update and tag together (#6513)
Also update to checkout v4
2023-10-09 14:37:16 -04:00
Eric Radman
3edf7790fc Snapshot: 23.10.0-dev (#6512) 2023-10-09 09:55:48 -04:00
Masayuki Takahashi
011f9ef311 Add column type to a query result of InfluxDB (#6505)
* Add column type to a query result of InfluxDB

* Remove an unused import

* Migrate to pytest

* Rename test names to descriptive

---------

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-08 14:39:51 +00:00
Guido Petri
138339a8a4 convert docker-compose to docker compose (#6504) 2023-10-08 12:06:48 +10:00
Guido Petri
0f175b7a5b build and push image only on master branch (#6507) 2023-10-08 10:55:15 +10:00
Guido Petri
0c2dc4e025 fix dockerhub image building (#6503) 2023-10-07 02:22:55 +00:00
Vladislav Denisov
a19b17b844 Fixed embedded queries (#6497)
* refactored users models

* added tests
2023-10-04 15:12:17 +10:00
dependabot[bot]
09ec299e65 Bump urllib3 from 1.26.16 to 1.26.17 (#6495)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.16 to 1.26.17.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.16...1.26.17)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 17:24:11 +10:00
dependabot[bot]
9461bf6479 Bump debug from 3.2.6 to 3.2.7 in /viz-lib (#6493)
Bumps [debug](https://github.com/debug-js/debug) from 3.2.6 to 3.2.7.
- [Release notes](https://github.com/debug-js/debug/releases)
- [Commits](https://github.com/debug-js/debug/compare/3.2.6...3.2.7)

---
updated-dependencies:
- dependency-name: debug
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 03:08:58 +00:00
dependabot[bot]
1ae4e20d70 Bump debug from 3.2.6 to 3.2.7 (#6494)
Bumps [debug](https://github.com/debug-js/debug) from 3.2.6 to 3.2.7.
- [Release notes](https://github.com/debug-js/debug/releases)
- [Commits](https://github.com/debug-js/debug/compare/3.2.6...3.2.7)

---
updated-dependencies:
- dependency-name: debug
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 02:05:37 +00:00
Eric Radman
3d32c55531 Avoid updating query result for archived queries (#6488) 2023-09-29 13:46:02 +10:00
Genki Sugawara
4a36abc628 Add Datadog alert destination (#6476)
* Add Datadog alert destination

* Fix Datadog Event API response code: 200 -> 202

* Add datadog alert dest test

* Sort test_destinations.py imports

* Fix test_datadog_notify_calls_requests_post

* Fix datadog alert dest: Add aggregation_key
2023-09-27 20:22:00 -04:00
George Spake
3ebf163c29 Update gevent to 23.9.1 to address CVE (#6487)
update greenlet to 2.0.2 - 
Because redash depends on gevent (23.9.1) which depends on greenlet (>=2.0.0), greenlet is required.
So, because redash depends on greenlet (1.1.3), version solving failed.
2023-09-27 18:56:24 +00:00
dependabot[bot]
c3c54f6ca2 Bump cryptography from 41.0.3 to 41.0.4 (#6474)
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.3 to 41.0.4.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.3...41.0.4)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-22 08:50:49 +10:00
Justin Clift
b13772c464 Update poetry.lock after PR 6469 (#6473)
Without this, poetry is complaining about a mismatch
2023-09-22 01:57:12 +10:00
Vladislav Denisov
74b0f8bb58 bump gpsread == 5.11.2 (#6469) 2023-09-20 19:42:40 -05:00
Justin Clift
953ed8431b Revert PR 6448 (SQLAlchemy-Utils update) for now (#6466) 2023-09-20 20:51:38 +10:00
Vladislav Denisov
0ca72d27e6 bump ldap3 = 2.9.1 (#6463) 2023-09-20 15:29:17 +10:00
Justin Clift
650ec90df3 Add kerberos development headers to Redash image (#6454)
Without these headers, compiling pymssql on arm64 fails:

  gcc -pthread -shared build/temp.linux-aarch64-cpython-38/src/pymssql/_mssql.o -L/usr/local/lib -lsybdb -lgssapi_krb5 -lkrb5 -lssl -lcrypto -o build/lib.linux-aarch64-cpython-38/pymssql/_mssql.cpython-38-aarch64-linux-gnu.so
  /usr/bin/ld: cannot find -lgssapi_krb5
  /usr/bin/ld: cannot find -lkrb5
  collect2: error: ld returned 1 exit status
2023-09-14 21:54:13 +10:00
Eric Radman
b84587931f Add ruff to Python dev dependencies (#6450) 2023-09-13 08:47:45 +10:00
Eric Radman
ff85a36f50 Avoid file locking issue when running CLI test (#6449)
__file__ will resolve to tests/test_cli.py, which is already opened by Python.
When tests are run on a network file system the test runner may deadlock while
waiting for an advisory lock to be released on this file.
2023-09-12 18:44:24 -04:00
Eric Radman
6d91c64dae Update SQLAlchemy-Utils to 0.36.5 (#6448)
This makes the Python unit tests compatible with Python 3.10
2023-09-12 13:32:58 +00:00
Eric Radman
ca36130e76 Update package.lock for updated python versions (#6446)
Output of `poetry update requires-python`
2023-09-12 02:53:00 +00:00
Guido Petri
0993f68fa0 Poetry conversion followup (#6440)
* change author and add maintainers

* remove bin/upgrade

* update project author/maintainers

* comment on how to get added/removed from the mailing list
2023-09-11 22:25:54 -04:00
Daniel Stevenson
f109af9f30 Check all Trino catalogs if no catalog configured (#5860)
* Check all Trino catalogs if no catalog configured

- If catalog is not set, query 'SHOW CATALOGS' to get catalogs
- For each catalog, discover schema, table, columns
- If catalog has a `.`, then quote the catalog name
- New table name returned includes catalog name
- If catalog is set, same result as before

* Use self._handle_run_query_error(error)

* Fix lint problem & format w/ black

* Fix condition so catalog_prefixes are [""] when catalog is set

* Fix for loop / Remove default values for catalog & schema

* Add untested tests for Trino's get_schema

* Black formatting

* Add test_get_schema_catalog_set test & fix tests

* Parameterize the side_effect fn thoroughly

* Get catalogs (not catalog_prefixes) bc confusing

* Trino._get_catalogs added for testability
2023-09-11 21:16:07 -04:00
Eric Radman
b4e4a5a928 Accept Python 3.8-3.10 (#6445)
For running a development environment on Ubuntu 22
2023-09-11 15:26:31 -04:00
Will Lachance
ca900769c2 Replace flake8/isort with ruff (#6441)
There's a few advantages of using ruff over these tools:

* It's way faster
* It's easier to configure
* It includes support for a bunch of other linters (for example bugbear)
  right out of the box, which catches some things and makes our code
  more consistent.

Ruff works great with black, which I'd recommend we continue using.

Fixed a few minor issues that the new linter combo picked up.
2023-09-11 06:41:08 -04:00
Guido Petri
c97afeb327 Convert project to poetry (#6423)
* poetry init

* add all dependencies

* update pyproject.toml

* add poetry.lock

* remove requirements txt fixer

* add ldap3 group and make all groups optional

* remove requirements files

* convert dockerfile to use poetry instead of pip

* fix ldap 3 dependency group typo

* update ldap3 inline error

* update cypress to install only main poetry group

* convert test_all_deps

* update redis/rq

* don't create virtualenv

* add -dev suffix and make version snapshot work

* fix typo in snapshot commit message

* remove importlib-resources
2023-09-08 23:57:26 +00:00
Leandro Lomónaco
b1f738fc96 Excel and CSV Query Runner fix (#6439) 2023-09-08 18:07:06 -04:00
Eric Radman
6f6d203ca9 Remove importlib-resources from requirements (#6431)
This is not required for Python >= 3.8 since the goal of this project is
to back port functionality.  Also the version specified is not
compatible with later versions of Python.

https://pypi.org/project/importlib-resources/
2023-09-07 13:28:30 -04:00
Tomoki Sekiyama
36482f6717 Move from oauth2client to google-auth / support ADC (#6422)
oauth2client was deprecated in 2017 and is no longer maintained.
This rewrites the service credentials code and replaces it with google-auth.

It also makes the JSON key file optional for the data source and use the
application's default credentials (ADC) if the JSON key file is omitted.
This enables support for a variety of GCP authentication methods, including
the gcloud CLI, GCE metadata servers, and GKE or AWS Workload Identity.

Note that the bigquery_gce functionality is covered by ADC, but is retained
for compatibility reasons.

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-09-07 23:50:18 +10:00
Eric Radman
3fee9f6cef Update pymssql and rapidjson (#6428)
Updates to these libraries are required for local development setup on Ubuntu 22 (python 3.10)
2023-09-06 18:58:06 -04:00
Vlad Gramuzov
cb4af6dd57 Add Tinybird query runner (#5616)
"

Co-authored-by: Thomas Rausch <thomas@thrau.at>
2023-09-06 12:59:08 +00:00
Avey777
7f42bf1b65 Add feature: Hide filter components on shared pages (#6115)
* Hide-filter-components-on-shared-pages

* Restyled by prettier

* Fix typo

---------

Co-authored-by: Jengro Woo <Jengro777@outlook.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-09-06 22:51:48 +10:00
Justin Clift
41495ba940 Update rq related dependencies, to hopefully alleviate issue 6424 (#6426) 2023-09-06 18:37:49 +10:00
Wataru Kurashima
9b18e1805c ci: use docker/build-push-action (#6425) 2023-09-06 17:52:38 +10:00
Anirudh Bagri
c2e7df098d Add webex as destination (#5574)
* Add webex as destination

* import from destinations explicitly

* make format

* remove unattributed image

* make webex bot token required

* don't use magic string

* add metadata kwarg

* simplify link creation

* simplify alert description

* simplify alert subject

* split attachments template into method

* DRY message posting

* use api endpoint method

* add missing param to post_message

* static method

* static method attachments template

* log exception if send fails

* simplify destination handling

* transparent image / right size webex logo

* remove unused organization param

* rename api endpoint and make it a property

* add test

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-09-05 00:26:21 +00:00
Omer Lachish
f1d5ac0d58 Convert unexpected parameter validation errors to InvalidParameterError (#4084)
* convert unexpected validation errors to InvalidParameterError

* get rid of local except blocks - any failure to validate is caught in _valid()

* avoid bare exception

* don't assign exception if we're not going to use it

* preferentially raise querydetachedfromdatasource error if it is present

---------

Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-09-04 21:08:41 +00:00
Justin Clift
710dd8c51b Generate docker hub preview image (#6420)
This needs the appropriate Docker Hub login credentials set in our GitHub settings before it will work properly.

  * DOCKER_USER environment variable
  * DOCKER_PASS secret
2023-09-04 04:30:24 +10:00
Justin Clift
2a2c90a014 Add pkg-config to the Docker image (#6419)
Without pkg-config the MySQL client install doesn't always work
2023-09-03 07:10:54 +00:00
Eric Radman
ab71bded7d Automatically tag release candidates (#6416)
Format similar to Ubuntu: YY.MM.N

Discussion:

  https://github.com/getredash/redash/discussions/6411

1. Updates version in:

  package.json
  redash/__init__.py

2. Sets version tag
2023-09-02 01:10:41 +00:00
kaiba
7b722a1067 Fix typo from ElasticSearch to Elasticsearch (#6349) 2023-09-01 22:11:47 +10:00
Justin Clift
c70d397c72 Fix Cypress not running in forked repos (#6413) 2023-09-01 21:31:56 +10:00
Tsuneo Yoshioka
abe70ab3ca Use multi_byte_search_enabled option for My Queries search and Favorite List search (#5761)
* Use multi_byte_search_enabled option for My Queries search and Favorite List search

* make format

* add search by user tests

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-08-31 21:43:18 -05:00
Omer Lachish
fcbe726eb2 Expire schemas after 7 days (#5112)
* expire schemas after 7 days

* expire schemas 7 days after the last refresh_schemas scheduled time

* format files

* add expire schema test

* patch schema away

* return nothing on schema get

* fix redis key name

* finally run tests locally and fix tests

---------

Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: konnectr <1konnectrl@gmail.com>
Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-09-01 01:20:45 +00:00
ufedor
528807f336 Add 'click' functionality for Chart visualization (#5662)
Co-authored-by: Jesse <jwhitehouse@airpost.net>
Co-authored-by: Justin Clift <justin@postgresql.org>
Reviewed-by: Eric Radman <eradman@starfishstorage.com>
2023-08-31 12:42:13 -04:00
yutopp
28db934698 Google Spreadsheet Data Source: support to find a worksheet by title (#5334)
* Support to find a worksheet by the title for google_spreadsheets

* Add tests for parse_query

* Fix types

* Add tests when finding a worksheet by a title is failed

* Proxy by a wrapper instead of using spreadsheet directly. Do not use gspread in tests

* Add tests. Fix format of quoted strings for titles

* Fix an error format

* Add a newline

* Fix formatting

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-31 16:28:12 +10:00
Eric Chang
182d84226b New alert destination: Asana (#5753)
* Add Asana alert destination

* change icon

* fix format

* add except in log

* fix flake8

* add metadata kwarg to notify

* update asana image

* make pat and project id required

* rename asana destination icon

* reuse Alert

* extract api base url to property method

* use required options

* add asana destination test

* make format

* define metadata

* fix test

* remove json.dumps from asana test

---------

Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: konnectr <1konnectrl@gmail.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-08-31 04:12:21 +00:00
Michael Parque
5b110b61f0 [client] Fix local dev QueryEditor crash when using a data source with "custom" syntax (#5271)
* [client] add friendly console log on '<' syntax error

Issue: when a javascript file is served with invalid contents, sometimes
it means that a fallback html file was returned from server instead.
This can be hard to determine because the stack trace is not helpful and
the `filename` information was previously lost from the global error
handler.

Added a specific error for this case to produce a friendlier error
message on the console.

* Add ace define override for custom mode

* Apply prettier changes

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-30 21:22:49 -04:00
David
d8b10a0f16 Update snowflake application name (#6403)
* SGA-9999 update header

* SGA-9999 update header
2023-08-30 20:34:06 -04:00
dependabot[bot]
972a49bb9d Bump restrictedpython from 6.1 to 6.2 (#6407)
Bumps [restrictedpython](https://github.com/zopefoundation/RestrictedPython) from 6.1 to 6.2.
- [Changelog](https://github.com/zopefoundation/RestrictedPython/blob/6.2/CHANGES.rst)
- [Commits](https://github.com/zopefoundation/RestrictedPython/compare/6.1...6.2)

---
updated-dependencies:
- dependency-name: restrictedpython
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 19:26:02 -04:00
Peter Dave Hello
45e791b675 Sync nodejs version in .nvmrc with Dockerfile & .github/workflows/ci.yml (#6401)
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-29 01:05:10 +00:00
Justin Clift
b73d68f056 Use a fixed older version of databend, due to problem with 0.4.7 (#6402) 2023-08-29 00:18:03 +00:00
ehearty
0258dca82a Enable manipulating parameterized queries with Query Results query runner (#5723)
* feat: pass query parameters to query results queries

* prefixing parameterized queries with param_query_<query_id>

* added tests

* Fix formatting, and also fix accidental paste.

---------

Co-authored-by: Elena Hearty <ehearty@whyhotel.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-24 20:47:27 -04:00
Omer Lachish
2d6f5b091c Base duplicate index on column names (#4600)
* increase duplicate column names based on the original column name and not the number of duplicates detected

* add fetch columns test for base query runner

---------

Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-08-24 04:18:05 +00:00
Omer Lachish
1ef63fc3f4 Cleaner pytest results (#4711)
* silence deprecataion warnings

* add some sugar

* filter warnings to only display once

* remove pytest-sugar

---------

Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-08-23 23:38:25 -04:00
snickerjp
fdd1d29693 Add redash.query_runner.oracle to default_query_runners (#6389) 2023-08-24 13:21:58 +10:00
Ivan Torgashov
e18cd8f248 Passing Request metadata to Alert destinations (#5230) 2023-08-23 23:08:52 -04:00
iwakiriK
5eeeb5c62e Fix: Cannot refresh if a query name contain control characters. (#5602) 2023-08-23 20:12:22 +00:00
Vladislav Denisov
1af49e9ddb added requirements-txt-fixer to pre-commit (#6388) 2023-08-24 05:24:44 +10:00
snickerjp
7eae598546 Replace cx_Oracle with python-oracledb (#6386) 2023-08-23 10:41:48 +00:00
mari
0ad43de229 Fix #4402. Removed token from the required list. (#5354)
* Fix issue #4402. Removed token from the required list.

* Update redash/query_runner/salesforce.py

Co-authored-by: Jay Chung <zhongjiajie955@gmail.com>

* Update redash/query_runner/salesforce.py

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: Jay Chung <zhongjiajie955@gmail.com>
2023-08-23 14:24:48 +10:00
htamakos
63140260eb Add useQueryAnnotation option to BigQuery Runner (#5675)
* Add useQueryAnnotation option to BigQuery Runner

* Fix formatting

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-22 21:43:07 -04:00
Vladislav Denisov
caf8097c9d fixed module 'numpy' has no attribute 'bool' (#6371) 2023-08-22 20:58:27 -04:00
pong
4107265feb Sometimes self._profile_image_url is empty string (#5308) 2023-08-23 07:54:10 +10:00
Nobuaki Mochizuki
5d8364437a Fix an issue when using Impala's reserved keywords (#5198) 2023-08-23 07:42:58 +10:00
Justin Clift
fcf847eaaf Fix: query result datetime column type check (#5369) (#6385)
Co-authored-by: kazuki.morozumi <kazuki.m777@gmail.com>
Co-authored-by: kawamataryo <ba068082@gmail.com>
Co-authored-by: Masukawa Takeshi <takeshi.masukawa@lapras.com>
2023-08-22 21:18:19 +00:00
Stephen Darlington
9751678c44 Add Apache ignite Query Runner (#5767) 2023-08-23 03:47:10 +10:00
Peter Chen
f49075bada add ssl_config to redshift iam class (#5465)
Co-authored-by: peterxichen <peterxichen@aol.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-21 13:37:59 +10:00
Jesse
772680bbd2 New cypress test: sorting dashboard list does not crash page. (#5702)
* New cypress test: sorting dashboard list does not crash page.

* Restyled by prettier (#5703)

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>
2023-08-20 21:03:47 -05:00
snickerjp
0586b43b75 Add offset for query_runner/oracle.py Error Message. (#6373) 2023-08-20 05:16:35 +10:00
Eric Radman
0f88a23835 Allow the X and Y tick format to be customized using a D3 format string (#6370)
Numbers: https://d3-wiki.readthedocs.io/zh_CN/master/Formatting/
Date/Time: https://d3-wiki.readthedocs.io/zh_CN/master/Time-Formatting/
2023-08-16 12:09:33 -04:00
Evgeny
4a5c9c2630 Scheduled queries should include origin Username (#6368) 2023-08-16 13:20:19 +10:00
Eric Radman
f8934b8312 Switch from numeral to numbro (#6344)
numeraljs is no longer maintained, and incorrectly parses high-precision
floats (such as 1.2e-7) as NaN.
2023-08-15 07:59:18 -04:00
Harry C
d333660473 Fix python query runner crashing the GUI due to missing 'rows' and/or… (#5749)
* Fix python query runner crashing the GUI due to missing 'rows' and/or 'columns' in the JSON returned data.

* Fix typo of previous commit.

* Throw exception when python query runner has invalid result.

* Update test_python.py
---------

Co-authored-by: YuhengChen <yuheng.chen@imaygou.com>
2023-08-07 21:03:12 +05:00
Manik Somayaji
f4a930ddeb Fix: Query results in public dashboard not loading when query ends with semicolon (#6351)
* Fix: Query results in public dashboard not loading when query ends with semicolon

* fix flake8 error for commit 7a50b18d3

---------

Co-authored-by: Alexander Strickner <alexander.strickner@outlook.com>
2023-08-07 04:45:21 +10:00
Konstantin Smirnov
113146e4b8 Add data type info into schemas of Trino tables (#6348)
The current get_schema method of Trino query runner is missing table columns' data types information, so these data types won't be seen in Queries editing GUI. After the modification, these info are back.

Co-authored-by: V <4979571+vnnw@users.noreply.github.com>
2023-08-05 16:07:43 +05:00
Justin Clift
126fe9310f Have make create_database create .env if its missing (#6345) 2023-08-03 16:35:03 +00:00
Konstantin Smirnov
0d1ce4d98c Incomplete URL substring sanitization (#6342)
* Incomplete URL substring sanitization

* fix hostname

* Only match on the exact host name

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-02 21:31:18 +00:00
Justin Clift
acf77f85ff Fix the broken icon loading (#6340) 2023-08-02 15:56:51 +00:00
Justin Clift
71bf65b496 Have make compose_build create .env if its missing (#6339) 2023-08-02 20:42:58 +10:00
dependabot[bot]
204e5c1fb9 Bump cryptography from 41.0.2 to 41.0.3 (#6338)
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.2 to 41.0.3.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.2...41.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 14:19:27 +10:00
Justin Clift
37fa1ec057 Update make env to not run multiple times (#6336) 2023-08-01 22:05:43 +10:00
snickerjp
f4ee891d68 Do not makedsn for query_runner/oracle.py (#6332)
* Do not makedsn. instead self.configuration["servicename"]
in host == "_donotmakedsn"

* add comment

* mod properties in `host`

* mod properties in `host`

* mod word. in host == "_donotmakedsn" to "_useservicename"

* mod properties in `host`

* fix format
2023-08-01 22:04:45 +10:00
Konstantin Smirnov
196bfece30 Fix warning test query (#6335)
* replace assertDictContainsSubset -> asserLessEqual

* refactor definition set
2023-08-01 18:57:22 +08:00
Peter Lee
1726aef0fc add pg types map (#6333)
* add pg types map

* Update pg.py
2023-08-01 10:49:34 +00:00
Konstantin Smirnov
afc6d878c2 replace hmset -> hset (#6331) 2023-08-01 08:57:09 +00:00
dependabot[bot]
9a7d2cdc02 Bump cryptography from 40.0.2 to 41.0.2 (#6188)
Bumps [cryptography](https://github.com/pyca/cryptography) from 40.0.2 to 41.0.2.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/40.0.2...41.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-01 01:37:26 +00:00
Justin Clift
2b8aa5cb32 Bump snowflake-connector-python to 3.1.0 (#6330) 2023-08-01 00:47:58 +00:00
Justin Clift
39477c73ad Webpack-dev-server seems to require the dev-middleware config (#6329) 2023-08-01 07:12:33 +10:00
Jay Chung
353ea868ff Unused qr should respect env setting (#5337)
* Monitor unused qr respect env setting

* style
2023-07-31 20:16:34 +05:00
Justin Clift
7dfacfc531 Update package.json so yarn watch works again (#6328)
For some unknown reason the `--colors` and `-d` options are no longer recognised by webpack (v4) in our configuration.

This is likely due to some other non-obvious problem in our configuration, as those options should exist (they're documented).

For now though, this gets things working again.
2023-07-31 13:47:05 +00:00
Justin Clift
ad39059558 Fix webpack error in viz-lib (#6324)
The config file format for webpack has changed slightly, so webpack was throwing this error:

  Invalid options object. Less Loader has been initialized using an
  options object that does not match the API schema.

This commit updates the config file format so webpack works again.
2023-07-31 21:12:37 +10:00
Jay Chung
a9a348cd64 Use set in fetch_columns for efficient (#5336)
Change list to set
2023-07-31 18:24:49 +10:00
Justin Clift
4155507695 Use exclude list with flake8 pre-commit check (#6322) 2023-07-31 02:33:00 +00:00
Konstantin Smirnov
f6ba9501da fix flake8 (#6321) 2023-07-30 17:58:15 +00:00
Justin Clift
ae29eb3dfb Bump react-test-renderer to 16.14.0 (#6316) 2023-07-29 12:27:29 +00:00
mattdjones
ea3d825a78 Commit the transaction for MS SQL inserts & Updates (#2538)
As discussed here https://discuss.redash.io/t/insert-or-update-query-does-not-apply-in-sql-server/1233
We have made the change to our local installation, it would be great if we can have this included.
@arikfr
2023-07-29 19:33:09 +10:00
Eric Radman
0d699328b8 Allow RSA key used for JWT to be specified as a file path (#6271)
- auth_jwt_auth_public_certs_url may file:// in addition to http/https
- Log an error if payload does not contain an email address
2023-07-29 19:20:18 +10:00
Bryan Yang
8f71e14887 Fixed python query runner and add unittest for python query runner (#4731)
* add test for python runner

* fixed CustomPrint

* remove print

* Reformatted to pass our backend lint tests

Reformatted using:

  $ make format

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-28 20:40:16 -05:00
Justin Clift
5561b5fc55 Fix the peer dep warning about leaflet in viz-lib (#6315) 2023-07-29 06:52:41 +10:00
Justin Clift
ea4ee7ce9b Remove request from the declared dependencies (#6313) 2023-07-28 05:54:35 +00:00
Justin Clift
b43cb1797e Bump Cypress to 11.2.0 (#6312) 2023-07-28 04:24:28 +00:00
Justin Clift
875973bfcd Bump Cypress to 10.11.0 (#6311) 2023-07-28 12:56:03 +10:00
Shunsuke Ohashi
1b064da901 return project id as str, not bytes (#6303) 2023-07-27 20:29:22 -05:00
Justin Clift
55690db1d8 Bump Cypress to 9.7.0 (#6309)
* Bump Cypress to 9.7.0

* Initial fixes for Cypress 9.7.0

* Restyled by prettier (#6310)

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>
2023-07-27 23:40:00 +00:00
Justin Clift
a5a9be352d Bump webpack-build-notifier to 2.3.0 (#6308) 2023-07-28 08:32:02 +10:00
Justin Clift
72db9757f8 Bump @percy/agent to 0.28.7 (#6307) 2023-07-27 20:49:35 +00:00
dependabot[bot]
ffbf0fbe45 Bump minimist from 1.2.0 to 1.2.8 (#6306)
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.0 to 1.2.8.
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.0...v1.2.8)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 19:52:29 +00:00
Justin Clift
d0f5215cd8 Bump eslint-loader to 4.0.2 (#6305) 2023-07-27 19:17:19 +00:00
Justin Clift
6d495bc83d Bump mini-css-extract-plugin to 1.6.2 (#6304) 2023-07-27 18:22:02 +00:00
Justin Clift
e012d25585 Add yarn.lock missing from PR #6300 (#6302) 2023-07-27 14:55:20 +00:00
Justin Clift
7a421cf6d0 Bump plotly.js to 1.58.5 in viz-lib (#6300) 2023-07-27 09:13:26 +10:00
dependabot[bot]
58b505536f Bump json5 from 1.0.1 to 1.0.2 in /viz-lib (#6299)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-26 22:01:44 +00:00
Justin Clift
a7c15b078a Bump babel-plugin-module-resolver to 5.0.0 in viz-lib (#6296) 2023-07-27 07:26:33 +10:00
Justin Clift
03d54d3313 Update Netlify to NodeJS 16.20.1 and Yarn 1.22.19 (#6298)
Also, Netlify doesn't seem to need yarn force installed any more
2023-07-26 20:48:45 +00:00
Justin Clift
fbe2f4d808 Update NodeJS in our CI to 16.20.x (#6297) 2023-07-26 19:35:41 +00:00
Justin Clift
5cd38b14b0 Bump file-loader to 6.2.0 (#6295) 2023-07-26 18:01:42 +00:00
Justin Clift
a8e1077bb7 Some manual dedupes of yarn.lock (#6294)
Yarn seems to miss a lot of deduplication opportunities, regardless of what the docs claim.

This can leave old, insecure versions of some dependencies in use when they shouldn't be.
2023-07-26 16:49:45 +00:00
Justin Clift
f572d88d8e Bump less to 3.13.1 in main repo, and to 4.1.3 in viz-lib (#6293)
Also bumps some of the less related dependencies in the main repo:

  * less-loader to 5.0.0
  * less-plugin-autoprefix to 2.0.0
2023-07-26 15:30:43 +00:00
Justin Clift
ba1b496f51 Bump webpack-cli to 4.10.0 (#6292) 2023-07-26 23:40:49 +10:00
Justin Clift
050b9e8716 Bump babel-loader to 8.3.0 (#6291) 2023-07-26 12:24:27 +00:00
Justin Clift
239f8abf70 Bump Cypress to 7.7.0 (#6289) 2023-07-26 20:33:58 +10:00
Eric Radman
2795e1b7a0 Render counter widgets using relative font size (#6191)
Using `transform` scales contents in in height and width, resulting in text wrapping even if there is horizontal space.
2023-07-26 14:07:16 +10:00
Justin Clift
4a847388fe Bump style-loader to 3.3.3 in viz-lib (#6286) 2023-07-25 13:15:44 +00:00
Justin Clift
2eed83bd7c Bump copy-webpack-plugin to 6.4.1 (#6285) 2023-07-25 12:32:02 +00:00
Justin Clift
34d380d427 Bump babel-plugin-istanbul to 6.1.1 (#6284) 2023-07-25 11:44:40 +00:00
Justin Clift
93a2901f6d Bump @cypress/code-coverage to 3.11.0 (#6283) 2023-07-25 10:22:32 +00:00
Justin Clift
2946713a15 Bump various @babel in /viz-lib to latest 7.x. Mostly 7.22.x (#6282) 2023-07-25 08:58:13 +00:00
Justin Clift
1b8f0ac2e9 Bump @babel/(various) to latest. Mostly 7.22.x (#6281) 2023-07-25 07:29:58 +00:00
dependabot[bot]
0701ee9b28 Bump color-string from 1.5.4 to 1.9.1 (#6280)
Bumps [color-string](https://github.com/Qix-/color-string) from 1.5.4 to 1.9.1.
- [Release notes](https://github.com/Qix-/color-string/releases)
- [Changelog](https://github.com/Qix-/color-string/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Qix-/color-string/compare/1.5.4...1.9.1)

---
updated-dependencies:
- dependency-name: color-string
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-25 06:05:34 +00:00
Justin Clift
ef7e38de49 Bump ts-migrate to 0.1.35 in viz-lib (#6279) 2023-07-25 14:49:59 +10:00
Justin Clift
ff1531bee4 Bump express to 4.18.2 (#6278) 2023-07-25 13:15:28 +10:00
dependabot[bot]
f172f15c7f Bump minimist from 1.2.5 to 1.2.8 in /viz-lib (#6276)
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.8.
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.8)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-25 01:44:48 +00:00
Justin Clift
ae10477e50 Bump request to 2.88.2 in viz-lib (#6275)
Had to hand edit the yarn.lock file (!), because I couldn't get the yarn command to do what I was trying to do.
2023-07-25 11:02:32 +10:00
Justin Clift
0a4d250268 Bump request to 2.88.2 (#6273) 2023-07-25 09:18:05 +10:00
Justin Clift
177f33a460 Bump plotly.js to 1.54.4 in viz-lib (#6272) 2023-07-24 21:48:56 +00:00
Justin Clift
6e4f96405d Bump React to exactly 16.14.0 (#6270)
This gets rid of a peer dependency warning from viz-lib.
2023-07-25 05:24:06 +10:00
Konstantin Smirnov
3446e7e569 update jest viz_lib (#6261) 2023-07-23 20:10:14 +05:00
Konstantin Smirnov
ef06dff433 bump jest to 24.9.0 (#6259) 2023-07-23 12:19:43 +00:00
dependabot[bot]
afa723c435 Bump js-yaml from 3.12.2 to 3.14.0 (#6260)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.2 to 3.14.0.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.12.2...3.14.0)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 21:19:34 +10:00
dependabot[bot]
4fb78387aa Bump bl from 1.2.2 to 1.2.3 (#6257)
Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Changelog](https://github.com/rvagg/bl/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: bl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 21:19:20 +10:00
Justin Clift
f8e9887feb Bump @pmmmwh/react-refresh-webpack-plugin to 0.5.10, react-refresh to 0.14.0 (#6258) 2023-07-23 20:39:59 +10:00
dependabot[bot]
f5c53efb3e Bump ws from 5.2.2 to 5.2.3 (#6252)
Bumps [ws](https://github.com/websockets/ws) from 5.2.2 to 5.2.3.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/5.2.2...5.2.3)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 20:06:51 +10:00
dependabot[bot]
37fd7f74dd Bump dompurify from 2.0.7 to 2.0.17 (#6256)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.0.7 to 2.0.17.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/2.0.7...2.0.17)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 19:26:12 +10:00
dependabot[bot]
3bddbcb025 Bump hosted-git-info from 2.7.1 to 2.8.9 (#6255)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.7.1 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.9)

---
updated-dependencies:
- dependency-name: hosted-git-info
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 19:24:05 +10:00
Justin Clift
f1477c825e Bump webpack-dev-server from 3.11.0 to 4.15.1 (#6254) 2023-07-23 19:14:53 +10:00
dependabot[bot]
416e6cb864 Bump ssri from 6.0.1 to 6.0.2 (#6247)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

---
updated-dependencies:
- dependency-name: ssri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:45:05 +10:00
dependabot[bot]
d4c69beef9 Bump path-parse from 1.0.6 to 1.0.7 (#6253)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:42:41 +10:00
Justin Clift
868453077a Bump css-loader from 0.28.7 to 1.0.1 (#6251) 2023-07-23 18:27:39 +10:00
dependabot[bot]
8973772548 Bump ansi-regex from 3.0.0 to 3.0.1 in /viz-lib (#6244)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:25:47 +10:00
dependabot[bot]
e2c824e1d5 Bump ini from 1.3.5 to 1.3.8 (#6250)
Bumps [ini](https://github.com/npm/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/npm/ini/releases)
- [Changelog](https://github.com/npm/ini/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/ini/compare/v1.3.5...v1.3.8)

---
updated-dependencies:
- dependency-name: ini
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:23:10 +10:00
dependabot[bot]
ed0075d495 Bump acorn from 5.7.3 to 5.7.4 (#6248)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

---
updated-dependencies:
- dependency-name: acorn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:22:23 +10:00
dependabot[bot]
de1e6ba018 Bump y18n from 4.0.0 to 4.0.3 (#6249)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/y18n-v4.0.3/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/compare/v4.0.0...y18n-v4.0.3)

---
updated-dependencies:
- dependency-name: y18n
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:19:47 +10:00
dependabot[bot]
2d6928469a Bump dns-packet from 1.3.1 to 1.3.4 (#6246)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4)

---
updated-dependencies:
- dependency-name: dns-packet
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 17:18:27 +10:00
dependabot[bot]
3370a34b6e Bump ajv from 6.9.2 to 6.12.6 (#6245)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.9.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.9.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 07:00:39 +00:00
dependabot[bot]
5f2aad2009 Bump elliptic from 6.4.1 to 6.5.4 (#6243)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.1 to 6.5.4.
- [Commits](https://github.com/indutny/elliptic/compare/v6.4.1...v6.5.4)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 06:44:20 +00:00
dependabot[bot]
58fc8f4aee Bump minimatch from 3.0.4 to 3.1.2 (#6242)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 06:37:47 +00:00
dependabot[bot]
a32c0dfb58 Bump lodash from 4.17.19 to 4.17.21 in /viz-lib (#5496)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 05:50:26 +00:00
dependabot[bot]
34c20afdd8 Bump decode-uri-component from 0.2.0 to 0.2.2 (#6241)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 05:05:11 +00:00
Justin Clift
7871e80abf Bump webpack to 4.46.0, webpack-bundle-analyzer to 4.9.0 (#6240)
This should help unblock some Dependabot updates
2023-07-23 04:25:08 +00:00
dependabot[bot]
00eab75127 Bump mixin-deep from 1.3.1 to 1.3.2 (#6239)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

---
updated-dependencies:
- dependency-name: mixin-deep
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 03:35:41 +00:00
dependabot[bot]
f3a768edb8 Bump eventsource from 1.0.7 to 1.1.2 (#6238)
Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.0.7 to 1.1.2.
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.0.7...v1.1.2)

---
updated-dependencies:
- dependency-name: eventsource
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 12:50:37 +10:00
dependabot[bot]
518fb33c7e Bump handlebars from 4.1.0 to 4.7.7 (#6237)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.0 to 4.7.7.
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.0...v4.7.7)

---
updated-dependencies:
- dependency-name: handlebars
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 12:02:25 +10:00
dependabot[bot]
9829a0957a Bump loader-utils from 1.4.0 to 1.4.2 in /viz-lib (#6236)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 01:22:37 +00:00
dependabot[bot]
4113bb532c Bump url-parse from 1.4.7 to 1.5.10 (#6235)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.10.
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 00:09:26 +00:00
Justin Clift
416126abd3 Bump webpack-cli to ^3.3.12 (#6234) 2023-07-22 23:25:51 +00:00
dependabot[bot]
02c8f71710 Bump loader-utils from 1.2.3 to 1.4.2 (#6233)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.2.3 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.2.3...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-22 22:42:32 +00:00
Justin Clift
7248be14bb Bump html-webpack-plugin to ^4.5.2 (#6232)
In theory (!), this should fix a dependabot warning.
2023-07-23 07:59:16 +10:00
Justin Clift
448bb99b7e Update webpack related deps in viz-lib (#6230) 2023-07-23 06:30:56 +10:00
Tadayuki Onishi
f2e31a602e [enhancement] Add a CLI command in order to create organization (#5869)
* Add a cli command in order to create organization

* Update redash/cli/organization.py

Co-authored-by: Jun <junnplus@gmail.com>


* add test

---------

Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: Jun <junnplus@gmail.com>
Co-authored-by: konnectr <1konnectrl@gmail.com>
2023-07-22 19:20:17 +05:00
Fernando Salcido
79ef3e4eb0 Handle error when data_source is None (#4936)
* add try except for data_source

* add try except for data_source

* fix errir handle

* add test for no data source

* changed error handle

* fix format

* fix test

---------

Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: konnectr <1konnectrl@gmail.com>
2023-07-22 19:17:49 +05:00
Konstantin Smirnov
b30622e531 delete password in the log (#6228) 2023-07-22 19:16:41 +10:00
Jannis Leidel
d2322c9904 Store start datetime in redash:status hash again. (#4894)
Fix #4893.

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-22 19:15:05 +10:00
Konstantin Smirnov
bac15db21f bump PyYaml to 6.0.1 (#6227) 2023-07-21 21:23:01 +00:00
Tejas Agrawal
b284dfe40d improvement: MongoDB - JSON syntax error sent back to Client (#6068) 2023-07-21 13:18:37 +00:00
Justin Clift
81da13b461 Add "make format" command (#6225) 2023-07-21 12:43:37 +00:00
Vitaly Vakhteev
7f4ade5f1f Feature/Add Discord Alert Destination (#6106)
* Add discord webhook

* Fix icon

* Boto3 dependency

* Add unit test for Discord webhook

* Add suggestions

* Apply suggestions from code review

Co-authored-by: Jun <junnplus@gmail.com>

* Misunderstood suggestion )

* Add suggestions

* Apply suggestions from code review

Co-authored-by: Jun <junnplus@gmail.com>

* Fix test

* Fix variables in strings

* Fix formatting using our pre-commit hook

---------

Co-authored-by: Jun <junnplus@gmail.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-21 12:14:42 +00:00
Peter Lee
8376e41684 Fix worker error in macOS (#6224)
* Update worker.py
* fix
---------

Co-authored-by: rajat goyal <gyl.rajat@gmail.com>
2023-07-21 21:10:19 +10:00
Naka Masato
c8eb445ce9 Remove hipchat (#5486)
* Remove hipchat
* Remove hipchat logo

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-21 09:23:15 +00:00
Justin Clift
e4302d9163 Bump ua-parser to 0.18.0 (#6221) 2023-07-21 13:29:51 +05:00
Peter Lee
be306e9284 fix pubic dashboard not update result #6203 (#6214) 2023-07-21 12:32:59 +05:00
ImhotepW
91eee2b49e Refactor permissions (#5600)
* Updated admin permission definition location

* Updated admin permission definition location for create_org and init_db

* format

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: Oleksandr <oleksandr_vasylenko4@epam.com>
Co-authored-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 07:18:28 +00:00
Konstantin Smirnov
bee833a6c1 update werkzeug==2.3.6 (#6219) 2023-07-21 15:35:41 +09:00
ChengDaqi2023
37f008cccb update ua-parser 0.8.0 to 0.15.0 (#6199) 2023-07-21 16:27:47 +10:00
Jun
77a2c24d47 fix test warning (#6217)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 14:52:46 +09:00
Jun
05c9b35e42 bump sentry to 1.28.1 (#6212)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 11:54:16 +09:00
Jun
f41eab7054 use CryptContext.hash instead of CryptContext.encrypt (#6211)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 11:51:00 +09:00
Jun
cd0bbc2621 Use 'urllib.parse.quote' instead 'werkzeug.urls.url_quote' (#6209)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 10:52:29 +09:00
Jun
20dbb461e9 Use assertEqual instead of assertEquals (#6210)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 10:52:18 +09:00
Jun
0dd8614d5d bump pysaml2 to 7.3.1 (#6208)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 10:52:09 +09:00
dependabot[bot]
281b552346 Bump urllib3 from 1.25.11 to 1.26.5 (#6136)
Dependabot couldn't find the original pull request head commit, b868bb5edd4a3fc036ed40754f099f37541a2814.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-21 09:33:07 +09:00
Jun
3e8222de17 upgrade boto3 and botocore (#6207)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 08:56:30 +09:00
Justin Clift
4869a652c0 Bump Cypress to 6.0.1 (#6205)
* Bump Cypress to 6.0.1

Unfortunately, due to a change in how Cypress treats elements with opacity 0, we need to disable two of the front end tests.

Hopefully someday, someone with better knowledge of JS and Cypress is able to fix these. :)
2023-07-21 02:08:15 +10:00
vvsd
0c223b6af7 update httplib2 0.14.0 to 0.19.0 (#5865)
Co-authored-by: Jun <junnplus@gmail.com>
2023-07-21 01:06:19 +10:00
Justin Clift
ff6377b6e2 Bump SQLAlchemy-Searchable to 1.2.0 (#6173)
* Drop pyparsing, update SQLAlchemy-Searchable to 1.2.0

* fix make_searchable (#6180)

* fix test

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: Spencer Weeks <Spince@users.noreply.github.com>
Co-authored-by: Ye Sijun <junnplus@gmail.com>
2023-07-20 23:27:58 +09:00
dependabot[bot]
f3ba10ff32 Bump sqlparse from 0.3.0 to 0.4.4 (#6049)
* Bump sqlparse from 0.3.0 to 0.4.4

Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.3.0 to 0.4.4.
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](https://github.com/andialbrecht/sqlparse/compare/0.3.0...0.4.4)

---
updated-dependencies:
- dependency-name: sqlparse
  dependency-type: direct:production
...

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

* use str instead of text_type

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ye Sijun <junnplus@gmail.com>
2023-07-20 10:39:26 +09:00
Justin Clift
9736bc76f7 Bump Cypress to 5.6.0 (#6198) 2023-07-19 10:18:19 +00:00
Justin Clift
87adad9afc Update our dev and CI docker to use NodeJS 16.20.1 (#6178) 2023-07-19 08:59:42 +00:00
Justin Clift
a63d7d9ad8 Add (dev focused) Discord link to the README (#6197) 2023-07-19 07:13:56 +00:00
dependabot[bot]
d3f118a74b Bump path-parse from 1.0.6 to 1.0.7 in /viz-lib (#5562)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 15:56:39 +10:00
dependabot[bot]
17a03628e4 Bump y18n from 4.0.0 to 4.0.3 in /viz-lib (#5554)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/y18n-v4.0.3/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/compare/v4.0.0...y18n-v4.0.3)

---
updated-dependencies:
- dependency-name: y18n
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 15:56:21 +10:00
dependabot[bot]
255f2221c6 Bump hosted-git-info from 2.8.8 to 2.8.9 in /viz-lib (#5497)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 15:54:59 +10:00
Justin Clift
698498d896 Update README to point at wiki based dev guide (#6196) 2023-07-19 05:11:12 +00:00
dependabot[bot]
4092d418f6 Bump tmpl from 1.0.4 to 1.0.5 in /viz-lib (#5597)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 14:04:54 +09:00
Jun
af243be0b3 bump copy-webpack-plugin to 5.1.2 (#6195)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-19 14:03:48 +09:00
dependabot[bot]
897e3dbd3b Bump ws from 5.2.2 to 5.2.3 in /viz-lib (#5553)
Bumps [ws](https://github.com/websockets/ws) from 5.2.2 to 5.2.3.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/5.2.2...5.2.3)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-19 13:59:44 +09:00
dependabot[bot]
cbe3093a5d Bump word-wrap from 1.2.3 to 1.2.4 (#6194)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 14:59:31 +10:00
dependabot[bot]
f5fd10bb6c Bump word-wrap from 1.2.3 to 1.2.4 in /viz-lib (#6193)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 13:16:08 +09:00
Peter Lee
a6447b46be Add Bahrain to Map Visualization #5839 (#6192) 2023-07-19 03:47:16 +00:00
Justin Clift
7567a8a76a Update yarn.lock for axios 0.27.2 version bump (#6190)
Looks like I missed adding this file with one of the recent axios version bumps.
2023-07-18 08:17:34 +00:00
Jun
6237d54347 Bump cryptography to 40.0.2 (#6187)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-18 10:26:18 +09:00
Eric Radman
0bdd3bd826 Add support for a default alert template (#5996)
- Escape all variables by default since Mustache only has a syntax for raw values
- Generate a generic HTML result table to allow an alert template to display any query
- Optionally allow alert template to be defined to be set using REDASH_ALERTS_DEFAULT_MAIL_BODY_TEMPLATE
- Formatting updated by black
2023-07-18 06:51:42 +10:00
Eric Radman
1e33eee479 Ensure the email dev server is reachable on port 1080 and 1025 (#6186)
Also set Redash to use local maildev when docker-compose is used to
start a development server.

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-18 06:05:42 +10:00
Justin Clift
f51b5ad1bb Switch to automatically upgraded PostgreSQL 15 (#6185)
The pgautoupgrade repo on Docker Hub now has stable version tags, so lets use the PostgreSQL 15.x series.
2023-07-17 18:25:29 +00:00
Peter Lee
1ab9036325 change default allow custom chart to true (#6184) 2023-07-17 16:05:40 +00:00
Oluwafemi Sule
c8516d38a7 Give query case sensitive treatment in query hash (#4254)
Generating the query hash from the query text with no lowercasing of the query text
allows case-sensitive parameter values in the dashboard to have different cache entries.

Fixes #2137
2023-07-17 12:40:00 +10:00
Vinod Pandey
095ac2ecf0 Added query runner for Google Analytics Data API (GA4) and Google Search Console API (#5868)
* quick and dirty GA4 integration to support limited queries

request pattern:
{
   "propertyId": 123456789,
   "dateRanges": [{ "startDate": "yesterday", "endDate": "yesterday" }],
   "dimensions": [{ "name": "date" }],
   "metrics": [{ "name": "activeUsers" }]
}

* Update Dockerfile

* Update requirements_bundles.txt

related issue: 
https://github.com/getredash/redash/pull/5851
https://stackoverflow.com/questions/73929564/entrypoints-object-has-no-attribute-get-digital-ocean

* updated integration code to support all usecases for runReport endpoint (does not have support for runPivotReport yet)

* added google search console as query runner

* removed info logger

* removed files that were causing merge conflicts

* fixed failing testcases and pre-commit formatting changes

* added testcases

* fixed linting errors in test files

* code optimization
2023-07-16 19:45:14 -05:00
shinsuke-nara
02d128e7ae Embed view becomes flex. (#4422)
Co-authored-by: Shinsuke Nara <shinsuke.nara@muraoka-design.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-16 15:15:03 +10:00
Will Lachance
d5b821e30a Fix persisting datasource selection choice (#6181)
* Fix persisting datasource selection choice

Closes getredash/redash#5646.

We were already storing this in localStorage, however we weren't
accounting for the fact that it was stored as a string, rather than
an integer.

* Restyled by prettier (#6182)

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>
2023-07-15 12:56:39 -05:00
Justin Clift
05526b557e Update /viz-lib axios to 0.27.2, and its axios-auth-refresh to 3.3.6 (#6177) 2023-07-13 15:36:25 +00:00
dependabot[bot]
60531a739d Bump axios from 0.21.1 to 0.27.2 (#5652)
* Bump axios from 0.21.1 to 0.21.2

Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

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

* Bump axios to 0.27.2, and axios-auth-refresh to 3.3.6

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-13 01:50:06 +10:00
dependabot[bot]
1b3215f79f Bump async from 2.6.2 to 2.6.4 (#5779)
Bumps [async](https://github.com/caolan/async) from 2.6.2 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.2...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:21:44 +00:00
dependabot[bot]
39f4530562 Bump axios from 0.19.2 to 0.21.2 in /viz-lib (#5610)
Bumps [axios](https://github.com/axios/axios) from 0.19.2 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.19.2...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 08:12:03 +09:00
dependabot[bot]
6dd6a4c28b Bump cached-path-relative from 1.0.2 to 1.1.0 (#5699)
Bumps [cached-path-relative](https://github.com/ashaffer/cached-path-relative) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/ashaffer/cached-path-relative/releases)
- [Commits](https://github.com/ashaffer/cached-path-relative/commits)

---
updated-dependencies:
- dependency-name: cached-path-relative
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 08:11:29 +09:00
dependabot[bot]
fc39e36771 Bump ajv from 6.12.0 to 6.12.6 in /viz-lib (#5778)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.12.0 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.12.0...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 08:09:40 +09:00
dependabot[bot]
3e3cca4023 Bump moment from 2.24.0 to 2.29.4 in /viz-lib (#5786)
Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 07:32:31 +09:00
dependabot[bot]
c707cccfbf Bump moment from 2.24.0 to 2.29.4 (#5787)
Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 07:31:02 +09:00
Flavio Altinier Maximiano da Silva
32b3e56c97 Make the database reencrypt script safer (#5878)
* Reencrypt Database Safely

* Try with only one statement

* remove success logging

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: Jun <junnplus@gmail.com>
2023-07-11 23:55:47 +09:00
dependabot[bot]
9d5754793f Bump terser from 4.8.0 to 4.8.1 (#5833)
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v4.8.0...v4.8.1)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:03:46 +09:00
dependabot[bot]
d1e533264d Bump minimatch from 3.0.4 to 3.1.2 in /viz-lib (#5856)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:03:25 +09:00
dependabot[bot]
591b607dd5 Bump decode-uri-component from 0.2.0 to 0.2.2 in /viz-lib (#5871)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:03:10 +09:00
dependabot[bot]
ad6b12c5ad Bump shell-quote from 1.7.2 to 1.8.1 in /viz-lib (#6175)
Bumps [shell-quote](https://github.com/ljharb/shell-quote) from 1.7.2 to 1.8.1.
- [Changelog](https://github.com/ljharb/shell-quote/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/shell-quote/compare/v1.7.2...v1.8.1)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:02:19 +09:00
Jun
a1a00c6819 upgrade flask limiter (#6174)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-11 21:34:13 +09:00
Jun
9b2f635692 format code by black and isort (#6167)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-11 19:13:54 +10:00
Justin Clift
7f40837d3f Add a make target to generate .env file for development (#6172) 2023-07-11 06:33:25 +00:00
dependabot[bot]
a944658265 Bump semver from 5.7.1 to 5.7.2 in /viz-lib (#6170)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 14:44:28 +09:00
dependabot[bot]
a7681a688e Bump semver from 5.6.0 to 5.7.2 (#6171)
Bumps [semver](https://github.com/npm/node-semver) from 5.6.0 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.6.0...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 14:44:17 +09:00
Jun
1b97d9ce04 add codecov action (#6168)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-11 15:33:07 +10:00
Justin Clift
b4801dd2b8 Update SQLAlchemy to highest 1.3.x release (#6169)
Moving to SQLAlchemy 1.4 / 2.0 seems like it'll be a substantial project:

  * https://docs.sqlalchemy.org/en/14/changelog/migration_14.html
  * https://docs.sqlalchemy.org/en/14/changelog/migration_20.html
2023-07-11 14:56:11 +10:00
dependabot[bot]
c922521dbd Bump restrictedpython from 5.0 to 6.1 (#6166)
Bumps [restrictedpython](https://github.com/zopefoundation/RestrictedPython) from 5.0 to 6.1.
- [Changelog](https://github.com/zopefoundation/RestrictedPython/blob/6.1/CHANGES.rst)
- [Commits](https://github.com/zopefoundation/RestrictedPython/compare/5.0...6.1)

---
updated-dependencies:
- dependency-name: restrictedpython
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 22:30:22 +00:00
Justin Clift
89e7669ec1 Update pysaml to last version of 6.5.x series for bettter error handling (#6165)
Co-authored-by: Timothy Der <timothy.der@gotinder.com>
2023-07-10 21:03:48 +00:00
Justin Clift
99be51ebc5 Move to Redis 7 for our development and CI docker compose (#6164) 2023-07-11 05:43:15 +10:00
Juan José Fuchs
29c21db813 fix #5811: passing server,port to MS ODBC driver (#5812)
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-11 05:17:18 +10:00
Kirill Lyubchenko
e639a789e7 Updated vertica-python to 1.1.1 (#5807)
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-11 05:16:32 +10:00
645775992
bc9460b04c update passlib 1.7.1 to 1.7.3 (#5855)
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-11 04:45:47 +10:00
dependabot[bot]
11c50567c3 Bump protobuf from 3.17.3 to 3.18.3 (#5829)
Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 3.17.3 to 3.18.3.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.17.3...v3.18.3)

---
updated-dependencies:
- dependency-name: protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-11 04:42:58 +10:00
Justin Clift
90cd27fa25 Use automatic upgrading PostgreSQL 15 docker image (#6162)
Also adds the POSTGRES_HOST_AUTH_METHOD environment variable to the CI docker compose files. Modern PostgreSQL docker images need it, at least as they're used by our CI.
2023-07-10 16:17:09 +00:00
Justin Clift
26010f793e Update watchdog to version 3.0.0, to workaround reported error (#6161)
https://github.com/getredash/redash/discussions/6131#discussioncomment-6399367
2023-07-10 19:42:14 +10:00
Jun
a45a95af68 Updated rq-scheduler to 0.10.0 (#6160)
Co-authored-by: Ardiea <mas48@mit.edu>
2023-07-10 19:11:28 +10:00
Jun
24fe1dd121 add pre-commit (#6156)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-10 17:21:03 +09:00
Jun
5af8764c10 upgrade dev deps (#6158)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-10 17:46:41 +10:00
Jun
5b3e47dc0f update ci badge (#6157)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-10 09:30:52 +08:00
wuqingfeng234
c775eedec1 change the version of greenlet and gevent to fit python10 (#5849)
Co-authored-by: Jun <junnplus@gmail.com>
2023-07-09 12:12:37 +10:00
Jun
537d153986 CI: add test_all_deps on docker build (#6152)
* add test_all_deps on docker build

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* upgrade pip version

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-08 12:00:36 +09:00
Beniamin
afef3dc6d4 allow ssl connections for impala runner (#5850)
There is no possibility to use ssl connections for impala runner.
Based on response here: https://discuss.redash.io/t/ssl-for-impala-use-ssl-true-issues-being-added-to-connect/3741/3 adding a ssl parameter in connector config should solve this issue.
2023-07-08 12:47:30 +10:00
Jesse
cdd4849f96 Install python dependencies one-by-one. Don't exit on failures. (#5788)
Cat code taken from https://stackoverflow.com/a/54053100
2023-07-08 12:02:49 +10:00
Jun
6b13d0ad96 fixed importlib-resources==5.13.0 (#6155)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-08 07:52:49 +09:00
Jun
73f49cbf0c upgrade flask (#6138)
* upgrade flask

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* fix test

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* override value_proc for click.prompt

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-08 06:05:27 +09:00
dependabot[bot]
d92fc98b13 Bump lodash from 4.17.20 to 4.17.21 (#5688)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

---
updated-dependencies:
- dependency-name: lodash
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-07 13:18:04 +00:00
Frank
350ddd0483 fix: catch exception tips (#5047) 2023-07-07 22:17:01 +10:00
dependabot[bot]
4d0ce10d97 Bump tmpl from 1.0.4 to 1.0.5 (#5653)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 21:26:18 +10:00
dependabot[bot]
a34deb25d6 Bump tar from 4.4.8 to 4.4.19 (#5651)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.8 to 4.4.19.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.8...v4.4.19)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 20:10:56 +10:00
dependabot[bot]
79b01406fc Bump shell-quote from 1.7.2 to 1.7.3 (#5780)
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases)
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md)
- [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 19:31:11 +10:00
dependabot[bot]
2881599aa3 Bump pyjwt from 1.7.1 to 2.4.0 (#5759)
Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 1.7.1 to 2.4.0.
- [Release notes](https://github.com/jpadilla/pyjwt/releases)
- [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/jpadilla/pyjwt/compare/1.7.1...2.4.0)

---
updated-dependencies:
- dependency-name: pyjwt
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jun <junnplus@gmail.com>
2023-07-07 07:10:31 +00:00
dependabot[bot]
0f3452f00f Bump qs from 6.5.2 to 6.5.3 in /viz-lib (#5873)
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 15:08:27 +09:00
drewmcmahon
e8621dba1a chore: inherit BaseSQLQueryRunner in Snowflake query runner (#6064) 2023-07-07 13:49:48 +10:00
Gabriel Dutra
d6432482bf Wait for query change to propagate on pivot spec (#6142) 2023-07-07 13:02:43 +10:00
Guido Petri
b9bdfe83cc update widget_spec.js test to pass on 380 or 381 vizheight (#6149) 2023-07-07 11:28:41 +10:00
Pavel Shuvalov
66da3bb7cd Add explicit permission checker to postgres schema fetcher (#5911) 2023-07-06 18:02:35 +10:00
Gabriel Dutra
a1e27ae1ed Upgrade viz-lib webpack to v5 (#6141) 2023-07-05 21:47:01 -03:00
Peter Lee
bbd0a21831 feat: add query result expired ttl (#6123)
* feat: add query result expired ttl

* update code
2023-07-03 19:49:53 +08:00
Ran Benita
ee601ec206 Fix FEATURE_POLICY to initialize from REDASH_FEATURE_POLICY envvar, not REDASH_REFERRER_POLICY (#5822)
Problem: setting the `REDASH_REFERRER_POLICY` environment variable also sets the feature policy in addition to the referrer policy. Conversely, there is no way to set the feature policy on its own.

It looks like a copy/paste error from the line above.

Solution: change the feature policy to be set by a `REDASH_FEATURE_POLICY` environment variable.
2023-07-01 14:53:47 +10:00
Justin Clift
241dcfacd9 Update to latest in yarn 1.22.x series (#6140) 2023-06-30 18:50:22 +00:00
Justin Clift
112b9ed1ba Use precompiled psycopg2-binary package instead of psycopg2 (#6137) 2023-06-30 22:24:16 +10:00
Mukesh
24b6ef7ae7 Pymongo version upgrade changes (#5970)
* Pymongo version upgrade changes
* Get count logic has been changed to get using count_documents method
2023-06-30 20:39:04 +10:00
dependabot[bot]
4c3fd833df Bump jinja2 from 2.10.3 to 2.11.3 (#5431)
Bumps [jinja2](https://github.com/pallets/jinja) from 2.10.3 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.10.3...2.11.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-30 18:01:26 +10:00
Justin Clift
c2c7f44d5c Update Python dependencies to eliminate version conflicts (#6122)
* Remove DynamoDB as a data source for now, due to dependency incompatibilities
* Remove Firebolt as a data source for now, due to dependency incompatibilities
* Remove pymapd / pyomnisci / heavyai, due to dependency incompatibilities
* Remove pycrypto, upgrade cryptography
* Remove pyarrow (for now), which we no longer need
* Require an (older) version of black, to avoid test failures with more recent click library
* Upgrade gevent to 21.12.0
* Upgrade greenlet to 1.1.2
* Upgrade httpli2 to 0.18.1
* Upgrade requests to 2.31.0
* Upgrade snowflake-connector-python to 3.0.4
* Upgrade urllib3 to 1.25.11

Note, the warning message caused by the older versions of gevent and greenlet was:

    RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 40 from C header, got 144 from PyObject
2023-06-30 16:15:12 +10:00
Will Lachance
46f67fd44b Upgrade Python version to 3.8 (#6130)
* Upgrade Python version to 3.8 (with ci too)

3.7 is now end-of-life: this is a minimal change to get us on a supported version.
2023-06-29 04:26:28 +10:00
Peter Lee
675838619e Try fixing cypress in a more correct way (#6117) 2023-06-27 02:46:10 +10:00
Justin Clift
b33bd1b02e ci: Attempt to fix restyled.io test (#6116)
We're now getting an error with exit code 127, so this commit adds the suggested solution of telling Restyled the exact command needed to run:

    https://github.com/restyled-io/restyled.io/wiki/Common-Errors:-Prettier#prettier-with-tailwindcss-executable-file-not-found-in-path
2023-06-26 05:29:04 +10:00
Peter Lee
28e63e3d76 fix pivot table style error (#6112) 2023-06-25 22:10:49 +10:00
Peter Lee
4d11c94be0 dependencies: pystache==0.6.0 (#6091)
fix Python3.9 can't install pystache problem
2023-06-24 15:35:45 +10:00
Jun
f3892e00a5 ci: migrate to github workflow ci (#6008)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-06-24 14:25:07 +10:00
Will Lachance
f45bd27e68 Update Simba ODBC driver (#6110) 2023-06-23 08:23:51 -07:00
dependabot[bot]
bc909a13a3 Bump redis from 3.5.0 to 4.4.4 (#6050)
Bumps [redis](https://github.com/redis/redis-py) from 3.5.0 to 4.4.4.
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](https://github.com/redis/redis-py/compare/3.5.0...v4.4.4)

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-26 11:35:40 +08:00
Will Lachance
962f13eed0 Update Debian version for Node image (#6038)
`14.17` used stretch, which was ancient and seems to no longer support
updates. Let's try updating to bullseye, which should be around for
a while.
2023-05-17 07:01:15 -07:00
Will Lachance
e8071dcb12 Pin boto3 dependencies in dev requirements as well (#6037)
* Pin boto3 dependencies in dev requirements as well

Testing to see if this fixes CI, where it appears a more recent (too
recent) version of boto3 is being installed.

* Add circle step to list installed packages

This takes almost no time, and helps debug dependency issues (a
longer-term fix might be to switch to pip-compile).
2023-05-17 07:00:42 -07:00
dependabot[bot]
3444f2b06c Bump pyyaml from 5.1.2 to 5.4 (#5442)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.1.2 to 5.4.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.1.2...5.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-30 08:33:18 -07:00
Arik Fraimovich
c46d66afec Bump pysaml2 to 6.5.0 (#6013) 2023-04-28 10:35:30 -07:00
須藤大輔 (SUDO Daisuke)
64c24b77f9 fix comparison operator (#5945) 2023-04-20 09:13:20 -07:00
myonlylonely
ad7d30f91d Bump mysqlclient from 1.3.14 to 2.1.1, memsql from 3.0.0 to 3.2.0, fixing MySQL multi statement support (#5957) 2023-04-05 06:59:36 -07:00
Shubham Jain
5b9fd40dc7 Add liveness check for workers (#5886)
* Add liveness check script for workers

closes #5885

* delete extra script

* Rename worker_healthcheck -> workers_healthcheck

---------

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2023-03-27 13:11:18 -07:00
Jeremy
0b86c76552 Fix/databend params (#5937)
* fix: databend params

* add databend logo

* fix log

* fix log

* Update redash/query_runner/databend.py

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

---------

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2023-03-27 13:08:53 -07:00
David Choi
35b2430ff9 Fix group not found message. (#5935) 2023-03-24 14:55:34 -07:00
Arik Fraimovich
65d0eb72f5 Update development workflow for Apple Silicon, Node version, default port, and maildev image (#5932)
* Update ngines definition to allow for newer versions of Node.

With Node version 19 I stumbled into some issues so for now bumped it to v16, until we get to updating the libraries we use.

* docker-compose.yml updates:

1. Switch to newer maildev docker image.
2. Update local port to 5001 as 5000 seems to be used by a system process now.

* Update pymssql and pyarrow. Also commented out ibm-db until we have a way to not install it only on ARM.
2023-03-24 14:36:58 -07:00
Jeremy
8487876e7f feat: New support databend for redash (#5902)
* feat: New support databend for redash

* fix
2023-03-21 08:21:56 -07:00
Genki Sugawara
c08ef9b502 Add "set -e" to docker_build (#5896) 2023-03-20 07:40:16 -07:00
Arik Fraimovich
28b0a2379d Remove extensions mechanism (#5895)
* Remove extensions mechanism.

* Missing change.
2023-03-20 07:39:21 -07:00
Zach Liu
0dfe726ec8 see https://discuss.redash.io/t/redash-datasource-connection-test-fails/9989 (#5898) 2023-03-20 07:38:45 -07:00
Arik Fraimovich
a1e3369ba3 Update references from Discourse to Discussions. (#5916) 2023-03-18 08:03:20 -07:00
Peter Lee
7ec443c800 fix word spell (#5859)
Co-authored-by: guyu <guyu@fordeal.com>
2023-02-17 06:36:25 -08:00
Izumu KUSUNOKI
d6dbc64cfe bug fix SAML_LOGIN_ENABLED setting logic (#5784) 2023-02-17 06:24:49 -08:00
tsbkw
82361e7054 fix: Support importlib_metadata v5.0.0 (#5840)
* fix: Support importlib_metadata v5.0.0

importlib_metadata removed compatibility shims for deprecated entry point interfaces.
see: https://github.com/python/importlib_metadata/blob/main/CHANGES.rst#v500

Filter result of entry_points function by group parameter.
see: https://importlib-metadata.readthedocs.io/en/latest/api.html#importlib_metadata.entry_points

* fix: Enable to run in older python version

In circleci frontend-unit-tests, old node image is used and python 3.5 is used.
Support both old version and latest version by checking ijmportlib_metadata version
2023-02-16 13:47:56 +11:00
Dmitriy
5cf13afafe Improve visibility of error message during schema retrieval (#5879)
* handle query execution error in one place. increase ability to debug issues with schema retrieval

* split message and details for error reporting

Co-authored-by: Dmitriy Apollonin <dmitriy.apollonin@aspireiq.com>
2023-01-05 14:12:16 +02:00
kevinchiang
328099137d Microsoft Teams Webhook alert destination (#5691)
* Microsoft Teams Webhook alert destination

* Text formatting and new image for Microsoft Teams Webhook

* Comment on how to build frontend

* Add title to clarify webhook URL

* Make the message into a configurable template.
2022-10-06 23:45:03 -07:00
Xiang Fu
a863c8c08c Adding Apache Pinot Query Runner (#5798)
* Adding Apache Pinot integration

* address comments
2022-10-06 23:40:00 -07:00
Ikko Ashimine
71458e5697 Fix typo in users.py (#5818)
seperated -> separated
2022-09-23 23:01:31 -07:00
trigremm
75cb59f4be Databricks ODBC Driver: follow redirects (#5814)
Use curl --location
2022-08-24 09:26:09 -05:00
luc-x41
2935844e88 README: add MariaDB to supported data sources (#5808) 2022-08-24 08:51:22 -05:00
Jesse
4186f8303e New ElasticSearch Query Runner (#5794)
- A runner supporting the newest versions of ES,
  aggregation, nested aggregations and nested fields.
- A runner for the SQL OpenDistro flavor
- A runner for the SQL X-Pack flavor

Co-authored-by: Nicolas Le Manchet <nicolas@lemanchet.fr>
Co-authored-by: wwl717195673 <717195673@qq.com>
2022-07-20 07:47:44 -05:00
Aniket Kulkarni
0712abb359 README: update list of supported data sources (#5790)
Co-authored-by: Jesse Whitehouse <jesse@whitehouse.dev>
2022-07-15 14:29:28 -05:00
Jesse
9abc4f5f1e Clickhouse: Multi-statements support (#5792)
ClickHouse query runner splits query into several and execute each query in turn. The result of the last execution is returned. Implementation uses ClickHouse sessions in the HTTP protocol. `session_id` is generated for the first query and then it is used with the subsequent queries (together with the `session_check` parameter).

If query runner gets a success response with empty body from ClickHouse (for example, in case of temporary table creation request) query runner returns empty response.

authored-by: Liubov Ulitina <ulitinalm@vl.ru>
2022-07-12 12:27:20 -05:00
Aniket Kulkarni
f0a390b11a New Query Runner: Netezza Performance Server (#5771)
Co-authored-by: Jesse <jwhitehouse@airpost.net>
2022-07-08 13:10:49 -05:00
Jacek Jabłoński
3624f8f2be Feature: allow configuration / increase of gunicorn timeout (#5783) 2022-07-06 16:00:56 -05:00
Jesse
65f7b6c5af Sort Python safe built-ins (#5781)
Co-authored-by: Jiajie Zhong <zhongjiajie955@hotmail.com>
Co-authored-by: Jiajie Zhong <zhongjiajie955@gmail.com>
2022-07-06 08:16:36 -05:00
Bryan Yang
412c82940a New Query Runner: Arango query runner (#5124)
Co-authored-by: Hugo Gresse <hugo.gresse@gmail.com>
2022-07-06 06:53:31 -05:00
Arik Fraimovich
e2bad61e5b Add unarchive button to dashboard (#4697)
Co-authored-by: Jesse Whitehouse <jesse@whitehouse.dev>
2022-07-03 13:13:59 -05:00
Adam Zwakenberg
173cbdb2d6 Added clear button for query-based parameter inputs (#5710) 2022-07-03 13:04:09 -05:00
Jiajie Zhong
fc37c1ecfc Remove unused params in query result GET handler (#5346) 2022-07-02 23:09:24 -05:00
Jiajie Zhong
c4bfd4f3e1 mysql: add more configuration options (#5280) 2022-07-02 23:00:56 -05:00
Leandro Lorenzini
bdd1244604 Fix: mongodb schema refresh failed when user had insufficient permissions (#5734)
Co-authored-by: ban-lee-seng <banleesengpaints.marketing@gmail.com>
2022-07-02 14:02:49 -05:00
Greg Stein
6806ebd244 Use correct names for Apache projects (#5776)
Apache's trademark policy says to use the full name for these products on their first mention, on a page.
2022-07-02 13:02:38 -05:00
Jesse
b2cc42e383 Disable auto limit for mssql query runner (#5777) 2022-07-02 11:13:00 -05:00
Ian
cabe33394b [Fix] Broken image included in emails (#5719) 2022-06-01 11:15:18 -05:00
Gabriel A. Devenyi
46ea3b1f0b Fix hard-coding of amd64 platform, make ARM build work. (#5687)
* Fix hard-coding of amd64 platform and make amd64 package installation conditional
* Cleanup Dockerfile for best practices
* Enable BuildKit for docker building
2022-04-28 11:20:13 -05:00
Jesse
e6ebef1e5a Update contributor guidelines and clarify PR review process (#5714) 2022-03-10 12:00:26 -06:00
adamzwakk
b713f6b240 Update Dockerfile CHOWN into COPY (#5660)
Its more efficient to chown while COPY for large stacks of files as per https://github.com/docker/for-linux/issues/388
2022-03-02 09:34:52 -06:00
Jesse
5de85543a5 List pages: move sidebar to the left (#5698)
This change took place in steps:

1. Change order of content and sidebar.

Sidebar appears first, then content.

2. Fix padding

* Before: content was jutted against the sidebar. The sidebar was double-
padded from the edge of the content area.

After: Content has 15px pad against the sidebar. Sidebar has the same pad
as the page title.

3. Don't pad the content on small screens.

Otherwise the content appears off-center and doesn't use all of the
available space.

4. Allow Create buttons to have varying width

This makes the Query, Dashboard, and Alert list pages share the same style
2022-02-09 10:04:54 -06:00
Bruno Agutoli
175a4da49b Fix: Dashboard List page crashes when sorting by name (#5645)
Closes #5119
2022-02-09 08:57:25 -06:00
Jesse
49fe29579a Move user profile image url into the users.details field (#5697)
Makes the details field a JSONB field per pg doc recommendations.

Update model.all() method to work properly now that profile_image_url
is not an independent field.

Closes #4469
2022-02-02 14:03:02 -06:00
Steven Hao
4164a42aab Multi-filters: show all results by default (#5676) 2022-02-02 07:13:40 -06:00
Jesse
6797f32ea6 Snowflake: add option to lowercase column names (#5657)
Ported from app.redash.io codebase.

* Add option to lowercase column names
* Black the file
2022-02-01 11:09:42 -06:00
JyothiGandi
ea07e7e19b Fix: Test Connection button disabled after save (#5666)
Closes #5455
2022-02-01 09:48:07 -06:00
anshulhiran
26ac8ab1cd Firebolt Query Runner: now uses firebold-sdk python package (#5689)
* Added firebolt-sdk in place of firebolt-sqlalchemy
* fixed connection issue
* fixed connection issue
* final commit
* Moved firebolt-sdk's imports to try block

Co-authored-by: rajeshSigmoid <rajeshk@sigmoidanalytics.com>
2022-02-01 08:42:39 -06:00
Jesse
12c4750684 Fix: don't accept password login requests if password auth is disabled (#5693) 2022-01-28 08:52:31 -06:00
Jesse
2b5d1c03c1 JSON query runner: optionally skip certificate verification (#5690)
Add verify option to json datasource runner to allow query developers the option of skipping certificate verification


Co-authored-by: Kevin Chiang <kchiang@tesla.com>
Co-authored-by: kevinchiang <kevinchiang@outlook.com>
2022-01-21 15:43:42 -06:00
Tin C
f77f1b5ca1 Fix: auto limit breaks for Oracle queries (#5181)
Moves auto limit primitives to the base SQL query runner
2022-01-20 12:03:04 -06:00
Vladislav Denisov
e28e4227bf Python query runner: add function that transforms pandas dataframe to result format (#5629) 2022-01-19 13:53:27 -06:00
be30c9
4fddff104a SAML auth: allow custom service provider settings from environment variable (#5621) 2022-01-19 12:36:49 -06:00
Steven Hao
8ef9a1d398 Fix: make plotly charts have unbounded hoverlabel name length (#5661) 2022-01-19 12:17:27 -06:00
Robin Zheng
965db26cab Fix"Unable to locate package msodbcsql17"on M1 (#5638)
If you run the docker-compose on a Mac with the new M1 chip, you will get the "Unable to locate package msodbcsql17" error. Because there are currently no msodbcsql17 packages for arm64 architecture. The solution was to change the base image in the Dockerfile to change the installation to the older AMD architecture. 

FROM --platform=linux/amd64 python:3.7-slim-buster
2021-12-16 00:50:13 -08:00
Katsuya Shimabukuro
64586500a7 Improve BigQuery schema fetching when environment contains 50+ datasets (#5667) 2021-12-14 22:05:52 -06:00
Jesse
df472eb1d4 Update CircleCI configs and move advocate to main requirements file (#5658)
Ported from the 10.0.x branch
2021-11-26 18:15:10 -06:00
Jesse
7487550ad7 Update changelog to incorporate security fixes and #5632 & #5606 (#5654)
* Update changelog to incorporate security fixes and #5632 & #5606

* Added reference to sqlite fix
2021-11-23 15:24:31 -08:00
Jesse
61bbb5aa7a Merge pull request from GHSA-fcpv-hgq6-87h7 2021-11-23 14:58:20 -08:00
Jesse
ce60d20c4e Merge pull request from GHSA-g8xr-f424-h2rv 2021-11-23 14:57:24 -08:00
Jesse
da696ff7f8 Merge pull request from GHSA-vhc7-w7r8-8m34
* WIP: break the flask_oauthlib behavior

* Refactor google-oauth to use cryptographic state.

* Clean up comments

* Fix: tests didn't pass because of the scope issues.

Moved outside the create_blueprint method because this does not depend
on the Authlib object.

* Apply Arik's fixes. Tests pass.
2021-11-23 14:22:02 -08:00
Katsuya Shimabukuro
ed654a7b78 Speed up BigQuery schema fetching (#5632)
New method improves schema fetching by as much as 98% on larger schemas
2021-11-18 09:00:48 -06:00
rajeshmauryasde
3d032b69e5 Update Readme to reflect Firebolt data source (#5649) 2021-11-17 08:58:57 -06:00
Dan Goldin
86514207a3 Fix TypeScript warning: integet -> integer typo (#5637) 2021-11-15 15:43:51 -06:00
Dan Goldin
2e67227f1b Typo(#5636) 2021-10-28 14:55:48 -05:00
Jesse
86b2c4d06e Bump master to 11.0.0-dev (#5631) 2021-10-21 15:27:55 -05:00
Jesse
3c248acf21 Fix: pagination is broken on the dashboard list page (#5612)
* Fix: pagination is broken on the dashboard list page (#5516)
* Add test that reproduces issue #5466
* Fix: Duplicate dashboard rows were returned by Dashboard.all() (#5466)
* Update changelog for V10
* Update changelog for #5516
2021-10-21 11:25:30 -05:00
Aratrik Pal
39ca71c356 Fixes issue #5622 (#5623) 2021-10-18 20:26:10 +03:00
rajeshSigmoid
143d22db04 Add support for Firebolt Database (#5606) 2021-10-14 12:57:12 -05:00
zoomdot
7cac149cef Fix: Specify the protobuf version (#5608)
protobuf package with a dependency of google-api-python-client released a new version (3.18.0) on September 16, 2021. Since then, the Docker build is failing, and it is presumed that there is a conflict with other DataSource packages that use protobuf. (phoenixdb, pydgraph)
2021-10-01 16:22:44 -05:00
Tucker Leavitt
a0a28b09b4 Guard against empty totalProcessedBytes in BigQuery responses (#5592)
* Guard against empty totalProcessedBytes in BigQuery responses

This field will be empty on query responses for tables with
row level access controls enabled.

* Fix whitespace

* Update redash/query_runner/big_query.py

Co-authored-by: Jesse <jwhitehouse@airpost.net>
2021-09-24 22:12:04 +03:00
Jesse
e9bcc3c924 Fix: Edit Source button disappeared for users without CanEdit perms (#5568) 2021-08-30 10:43:00 +03:00
Levko Kravets
380345bb08 Pin python3 image version (#5570) 2021-08-18 11:04:46 -07:00
Kyunghwan Ko
0f41f25720 Fix: log message for bad auth token was malformed (#5557) 2021-08-10 11:31:26 -05:00
Levko Kravets
7445080d1a Use Yarn instead of NPM (#5541) 2021-08-02 13:16:33 +03:00
deecay
b9cb8191f5 Excel & CSV query runner (#2478)
* Excel query runner

* Param handling for read_excel

* CSV query runner

* Fix wrong module name

* Use yaml as query language

* Use yaml as query language for CSV

* Added icon and required modules

* Local address filtering

* Fix syntax error
2021-07-27 13:27:09 -07:00
Omer Lachish
ff7c5e8367 remove redundant fields from slack alert destination (#5514) 2021-06-15 17:41:36 +03:00
Shen Li
041b184d37 README.md: Add TiDB to the Supported Data Sources (#5477) 2021-05-14 06:52:29 -07:00
Omer Lachish
5085495dd4 Refine Dockerfile caching (#5484) 2021-05-14 06:48:10 -07:00
case-k-git
e62de4e4c3 fix big_query.py google api import error (#5482) 2021-05-14 06:47:38 -07:00
Jawshua
8cac6b555c Use the correct rq connection in get_queues_status (#5491) 2021-05-14 16:45:43 +03:00
adamzwakk
e4e567bbb9 Fixing failure report rendering (#5492) 2021-05-14 06:25:52 -07:00
Ben Herzberg
8e728308ab SFS-001: Adding support for the optional host connection property (#5490) 2021-05-14 06:07:30 -07:00
Omer Lachish
7ec86cf4bd Expire sessions after 6 hours of inactivity (#5159)
Configurable with environment variables
2021-05-10 13:36:34 -05:00
Omer Lachish
1c3f724f3e use ptpython instead of standard python shell (#5483) 2021-05-05 16:56:34 -07:00
Jesse
9c8c1bfa9a Adds rate limit to /forgot. (#5425)
Security vulnerability was disclosed by Sohail Ahmed <https://www.linkedin.com/in/sohail-ahmed-755776184/>
2021-04-26 12:02:47 -05:00
iwakiriK
f21f7e211f Athena: skip tables with no StorageDescriptor (#5447) 2021-04-21 15:01:57 -05:00
Nolan Nichols
a70eeb9530 Query Runner: SPARQL Endpoint Data Source (#5469) 2021-04-19 16:45:52 -05:00
Rafael Wendel
427c005c04 Replace hardcoded ids with hook (#5444)
* refactor: replace hardcoded ids with hook

* refactor: replace hard coded ids with lodash id (class)
2021-04-19 09:30:46 -03:00
Rafael Wendel
d8d7c78992 Replace <a> and <button> with <PlainButton> (#5433)
* Add PlainButton

* refactor close icons

* reorder import

* refactor remaining anchors

* refactor: replace remaining <button> and TODOs

* refactor: changed applicable elements to type link

* fix: minor details

* bug: fix tooltip ternary

* refactor: improve interactivity and semantics of schema list item
2021-04-10 16:43:58 -03:00
Rafael Wendel
23ced5db50 fix: treat possibly empty hrefs (#5468) 2021-04-10 13:00:15 -03:00
Rafael Wendel
f018c0a7b7 fix: rollback pip version to avoid legacy resolver problem (#5467)
Co-authored-by: Lingkai Kong <lingkai.kong@databricks.com>
2021-04-09 15:34:42 -03:00
Jesse
67263e1b0f Fixes issue #5445: Scheduled query not working (#5448)
* use 'query_id' everywhere instead of 'Query ID'
* some black while we're at it

Co-authored-by: Omer Lachish <omer@rauchy.net>
2021-04-08 13:32:34 -05:00
Rafael Wendel
bb1f8cbcf5 Fix Ace editor keyboard trap (#5451)
* bug: fix a11y and add sr notification

* refactor: improvements to sr notification
2021-04-07 09:50:54 -03:00
Rafael Wendel
a61a25dd32 Run prettier (#5436)
* run in /client

* run in /viz-lib

* bug: fix wrong line ts expect error

* bug: fixed search pattern for prettier
2021-03-31 16:44:19 -03:00
Jesse
21ea72fdc5 Get the user's current groups from props instead of useEffect(). (#5450)
useEffect() doesn't run until _after_ the component renders. Before the
hook runs, the value of `groups` === []. And this is passed to
<DynamicForm>'s `initialValue` prop. The `initialValue` is not re-evaluated
after useEffect() completes. So the users groups are never updated.

This change pulls the user's current groups from `user` prop on the
page.
2021-03-31 16:18:59 +03:00
Gabriel Dutra
fa8b24ea01 Prepare viz-lib release with Antd v4 (#5443) 2021-03-30 16:06:35 -03:00
Rafael Wendel
a2c96c1e6d Embed "external" link type into <Link> component (#5432)
* feature: add external link

* refactor: split external link into own component

* refactor: added link with icon

* refactor: remove reduntant tab index

* refactor: simplify props

* refactor: fix types

* refactor: bring types and components together

* refactor: improve treatment of target
2021-03-26 15:24:07 -03:00
Rafael Wendel
44178d9908 Improve input fields a11y (#5427)
* Added labels to params

* Added aria-label to inputs

* Linked unsemantic label with input

* Replaced span with label

* refactor: improve labels for schema browsers

* refactor: component accepts aria label

* refactor: add labels to sidebar search inputs
2021-03-26 11:45:24 -03:00
Rafael Wendel
6228f4cf71 Add live regions to tooltip (#5440)
* feature: add live regions to tooltip

* bug: treat null case
2021-03-25 17:47:49 -03:00
Rafael Wendel
c8df7a1c8a Add jsx/a11y eslint plugin (#5439)
* build: install eslint jsx/a11y

* chore: add ESlint rules for jsx/a11y

* bug: add exceptions
2021-03-24 18:50:21 -03:00
Rafael Wendel
a665253f50 Adds configuration for <Tooltip> trigger on focus (#5434)
* refactor: add tooltip

* refactor: replace imports

* feature: add focus trigger
2021-03-24 18:35:21 -03:00
Sebastian Tramp
70681294a3 Query Runner: eccenca Corporate Memory (SPARQL) - query RDF / Linked Data Knowledge Graphs with redash (#5415)
* add Corporate Memory Runner based on cmempy 21.2.3

* fix code style

* apply some code nice ups

* use extendedEnum, boolean and extra_options for schema description

* use lower case sorting for data source types list

This correctly orders data source names which starts with lower
chars (such as eccenca Corporate Memory)

* add missing dblogo
2021-03-24 00:15:24 -07:00
Rafael Wendel
fb90b501cb Improve icon a11y (#5424)
* Added screen reader CSS

* Added description to external links

* Added spinner icon accessibility

* Added accessibility to exclamation and big message

* Added question and exclamation accessibility

* Hide decorative icons

* Standardized link design

* Added a11y to refresh icons

* Added aria-label to anchors and buttons

* Added a11y to conditional icons

* Added applicable labels to Ant Icons

* Changed escape to interpolation

* Replaced external links with opens in new tab

* Improved Tooltip hosts

* Added aria live to temporary elements

* Removed mistakenly added redundant helper

* Undoes unnecessarily added interpolation

* Replaced empty label with hidden

* Improved full icon label

* Improved display of live regions

* Added note

* remove unused class

* Created unique id

* Remove TODOs

* Proper action label

* Improved feedback for autocomplete toggle

* feature: add id hook

* refactor: use id hook

* standardize white space
2021-03-22 19:49:36 -03:00
Rafael Wendel
0560e2410e Improve css and add focus styles (#5420)
* Add styles for focused ant menus

* Add disabled styles to clickable button

* Improved dashboard header syntax and added focus

* Improved CSS syntax

* Add interactive styles

* Improved anchor dependent styles

* Improved styles of widget (gray more/delete btns)

* Add interactive style for favorite star

* Improved style of delete btn

* Make table content fill all space

* Added focus and active styles

* Scoped query snippets list

* Fixed behavior for all major browsers

* Replaced button styles with plain button

* Scoped items list styles

* Added focus styles to ant table

* Add plain button (#5419)

* Minor syntax improvements

* Refactor of Link component (#5418)
2021-03-17 14:26:08 -03:00
Đặng Minh Dũng
a5ec506b60 feat: support Trino data-source (#5411)
* feat: add trino logo

* feat: add trino
2021-03-12 12:10:06 -08:00
Jiajie Zhong
d4f363854d Add setting to identify email block domain (#5377)
* Add setting to identify email block domain

ref: #5368

* rename

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

* rename and add comment

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

* Update redash/handlers/users.py

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

* Update redash/handlers/users.py

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

* Add more comment to settting

Co-authored-by: Levko Kravets <levko.ne@gmail.com>
2021-03-12 12:06:41 -08:00
Omer Lachish
9fdf1f341d Reset failure counter on adhoc success (#5394)
* reset failure counter when query completes successfully via adhoc

* Use "query_id" in metadata, but still allow "Query ID" for transition/legacy support
2021-03-12 12:02:29 -08:00
Rafael Wendel
10bce2d1ac Refactor of Link component (#5418)
* Refactor of link component

* Applied anchor-is-valid to Link component

* Fixed Eslint error

* Removed improper anchor uses

* Fixed TS errors
2021-03-11 11:07:01 -03:00
Rafael Wendel
b2636deef4 Add plain button (#5419)
* Add plain button

* Minor syntax improvements
2021-03-10 13:42:51 -03:00
Rafael Wendel
6cc69ec2c1 Initial a11y improvements (#5408)
* Fixed jsx-a11y problems

* Changed tabIndex to type number

* Initial improvements to DesktopNavbar accessibility

* Added accessibility to favorites list

* Improved accessibility in Desktop Navbar

* Improvements in Desktop navbar semantics

* Added aria roles to tags list

* Fixed tabindex type

* Improved aria labels in query control dropdown

* Added tab for help trigger close button

* Fixed typo

* Improved accessibility in query selector

* Changed resizable role to separator

* Added label to empty state close button

* Removed redundant and mistaken roles

* Used semantic components

* Removed tabIndex from anchor tags

* Removed mistakenly set menuitem role from anchors

* Removed tabIndex from Link components

* Removed improper hidden aria label from icon

* Reverted button and link roles in anchors for minimal merge conflicts

* Replaced alt attr with aria-label for icons

* Removed redundant menu role

* Improved accessibility of CodeBlock

* Removed improper role from schema browser

* Reverted favorites list to div

* Removed improper presentation role in query snippets

* Tracked changes for further PR

* Revert "Improved accessibility of CodeBlock"

* Add aria-labelledby to the associated code labels

This reverts commit 00a1685b1b.

* Wrapped close icon into button
2021-03-04 16:30:31 -03:00
Omer Lachish
46e97a08cc Upgrade RQ to v1.5 (#5207)
* upgrade RQ to v1.5

* set job's started_at

* update healthcheck to match string worker names

* delay worker healthcheck for 5 minutes from start to allow enough time to load in case many workers try to load simultaneously

* log when worker cannot be found
2021-02-15 22:52:53 +02:00
Levko Kravets
640fea5e47 Fix duplicate stylesheets (#5396) 2021-02-14 22:16:06 +02:00
Rafael Wendel
c865293aaa Revert "Updated axios (#5371)" (#5385)
This reverts commit 49536de1ed.
2021-02-02 17:59:53 -03:00
Omer Lachish
3d3f6b1916 extend sync_user_details expiry (#5330) 2021-02-02 16:30:38 +02:00
Justin Talbot
0e1587a068 Add My Dashboards filter option to the Dashboards list (#5375)
* Add My Dashboards filter option to the Dashboards list. Added API endpoint to get the list of a user's dashboards, similar to the My Queries feature.

* Update empty dashboard list state to show an invite to create a new dashboard, like My Queries

* Update to Levko's suggested approach. Clean up some of the formatting for consistency. Put the 'My Queries/Dashboards' item before the Favorites since that organization seems cleaner to me.

* Address Levko's comments
2021-02-02 12:37:48 +02:00
Rafael Wendel
04edf16ed4 Increased waiting time to avoid flakiness (#5370) 2021-01-28 15:02:36 -03:00
Rafael Wendel
49536de1ed Updated axios (#5371) 2021-01-28 14:48:36 -03:00
dependabot[bot]
2f1394a6f4 Bump axios from 0.19.0 to 0.21.1 (#5366)
Bumps [axios](https://github.com/axios/axios) from 0.19.0 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.19.0...v0.21.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-25 21:49:32 -03:00
dependabot[bot]
911f398006 Bump bl from 1.2.2 to 1.2.3 in /viz-lib (#5257)
Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-25 16:52:14 -03:00
dependabot[bot]
b0b1d6c81c Bump dompurify from 2.0.8 to 2.0.17 in /viz-lib (#5326)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.0.8 to 2.0.17.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/2.0.8...2.0.17)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-25 13:44:11 -03:00
Rafael Wendel
23a279f318 Fix for Cypress flakiness generated by param_spec (#5349) 2021-01-22 21:03:15 -03:00
Arik Fraimovich
e71ccf5de5 Fix: add a merge migration to solve multi head issue (#5364)
* Add unit test to test for multi-head migrations issue

* Add merge migration
2021-01-21 10:55:52 -08:00
Jiajie Zhong
bb42e92cd0 Remove unnecessary space in rq log (#5345) 2021-01-20 19:45:16 -08:00
Patrick Yang
4ec96caac5 Encrypt alert notification destinations (#5317) 2021-01-20 19:40:53 -08:00
Vipul Mathur
829247c2d2 Use legacy resolver in pip to fix broken build (#5309)
Fixes #5300 and fixes #5307 

There have been upstream (`python:37-slim` image) changes that
bring in `pip` version 20.3.1, which makes new `2020-resolver`
the default.  Due to that, un-resolvable dependency conflicts
in  `requirements_all_ds.txt` now cause the build to fail.

This is a workaround until the package versions can be updated
to work with the new pip resolver.
2021-01-20 12:17:39 -08:00
Rafael Wendel
7d33af4343 Fix inconsistent Sankey behavior (#5286)
* added type casting to coerce number string into nuber

* Merge branch 'master' into fix-inconsistent=sankey-behavior

* typed map viz options

* Partially typed what was possible

* reworked data coercion

* improved MapOptionsType types

* readaqueted sankey rows so as to allow strings again
2021-01-12 23:54:14 -03:00
Rafael Wendel
84c2abed59 Add reorder to dashboard parameter widgets (#5267)
* added paramOrder prop

* minor refactor

* moved logic to widget

* Added paramOrder to widget API call

* Update client/app/components/dashboards/dashboard-widget/VisualizationWidget.jsx

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

* Merge branch 'master' into reorder-dashboard-parameters

* experimental removal of helper element

* cleaner comment

* Added dashboard global params logic

* Added backend logic for dashboard options

* Removed testing leftovers

* removed appending sortable to parent component behavior

* Revert "Added backend logic for dashboard options"

This reverts commit 41ae2ce475.

* Re-structured backend options

* removed temporary edits

* Added dashboard/widget param reorder cypress tests

* Separated edit and sorting permission

* added options to public dashboard serializer

* Removed undesirable events from drag

* Bring back attaching sortable to its parent

This reverts commit 163fb6fef5.

* Added prop to control draggable destination parent

* Removed paramOrder fallback

* WIP (for Netflify preview)

* fixup! Added prop to control draggable destination parent

* Better drag and drop styling and fix for the padding

* Revert "WIP (for Netflify preview)"

This reverts commit 433e11edc3.

* Improved dashboard parameter Cypress test

* Standardized reorder styling

* Changed dashboard param reorder to edit mode only

* fixup! Improved dashboard parameter Cypress test

* fixup! Improved dashboard parameter Cypress test

* Fix for Cypress CI error

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2021-01-11 15:18:50 -03:00
Christopher Grant
8b068dfd0b Truncate large Databricks ODBC result sizes (#5290)
Truncates results sets that exceed a limit taken from an environment
variable called DATABRICKS_ROW_LIMIT.
2021-01-08 15:20:11 -06:00
Rafael Wendel
06eb868120 Bar chart e2e test (#5279)
* created bar-chart e2e test boilerplate

* refactored assertions

* added snapshots and dashboard

* refactored assertions to properly deal with async

* replaced loops with getters for proper workings of cypress

* added a couple other bar charts

* ran prettier

* added a better query for bar charts

* removed leftovers

* moved helpers to support folder

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2021-01-06 15:13:33 -03:00
Patrick Yang
52ae7bedb2 Secret handling for Yandex, TreasureData, & Postgres/CockroachDB SSL (#5312) 2021-01-05 11:47:54 -08:00
Tim Gates
fbe57de53c docs: fix simple typo, possbily -> possibly (#5329)
There is a small typo in redash/settings/__init__.py.

Should read `possibly` rather than `possbily`.
2021-01-05 12:43:14 +02:00
Patrick Yang
db0cb98ed3 Add Username and Password fields to MongoDB config (#5314) 2021-01-04 23:14:16 -08:00
Rafael Wendel
dcdff66e62 Dropdown param search fix (#5304)
* fixed QueryBasedParamterInput optionFilterProp

* added optionFilterProp fallback for SelectWithVirtualScroll

* simplified syntax

* removed optionFilterProp from QueryBasedParameterInput.jsx

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

* restricted SelectWithVirtualScroll props

* Added e2e test for parameter filters

* moved filter assertion to more suitable place

* created helper for option filter prop assertion

* moved option filter prop assertion to proper place, added result update assertion

* refactor openAndSearchAntdDropdown helper

* Fix parameter_spec

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-12-17 21:56:46 -03:00
Patrick Yang
d0793c4ba8 Obfuscate non-email alert destinations (#5318) 2020-12-16 15:39:30 -08:00
Lingkai Kong
7b8bcdf356 change item element in system status page (#5323) 2020-12-16 11:22:19 -08:00
Elad Ossadon
c290864ccd Convert viz-lib to TypeScript (#5310)
Co-authored-by: ts-migrate <>
2020-12-15 18:21:37 -08:00
Rafael Wendel
b70e95a323 added eslint no-console (#5305)
* added eslint no-console

* Update client/.eslintrc.js to allow warnings

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

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
2020-12-14 10:09:43 -03:00
Elad Ossadon
18ee5343aa Sync date format from settings with clientConfig (#5299) 2020-12-10 11:16:31 -08:00
Elad Ossadon
fdf636a393 Fix disabled hot reload flow (#5306) 2020-12-07 16:02:52 -08:00
Rafael Wendel
88c13868a3 removed leftover console.log (#5303) 2020-12-07 17:21:40 -03:00
Elad Ossadon
aab11dc79b Add React Fast Refresh + Hot Module Reloading (#5291) 2020-12-07 11:46:46 -08:00
Elad Ossadon
00c77cf36e Redesign desktop nav bar (#5294) 2020-12-06 12:09:19 -08:00
Rafael Wendel
6e2631dec2 Changed 'Delete Alert' into 'Delete' for consistency (#5287) 2020-11-30 18:48:35 -03:00
Rafael Wendel
4b88959341 Fix QuerySourceDropdown value type (#5284) 2020-11-24 11:42:20 -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
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
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
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
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
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
Omer Lachish
abbfd598d7 support relative time in cloudwatch queries (#4649) 2020-02-16 12:23:25 +02: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
1312 changed files with 116578 additions and 59654 deletions

12
.ci/Dockerfile.cypress Normal file
View File

@@ -0,0 +1,12 @@
FROM cypress/browsers:node18.12.0-chrome106-ff106
ENV APP /usr/src/app
WORKDIR $APP
COPY package.json yarn.lock .yarnrc $APP/
COPY viz-lib $APP/viz-lib
RUN npm install yarn@1.22.22 -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null
COPY . $APP
RUN ./node_modules/.bin/cypress verify

View File

@@ -1,4 +1,3 @@
version: '3'
services:
redash:
build: ../
@@ -12,11 +11,15 @@ services:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
POSTGRES_PASSWORD: "FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb"
REDASH_DATABASE_URL: "postgresql://postgres:FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb@postgres/postgres"
REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
redis:
image: redis:3.0-alpine
image: redis:7-alpine
restart: unless-stopped
postgres:
image: postgres:9.5.6-alpine
image: pgautoupgrade/pgautoupgrade:latest
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"

73
.ci/compose.cypress.yaml Normal file
View File

@@ -0,0 +1,73 @@
x-redash-service: &redash-service
build:
context: ../
args:
install_groups: "main"
code_coverage: ${CODE_COVERAGE}
x-redash-environment: &redash-environment
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
POSTGRES_PASSWORD: "FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb"
REDASH_DATABASE_URL: "postgresql://postgres:FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb@postgres/postgres"
REDASH_RATELIMIT_ENABLED: "false"
REDASH_ENFORCE_CSRF: "true"
REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
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: .ci/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:7-alpine
restart: unless-stopped
postgres:
image: pgautoupgrade/pgautoupgrade:latest
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"

39
.ci/docker_build Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
# This script only needs to run on the main Redash repo
if [ "${GITHUB_REPOSITORY}" != "getredash/redash" ]; then
echo "Skipping image build for Docker Hub, as this isn't the main Redash repository"
exit 0
fi
if [ "${GITHUB_REF_NAME}" != "master" ] && [ "${GITHUB_REF_NAME}" != "preview-image" ]; then
echo "Skipping image build for Docker Hub, as this isn't the 'master' nor 'preview-image' branch"
exit 0
fi
if [ "x${DOCKER_USER}" = "x" ] || [ "x${DOCKER_PASS}" = "x" ]; then
echo "Skipping image build for Docker Hub, as the login details aren't available"
exit 0
fi
set -e
VERSION=$(jq -r .version package.json)
VERSION_TAG="$VERSION.b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}"
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}"
DOCKERHUB_REPO="redash/redash"
DOCKER_TAGS="-t redash/redash:preview -t redash/preview:${VERSION_TAG}"
# Build the docker container
docker build --build-arg install_groups="main,all_ds,dev" ${DOCKER_TAGS} .
# Push the container to the preview build locations
docker push "${DOCKERHUB_REPO}:preview"
docker push "redash/preview:${VERSION_TAG}"
echo "Built: ${VERSION_TAG}"

6
.ci/update_version Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
VERSION=$(jq -r .version package.json)
FULL_VERSION=${VERSION}+b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}
sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '${FULL_VERSION}'/" redash/__init__.py
sed -i "s/dev/${GITHUB_SHA}/" client/app/version.json

View File

@@ -1,12 +0,0 @@
FROM cypress/browsers:chrome67
ENV APP /usr/src/app
WORKDIR $APP
COPY package.json $APP/package.json
RUN npm run cypress:install > /dev/null
COPY client/cypress $APP/client/cypress
COPY cypress.json $APP/cypress.json
RUN ./node_modules/.bin/cypress verify

View File

@@ -1,148 +0,0 @@
version: 2.0
flake8-steps: &steps
- checkout
- run: sudo pip install flake8
- run: ./bin/flake8_tests.sh
jobs:
python-flake8-tests:
docker:
- image: circleci/python:3.7.0
steps: *steps
legacy-python-flake8-tests:
docker:
- image: circleci/python:2.7.15
steps: *steps
backend-unit-tests:
environment:
COMPOSE_FILE: .circleci/docker-compose.circle.yml
COMPOSE_PROJECT_NAME: redash
docker:
- image: circleci/buildpack-deps:xenial
steps:
- setup_remote_docker
- checkout
- run:
name: Build Docker Images
command: |
set -x
docker-compose build --build-arg skip_ds_deps=true
docker-compose up -d
sleep 10
- run:
name: Create Test Database
command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;"
- run:
name: Run Tests
command: docker-compose run --name tests redash tests --junitxml=junit.xml --cov-report xml --cov=redash --cov-config .coveragerc tests/
- run:
name: Copy Test Results
command: |
mkdir -p /tmp/test-results/unit-tests
docker cp tests:/app/coverage.xml ./coverage.xml
docker cp tests:/app/junit.xml /tmp/test-results/unit-tests/results.xml
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: coverage.xml
frontend-lint:
docker:
- image: circleci/node:8
steps:
- checkout
- run: mkdir -p /tmp/test-results/eslint
- run: npm install
- run: npm run lint:ci
- store_test_results:
path: /tmp/test-results
frontend-unit-tests:
docker:
- image: circleci/node:8
steps:
- checkout
- run: sudo apt install python-pip
- run: npm install
- run: npm run bundle
- run: 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
docker:
- image: circleci/node:8
steps:
- setup_remote_docker
- checkout
- run:
name: Install npm dependencies
command: |
npm install
- run:
name: Setup Redash server
command: |
npm run cypress start
docker-compose run cypress npm run cypress db-seed
- run:
name: Execute Cypress tests
command: npm run cypress run-ci
build-tarball:
docker:
- image: circleci/node:8
steps:
- checkout
- run: sudo apt install python-pip
- run: npm install
- run: .circleci/update_version
- run: npm run bundle
- run: npm run build
- run: rm -rf ./node_modules/
- run: .circleci/pack
- store_artifacts:
path: /tmp/artifacts/
build-docker-image:
docker:
- image: circleci/buildpack-deps:xenial
steps:
- setup_remote_docker
- checkout
- run: .circleci/update_version
- run: .circleci/docker_build
workflows:
version: 2
build:
jobs:
- python-flake8-tests
- legacy-python-flake8-tests
- backend-unit-tests
- frontend-lint
- frontend-unit-tests:
requires:
- frontend-lint
- frontend-e2e-tests:
requires:
- frontend-lint
- build-tarball:
requires:
- backend-unit-tests
- frontend-unit-tests
- frontend-e2e-tests
filters:
branches:
only:
- master
- /release\/.*/
- build-docker-image:
requires:
- backend-unit-tests
- frontend-unit-tests
- frontend-e2e-tests
filters:
branches:
only:
- master
- preview-image
- /release\/.*/

View File

@@ -1,50 +0,0 @@
version: '3'
services:
server:
build: ../
command: dev_server
depends_on:
- postgres
- redis
ports:
- "5000:5000"
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
REDASH_RATELIMIT_ENABLED: "false"
worker:
build: ../
command: scheduler
depends_on:
- server
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
QUEUES: "queries,scheduled_queries,celery,schemas"
WORKERS_COUNT: 2
cypress:
build:
context: ../
dockerfile: .circleci/Dockerfile.cypress
depends_on:
- server
- worker
environment:
CYPRESS_baseUrl: "http://server:5000"
PERCY_TOKEN: ${PERCY_TOKEN}
PERCY_BRANCH: ${CIRCLE_BRANCH}
PERCY_COMMIT: ${CIRCLE_SHA1}
PERCY_PULL_REQUEST: ${CIRCLE_PR_NUMBER}
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

View File

@@ -1,17 +0,0 @@
#!/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 -t redash/redash:preview -t redash/preview:$VERSION_TAG .
docker push redash/redash:preview
docker push redash/preview:$VERSION_TAG
else
docker build -t redash/redash:$VERSION_TAG .
docker push redash/redash:$VERSION_TAG
fi
echo "Built: $VERSION_TAG"

View File

@@ -1,6 +0,0 @@
#!/bin/bash
VERSION=$(jq -r .version package.json)
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM
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,32 +0,0 @@
version: "2"
checks:
complex-logic:
enabled: false
file-lines:
enabled: false
method-complexity:
enabled: false
method-count:
enabled: false
method-lines:
config:
threshold: 100
nested-control-flow:
enabled: false
identical-code:
enabled: false
similar-code:
enabled: false
plugins:
pep8:
enabled: true
eslint:
enabled: false
exclude_patterns:
- "tests/**/*.py"
- "migrations/**/*.py"
- "setup/**/*"
- "bin/**/*"
- "**/node_modules/"
- "client/dist/"
- "**/*.pyc"

View File

@@ -1,6 +1,6 @@
client/.tmp/
client/dist/
node_modules/
viz-lib/node_modules/
.tmp/
.venv/
venv/

View File

@@ -7,10 +7,10 @@ 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 👫
Anything else should be a discussion: https://github.com/getredash/redash/discussions/ 👫
🚨For support, help & questions use https://discuss.redash.io/c/support
💡For feature requests & ideas use https://discuss.redash.io/c/feature-requests
🚨For support, help & questions use https://github.com/getredash/redash/discussions/categories/q-a
💡For feature requests & ideas use https://github.com/getredash/redash/discussions/categories/ideas
**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.

View File

@@ -1,17 +1,17 @@
---
name: "\U0001F4A1Anything else"
about: "For help, support, features & ideas - please use https://discuss.redash.io \U0001F46B "
about: "For help, support, features & ideas - please use Discussions \U0001F46B "
labels: "Support Question"
---
We use GitHub only for bug reports 🐛
Anything else should be posted to https://discuss.redash.io 👫
Anything else should be a discussion: https://github.com/getredash/redash/discussions/ 👫
🚨For support, help & questions use https://discuss.redash.io/c/support
💡For feature requests & ideas use https://discuss.redash.io/c/feature-requests
🚨For support, help & questions use https://github.com/getredash/redash/discussions/categories/q-a
💡For feature requests & ideas use https://github.com/getredash/redash/discussions/categories/ideas
Alternatively, check out these resources below. Thanks! 😁.
- [Forum](https://disucss.redash.io)
- [Discussions](https://github.com/getredash/redash/discussions/)
- [Knowledge Base](https://redash.io/help)

View File

@@ -1,5 +1,5 @@
## What type of PR is this? (check all applicable)
<!-- Please leave only what's applicable -->
## What type of PR is this?
<!-- Check all that apply, delete what doesn't apply. -->
- [ ] Refactor
- [ ] Feature
@@ -9,7 +9,18 @@
- [ ] Other
## Description
<!-- In case of adding / modifying a query runner, please specify which version(s) you expect are compatible. -->
## How is this tested?
- [ ] Unit tests (pytest, jest)
- [ ] E2E Tests (Cypress)
- [ ] Manually
- [ ] N/A
<!-- If Manually, please describe. -->
## Related Tickets & Documents
<!-- If applicable, please include a link to your documentation PR against getredash/website -->
## Mobile & Desktop Screenshots/Recordings (if there are UI changes)

23
.github/support.yml vendored
View File

@@ -1,23 +0,0 @@
# 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

175
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,175 @@
name: Tests
on:
push:
branches:
- master
pull_request_target:
branches:
- master
env:
NODE_VERSION: 18
YARN_VERSION: 1.22.22
jobs:
backend-lint:
runs-on: ubuntu-22.04
steps:
- if: github.event.pull_request.mergeable == 'false'
name: Exit if PR is not mergeable
run: exit 1
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- run: sudo pip install black==23.1.0 ruff==0.0.287
- run: ruff check .
- run: black --check .
backend-unit-tests:
runs-on: ubuntu-22.04
needs: backend-lint
env:
COMPOSE_FILE: .ci/compose.ci.yaml
COMPOSE_PROJECT_NAME: redash
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
steps:
- if: github.event.pull_request.mergeable == 'false'
name: Exit if PR is not mergeable
run: exit 1
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- name: Build Docker Images
run: |
set -x
docker compose build --build-arg install_groups="main,all_ds,dev" --build-arg skip_frontend_build=true
docker compose up -d
sleep 10
- name: Create Test Database
run: docker compose -p redash run --rm postgres psql -h postgres -U postgres -c "create database tests;"
- name: List Enabled Query Runners
run: docker compose -p redash run --rm redash manage ds list_types
- name: Run Tests
run: docker compose -p redash run --name tests redash tests --junitxml=junit.xml --cov-report=xml --cov=redash --cov-config=.coveragerc tests/
- name: Copy Test Results
run: |
mkdir -p /tmp/test-results/unit-tests
docker cp tests:/app/coverage.xml ./coverage.xml
docker cp tests:/app/junit.xml /tmp/test-results/unit-tests/results.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- name: Store Test Results
uses: actions/upload-artifact@v3
with:
name: test-results
path: /tmp/test-results
- name: Store Coverage Results
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage.xml
frontend-lint:
runs-on: ubuntu-22.04
steps:
- if: github.event.pull_request.mergeable == 'false'
name: Exit if PR is not mergeable
run: exit 1
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install Dependencies
run: |
npm install --global --force yarn@$YARN_VERSION
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- name: Run Lint
run: yarn lint:ci
- name: Store Test Results
uses: actions/upload-artifact@v3
with:
name: test-results
path: /tmp/test-results
frontend-unit-tests:
runs-on: ubuntu-22.04
needs: frontend-lint
steps:
- if: github.event.pull_request.mergeable == 'false'
name: Exit if PR is not mergeable
run: exit 1
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install Dependencies
run: |
npm install --global --force yarn@$YARN_VERSION
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- name: Run App Tests
run: yarn test
- name: Run Visualizations Tests
run: cd viz-lib && yarn test
- run: yarn lint
frontend-e2e-tests:
runs-on: ubuntu-22.04
needs: frontend-lint
env:
COMPOSE_FILE: .ci/compose.cypress.yaml
COMPOSE_PROJECT_NAME: cypress
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
steps:
- if: github.event.pull_request.mergeable == 'false'
name: Exit if PR is not mergeable
run: exit 1
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Enable Code Coverage Report For Master Branch
if: endsWith(github.ref, '/master')
run: |
echo "CODE_COVERAGE=true" >> "$GITHUB_ENV"
- name: Install Dependencies
run: |
npm install --global --force yarn@$YARN_VERSION
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- name: Setup Redash Server
run: |
set -x
yarn cypress build
yarn cypress start -- --skip-db-seed
docker compose run cypress yarn cypress db-seed
- name: Execute Cypress Tests
run: yarn cypress run-ci
- name: "Failure: output container logs to console"
if: failure()
run: docker compose logs
- name: Copy Code Coverage Results
run: docker cp cypress:/usr/src/app/coverage ./coverage || true
- name: Store Coverage Results
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage

30
.github/workflows/periodic-snapshot.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Periodic Snapshot
# 10 minutes after midnight on the first of every month
on:
schedule:
- cron: '10 0 1 * *'
permissions:
contents: write
jobs:
bump-version-and-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{secrets.ACTION_PUSH_KEY}}
- run: |
# https://api.github.com/users/github-actions[bot]
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
TAG_NAME="$(date +%y.%m).0-dev"
gawk -i inplace -F: -v q=\" -v tag=${TAG_NAME} '/^ "version": / { print $1 FS, q tag q ","; next} { print }' package.json
gawk -i inplace -F= -v q=\" -v tag=${TAG_NAME} '/^__version__ =/ { print $1 FS, q tag q; next} { print }' redash/__init__.py
gawk -i inplace -F= -v q=\" -v tag=${TAG_NAME} '/^version =/ { print $1 FS, q tag q; next} { print }' pyproject.toml
git add package.json redash/__init__.py pyproject.toml
git commit -m "Snapshot: ${TAG_NAME}"
git tag ${TAG_NAME}
git push --atomic origin master refs/tags/${TAG_NAME}

87
.github/workflows/preview-image.yml vendored Normal file
View File

@@ -0,0 +1,87 @@
name: Preview Image
on:
push:
tags:
- '*-dev'
env:
NODE_VERSION: 18
jobs:
build-skip-check:
runs-on: ubuntu-22.04
outputs:
skip: ${{ steps.skip-check.outputs.skip }}
steps:
- name: Skip?
id: skip-check
run: |
if [[ "${{ vars.DOCKER_USER }}" == '' ]]; then
echo 'Docker user is empty. Skipping build+push'
echo skip=true >> "$GITHUB_OUTPUT"
elif [[ "${{ secrets.DOCKER_PASS }}" == '' ]]; then
echo 'Docker password is empty. Skipping build+push'
echo skip=true >> "$GITHUB_OUTPUT"
else
echo 'Docker user and password are set and branch is `master`.'
echo 'Building + pushing `preview` image.'
echo skip=false >> "$GITHUB_OUTPUT"
fi
build-docker-image:
runs-on: ubuntu-22.04
needs:
- build-skip-check
if: needs.build-skip-check.outputs.skip == 'false'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.push.after }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install Dependencies
run: |
npm install --global --force yarn@1.22.22
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Set version
id: version
run: |
set -x
.ci/update_version
VERSION_TAG=$(jq -r .version package.json)
echo "VERSION_TAG=$VERSION_TAG" >> "$GITHUB_OUTPUT"
- name: Build and push preview image to Docker Hub
uses: docker/build-push-action@v4
with:
push: true
tags: |
redash/redash:preview
redash/preview:${{ steps.version.outputs.VERSION_TAG }}
context: .
build-args: |
test_all_deps=true
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64
env:
DOCKER_CONTENT_TRUST: true
- name: "Failure: output container logs to console"
if: failure()
run: docker compose logs

3
.gitignore vendored
View File

@@ -5,11 +5,12 @@ venv/
.coveralls.yml
.idea
*.pyc
.nyc_output
coverage
.coverage
coverage.xml
client/dist
.DS_Store
celerybeat-schedule*
.#*
\#*#
*~

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
engine-strict = true

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
v18

10
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.287"
hooks:
- id: ruff

66
.restyled.yaml Normal file
View File

@@ -0,0 +1,66 @@
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
command:
- prettier
- --write
include:
- client/app/**/*.js
- client/app/**/*.jsx
- client/cypress/**/*.js

2
.yarn/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

0
.yarnrc Normal file
View File

View File

@@ -1,5 +1,412 @@
# Change Log
## V10.1.0 - 2021-11-23
This release includes patches for three security vulnerabilities:
- Insecure default configuration affects installations where REDASH_COOKIE_SECRET is not set explicitly (CVE-2021-41192)
- SSRF vulnerability affects installations that enabled URL-loading data sources (CVE-2021-43780)
- Incorrect usage of state parameter in OAuth client code affects installations where Google Login is enabled (CVE-2021-43777)
And a couple features that didn't merge in time for 10.0.0
- Big Query: Speed up schema loading (#5632)
- Add support for Firebolt data source (#5606)
- Fix: Loading schema for Sqlite DB with "Order" column name fails (#5623)
## v10.0.0 - 2021-10-01
A few changes were merged during the V10 beta period.
- New Data Source: CSV/Excel Files
- Fix: Edit Source button disappeared for users without CanEdit permissions
- We pinned our docker base image to Python3.7-slim-buster to avoid build issues
- Fix: dashboard list pagination didn't work
## v10.0.0-beta - 2021-06-16
Just over a year since our last release, the V10 beta is ready. Since we never made a non-beta release of V9, we expect many users will upgrade directly from V8 -> V10. This will bring a lot of exciting features. Please check out the V9 beta release notes below to learn more.
This V10 beta incorporates fixes for the feedback we received on the V9 beta along with a few long-requested features (horizontal bar charts!) and other changes to improve UX and reliability.
This release was made possible by contributions from 35+ people (the Github API didn't let us pull handles this time around): Alex Kovar, Alexander Rusanov, Arik Fraimovich, Ben Amor, Christopher Grant, Đặng Minh Dũng, Daniel Lang, deecay, Elad Ossadon, Gabriel Dutra, iwakiriK, Jannis Leidel, Jerry, Jesse Whitehouse, Jiajie Zhong, Jim Sparkman, Jonathan Hult, Josh Bohde, Justin Talbot, koooge, Lei Ni, Levko Kravets, Lingkai Kong, max-voronov, Mike Nason, Nolan Nichols, Omer Lachish, Patrick Yang, peterlee, Rafael Wendel, Sebastian Tramp, simonschneider-db, Tim Gates, Tobias Macey, Vipul Mathur, and Vladislav Denisov
Our special thanks to [Sohail Ahmed](https://pk.linkedin.com/in/sohail-ahmed-755776184) for reporting a vulnerability in our "forgot password" page (#5425)
### Upgrading
(This section is duplicated from the previous release - since many users will upgrade directly from V8 -> V10)
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
- Redash now uses a vertical navbar
- Dashboard list now includes “My Dashboards” filter
- Dashboard parameters can now be re-ordered
- Queries can now be executed with Shift + Enter on all platforms.
- Added New Dashboard/Query/Alert buttons to corresponding list pages
- Dashboard text widgets now prompt to confirm before closing the text editor
- A plus sign is now shown between tags used for search
- On the queries list view “My Queries” has moved above “Archived”
- Improved behavior for filtering by tags in list views
- When a users session expires for inactivity, they are prompted to log-in with a pop-up so they dont lose their place in the app
- Numerous accessibility changes towards the a11y standard
- Hide the “Create” menu button if current user doesnt have permission to any data sources
### Visualizations
- Feature: Added support for horizontal box plots
- Feature: Added support for horizontal bar charts
- Feature: Added “Reverse” option for Chart visualization legend
- Feature: Added option to align Chart Y-axes at zero
- Feature: The table visualization header is now fixed when scrolling
- Feature: Added USA map to choropleth visualization
- Fix: Selected filters were reset when switching visualizations
- Fix: Stacked bar chart showed the wrong Y-axis range in some cases
- Fix: Bar chart with second y axis overlapped data series
- Fix: Y-axis autoscale failed when min or max was set
- Fix: Custom JS visualization was broken because of a typo
- Fix: Too large visualization caused filters block to collapse
- Fix: Sankey visualization looked inconsistent if the data source returned VARCHAR instead of numeric types
### Structural Updates
- Redash now prevents CSRF attacks
- Migration to TypeScript
- Upgrade to Antd version 4
### Data Sources
- New Data Sources: SPARQL Endpoint, Eccenca Corporate Memory, TrinoDB
- Databricks
- Custom Schema Browser that allows switching between databases
- Option added to truncate large results
- Support for multiple-statement queries
- Schema browser can now use eventlet instead of RQ
- MongoDB:
- Moved Username and Password out of the connection string so that password can be stored secretly
- Oracle:
- Fix: Annotated queries always failed. Annotation is now disabled
- Postgres/CockroachDB:
- SSL certfile/keyfile fields are now handled as secret
- Python:
- Feature: Custom built-ins are now supported
- Fix: Query runner was not compatible with Python 3
- Snowflake:
- Data source now accepts a custom host address (for use with proxies)
- TreasureData:
- API key field is now handled as secret
- Yandex:
- OAuth token field is now handled as secret
### Alerts
- Feature: Added ability to mute alerts without deleting them
- Change: Non-email alert destination details are now obfuscated to avoid leaking sensitive information (webhook URLs, tokens etc.)
- Fix: numerical comparisons failed if value from query was a string
### Parameters
- Added “Last 12 months” option for dynamic date ranges
### Bug Fixes
- Fix: Private addresses were not allowed even when enforcing was disabled
- Fix: Python query runner wasnt updated for Python 3
- Fix: Sorting queries by schedule returned the wrong order
- Fix: Counter visualization was enormous in some cases
- Fix: Dashboard URL will now change when the dashboard title changes
- Fix: URL parameters were removed when forking a query
- Fix: Create link on data sources page was broken
- Fix: Queries could be reassigned to read-only data sources
- Fix: Multi-select dropdown was very slow if there were 1k+ options
- Fix: Search Input couldnt be focused or updated while editing a dashboard
- Fix: The CLI command for “status” did not work
- Fix: The dashboard list screen displayed too few items under certain pagination configurations
### Other
- Added an environment variable to disable public sharing links for queries and dashboards
- Alert destinations are now encrypted at the database
- The base query runner now has stubs to implement result truncating for other data sources
- Static SAML configuration and assertion encryption are now supported
- Adds new component for adding extra actions to the query and dashboard pages
- Non-admins with at least view_only permission on a dashboard can now make GET requests to the data source resource
- Added a BLOCKED_DOMAINS setting to prevent sign-ups from emails at specific domains
- Added a rate limit to the “forgot password” page
- RQ workers will now shutdown gracefully for known error codes
- Scheduled execution failure counter now resets following a successful ad hoc execution
- Redash now deletes locks for cancelled queries
- Upgraded Ace Editor from v6 to v9
- Added a periodic job to remove ghost locks
- Removed content width limit on all pages
- Introduce a <Link> React component
## 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).

View File

@@ -4,19 +4,7 @@ Thank you for taking the time to contribute! :tada::+1:
The following is a set of guidelines for contributing to Redash. These are guidelines, not rules, please use your best judgement and feel free to propose changes to this document in a pull request.
## Quick Links:
- [Feature Requests](https://discuss.redash.io/c/feature-requests)
- [Documentation](https://redash.io/help/)
- [Blog](https://blog.redash.io/)
- [Twitter](https://twitter.com/getredash)
---
:star: If you already here and love the project, please make sure to press the Star button. :star:
---
:star: If you're already here and love the project, please make sure to press the Star button. :star:
## Table of Contents
[How can I contribute?](#how-can-i-contribute)
@@ -32,6 +20,13 @@ The following is a set of guidelines for contributing to Redash. These are guide
- [Release Method](#release-method)
- [Code of Conduct](#code-of-conduct)
## Quick Links:
- [User Forum](https://github.com/getredash/redash/discussions)
- [Documentation](https://redash.io/help/)
---
## How can I contribute?
### Reporting Bugs
@@ -39,24 +34,53 @@ The following is a set of guidelines for contributing to Redash. These are guide
When creating a new bug report, please make sure to:
- Search for existing issues first. If you find a previous report of your issue, please update the existing issue with additional information instead of creating a new one.
- If you are not sure if your issue is really a bug or just some configuration/setup problem, please start a discussion in [the support forum](https://discuss.redash.io/c/support) first. Unless you can provide clear steps to reproduce, it's probably better to start with a thread in the forum and later to open an issue.
- If you are not sure if your issue is really a bug or just some configuration/setup problem, please start a [Q&A discussion](https://github.com/getredash/redash/discussions/new?category=q-a) first. Unless you can provide clear steps to reproduce, it's probably better to start with a discussion and later to open an issue.
- If you still decide to open an issue, please review the template and guidelines and include as much details as possible.
### Suggesting Enhancements / Feature Requests
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.
- 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*.
- Please check [the Ideas discussions](https://github.com/getredash/redash/discussions/categories/ideas) 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 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
- **Code contributions are welcomed**. For big changes or significant features, it's usually better to reach out first and discuss what you want to implement and how (we recommend reading: [Pull Request First](https://medium.com/practical-blend/pull-request-first-f6bb667a9b6#.ozlqxvj36)). This to make sure that what you want to implement is aligned with our goals for the project and that no one else is already working on it.
- Include screenshots and animated GIFs in your pull request whenever possible.
**Code contributions are welcomed**. For big changes or significant features, it's usually better to reach out first and discuss what you want to implement and how (we recommend reading: [Pull Request First](https://medium.com/practical-blend/pull-request-first-f6bb667a9b6#.ozlqxvj36)). This is to make sure that what you want to implement is aligned with our goals for the project and that no one else is already working on it.
#### Criteria for Review / Merging
When you open your pull request, please follow this repositorys PR template carefully:
- Indicate the type of change
- If you implement multiple unrelated features, bug fixes, or refactors please split them into individual pull requests.
- Describe the change
- If fixing a bug, please describe the bug or link to an existing github issue / forum discussion
- Include UI screenshots / GIFs whenever possible
- Please add [documentation](#documentation) for new features or changes in functionality along with the code.
- Please follow existing code style:
- Python: we use PEP8 for Python.
- 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).
- Python: we use [Black](https://github.com/psf/black) to auto format the code.
- Javascript: we use [Prettier](https://github.com/prettier/prettier) to auto-format the code.
#### Initial Review (1 week)
During this phase, a team member will apply the “Team Review” label if a pull request meets our criteria or a “Needs More Information” label if not. If more information is required, the team member will comment which criteria have not been met.
If your pull request receives the “Needs More Information” label, please make the requested changes and then remove the label. This resets the 1 week timer for an initial review.
Stale pull requests that remain untouched in “Needs More Information” for more than 4 weeks will be closed.
If a team member closes your pull request, you may reopen it after you have made the changes requested during initial review. After you make these changes, remove the “Needs More Information” label. This again resets the timer for another initial review.
#### Full Review (2 weeks)
After the “Team Review” label is applied, a member of the core team will review the PR within 2 weeks.
Reviews will approve, request changes, or ask questions to discuss areas of uncertainty. After youve responded, a member of the team will re-review within one week.
#### Merging (1 week)
After your pull request has been approved, a member of the core team will merge the pull request within a week.
### Documentation
@@ -66,9 +90,9 @@ The project's documentation can be found at [https://redash.io/help/](https://re
### 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](https://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.

View File

@@ -1,26 +1,102 @@
FROM node:10 as frontend-builder
FROM node:18-bookworm as frontend-builder
RUN npm install --global --force yarn@1.22.22
# 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 package.json package-lock.json /frontend/
RUN npm install
COPY --chown=redash package.json yarn.lock .yarnrc /frontend/
COPY --chown=redash viz-lib /frontend/viz-lib
COPY --chown=redash scripts /frontend/scripts
COPY . /frontend
RUN npm run build
# Controls whether to instrument code for coverage information
ARG code_coverage
ENV BABEL_ENV=${code_coverage:+test}
FROM redash/base:latest
RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn --frozen-lockfile --network-concurrency 1; fi
# Controls whether to install extra dependencies needed for all data sources.
ARG skip_ds_deps
COPY --chown=redash client /frontend/client
COPY --chown=redash webpack.config.js /frontend/
RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn build; else mkdir -p /frontend/client/dist && touch /frontend/client/dist/multi_org.html && touch /frontend/client/dist/index.html; fi
# We first copy only the requirements file, to avoid rebuilding on every file
# change.
COPY requirements.txt requirements_dev.txt requirements_all_ds.txt ./
RUN pip install -r requirements.txt -r requirements_dev.txt
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
FROM python:3.10-slim-bookworm
COPY . /app
COPY --from=frontend-builder /frontend/client/dist /app/client/dist
RUN chown -R redash /app
EXPOSE 5000
RUN useradd --create-home redash
# Ubuntu packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
pkg-config \
curl \
gnupg \
build-essential \
pwgen \
libffi-dev \
sudo \
git-core \
# Kerberos, needed for MS SQL Python driver to compile on arm64
libkrb5-dev \
# 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 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ARG TARGETPLATFORM
ARG databricks_odbc_driver_url=https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/odbc/2.6.26/SimbaSparkODBC-2.6.26.1045-Debian-64bit.zip
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \
&& curl https://packages.microsoft.com/config/debian/12/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& curl "$databricks_odbc_driver_url" --location --output /tmp/simba_odbc.zip \
&& chmod 600 /tmp/simba_odbc.zip \
&& unzip /tmp/simba_odbc.zip -d /tmp/simba \
&& dpkg -i /tmp/simba/*.deb \
&& printf "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini \
&& rm /tmp/simba_odbc.zip \
&& rm -rf /tmp/simba; fi
WORKDIR /app
ENV POETRY_VERSION=1.6.1
ENV POETRY_HOME=/etc/poetry
ENV POETRY_VIRTUALENVS_CREATE=false
RUN curl -sSL https://install.python-poetry.org | python3 -
COPY pyproject.toml poetry.lock ./
ARG POETRY_OPTIONS="--no-root --no-interaction --no-ansi"
# for LDAP authentication, install with `ldap3` group
# disabled by default due to GPL license conflict
ARG install_groups="main,all_ds,dev"
RUN /etc/poetry/bin/poetry install --only $install_groups $POETRY_OPTIONS
COPY --chown=redash . /app
COPY --from=frontend-builder --chown=redash /frontend/client/dist /app/client/dist
RUN chown redash /app
USER redash
ENTRYPOINT ["/app/bin/docker-entrypoint"]

View File

@@ -1,4 +1,4 @@
Copyright (c) 2013-2019, Arik Fraimovich.
Copyright (c) 2013-2020, Arik Fraimovich.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,

3
LICENSE.borders Normal file
View File

@@ -0,0 +1,3 @@
The Bahrain map data used in Redash was downloaded from
https://cartographyvectors.com/map/857-bahrain-detailed-boundary in PR #6192.
* Free for personal and commercial purpose with attribution.

View File

@@ -1,57 +1,76 @@
.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
.PHONY: compose_build up test_db create_database clean clean-all down tests lint backend-unit-tests frontend-unit-tests test build watch start redis-cli bash
compose_build:
docker-compose build
compose_build: .env
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build
up:
docker-compose up -d --build
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 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; \
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;"'
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
create_database: .env
docker compose run server create_db
clean:
docker-compose down && docker-compose rm
docker compose down
docker compose --project-name cypress down
docker compose rm --stop --force
docker compose --project-name cypress rm --stop --force
docker image rm --force \
cypress-server:latest cypress-worker:latest cypress-scheduler:latest \
redash-server:latest redash-worker:latest redash-scheduler:latest
docker container prune --force
docker image prune --force
docker volume prune --force
clean-all: clean
docker image rm --force \
redash/redash:10.1.0.b50633 redis:7-alpine maildev/maildev:latest \
pgautoupgrade/pgautoupgrade:15-alpine3.8 pgautoupgrade/pgautoupgrade:latest
down:
docker-compose down
docker compose down
bundle:
docker-compose run server bin/bundle-extensions
.env:
printf "REDASH_COOKIE_SECRET=`pwgen -1s 32`\nREDASH_SECRET_KEY=`pwgen -1s 32`\n" >> .env
env: .env
format:
pre-commit run --all-files
tests:
docker-compose run server tests
docker compose run server tests
lint:
./bin/flake8_tests.sh
ruff check .
black --check . --diff
backend-unit-tests: up test_db
docker-compose run --rm --name tests server tests
docker compose run --rm --name tests server tests
frontend-unit-tests: bundle
npm install
npm run bundle
npm test
frontend-unit-tests:
CYPRESS_INSTALL_BINARY=0 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 yarn --frozen-lockfile
yarn test
test: lint backend-unit-tests frontend-unit-tests
test: backend-unit-tests frontend-unit-tests lint
build: bundle
npm run build
build:
yarn build
watch: bundle
npm run watch
watch:
yarn watch
start: bundle
npm run start
start:
yarn start
redis-cli:
docker-compose run --rm redis redis-cli -h redis
docker compose run --rm redis redis-cli -h redis
bash:
docker-compose run --rm server bash
docker compose run --rm server bash

103
README.md
View File

@@ -1,44 +1,115 @@
<p align="center">
<img title="Redash" src='https://redash.io/assets/images/logo.png' width="200px"/>
</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/)
[![GitHub Build](https://github.com/getredash/redash/actions/workflows/ci.yml/badge.svg)](https://github.com/getredash/redash/actions)
**_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).
Today **_Redash_** has support for querying multiple databases, including: Redshift, Google BigQuery, PostgreSQL, MySQL, Graphite, Presto, Google Spreadsheets, Cloudera Impala, Hive and custom scripts.
**_Redash_** consists of two parts:
1. **Query Editor**: think of [JS Fiddle](https://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.
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).
1. **Browser-based**: Everything in your browser, with a shareable URL.
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.
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.
6. **Schedule refreshes**: Automatically update your charts and dashboards at regular intervals you define.
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%"/>
## 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/).
## Supported Data Sources
Redash supports more than 35 [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 CloudWatch / Insights
- Amazon DynamoDB
- Amazon Redshift
- ArangoDB
- Axibase Time Series Database
- Apache Cassandra
- ClickHouse
- CockroachDB
- Couchbase
- CSV
- Databricks
- DB2 by IBM
- Dgraph
- Apache Drill
- Apache Druid
- e6data
- Eccenca Corporate Memory
- Elasticsearch
- Exasol
- Microsoft Excel
- Firebolt
- Databend
- Google Analytics
- Google BigQuery
- Google Spreadsheets
- Graphite
- Greenplum
- Apache Hive
- Apache Impala
- InfluxDB
- InfluxDBv2
- IBM Netezza Performance Server
- JIRA (JQL)
- JSON
- Apache Kylin
- OmniSciDB (Formerly MapD)
- MariaDB
- MemSQL
- Microsoft Azure Data Warehouse / Synapse
- Microsoft Azure SQL Database
- Microsoft Azure Data Explorer / Kusto
- Microsoft SQL Server
- MongoDB
- MySQL
- Oracle
- Apache Phoenix
- Apache Pinot
- PostgreSQL
- Presto
- Prometheus
- Python
- Qubole
- Rockset
- RisingWave
- Salesforce
- ScyllaDB
- Shell Scripts
- Snowflake
- SPARQL
- SQLite
- TiDB
- Tinybird
- TreasureData
- Trino
- Uptycs
- Vertica
- Yandex AppMetrrica
- Yandex Metrica
## Getting Help
* Issues: https://github.com/getredash/redash/issues
* Discussion Forum: https://discuss.redash.io/
* Discussion Forum: https://github.com/getredash/redash/discussions/
* Development Discussion: https://discord.gg/tN5MdmfGBp
## 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 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://github.com/getredash/redash/wiki/Local-development-setup) and make a pull request. We need all the help we can get!
## 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).

View File

@@ -1,39 +0,0 @@
#!/usr/bin/env python
import os
from subprocess import call
from distutils.dir_util import copy_tree
from pkg_resources import iter_entry_points, resource_filename, resource_isdir
# Make a directory for extensions and set it as an environment variable
# to be picked up by webpack.
EXTENSIONS_RELATIVE_PATH = os.path.join('client', 'app', 'extensions')
EXTENSIONS_DIRECTORY = os.path.join(
os.path.dirname(os.path.dirname(__file__)),
EXTENSIONS_RELATIVE_PATH)
if not os.path.exists(EXTENSIONS_DIRECTORY):
os.makedirs(EXTENSIONS_DIRECTORY)
os.environ["EXTENSIONS_DIRECTORY"] = EXTENSIONS_RELATIVE_PATH
for entry_point in iter_entry_points('redash.extensions'):
# This is where the frontend code for an extension lives
# inside of its package.
content_folder_relative = os.path.join(
entry_point.name, 'bundle')
(root_module, _) = os.path.splitext(entry_point.module_name)
if not resource_isdir(root_module, content_folder_relative):
continue
content_folder = resource_filename(root_module, content_folder_relative)
# This is where we place our extensions folder.
destination = os.path.join(
EXTENSIONS_DIRECTORY,
entry_point.name)
copy_tree(content_folder, destination)

View File

@@ -1,37 +1,58 @@
#!/bin/bash
set -e
worker() {
WORKERS_COUNT=${WORKERS_COUNT:-2}
QUEUES=${QUEUES:-queries,scheduled_queries,celery,schemas}
WORKER_EXTRA_OPTIONS=${WORKER_EXTRA_OPTIONS:-}
scheduler() {
echo "Starting RQ scheduler..."
echo "Starting $WORKERS_COUNT workers for queues: $QUEUES..."
exec /usr/local/bin/celery worker --app=redash.worker -c$WORKERS_COUNT -Q$QUEUES -linfo --max-tasks-per-child=10 -Ofair $WORKER_EXTRA_OPTIONS
exec /app/manage.py rq scheduler
}
scheduler() {
WORKERS_COUNT=${WORKERS_COUNT:-1}
QUEUES=${QUEUES:-celery}
SCHEDULE_DB=${SCHEDULE_DB:-celerybeat-schedule}
dev_scheduler() {
echo "Starting dev RQ scheduler..."
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 -s$SCHEDULE_DB -c$WORKERS_COUNT -Q$QUEUES -linfo --max-tasks-per-child=10 -Ofair
worker() {
echo "Starting RQ worker..."
export WORKERS_COUNT=${WORKERS_COUNT:-2}
export QUEUES=${QUEUES:-}
exec supervisord -c worker.conf
}
workers_healthcheck() {
WORKERS_COUNT=${WORKERS_COUNT}
echo "Checking active workers count against $WORKERS_COUNT..."
ACTIVE_WORKERS_COUNT=`echo $(rq info --url $REDASH_REDIS_URL -R | grep workers | grep -oP ^[0-9]+)`
if [ "$ACTIVE_WORKERS_COUNT" -lt "$WORKERS_COUNT" ]; then
echo "$ACTIVE_WORKERS_COUNT workers are active, Exiting"
exit 1
else
echo "$ACTIVE_WORKERS_COUNT workers are active"
exit 0
fi
}
dev_worker() {
echo "Starting dev RQ worker..."
exec watchmedo auto-restart --directory=./redash/ --pattern=*.py --recursive -- ./manage.py rq worker $QUEUES
}
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}
TIMEOUT=${REDASH_GUNICORN_TIMEOUT:-60}
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 --timeout $TIMEOUT
}
create_db() {
exec /app/manage.py database create_tables
}
celery_healthcheck() {
exec /usr/local/bin/celery inspect ping --app=redash.worker -d celery@$HOSTNAME
}
help() {
echo "Redash Docker."
echo ""
@@ -39,9 +60,10 @@ help() {
echo ""
echo "server -- start Redash server (with gunicorn)"
echo "worker -- start Celery worker"
echo "scheduler -- start Celery worker with a beat (scheduler) process"
echo "celery_healthcheck -- runs a Celery healthcheck. Useful for Docker's HEALTHCHECK mechanism."
echo "worker -- start a single RQ worker"
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 "shell -- open shell"
echo "dev_server -- start Flask development server with debugger and auto reload"
@@ -67,6 +89,10 @@ case "$1" in
shift
worker
;;
workers_healthcheck)
shift
workers_healthcheck
;;
server)
shift
server
@@ -75,6 +101,18 @@ case "$1" in
shift
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)
export FLASK_DEBUG=1
exec /app/manage.py runserver --debugger --reload -h 0.0.0.0
@@ -106,4 +144,3 @@ case "$1" in
exec "$@"
;;
esac

View File

@@ -1,7 +0,0 @@
#!/bin/sh
flake8 --version ; pip --version
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E901,E999,F821,F822,F823 --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,34 +1,44 @@
#!/bin/env python
from __future__ import print_function
import sys
#!/bin/env python3
import re
import subprocess
import sys
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)
changes = []
for line in log.split('\n'):
for line in log.split("\n"):
try:
sha, subject, body, parents = line[1:-1].split('|')
sha, subject, body, parents = line[1:-1].split("|")
except ValueError:
continue
try:
pull_request = re.match("Merge pull request #(\d+)", subject).groups()[0]
pull_request = re.match(r"Merge pull request #(\d+)", subject).groups()[0]
pull_request = " #{}".format(pull_request)
except Exception as ex:
except Exception:
pull_request = ""
author = subprocess.check_output(['git', 'log', '-1', '--pretty=format:"%an"', parents.split(' ')[-1]])[1:-1]
author = subprocess.check_output(["git", "log", "-1", '--pretty=format:"%an"', parents.split(" ")[-1]])[1:-1]
changes.append("{}{}: {} ({})".format(sha, pull_request, body.strip(), author))
return changes
if __name__ == '__main__':
if __name__ == "__main__":
previous_sha = sys.argv[1]
changes = get_change_log(previous_sha)

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,17 +1,20 @@
from __future__ import print_function
#!/usr/bin/env python3
import os
import sys
import re
import subprocess
import sys
from urllib.parse import urlparse
import requests
import simplejson
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
repo = 'getredash/redash'
github_token = os.environ["GITHUB_TOKEN"]
auth = (github_token, "x-oauth-basic")
repo = "getredash/redash"
def _github_request(method, path, params=None, headers={}):
if not path.startswith('https://api.github.com'):
if urlparse(path).hostname != "api.github.com":
url = "https://api.github.com/{}".format(path)
else:
url = path
@@ -22,15 +25,18 @@ def _github_request(method, path, params=None, headers={}):
response = requests.request(method, url, data=params, auth=auth)
return response
def exception_from_error(message, response):
return Exception("({}) {}: {}".format(response.status_code, message, response.json().get('message', '?')))
return Exception("({}) {}: {}".format(response.status_code, message, response.json().get("message", "?")))
def rc_tag_name(version):
return "v{}-rc".format(version)
def get_rc_release(version):
tag = rc_tag_name(version)
response = _github_request('get', 'repos/{}/releases/tags/{}'.format(repo, tag))
response = _github_request("get", "repos/{}/releases/tags/{}".format(repo, tag))
if response.status_code == 404:
return None
@@ -39,84 +45,101 @@ def get_rc_release(version):
raise exception_from_error("Unknown error while looking RC release: ", response)
def create_release(version, commit_sha):
tag = rc_tag_name(version)
params = {
'tag_name': tag,
'name': "{} - RC".format(version),
'target_commitish': commit_sha,
'prerelease': True
"tag_name": tag,
"name": "{} - RC".format(version),
"target_commitish": commit_sha,
"prerelease": True,
}
response = _github_request('post', 'repos/{}/releases'.format(repo), params)
response = _github_request("post", "repos/{}/releases".format(repo), params)
if response.status_code != 201:
raise exception_from_error("Failed creating new release", response)
return response.json()
def upload_asset(release, filepath):
upload_url = release['upload_url'].replace('{?name,label}', '')
filename = filepath.split('/')[-1]
upload_url = release["upload_url"].replace("{?name,label}", "")
filename = filepath.split("/")[-1]
with open(filepath) as file_content:
headers = {'Content-Type': 'application/gzip'}
response = requests.post(upload_url, file_content, params={'name': filename}, headers=headers, auth=auth, verify=False)
headers = {"Content-Type": "application/gzip"}
response = requests.post(
upload_url, file_content, params={"name": filename}, headers=headers, auth=auth, verify=False
)
if response.status_code != 201: # not 200/201/...
raise exception_from_error('Failed uploading asset', response)
raise exception_from_error("Failed uploading asset", response)
return response
def remove_previous_builds(release):
for asset in release['assets']:
response = _github_request('delete', asset['url'])
for asset in release["assets"]:
response = _github_request("delete", asset["url"])
if response.status_code != 204:
raise exception_from_error("Failed deleting asset", response)
def get_changelog(commit_sha):
latest_release = _github_request('get', 'repos/{}/releases/latest'.format(repo))
latest_release = _github_request("get", "repos/{}/releases/latest".format(repo))
if latest_release.status_code != 200:
raise exception_from_error('Failed getting latest release', latest_release)
raise exception_from_error("Failed getting latest release", latest_release)
latest_release = latest_release.json()
previous_sha = latest_release['target_commitish']
previous_sha = latest_release["target_commitish"]
args = ['git', '--no-pager', 'log', '--merges', '--grep', 'Merge pull request', '--pretty=format:"%h|%s|%b|%p"', '{}...{}'.format(previous_sha, commit_sha)]
args = [
"git",
"--no-pager",
"log",
"--merges",
"--grep",
"Merge pull request",
'--pretty=format:"%h|%s|%b|%p"',
"{}...{}".format(previous_sha, commit_sha),
]
log = subprocess.check_output(args)
changes = ["Changes since {}:".format(latest_release['name'])]
changes = ["Changes since {}:".format(latest_release["name"])]
for line in log.split('\n'):
for line in log.split("\n"):
try:
sha, subject, body, parents = line[1:-1].split('|')
sha, subject, body, parents = line[1:-1].split("|")
except ValueError:
continue
try:
pull_request = re.match("Merge pull request #(\d+)", subject).groups()[0]
pull_request = re.match(r"Merge pull request #(\d+)", subject).groups()[0]
pull_request = " #{}".format(pull_request)
except Exception as ex:
except Exception:
pull_request = ""
author = subprocess.check_output(['git', 'log', '-1', '--pretty=format:"%an"', parents.split(' ')[-1]])[1:-1]
author = subprocess.check_output(["git", "log", "-1", '--pretty=format:"%an"', parents.split(" ")[-1]])[1:-1]
changes.append("{}{}: {} ({})".format(sha, pull_request, body.strip(), author))
return "\n".join(changes)
def update_release_commit_sha(release, commit_sha):
params = {
'target_commitish': commit_sha,
"target_commitish": commit_sha,
}
response = _github_request('patch', 'repos/{}/releases/{}'.format(repo, release['id']), params)
response = _github_request("patch", "repos/{}/releases/{}".format(repo, release["id"]), params)
if response.status_code != 200:
raise exception_from_error("Failed updating commit sha for existing release", response)
return response.json()
def update_release(version, build_filepath, commit_sha):
try:
release = get_rc_release(version)
@@ -125,21 +148,22 @@ def update_release(version, build_filepath, commit_sha):
else:
release = create_release(version, commit_sha)
print("Using release id: {}".format(release['id']))
print("Using release id: {}".format(release["id"]))
remove_previous_builds(release)
response = upload_asset(release, build_filepath)
changelog = get_changelog(commit_sha)
response = _github_request('patch', release['url'], {'body': changelog})
response = _github_request("patch", release["url"], {"body": changelog})
if response.status_code != 200:
raise exception_from_error("Failed updating release description", response)
except Exception as ex:
print(ex)
if __name__ == '__main__':
if __name__ == "__main__":
commit_sha = sys.argv[1]
version = sys.argv[2]
filepath = sys.argv[3]

View File

@@ -1,242 +0,0 @@
#!/usr/bin/env python
import urllib
import argparse
import os
import subprocess
import sys
from collections import namedtuple
from fnmatch import fnmatch
import requests
try:
import semver
except ImportError:
print("Missing required library: semver.")
exit(1)
REDASH_HOME = os.environ.get('REDASH_HOME', '/opt/redash')
CURRENT_VERSION_PATH = '{}/current'.format(REDASH_HOME)
def run(cmd, cwd=None):
if not cwd:
cwd = REDASH_HOME
return subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=subprocess.STDOUT)
def confirm(question):
reply = str(raw_input(question + ' (y/n): ')).lower().strip()
if reply[0] == 'y':
return True
if reply[0] == 'n':
return False
else:
return confirm("Please use 'y' or 'n'")
def version_path(version_name):
return "{}/{}".format(REDASH_HOME, version_name)
END_CODE = '\033[0m'
def colored_string(text, color):
if sys.stdout.isatty():
return "{}{}{}".format(color, text, END_CODE)
else:
return text
def h1(text):
print(colored_string(text, '\033[4m\033[1m'))
def green(text):
print(colored_string(text, '\033[92m'))
def red(text):
print(colored_string(text, '\033[91m'))
class Release(namedtuple('Release', ('version', 'download_url', 'filename', 'description'))):
def v1_or_newer(self):
return semver.compare(self.version, '1.0.0-alpha') >= 0
def is_newer(self, version):
return semver.compare(self.version, version) > 0
@property
def version_name(self):
return self.filename.replace('.tar.gz', '')
def get_latest_release_from_ci():
response = requests.get('https://circleci.com/api/v1.1/project/github/getredash/redash/latest/artifacts?branch=master')
if response.status_code != 200:
exit("Failed getting releases (status code: %s)." % response.status_code)
tarball_asset = filter(lambda asset: asset['url'].endswith('.tar.gz'), response.json())[0]
filename = urllib.unquote(tarball_asset['pretty_path'].split('/')[-1])
version = filename.replace('redash.', '').replace('.tar.gz', '')
release = Release(version, tarball_asset['url'], filename, '')
return release
def get_release(channel):
if channel == 'ci':
return get_latest_release_from_ci()
response = requests.get('https://version.redash.io/api/releases?channel={}'.format(channel))
release = response.json()[0]
filename = release['download_url'].split('/')[-1]
release = Release(release['version'], release['download_url'], filename, release['description'])
return release
def link_to_current(version_name):
green("Linking to current version...")
run('ln -nfs {} {}'.format(version_path(version_name), CURRENT_VERSION_PATH))
def restart_services():
# We're doing this instead of simple 'supervisorctl restart all' because
# otherwise it won't notice that /opt/redash/current pointing at a different
# directory.
green("Restarting...")
try:
run('sudo /etc/init.d/redash_supervisord restart')
except subprocess.CalledProcessError as e:
run('sudo service supervisor restart')
def update_requirements(version_name):
green("Installing new Python packages (if needed)...")
new_requirements_file = '{}/requirements.txt'.format(version_path(version_name))
install_requirements = False
try:
run('diff {}/requirements.txt {}'.format(CURRENT_VERSION_PATH, new_requirements_file)) != 0
except subprocess.CalledProcessError as e:
if e.returncode != 0:
install_requirements = True
if install_requirements:
run('sudo pip install -r {}'.format(new_requirements_file))
def apply_migrations(release):
green("Running migrations (if needed)...")
if not release.v1_or_newer():
return apply_migrations_pre_v1(release.version_name)
run("sudo -u redash bin/run ./manage.py db upgrade", cwd=version_path(release.version_name))
def find_migrations(version_name):
current_migrations = set([f for f in os.listdir("{}/migrations".format(CURRENT_VERSION_PATH)) if fnmatch(f, '*_*.py')])
new_migrations = sorted([f for f in os.listdir("{}/migrations".format(version_path(version_name))) if fnmatch(f, '*_*.py')])
return [m for m in new_migrations if m not in current_migrations]
def apply_migrations_pre_v1(version_name):
new_migrations = find_migrations(version_name)
if new_migrations:
green("New migrations to run: ")
print(', '.join(new_migrations))
else:
print("No new migrations in this version.")
if new_migrations and confirm("Apply new migrations? (make sure you have backup)"):
for migration in new_migrations:
print("Applying {}...".format(migration))
run("sudo sudo -u redash PYTHONPATH=. bin/run python migrations/{}".format(migration), cwd=version_path(version_name))
def download_and_unpack(release):
directory_name = release.version_name
green("Downloading release tarball...")
run('sudo wget --header="Accept: application/octet-stream" -O {} {}'.format(release.filename, release.download_url))
green("Unpacking to: {}...".format(directory_name))
run('sudo mkdir -p {}'.format(directory_name))
run('sudo tar -C {} -xvf {}'.format(directory_name, release.filename))
green("Changing ownership to redash...")
run('sudo chown redash {}'.format(directory_name))
green("Linking .env file...")
run('sudo ln -nfs {}/.env {}/.env'.format(REDASH_HOME, version_path(directory_name)))
def current_version():
real_current_path = os.path.realpath(CURRENT_VERSION_PATH).replace('.b', '+b')
return real_current_path.replace(REDASH_HOME + '/', '').replace('redash.', '')
def verify_minimum_version():
green("Current version: " + current_version())
if semver.compare(current_version(), '0.12.0') < 0:
red("You need to have Redash v0.12.0 or newer to upgrade to post v1.0.0 releases.")
green("To upgrade to v0.12.0, run the upgrade script set to the legacy channel (--channel legacy).")
exit(1)
def show_description_and_confirm(description):
if description:
print(description)
if not confirm("Continue with upgrade?"):
red("Cancelling upgrade.")
exit(1)
def verify_newer_version(release):
if not release.is_newer(current_version()):
red("The found release is not newer than your current deployed release ({}).".format(current_version()))
if not confirm("Continue with upgrade?"):
red("Cancelling upgrade.")
exit(1)
def deploy_release(channel):
h1("Starting Redash upgrade:")
release = get_release(channel)
green("Found version: {}".format(release.version))
if release.v1_or_newer():
verify_minimum_version()
verify_newer_version(release)
show_description_and_confirm(release.description)
try:
download_and_unpack(release)
update_requirements(release.version_name)
apply_migrations(release)
link_to_current(release.version_name)
restart_services()
green("Done! Enjoy.")
except subprocess.CalledProcessError as e:
red("Failed running: {}".format(e.cmd))
red("Exit status: {}\nOutput:\n{}".format(e.returncode, e.output))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--channel", help="The channel to get release from (default: stable).", default='stable')
args = parser.parse_args()
deploy_release(args.channel)

View File

@@ -1,20 +1,29 @@
{
"presets": [
["@babel/preset-env", {
"exclude": [
"@babel/plugin-transform-async-to-generator",
"@babel/plugin-transform-arrow-functions"
],
[
"@babel/preset-env",
{
"exclude": ["@babel/plugin-transform-async-to-generator", "@babel/plugin-transform-arrow-functions"],
"corejs": "2",
"useBuiltIns": "usage"
}],
"@babel/preset-react"
}
],
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
"angularjs-annotate",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-object-assign",
["babel-plugin-transform-builtin-extend", {
[
"babel-plugin-transform-builtin-extend",
{
"globals": ["Error"]
}]
}
]
],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}

View File

@@ -1,3 +1,4 @@
build/*.js
dist
config/*.js
client/dist

View File

@@ -1,66 +1,71 @@
module.exports = {
root: true,
extends: ["airbnb", "plugin:compat/recommended"],
plugins: ["jest", "compat"],
parser: "@typescript-eslint/parser",
extends: [
"react-app",
"plugin:compat/recommended",
"prettier",
"plugin:jsx-a11y/recommended",
// Remove any typescript-eslint rules that would conflict with prettier
"prettier/@typescript-eslint",
],
plugins: ["jest", "compat", "no-only-tests", "@typescript-eslint", "jsx-a11y"],
settings: {
"import/resolver": "webpack"
"import/resolver": "webpack",
},
parser: "babel-eslint",
env: {
browser: true,
node: true
node: true,
},
rules: {
// allow debugger during development
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
"no-param-reassign": 0,
"no-mixed-operators": 0,
"no-underscore-dangle": 0,
"no-use-before-define": ["error", "nofunc"],
"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",
"no-multiple-empty-lines": "warn",
"no-script-url": "off", // some <a> tags should have href="javascript:void(0)"
"operator-linebreak": "off",
"react/destructuring-assignment": "off",
"react/jsx-filename-extension": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/jsx-wrap-multilines": "warn",
"react/no-access-state-in-setstate": "warn",
"react/prefer-stateless-function": "warn",
"react/forbid-prop-types": "warn",
"react/prop-types": "warn",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/label-has-associated-control": [
"warn",
"jsx-a11y/anchor-is-valid": [
// TMP
"off",
{
controlComponents: true
}
components: ["Link"],
aspects: ["noHref", "invalidHref", "preferButton"],
},
],
"jsx-a11y/label-has-for": "off",
"jsx-a11y/no-static-element-interactions": "off",
"max-len": [
"jsx-a11y/no-redundant-roles": "error",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/click-events-have-key-events": "off", // TMP
"jsx-a11y/no-static-element-interactions": "off", // TMP
"jsx-a11y/no-noninteractive-element-interactions": "off", // TMP
"no-console": ["warn", { allow: ["warn", "error"] }],
"no-restricted-imports": [
"error",
120,
2,
{
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true
}
paths: [
{
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",
},
},
],
"no-else-return": ["error", { allowElseIf: true }],
"object-curly-newline": ["error", { consistent: true }]
}
};

View File

@@ -4,4 +4,7 @@ module.exports = {
env: {
"jest/globals": true,
},
rules: {
"jest/no-focused-tests": "off",
},
};

View File

@@ -1,4 +1,4 @@
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
configure({ adapter: new Adapter() });

View File

@@ -1,5 +1,5 @@
import MockDate from 'mockdate';
import MockDate from "mockdate";
const date = new Date('2000-01-01T02:00:00.000');
const date = new Date("2000-01-01T02:00:00.000");
MockDate.set(date);

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 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: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 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

@@ -1,39 +1,60 @@
@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/icon/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/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 'inc/ant-variables';
@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,
@@ -41,6 +62,11 @@
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
@@ -58,14 +84,14 @@
}
}
// Fix for Ant dropdowns when they are used in Boootstrap modals
.ant-dropdown-in-bootstrap-modal {
z-index: 1050;
}
// Button overrides
.@{btn-prefix-cls} {
transition-duration: 150ms;
&.icon-button {
width: 32px;
padding: 0 10px;
}
}
// Fix ant input number showing duplicate arrows
@@ -136,6 +162,10 @@
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,
@@ -195,6 +225,16 @@
}
}
&-tbody > tr&-row {
&:hover,
&:focus,
&:focus-within {
& > td {
background: @table-row-hover-bg;
}
}
}
// Custom styles
&-headerless &-tbody > tr:first-child > td {
@@ -208,11 +248,11 @@
&-item {
// custom rule
&.selected {
background-color: #F6F8F9;
background-color: #f6f8f9;
}
&.disabled {
background-color: fade(#F6F8F9, 40%);
background-color: fade(#f6f8f9, 40%);
& > * {
opacity: 0.4;
@@ -288,10 +328,6 @@
margin-top: 4px;
}
.ant-popover {
z-index: 1000; // make sure it doesn't cover drawer
}
// Notification overrides
.@{notification-prefix-cls} {
// vertical centering
@@ -306,5 +342,95 @@
}
.@{btn-prefix-cls} .@{iconfont-css-prefix}-ellipsis {
margin: 0 -7px;
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;
}
}
&:focus,
&:focus-within {
color: @menu-highlight-color;
}
}
}
.@{dropdown-prefix-cls}-menu-item {
&:focus,
&:focus-within {
background-color: @item-hover-bg;
}
}
// 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 {
border: 1px solid #eee;
border: 1px solid fade(@redash-gray, 15%);
height: 100%;
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 {
padding-left: 30px;
padding-right: 30px;
.alert-page h3 {
flex-grow: 1;
span {
cursor: pointer;
input {
margin: -0.2em 0;
width: 100%;
min-width: 170px;
}
}
.alert-dismissable,
.alert-dismissible {
padding-right: 44px;
.btn-create-alert[disabled] {
display: block;
margin-top: -20px;
}
.alert-inverse {
.alert-variant(@alert-inverse-bg; @alert-inverse-border; @alert-inverse-text);
}
.alert-state {
border-bottom: 1px solid @input-border;
padding-bottom: 30px;
.alert-link {
color: #fff !important;
font-weight: normal !important;
text-decoration: underline;
}
.growl-animated {
&.alert-inverse {
box-shadow: 0 0 5px fade(@alert-inverse-bg, 50%);
.alert-state-indicator {
text-transform: uppercase;
font-size: 14px;
padding: 5px 8px;
}
&.alert-info {
box-shadow: 0 0 5px fade(@alert-info-bg, 50%);
.ant-form-item-explain {
margin-top: 10px;
}
&.alert-success {
box-shadow: 0 0 5px fade(@alert-success-bg, 50%);
}
&.alert-warning {
box-shadow: 0 0 5px fade(@alert-warning-bg, 50%);
}
&.alert-danger {
box-shadow: 0 0 5px fade(@alert-danger-bg, 50%);
.alert-last-triggered {
color: @headings-color;
}
}
.alert-query-selector {
min-width: 250px;
width: auto !important;
}
// allow form item labels to gracefully break line
.alert-form-item label {
white-space: initial;
padding-right: 8px;
line-height: 21px;
&::after {
margin-right: 0 !important;
}
}

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

@@ -1,8 +1,8 @@
/* --------------------------------------------------------
Colors
-----------------------------------------------------------*/
@lightblue: #03A9F4;
@primary-color: #2196F3;
@lightblue: #03a9f4;
@primary-color: #2196f3;
@redash-gray: rgba(102, 136, 153, 1);
@redash-orange: rgba(255, 120, 100, 1);
@@ -12,34 +12,31 @@
/* --------------------------------------------------------
Font
-----------------------------------------------------------*/
@redash-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
@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;
/* --------------------------------------------------------
Button
-----------------------------------------------------------*/
@btn-danger-bg: fade(@redash-gray, 10%);
@btn-danger-border: fade(@redash-gray, 15%);
@border-color-base: #e8e8e8;
/* --------------------------------------------------------
Pagination
@@ -49,14 +46,13 @@
@pagination-font-weight-active: normal;
@pagination-bg: fade(@redash-gray, 15%);
@pagination-color: #7E7E7E;
@pagination-color: #7e7e7e;
@pagination-active-bg: @lightblue;
@pagination-active-color: #FFF;
@pagination-active-color: #fff;
@pagination-disabled-bg: fade(@redash-gray, 15%);
@pagination-hover-color: #333;
@pagination-hover-bg: fade(@redash-gray, 25%);
/* --------------------------------------------------------
Table
-----------------------------------------------------------*/

View File

@@ -1,4 +1,8 @@
*, button, input, i, a {
*,
button,
input,
i,
a {
-webkit-font-smoothing: antialiased;
}
@@ -14,26 +18,28 @@ html {
-ms-overflow-style: auto;
}
html, body {
html,
body {
min-height: 100vh;
}
body {
padding-top: @header-height;
position: relative;
&.headless {
padding-top: 0;
.nav.app-header {
display: none;
}
background: #f6f8f9;
font-family: @redash-font;
position: relative;
#application-root {
padding-bottom: 15px;
}
}
app-view {
#application-root {
min-height: 100vh;
}
app-view, #app-content {
#application-root,
#app-content {
display: flex;
flex-direction: column;
flex-grow: 1;
@@ -72,14 +78,30 @@ strong {
}
}
.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 {
overflow: auto;
position: relative;
}
.clickable {
cursor: pointer;
button&:disabled {
cursor: not-allowed;
}
}
.resize-vertical {
@@ -95,3 +117,115 @@ strong {
resize: both !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,
.collapse.in {
padding: 5px 10px;
padding: 0;
transition: all 0.35s ease;
}

View File

@@ -122,3 +122,21 @@
top: 1px;
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

@@ -1,54 +1,23 @@
.edit-in-place span {
.edit-in-place {
white-space: pre-line;
display: inline-block;
p {
margin-bottom: 0;
}
}
.edit-in-place span.editable {
.editable {
display: inline-block;
cursor: pointer;
}
.edit-in-place span.editable:hover {
&:hover {
background: @redash-yellow;
border-radius: @redash-radius;
}
}
}
.edit-in-place.active input,
.edit-in-place.active textarea {
&.active input,
&.active textarea {
display: inline-block;
}
.edit-in-place {
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

@@ -29,24 +29,6 @@ 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
-----------------------------------------------------------*/
@@ -55,19 +37,23 @@ textarea.v-resizable {
.transition-duration(300ms);
resize: none;
box-shadow: 0 0 0 40px rgba(0, 0, 0, 0) !important;
border-radius: 0;
border-radius: @redash-input-radius;
&: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
-----------------------------------------------------------*/
.cra-validatation(@color) {
input[type="checkbox"], input[type="radio"] {
input[type="checkbox"],
input[type="radio"] {
& + .input-helper {
border-color: @color;
}
@@ -94,15 +80,14 @@ textarea.v-resizable {
&.has-warning {
.cra-validatation(@orange);
}
&.has-error {
.cra-validatation(@red);
}
input[type="checkbox"], input[type="radio"] {
input[type="checkbox"],
input[type="radio"] {
.opacity(0);
width: 20px;
height: 20px;
@@ -128,7 +113,7 @@ textarea.v-resizable {
content: "";
width: 9px;
height: 9px;
background: #31ACFF;
background: #31acff;
position: absolute;
left: 4px;
top: 4px;
@@ -155,7 +140,6 @@ textarea.v-resizable {
padding-left: 27px;
}
/* --------------------------------------------------------
Input Addon
-----------------------------------------------------------*/
@@ -173,11 +157,10 @@ textarea.v-resizable {
}
}
/* --------------------------------------------------------
Toggle Switch
-----------------------------------------------------------*/
.ts-color(@color){
.ts-color(@color) {
input {
&:not(:disabled) {
&:checked {
@@ -190,7 +173,7 @@ textarea.v-resizable {
&:active {
&: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%);
}
}
}
@@ -218,24 +201,26 @@ textarea.v-resizable {
width: 40px;
height: 16px;
border-radius: 8px;
background: rgba(0,0,0,0.26);
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: '';
content: "";
position: absolute;
top: -4px;
left: -4px;
width: 24px;
height: 24px;
background: #fafafa;
box-shadow: 0 2px 8px rgba(0,0,0,0.28);
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);
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);
}
}
@@ -243,7 +228,7 @@ textarea.v-resizable {
.ts-helper {
&:active {
&:before {
box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 0 20px rgba(128,128,128,0.1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 20px rgba(128, 128, 128, 0.1);
}
}
}
@@ -267,7 +252,7 @@ textarea.v-resizable {
}
}
&:not([data-ts-color]){
&:not([data-ts-color]) {
.ts-color(@teal);
}
@@ -306,5 +291,4 @@ textarea.v-resizable {
&[data-ts-color="green"] {
.ts-color(@green);
}
}

View File

@@ -2,7 +2,7 @@
Generate Margin Classes (0px - 25px)
margin, margin-top, margin-bottom, margin-left, margin-right
-----------------------------------------------------------*/
.margin (@label, @size: 1, @key:1) when (@size =< 30){
.margin (@label, @size: 1, @key:1) when (@size =< 30) {
.m-@{key} {
margin: @size !important;
}
@@ -28,15 +28,15 @@
.margin(25, 0px, 0);
.m-2{
margin:2px;
.m-2 {
margin: 2px;
}
/* --------------------------------------------------------
Generate Padding Classes (0px - 25px)
padding, padding-top, padding-bottom, padding-left, padding-right
-----------------------------------------------------------*/
.padding (@label, @size: 1, @key:1) when (@size =< 30){
.padding (@label, @size: 1, @key:1) when (@size =< 30) {
.p-@{key} {
padding: @size !important;
}
@@ -62,11 +62,10 @@
.padding(25, 0px, 0);
/* --------------------------------------------------------
Generate Font-Size Classes (8px - 20px)
-----------------------------------------------------------*/
.font-size (@label, @size: 8, @key:10) when (@size =< 20){
.font-size (@label, @size: 8, @key:10) when (@size =< 20) {
.f-@{key} {
font-size: @size !important;
}
@@ -76,45 +75,78 @@
.font-size(20, 8px, 8);
.f-inherit {
font-size: inherit !important;
}
/* --------------------------------------------------------
Font Weight
-----------------------------------------------------------*/
.f-300 { font-weight: 300 !important; }
.f-400 { font-weight: 400 !important; }
.f-500 { font-weight: 500 !important; }
.f-700 { font-weight: 700 !important; }
.f-300 {
font-weight: 300 !important;
}
.f-400 {
font-weight: 400 !important;
}
.f-500 {
font-weight: 500 !important;
}
.f-700 {
font-weight: 700 !important;
}
/* --------------------------------------------------------
Position
-----------------------------------------------------------*/
.p-relative { position: relative !important; }
.p-absolute { position: absolute !important; }
.p-fixed { position: fixed !important; }
.p-static { position: static !important; }
.p-relative {
position: relative !important;
}
.p-absolute {
position: absolute !important;
}
.p-fixed {
position: fixed !important;
}
.p-static {
position: static !important;
}
/* --------------------------------------------------------
Overflow
-----------------------------------------------------------*/
.o-hidden { overflow: hidden !important; }
.o-visible { overflow: visible !important; }
.o-auto { overflow: auto !important; }
.o-hidden {
overflow: hidden !important;
}
.o-visible {
overflow: visible !important;
}
.o-auto {
overflow: auto !important;
}
/* --------------------------------------------------------
Display
-----------------------------------------------------------*/
.di-block { display: inline-block !important; }
.d-block { display: block; }
.di-block {
display: inline-block !important;
}
.d-block {
display: block;
}
/* --------------------------------------------------------
Background Colors and Colors
-----------------------------------------------------------*/
@array: c-white bg-white @white, c-ace bg-ace @ace, c-black bg-black @black, c-brown bg-brown @brown, c-pink bg-pink @pink, c-red bg-red @red, c-blue bg-blue @blue, c-purple bg-purple @purple, c-deeppurple bg-deeppurple @deeppurple, c-lightblue bg-lightblue @lightblue, c-cyan bg-cyan @cyan, c-teal bg-teal @teal, c-green bg-green @green, c-lightgreen bg-lightgreen @lightgreen, c-lime bg-lime @lime, c-yellow bg-yellow @yellow, c-amber bg-amber @amber, c-orange bg-orange @orange, c-deeporange bg-deeporange @deeporange, c-gray bg-gray @gray, c-bluegray bg-bluegray @bluegray, c-indigo bg-indigo @indigo;
@array: c-white bg-white @white, c-ace bg-ace @ace, c-black bg-black @black, c-brown bg-brown @brown,
c-pink bg-pink @pink, c-red bg-red @red, c-blue bg-blue @blue, c-purple bg-purple @purple,
c-deeppurple bg-deeppurple @deeppurple, c-lightblue bg-lightblue @lightblue, c-cyan bg-cyan @cyan,
c-teal bg-teal @teal, c-green bg-green @green, c-lightgreen bg-lightgreen @lightgreen, c-lime bg-lime @lime,
c-yellow bg-yellow @yellow, c-amber bg-amber @amber, c-orange bg-orange @orange,
c-deeporange bg-deeporange @deeporange, c-gray bg-gray @gray, c-bluegray bg-bluegray @bluegray,
c-indigo bg-indigo @indigo;
.for(@array); .-each(@value) {
.for(@array);
.-each(@value) {
@name: extract(@value, 1);
@name2: extract(@value, 2);
@color: extract(@value, 3);
@@ -127,30 +159,61 @@
}
}
/* --------------------------------------------------------
Background Colors
-----------------------------------------------------------*/
.bg-brand { background-color: @brand-bg; }
.bg-black-trp { background-color: rgba(0,0,0,0.12) !important; }
.bg-brand {
background-color: @brand-bg;
}
.bg-black-trp {
background-color: rgba(0, 0, 0, 0.12) !important;
}
/* --------------------------------------------------------
Borders
-----------------------------------------------------------*/
.b-0 { border: 0 !important; }
.b-0 {
border: 0 !important;
}
/* --------------------------------------------------------
Width
-----------------------------------------------------------*/
.w-100 { width: 100% !important; }
.w-50 { width: 50% !important; }
.w-25 { width: 25% !important; }
.w-100 {
width: 100% !important;
}
.w-50 {
width: 50% !important;
}
.w-25 {
width: 25% !important;
}
/* --------------------------------------------------------
Border Radius
-----------------------------------------------------------*/
.brd-2 { border-radius: 2px; }
.brd-2 {
border-radius: 2px;
}
/* --------------------------------------------------------
Alignment
-----------------------------------------------------------*/
.va-top {
vertical-align: top;
}
/* --------------------------------------------------------
Screen readers
-----------------------------------------------------------*/
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}

Some files were not shown because too many files have changed in this diff Show More