Compare commits

...

510 Commits

Author SHA1 Message Date
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
752 changed files with 49877 additions and 48828 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.19 -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null
COPY . $APP
RUN ./node_modules/.bin/cypress verify

View File

@@ -1,4 +1,3 @@
version: '2.2'
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:15-alpine3.8
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"

View File

@@ -1,17 +1,17 @@
version: "2.2"
x-redash-service: &redash-service
build:
context: ../
args:
skip_dev_deps: "true"
skip_ds_deps: "true"
install_groups: "main"
code_coverage: ${CODE_COVERAGE}
x-redash-environment: &redash-environment
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
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
@@ -43,7 +43,7 @@ services:
ipc: host
build:
context: ../
dockerfile: .circleci/Dockerfile.cypress
dockerfile: .ci/Dockerfile.cypress
depends_on:
- server
- worker
@@ -63,9 +63,11 @@ services:
CYPRESS_PROJECT_ID: ${CYPRESS_PROJECT_ID}
CYPRESS_RECORD_KEY: ${CYPRESS_RECORD_KEY}
redis:
image: redis:3.0-alpine
image: redis:7-alpine
restart: unless-stopped
postgres:
image: postgres:9.5.6-alpine
image: pgautoupgrade/pgautoupgrade:15-alpine3.8
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:node14.0.0-chrome84
ENV APP /usr/src/app
WORKDIR $APP
COPY package.json package-lock.json $APP/
COPY viz-lib $APP/viz-lib
RUN npm ci > /dev/null
COPY . $APP
RUN ./node_modules/.bin/cypress verify

View File

@@ -1,177 +0,0 @@
version: 2.0
build-docker-image-job: &build-docker-image-job
docker:
- image: circleci/node:12
steps:
- setup_remote_docker
- checkout
- run: sudo apt update
- run: sudo apt install python3-pip
- run: sudo pip3 install -r requirements_bundles.txt
- run: .circleci/update_version
- run: npm run bundle
- run: .circleci/docker_build
jobs:
backend-lint:
docker:
- image: circleci/python:3.7.0
steps:
- checkout
- run: sudo pip install flake8
- run: ./bin/flake8_tests.sh
backend-unit-tests:
environment:
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 --build-arg skip_frontend_build=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: List Enabled Query Runners
command: docker-compose run --rm redash manage ds list_types
- 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
when: always
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: coverage.xml
frontend-lint:
environment:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker:
- image: circleci/node:12
steps:
- checkout
- run: mkdir -p /tmp/test-results/eslint
- run: npm ci
- run: npm run lint:ci
- store_test_results:
path: /tmp/test-results
frontend-unit-tests:
environment:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker:
- image: circleci/node:12
steps:
- checkout
- run: sudo apt update
- run: sudo apt install python3-pip
- run: sudo pip3 install -r requirements_bundles.txt
- run: npm ci
- run: npm run bundle
- run:
name: Run App Tests
command: npm test
- run:
name: Run Visualizations Tests
command: (cd viz-lib && npm test)
- run: npm run lint
frontend-e2e-tests:
environment:
COMPOSE_FILE: .circleci/docker-compose.cypress.yml
COMPOSE_PROJECT_NAME: cypress
PERCY_TOKEN_ENCODED: ZGRiY2ZmZDQ0OTdjMzM5ZWE0ZGQzNTZiOWNkMDRjOTk4Zjg0ZjMxMWRmMDZiM2RjOTYxNDZhOGExMjI4ZDE3MA==
CYPRESS_PROJECT_ID_ENCODED: OTI0Y2th
CYPRESS_RECORD_KEY_ENCODED: YzA1OTIxMTUtYTA1Yy00NzQ2LWEyMDMtZmZjMDgwZGI2ODgx
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker:
- image: circleci/node:12
steps:
- setup_remote_docker
- checkout
- run:
name: Enable Code Coverage report for master branch
command: |
if [ "$CIRCLE_BRANCH" = "master" ]; then
echo 'export CODE_COVERAGE=true' >> $BASH_ENV
source $BASH_ENV
fi
- run:
name: Install npm dependencies
command: |
npm ci
- run:
name: Setup Redash server
command: |
npm run cypress build
npm run cypress start -- --skip-db-seed
docker-compose run cypress npm run cypress db-seed
- run:
name: Execute Cypress tests
command: npm run cypress run-ci
- run:
name: "Failure: output container logs to console"
command: |
docker-compose logs
when: on_fail
- run:
name: Copy Code Coverage results
command: |
docker cp cypress:/usr/src/app/coverage ./coverage || true
when: always
- store_artifacts:
path: coverage
build-docker-image: *build-docker-image-job
build-preview-docker-image: *build-docker-image-job
workflows:
version: 2
build:
jobs:
- backend-lint
- backend-unit-tests:
requires:
- backend-lint
- frontend-lint
- frontend-unit-tests:
requires:
- backend-lint
- frontend-lint
- frontend-e2e-tests:
requires:
- frontend-lint
- build-preview-docker-image:
requires:
- backend-unit-tests
- frontend-unit-tests
- frontend-e2e-tests
filters:
branches:
only:
- master
- hold:
type: approval
requires:
- backend-unit-tests
- frontend-unit-tests
- frontend-e2e-tests
filters:
branches:
only:
- /release\/.*/
- build-docker-image:
requires:
- hold

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 --build-arg skip_dev_deps=true -t redash/redash:preview -t redash/preview:$VERSION_TAG .
docker push redash/redash:preview
docker push redash/preview:$VERSION_TAG
else
docker build --build-arg skip_dev_deps=true -t redash/redash:$VERSION_TAG .
docker push redash/redash:$VERSION_TAG
fi
echo "Built: $VERSION_TAG"

View File

@@ -1,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

@@ -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

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

@@ -0,0 +1,174 @@
name: Tests
on:
push:
branches:
- master
pull_request_target:
branches:
- master
env:
NODE_VERSION: 18
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@v4
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@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install Dependencies
run: |
npm install --global --force yarn@1.22.19
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@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install Dependencies
run: |
npm install --global --force yarn@1.22.19
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@v3
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@1.22.19
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

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

@@ -0,0 +1,28 @@
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: |
date="$(date +%y.%m).0-dev"
gawk -i inplace -F: -v q=\" -v tag=$date '/^ "version": / { print $1 FS, q tag q ","; next} { print }' package.json
gawk -i inplace -F= -v q=\" -v tag=$date '/^__version__ =/ { print $1 FS, q tag q; next} { print }' redash/__init__.py
gawk -i inplace -F= -v q=\" -v tag=$date '/^version =/ { print $1 FS, q tag q; next} { print }' pyproject.toml
git config user.name github-actions
git config user.email github-actions@github.com
git add package.json redash/__init__.py pyproject.toml
git commit -m "Snapshot: ${date}"
git tag $date
git push --atomic origin master refs/tags/$date

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.19
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

1
.npmrc Normal file
View File

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

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
v16.20.1

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

View File

@@ -57,6 +57,9 @@ restylers:
- migrations/versions
- name: prettier
image: restyled/restyler-prettier:v1.19.1-2
command:
- prettier
- --write
include:
- client/app/**/*.js
- client/app/**/*.jsx

2
.yarn/.gitignore vendored Normal file
View File

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

View File

@@ -1,5 +1,152 @@
# 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:

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,25 +34,54 @@ 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 forum](https://discuss.redash.io/c/feature-requests/5) for existing threads about what you want to suggest/ask. If there is, feel free to upvote it to signal interest or add your comments.
- 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 [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
The project's documentation can be found at [https://redash.io/help/](https://redash.io/help/). The [documentation sources](https://github.com/getredash/website/tree/master/src/pages/kb) are hosted on GitHub. To contribute edits / new pages, you can use GitHub's interface. Click the "Edit on GitHub" link on the documentation page to quickly open the edit interface.

View File

@@ -1,4 +1,6 @@
FROM node:12 as frontend-builder
FROM node:18-bookworm as frontend-builder
RUN npm install --global --force yarn@1.22.19
# Controls whether to build the frontend assets
ARG skip_frontend_build
@@ -10,32 +12,30 @@ RUN useradd -m -d /frontend redash
USER redash
WORKDIR /frontend
COPY --chown=redash package.json package-lock.json /frontend/
COPY --chown=redash package.json yarn.lock .yarnrc /frontend/
COPY --chown=redash viz-lib /frontend/viz-lib
COPY --chown=redash scripts /frontend/scripts
# Controls whether to instrument code for coverage information
ARG code_coverage
ENV BABEL_ENV=${code_coverage:+test}
RUN if [ "x$skip_frontend_build" = "x" ] ; then npm ci --unsafe-perm; fi
RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn --frozen-lockfile --network-concurrency 1; fi
COPY --chown=redash client /frontend/client
COPY --chown=redash webpack.config.js /frontend/
RUN if [ "x$skip_frontend_build" = "x" ] ; then npm run build; else mkdir -p /frontend/client/dist && touch /frontend/client/dist/multi_org.html && touch /frontend/client/dist/index.html; fi
FROM python:3.7-slim
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
FROM python:3.8-slim-bookworm
EXPOSE 5000
# Controls whether to install extra dependencies needed for all data sources.
ARG skip_ds_deps
# Controls whether to install dev dependencies.
ARG skip_dev_deps
RUN useradd --create-home redash
# Ubuntu packages
RUN apt-get update && \
apt-get install -y \
apt-get install -y --no-install-recommends \
pkg-config \
curl \
gnupg \
build-essential \
@@ -43,7 +43,8 @@ RUN apt-get update && \
libffi-dev \
sudo \
git-core \
wget \
# Kerberos, needed for MS SQL Python driver to compile on arm64
libkrb5-dev \
# Postgres client
libpq-dev \
# ODBC support:
@@ -57,37 +58,45 @@ RUN apt-get update && \
libsasl2-dev \
unzip \
libsasl2-modules-gssapi-mit && \
# MSSQL ODBC Driver:
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql17 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ARG databricks_odbc_driver_url=https://databricks.com/wp-content/uploads/2.6.10.1010-2/SimbaSparkODBC-2.6.10.1010-2-Debian-64bit.zip
ADD $databricks_odbc_driver_url /tmp/simba_odbc.zip
RUN unzip /tmp/simba_odbc.zip -d /tmp/ \
&& dpkg -i /tmp/SimbaSparkODBC-*/*.deb \
&& echo "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini \
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 msodbcsql17 \
&& 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/SimbaSparkODBC*
&& rm -rf /tmp/simba; fi
WORKDIR /app
# Disalbe PIP Cache and Version Check
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
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 -
# We first copy only the requirements file, to avoid rebuilding on every file
# change.
COPY requirements.txt requirements_bundles.txt requirements_dev.txt requirements_all_ds.txt ./
RUN if [ "x$skip_dev_deps" = "x" ] ; then pip install -r requirements.txt -r requirements_dev.txt; else pip install -r requirements.txt; fi
RUN if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi
COPY pyproject.toml poetry.lock ./
COPY . /app
COPY --from=frontend-builder /frontend/client/dist /app/client/dist
RUN chown -R redash /app
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"]

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,62 @@
.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 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 rm
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
CYPRESS_INSTALL_BINARY=0 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm ci
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

View File

@@ -3,8 +3,7 @@
</p>
[![Documentation](https://img.shields.io/badge/docs-redash.io/help-brightgreen.svg)](https://redash.io/help/)
[![Datree](https://s3.amazonaws.com/catalog.static.datree.io/datree-badge-20px.svg)](https://datree.io/?src=badge)
[![Build Status](https://circleci.com/gh/getredash/redash.png?style=shield&circle-token=8a695aa5ec2cbfa89b48c275aea298318016f040)](https://circleci.com/gh/getredash/redash/tree/master)
[![GitHub Build](https://github.com/getredash/redash/actions/workflows/ci.yml/badge.svg)](https://github.com/getredash/redash/actions)
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.
@@ -32,36 +31,53 @@ Redash features:
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
- Cassandra
- Apache Cassandra
- ClickHouse
- CockroachDB
- Couchbase
- CSV
- Databricks (Apache Spark)
- Databricks
- DB2 by IBM
- Druid
- Dgraph
- Apache Drill
- Apache Druid
- e6data
- Eccenca Corporate Memory
- Elasticsearch
- Exasol
- Microsoft Excel
- Firebolt
- Databend
- Google Analytics
- Google BigQuery
- Google Spreadsheets
- Graphite
- Greenplum
- Hive
- Impala
- Apache Hive
- Apache Impala
- InfluxDB
- JIRA
- 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
@@ -72,8 +88,13 @@ Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help
- ScyllaDB
- Shell Scripts
- Snowflake
- SPARQL
- SQLite
- TiDB
- Tinybird
- TreasureData
- Trino
- Uptycs
- Vertica
- Yandex AppMetrrica
- Yandex Metrica
@@ -81,12 +102,13 @@ Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help
## 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

View File

@@ -1,115 +0,0 @@
#!/usr/bin/env python3
"""Copy bundle extension files to the client/app/extension directory"""
import logging
import os
from pathlib import Path
from shutil import copy
from collections import OrderedDict as odict
import importlib_metadata
import importlib_resources
# Name of the subdirectory
BUNDLE_DIRECTORY = "bundle"
logger = logging.getLogger(__name__)
# Make a directory for extensions and set it as an environment variable
# to be picked up by webpack.
extensions_relative_path = Path("client", "app", "extensions")
extensions_directory = Path(__file__).parent.parent / extensions_relative_path
if not extensions_directory.exists():
extensions_directory.mkdir()
os.environ["EXTENSIONS_DIRECTORY"] = str(extensions_relative_path)
def entry_point_module(entry_point):
"""Returns the dotted module path for the given entry point"""
return entry_point.pattern.match(entry_point.value).group("module")
def load_bundles():
""""Load bundles as defined in Redash extensions.
The bundle entry point can be defined as a dotted path to a module
or a callable, but it won't be called but just used as a means
to find the files under its file system path.
The name of the directory it looks for files in is "bundle".
So a Python package with an extension bundle could look like this::
my_extensions/
├── __init__.py
└── wide_footer
├── __init__.py
└── bundle
├── extension.js
└── styles.css
and would then need to register the bundle with an entry point
under the "redash.bundles" group, e.g. in your setup.py::
setup(
# ...
entry_points={
"redash.bundles": [
"wide_footer = my_extensions.wide_footer",
]
# ...
},
# ...
)
"""
bundles = odict()
for entry_point in importlib_metadata.entry_points().get("redash.bundles", []):
logger.info('Loading Redash bundle "%s".', entry_point.name)
module = entry_point_module(entry_point)
# Try to get a list of bundle files
try:
bundle_dir = importlib_resources.files(module).joinpath(BUNDLE_DIRECTORY)
except (ImportError, TypeError):
# Module isn't a package, so can't have a subdirectory/-package
logger.error(
'Redash bundle module "%s" could not be imported: "%s"',
entry_point.name,
module,
)
continue
if not bundle_dir.is_dir():
logger.error(
'Redash bundle directory "%s" could not be found or is not a directory: "%s"',
entry_point.name,
bundle_dir,
)
continue
bundles[entry_point.name] = list(bundle_dir.rglob("*"))
return bundles
bundles = load_bundles().items()
if bundles:
print("Number of extension bundles found: {}".format(len(bundles)))
else:
print("No extension bundles found.")
for bundle_name, paths in bundles:
# Shortcut in case not paths were found for the bundle
if not paths:
print('No paths found for bundle "{}".'.format(bundle_name))
continue
# The destination for the bundle files with the entry point name as the subdirectory
destination = Path(extensions_directory, bundle_name)
if not destination.exists():
destination.mkdir()
# Copy the bundle directory from the module to its destination.
print('Copying "{}" bundle to {}:'.format(bundle_name, destination.resolve()))
for src_path in paths:
dest_path = destination / src_path.name
print(" - {} -> {}".format(src_path, dest_path))
copy(str(src_path), str(dest_path))

View File

@@ -22,6 +22,19 @@ worker() {
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..."
@@ -32,7 +45,8 @@ server() {
# Recycle gunicorn workers every n-th request. See http://docs.gunicorn.org/en/stable/settings.html#max-requests for more details.
MAX_REQUESTS=${MAX_REQUESTS:-1000}
MAX_REQUESTS_JITTER=${MAX_REQUESTS_JITTER:-100}
exec /usr/local/bin/gunicorn -b 0.0.0.0:5000 --name redash -w${REDASH_WEB_WORKERS:-4} redash.wsgi:app --max-requests $MAX_REQUESTS --max-requests-jitter $MAX_REQUESTS_JITTER
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() {
@@ -75,6 +89,10 @@ case "$1" in
shift
worker
;;
workers_healthcheck)
shift
workers_healthcheck
;;
server)
shift
server

View File

@@ -1,9 +0,0 @@
#!/bin/sh
set -o errexit # fail the build if any task fails
flake8 --version ; pip --version
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

View File

@@ -1,35 +1,44 @@
#!/bin/env python3
import sys
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,17 +1,20 @@
#!/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 python3
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(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

@@ -5,10 +5,11 @@ module.exports = {
"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"],
plugins: ["jest", "compat", "no-only-tests", "@typescript-eslint", "jsx-a11y"],
settings: {
"import/resolver": "webpack",
},
@@ -19,7 +20,20 @@ module.exports = {
rules: {
// allow debugger during development
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/anchor-is-valid": [
// TMP
"off",
{
components: ["Link"],
aspects: ["noHref", "invalidHref", "preferButton"],
},
],
"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",
{

Binary file not shown.

After

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 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: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -225,6 +225,16 @@
}
}
&-tbody > tr&-row {
&:hover,
&:focus,
&:focus-within {
& > td {
background: @table-row-hover-bg;
}
}
}
// Custom styles
&-headerless &-tbody > tr:first-child > td {
@@ -391,6 +401,18 @@
left: 0;
}
}
&:focus,
&:focus-within {
color: @menu-highlight-color;
}
}
}
.@{dropdown-prefix-cls}-menu-item {
&:focus,
&:focus-within {
background-color: @item-hover-bg;
}
}

View File

@@ -98,6 +98,10 @@ strong {
.clickable {
cursor: pointer;
button&:disabled {
cursor: not-allowed;
}
}
.resize-vertical {

View File

@@ -1,26 +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 {
display: inline-block;
}
.edit-in-place {
&.active input,
&.active textarea {
display: inline-block;
}
}

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,47 +75,78 @@
.font-size(20, 8px, 8);
.f-inherit { font-size: inherit !important; }
.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);
@@ -129,36 +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; }
.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;
}

View File

@@ -1,33 +1,9 @@
div.table-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
padding: 2px 22px 2px 10px;
border-radius: @redash-radius;
position: relative;
height: 22px;
.copy-to-editor {
display: none;
}
&:hover {
background: fade(@redash-gray, 10%);
.copy-to-editor {
display: flex;
}
}
}
.schema-container {
height: 100%;
z-index: 10;
background-color: white;
}
.schema-browser {
.schema-browser {
overflow: hidden;
border: none;
padding-top: 10px;
@@ -46,25 +22,54 @@ div.table-name {
}
.copy-to-editor {
visibility: hidden;
color: fade(@redash-gray, 90%);
cursor: pointer;
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 20px;
display: flex;
align-items: center;
justify-content: center;
transition: none;
}
.table-open {
padding: 0 22px 0 26px;
.schema-list-item {
display: flex;
border-radius: @redash-radius;
height: 22px;
.table-name {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
position: relative;
cursor: pointer;
padding: 2px 22px 2px 10px;
}
&:hover,
&:focus,
&:focus-within {
background: fade(@redash-gray, 10%);
.copy-to-editor {
visibility: visible;
}
}
}
.table-open {
.table-open-item {
display: flex;
height: 18px;
width: calc(100% - 22px);
padding-left: 22px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
transition: none;
div:first-child {
flex: 1;
}
.column-type {
color: fade(@text-color, 80%);
@@ -73,21 +78,20 @@ div.table-name {
text-transform: uppercase;
}
.copy-to-editor {
display: none;
}
&:hover {
&:hover,
&:focus,
&:focus-within {
background: fade(@redash-gray, 10%);
.copy-to-editor {
display: flex;
visibility: visible;
}
}
}
}
}
}
.schema-control {
.schema-control {
display: flex;
flex-wrap: nowrap;
padding: 0;
@@ -95,8 +99,9 @@ div.table-name {
.ant-btn {
height: auto;
}
}
}
.parameter-label {
.parameter-label {
display: block;
}
}

View File

@@ -103,7 +103,7 @@
padding-top: 5px !important;
}
.btn-favourite,
.btn-favorite,
.btn-archive {
font-size: 15px;
}
@@ -114,18 +114,23 @@
line-height: 1.7 !important;
}
.btn-favourite {
.btn-favorite {
color: #d4d4d4;
transition: all 0.25s ease-in-out;
.fa-star {
color: @yellow-darker;
}
&:hover,
&:focus {
color: @yellow-darker;
cursor: pointer;
}
.fa-star {
color: @yellow-darker;
filter: saturate(75%);
opacity: 0.75;
}
}
}

View File

@@ -90,6 +90,23 @@ body.fixed-layout {
.embed__vis {
display: flex;
flex-flow: column;
height: calc(~'100vh - 25px');
> .embed-heading {
flex: 0 0 auto;
}
> .query__vis {
flex: 1 1 auto;
.chart-visualization-container, .visualization-renderer-wrapper, .visualization-renderer {
height: 100%
}
}
> .tile__bottom-control {
flex: 0 0 auto;
}
width: 100%;
}
@@ -127,11 +144,13 @@ body.fixed-layout {
}
}
a.label-tag {
.label-tag {
background: fade(@redash-gray, 15%);
color: darken(@redash-gray, 15%);
&:hover {
&:hover,
&:focus,
&:active {
color: darken(@redash-gray, 15%);
background: fade(@redash-gray, 25%);
}
@@ -204,6 +223,7 @@ a.label-tag {
}
.editor__left__schema {
min-height: 120px;
flex-grow: 1;
display: flex;
flex-direction: column;

View File

@@ -1,10 +1,11 @@
import { first } from "lodash";
import React, { useState } from "react";
import Button from "antd/lib/button";
import React, { useMemo } from "react";
import { first, includes } from "lodash";
import Menu from "antd/lib/menu";
import Link from "@/components/Link";
import PlainButton from "@/components/PlainButton";
import HelpTrigger from "@/components/HelpTrigger";
import CreateDashboardDialog from "@/components/dashboards/CreateDashboardDialog";
import { useCurrentRoute } from "@/components/ApplicationArea/Router";
import { Auth, currentUser } from "@/services/auth";
import settingsMenu from "@/services/settingsMenu";
import logoUrl from "@/assets/images/redash_icon_small.png";
@@ -15,83 +16,109 @@ import AlertOutlinedIcon from "@ant-design/icons/AlertOutlined";
import PlusOutlinedIcon from "@ant-design/icons/PlusOutlined";
import QuestionCircleOutlinedIcon from "@ant-design/icons/QuestionCircleOutlined";
import SettingOutlinedIcon from "@ant-design/icons/SettingOutlined";
import MenuUnfoldOutlinedIcon from "@ant-design/icons/MenuUnfoldOutlined";
import MenuFoldOutlinedIcon from "@ant-design/icons/MenuFoldOutlined";
import VersionInfo from "./VersionInfo";
import "./DesktopNavbar.less";
function NavbarSection({ inlineCollapsed, children, ...props }) {
function NavbarSection({ children, ...props }) {
return (
<Menu
selectable={false}
mode={inlineCollapsed ? "inline" : "vertical"}
inlineCollapsed={inlineCollapsed}
theme="dark"
{...props}>
<Menu selectable={false} mode="vertical" theme="dark" {...props}>
{children}
</Menu>
);
}
export default function DesktopNavbar() {
const [collapsed, setCollapsed] = useState(true);
function useNavbarActiveState() {
const currentRoute = useCurrentRoute();
return useMemo(
() => ({
dashboards: includes(
[
"Dashboards.List",
"Dashboards.Favorites",
"Dashboards.My",
"Dashboards.ViewOrEdit",
"Dashboards.LegacyViewOrEdit",
],
currentRoute.id
),
queries: includes(
[
"Queries.List",
"Queries.Favorites",
"Queries.Archived",
"Queries.My",
"Queries.View",
"Queries.New",
"Queries.Edit",
],
currentRoute.id
),
dataSources: includes(["DataSources.List"], currentRoute.id),
alerts: includes(["Alerts.List", "Alerts.New", "Alerts.View", "Alerts.Edit"], currentRoute.id),
}),
[currentRoute.id]
);
}
export default function DesktopNavbar() {
const firstSettingsTab = first(settingsMenu.getAvailableItems());
const activeState = useNavbarActiveState();
const canCreateQuery = currentUser.hasPermission("create_query");
const canCreateDashboard = currentUser.hasPermission("create_dashboard");
const canCreateAlert = currentUser.hasPermission("list_alerts");
return (
<div className="desktop-navbar">
<NavbarSection inlineCollapsed={collapsed} className="desktop-navbar-logo">
<div>
<nav className="desktop-navbar">
<NavbarSection className="desktop-navbar-logo">
<div role="menuitem">
<Link href="./">
<img src={logoUrl} alt="Redash" />
</Link>
</div>
</NavbarSection>
<NavbarSection inlineCollapsed={collapsed}>
<NavbarSection>
{currentUser.hasPermission("list_dashboards") && (
<Menu.Item key="dashboards">
<Menu.Item key="dashboards" className={activeState.dashboards ? "navbar-active-item" : null}>
<Link href="dashboards">
<DesktopOutlinedIcon />
<span>Dashboards</span>
<DesktopOutlinedIcon aria-label="Dashboard navigation button" />
<span className="desktop-navbar-label">Dashboards</span>
</Link>
</Menu.Item>
)}
{currentUser.hasPermission("view_query") && (
<Menu.Item key="queries">
<Menu.Item key="queries" className={activeState.queries ? "navbar-active-item" : null}>
<Link href="queries">
<CodeOutlinedIcon />
<span>Queries</span>
<CodeOutlinedIcon aria-label="Queries navigation button" />
<span className="desktop-navbar-label">Queries</span>
</Link>
</Menu.Item>
)}
{currentUser.hasPermission("list_alerts") && (
<Menu.Item key="alerts">
<Menu.Item key="alerts" className={activeState.alerts ? "navbar-active-item" : null}>
<Link href="alerts">
<AlertOutlinedIcon />
<span>Alerts</span>
<AlertOutlinedIcon aria-label="Alerts navigation button" />
<span className="desktop-navbar-label">Alerts</span>
</Link>
</Menu.Item>
)}
</NavbarSection>
<NavbarSection inlineCollapsed={collapsed} className="desktop-navbar-spacer">
{(canCreateQuery || canCreateDashboard || canCreateAlert) && <Menu.Divider />}
<NavbarSection className="desktop-navbar-spacer">
{(canCreateQuery || canCreateDashboard || canCreateAlert) && (
<Menu.SubMenu
key="create"
popupClassName="desktop-navbar-submenu"
data-test="CreateButton"
tabIndex={0}
title={
<React.Fragment>
<span data-test="CreateButton">
<PlusOutlinedIcon />
<span>Create</span>
</span>
<span className="desktop-navbar-label">Create</span>
</React.Fragment>
}>
{canCreateQuery && (
@@ -103,9 +130,9 @@ export default function DesktopNavbar() {
)}
{canCreateDashboard && (
<Menu.Item key="new-dashboard">
<a data-test="CreateDashboardMenuItem" onMouseUp={() => CreateDashboardDialog.showModal()}>
<PlainButton data-test="CreateDashboardMenuItem" onClick={() => CreateDashboardDialog.showModal()}>
New Dashboard
</a>
</PlainButton>
</Menu.Item>
)}
{canCreateAlert && (
@@ -119,32 +146,31 @@ export default function DesktopNavbar() {
)}
</NavbarSection>
<NavbarSection inlineCollapsed={collapsed}>
<NavbarSection>
<Menu.Item key="help">
<HelpTrigger showTooltip={false} type="HOME">
<HelpTrigger showTooltip={false} type="HOME" tabIndex={0}>
<QuestionCircleOutlinedIcon />
<span>Help</span>
<span className="desktop-navbar-label">Help</span>
</HelpTrigger>
</Menu.Item>
{firstSettingsTab && (
<Menu.Item key="settings">
<Menu.Item key="settings" className={activeState.dataSources ? "navbar-active-item" : null}>
<Link href={firstSettingsTab.path} data-test="SettingsLink">
<SettingOutlinedIcon />
<span>Settings</span>
<span className="desktop-navbar-label">Settings</span>
</Link>
</Menu.Item>
)}
<Menu.Divider />
</NavbarSection>
<NavbarSection inlineCollapsed={collapsed} className="desktop-navbar-profile-menu">
<NavbarSection className="desktop-navbar-profile-menu">
<Menu.SubMenu
key="profile"
popupClassName="desktop-navbar-submenu"
tabIndex={0}
title={
<span data-test="ProfileDropdown" className="desktop-navbar-profile-menu-title">
<img className="profile__image_thumb" src={currentUser.profile_image_url} alt={currentUser.name} />
<span>{currentUser.name}</span>
</span>
}>
<Menu.Item key="profile">
@@ -157,20 +183,16 @@ export default function DesktopNavbar() {
)}
<Menu.Divider />
<Menu.Item key="logout">
<a data-test="LogOutButton" onClick={() => Auth.logout()}>
<PlainButton data-test="LogOutButton" onClick={() => Auth.logout()}>
Log out
</a>
</PlainButton>
</Menu.Item>
<Menu.Divider />
<Menu.Item key="version" disabled className="version-info">
<Menu.Item key="version" role="presentation" disabled className="version-info">
<VersionInfo />
</Menu.Item>
</Menu.SubMenu>
</NavbarSection>
<Button onClick={() => setCollapsed(!collapsed)} className="desktop-navbar-collapse-button">
{collapsed ? <MenuUnfoldOutlinedIcon /> : <MenuFoldOutlinedIcon />}
</Button>
</div>
</nav>
);
}

View File

@@ -1,12 +1,17 @@
@backgroundColor: #001529;
@dividerColor: rgba(255, 255, 255, 0.5);
@textColor: rgba(255, 255, 255, 0.75);
@brandColor: #ff7964; // Redash logo color
@activeItemColor: @brandColor;
@iconSize: 26px;
.desktop-navbar {
background: @backgroundColor;
display: flex;
flex-direction: column;
height: 100%;
width: 80px;
overflow: hidden;
&-spacer {
flex: 1 1 auto;
@@ -21,12 +26,6 @@
height: 40px;
transition: all 270ms;
}
&.ant-menu-inline-collapsed {
img {
height: 20px;
}
}
}
.help-trigger {
@@ -34,33 +33,38 @@
}
.ant-menu {
&:not(.ant-menu-inline-collapsed) {
width: 170px;
}
&.ant-menu-inline-collapsed > .ant-menu-submenu-title span img + span,
&.ant-menu-inline-collapsed > .ant-menu-item i + span {
display: inline-block;
max-width: 0;
opacity: 0;
}
.ant-menu-item-divider {
background: @dividerColor;
}
.ant-menu-item,
.ant-menu-submenu {
font-weight: 500;
color: @textColor;
&.navbar-active-item {
box-shadow: inset 3px 0 0 @activeItemColor;
.anticon {
color: @activeItemColor;
}
}
&.ant-menu-submenu-open,
&.ant-menu-submenu-active,
&:hover,
&:active {
&:active,
&:focus,
&:focus-within {
color: #fff;
}
.anticon {
font-size: @iconSize;
margin: 0;
}
.desktop-navbar-label {
margin-top: 4px;
font-size: 11px;
}
a,
span,
.anticon {
@@ -71,21 +75,33 @@
.ant-menu-submenu-arrow {
display: none;
}
.ant-menu-item,
.ant-menu-submenu {
padding: 0;
height: 60px;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}
.ant-btn.desktop-navbar-collapse-button {
background-color: @backgroundColor;
border: 0;
border-radius: 0;
color: @textColor;
&:hover,
&:active {
color: #fff;
.ant-menu-submenu-title {
width: 100%;
padding: 0;
}
&:after {
animation: 0s !important;
a,
&.ant-menu-vertical > .ant-menu-submenu > .ant-menu-submenu-title,
.ant-menu-submenu-title {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
line-height: normal;
height: auto;
background: none;
color: inherit;
}
}
@@ -99,37 +115,8 @@
.profile__image_thumb {
margin: 0;
vertical-align: middle;
}
.profile__image_thumb + span {
flex: 1 1 auto;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 10px;
vertical-align: middle;
display: inline-block;
// styles from Antd
opacity: 1;
transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
margin-left 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
}
&.ant-menu-inline-collapsed {
.ant-menu-submenu-title {
padding-left: 16px !important;
padding-right: 16px !important;
}
.desktop-navbar-profile-menu-title {
.profile__image_thumb + span {
opacity: 0;
max-width: 0;
margin-left: 0;
}
width: @iconSize;
height: @iconSize;
}
}
}
@@ -146,7 +133,9 @@
color: @textColor;
&:hover,
&:active {
&:active,
&:focus,
&:focus-within {
color: #fff;
}
@@ -171,7 +160,9 @@
color: rgba(255, 255, 255, 0.8);
&:hover,
&:active {
&:active,
&:focus,
&:focus-within {
color: rgba(255, 255, 255, 1);
}
}

View File

@@ -14,8 +14,8 @@ export default function VersionInfo() {
<div className="m-t-10">
{/* eslint-disable react/jsx-no-target-blank */}
<Link href="https://version.redash.io/" className="update-available" target="_blank" rel="noopener">
Update Available
<i className="fa fa-external-link m-l-5" />
Update Available <i className="fa fa-external-link m-l-5" aria-hidden="true" />
<span className="sr-only">(opens in a new tab)</span>
</Link>
</div>
)}

View File

@@ -49,7 +49,7 @@ export default function ErrorMessage({ error, message }) {
<div className="error-message-container" data-test="ErrorMessage" role="alert">
<div className="error-state bg-white tiled">
<div className="error-state__icon">
<i className="zmdi zmdi-alert-circle-o" />
<i className="zmdi zmdi-alert-circle-o" aria-hidden="true" />
</div>
<div className="error-state__details">
<DynamicComponent

View File

@@ -17,6 +17,13 @@ export default function ApplicationArea() {
useEffect(() => {
function globalErrorHandler(event) {
event.preventDefault();
if (event.message === "Uncaught SyntaxError: Unexpected token '<'") {
// if we see a javascript error on unexpected token where the unexpected token is '<', this usually means that a fallback html file (like index.html)
// was served as content of script rather than the expected script, give a friendlier message in the console on what could be going on
console.error(
`[Uncaught SyntaxError: Unexpected token '<'] usually means that a fallback html file was returned from server rather than the expected script. Check that the server is properly serving the file ${event.filename}.`
);
}
setUnhandledError(event.error);
}

View File

@@ -1,5 +1,4 @@
import React, { useEffect, useState } from "react";
// @ts-expect-error (Must be removed after adding @redash/viz typing)
import ErrorBoundary, { ErrorBoundaryContext } from "@redash/viz/lib/components/ErrorBoundary";
import { Auth } from "@/services/auth";
import { policy } from "@/services/policy";
@@ -62,11 +61,14 @@ export function UserSessionWrapper<P>({ bodyClass, currentRoute, render }: UserS
return (
<ApplicationLayout>
<React.Fragment key={currentRoute.key}>
{/* @ts-expect-error FIXME */}
<ErrorBoundary renderError={(error: Error) => <ErrorMessage error={error} />}>
<ErrorBoundaryContext.Consumer>
{({ handleError }: { handleError: UserSessionWrapperRenderChildrenProps<P>["onError"] }) =>
render({ ...currentRoute.routeParams, pageTitle: currentRoute.title, onError: handleError })
}
{(
{
handleError,
} /* : { handleError: UserSessionWrapperRenderChildrenProps<P>["onError"] } FIXME bring back type */
) => render({ ...currentRoute.routeParams, pageTitle: currentRoute.title, onError: handleError })}
</ErrorBoundaryContext.Consumer>
</ErrorBoundary>
</React.Fragment>

View File

@@ -1,14 +1,21 @@
import React from "react";
import PropTypes from "prop-types";
import { useUniqueId } from "@/lib/hooks/useUniqueId";
import cx from "classnames";
function BigMessage({ message, icon, children, className }) {
const messageId = useUniqueId("bm-message");
return (
<div className={"p-15 text-center " + className}>
<h3 className="m-t-0 m-b-0">
<i className={"fa " + icon} />
<div
className={"big-message p-15 text-center " + className}
role="status"
aria-live="assertive"
aria-relevant="additions removals">
<h3 className="m-t-0 m-b-0" aria-labelledby={messageId}>
<i className={cx("fa", icon)} aria-hidden="true" />
</h3>
<br />
{message}
<span id={messageId}>{message}</span>
{children}
</div>
);

View File

@@ -1,7 +1,7 @@
import React from "react";
import PropTypes from "prop-types";
import Button from "antd/lib/button";
import Tooltip from "antd/lib/tooltip";
import Tooltip from "@/components/Tooltip";
import CopyOutlinedIcon from "@ant-design/icons/CopyOutlined";
import "./CodeBlock.less";

View File

@@ -1,4 +1,4 @@
@import '~antd/lib/button/style/index';
@import (reference, less) "~@/assets/less/ant";
.code-block {
background: rgba(0, 0, 0, 0.06);

View File

@@ -1,6 +1,6 @@
import React from "react";
import PropTypes from "prop-types";
import { isEmpty, toUpper, includes, get } from "lodash";
import { isEmpty, toUpper, includes, get, uniqueId } from "lodash";
import Button from "antd/lib/button";
import List from "antd/lib/list";
import Modal from "antd/lib/modal";
@@ -45,6 +45,8 @@ class CreateSourceDialog extends React.Component {
currentStep: StepEnum.SELECT_TYPE,
};
formId = uniqueId("sourceForm");
selectType = selectedType => {
this.setState({ selectedType, currentStep: StepEnum.CONFIGURE_IT });
};
@@ -82,6 +84,7 @@ class CreateSourceDialog extends React.Component {
<div className="m-t-10">
<Search
placeholder="Search..."
aria-label="Search"
onChange={e => this.setState({ searchText: e.target.value })}
autoFocus
data-test="SearchSource"
@@ -111,11 +114,12 @@ class CreateSourceDialog extends React.Component {
<div className="text-right">
{HELP_TRIGGER_TYPES[helpTriggerType] && (
<HelpTrigger className="f-13" type={helpTriggerType}>
Setup Instructions <i className="fa fa-question-circle" />
Setup Instructions <i className="fa fa-question-circle" aria-hidden="true" />
<span className="sr-only">(help)</span>
</HelpTrigger>
)}
</div>
<DynamicForm id="sourceForm" fields={fields} onSubmit={this.createSource} feedbackIcons hideSubmitButton />
<DynamicForm id={this.formId} fields={fields} onSubmit={this.createSource} feedbackIcons hideSubmitButton />
{selectedType.type === "databricks" && (
<small>
By using the Databricks Data Source you agree to the Databricks JDBC/ODBC{" "}
@@ -139,7 +143,7 @@ class CreateSourceDialog extends React.Component {
roundedImage={false}
data-test="PreviewItem"
data-test-type={item.type}>
<i className="fa fa-angle-double-right" />
<i className="fa fa-angle-double-right" aria-hidden="true" />
</PreviewCard>
</List.Item>
);
@@ -169,7 +173,7 @@ class CreateSourceDialog extends React.Component {
<Button
key="submit"
htmlType="submit"
form="sourceForm"
form={this.formId}
type="primary"
loading={savingSource}
data-test="CreateSourceSaveButton">

View File

@@ -86,6 +86,7 @@ export default class EditInPlace extends React.Component {
return (
<InputComponent
defaultValue={value}
aria-label="Editing"
onBlur={e => this.stopEditing(e.target.value)}
onKeyDown={this.handleKeyDown}
autoFocus

View File

@@ -11,6 +11,7 @@ import Divider from "antd/lib/divider";
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
import QuerySelector from "@/components/QuerySelector";
import { Query } from "@/services/query";
import { useUniqueId } from "@/lib/hooks/useUniqueId";
const { Option } = Select;
const formItemProps = { labelCol: { span: 6 }, wrapperCol: { span: 16 } };
@@ -111,6 +112,8 @@ function EditParameterSettingsDialog(props) {
props.dialog.close(param);
}
const paramFormId = useUniqueId("paramForm");
return (
<Modal
{...props.dialog.props}
@@ -125,12 +128,12 @@ function EditParameterSettingsDialog(props) {
htmlType="submit"
disabled={!isFulfilled()}
type="primary"
form="paramForm"
form={paramFormId}
data-test="SaveParameterSettings">
{isNew ? "Add Parameter" : "OK"}
</Button>,
]}>
<Form layout="horizontal" onFinish={onConfirm} id="paramForm">
<Form layout="horizontal" onFinish={onConfirm} id={paramFormId}>
{isNew && (
<NameInput
name={param.name}

View File

@@ -3,6 +3,7 @@ import PropTypes from "prop-types";
import Dropdown from "antd/lib/dropdown";
import Menu from "antd/lib/menu";
import Button from "antd/lib/button";
import PlainButton from "@/components/PlainButton";
import { clientConfig } from "@/services/auth";
import PlusCircleFilledIcon from "@ant-design/icons/PlusCircleFilled";
@@ -18,16 +19,18 @@ export default function QueryControlDropdown(props) {
<Menu>
{!props.query.isNew() && (!props.query.is_draft || !props.query.is_archived) && (
<Menu.Item>
<a target="_self" onClick={() => props.openAddToDashboardForm(props.selectedTab)}>
<PlainButton onClick={() => props.openAddToDashboardForm(props.selectedTab)}>
<PlusCircleFilledIcon /> Add to Dashboard
</a>
</PlainButton>
</Menu.Item>
)}
{!clientConfig.disablePublicUrls && !props.query.isNew() && (
<Menu.Item>
<a onClick={() => props.showEmbedDialog(props.query, props.selectedTab)} data-test="ShowEmbedDialogButton">
<PlainButton
onClick={() => props.showEmbedDialog(props.query, props.selectedTab)}
data-test="ShowEmbedDialogButton">
<ShareAltOutlinedIcon /> Embed Elsewhere
</a>
</PlainButton>
</Menu.Item>
)}
<Menu.Item>

View File

@@ -1,12 +1,14 @@
import React from "react";
import PropTypes from "prop-types";
import cx from "classnames";
import { clientConfig, currentUser } from "@/services/auth";
import Tooltip from "antd/lib/tooltip";
import Tooltip from "@/components/Tooltip";
import Alert from "antd/lib/alert";
import HelpTrigger from "@/components/HelpTrigger";
import { useUniqueId } from "@/lib/hooks/useUniqueId";
export default function EmailSettingsWarning({ featureName, className, mode, adminOnly }) {
const messageDescriptionId = useUniqueId("sr-mail-description");
if (!clientConfig.mailSettingsMissing) {
return null;
}
@@ -16,7 +18,7 @@ export default function EmailSettingsWarning({ featureName, className, mode, adm
}
const message = (
<span>
<span id={messageDescriptionId}>
Your mail server isn&apos;t configured correctly, and is needed for {featureName} to work.{" "}
<HelpTrigger type="MAIL_CONFIG" className="f-inherit" />
</span>
@@ -24,8 +26,11 @@ export default function EmailSettingsWarning({ featureName, className, mode, adm
if (mode === "icon") {
return (
<Tooltip title={message}>
<i className={cx("fa fa-exclamation-triangle", className)} />
<Tooltip title={message} placement="topRight" arrowPointAtCenter>
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
<span className={className} aria-label="Mail alert" aria-describedby={messageDescriptionId} tabIndex={0}>
<i className={"fa fa-exclamation-triangle"} aria-hidden="true" />
</span>
</Tooltip>
);
}

View File

@@ -1,5 +1,6 @@
import React from "react";
import PropTypes from "prop-types";
import PlainButton from "@/components/PlainButton";
export default class FavoritesControl extends React.Component {
static propTypes = {
@@ -29,12 +30,13 @@ export default class FavoritesControl extends React.Component {
const icon = item.is_favorite ? "fa fa-star" : "fa fa-star-o";
const title = item.is_favorite ? "Remove from favorites" : "Add to favorites";
return (
<a
<PlainButton
title={title}
className="favorites-control btn-favourite"
aria-label={title}
className="favorites-control btn-favorite"
onClick={event => this.toggleItem(event, item, onChange)}>
<i className={icon} aria-hidden="true" />
</a>
</PlainButton>
);
}
}

View File

@@ -112,11 +112,11 @@ function Filters({ filters, onChange }) {
{!filter.multiple && options}
{filter.multiple && [
<Select.Option key={NONE_VALUES} data-test="ClearOption">
<i className="fa fa-square-o m-r-5" />
<i className="fa fa-square-o m-r-5" aria-hidden="true" />
Clear
</Select.Option>,
<Select.Option key={ALL_VALUES} data-test="SelectAllOption">
<i className="fa fa-check-square-o m-r-5" />
<i className="fa fa-check-square-o m-r-5" aria-hidden="true" />
Select All
</Select.Option>,
<Select.OptGroup key="Values" title="Values">

View File

@@ -2,9 +2,10 @@ import { startsWith, get, some, mapValues } from "lodash";
import React from "react";
import PropTypes from "prop-types";
import cx from "classnames";
import Tooltip from "antd/lib/tooltip";
import Tooltip from "@/components/Tooltip";
import Drawer from "antd/lib/drawer";
import Link from "@/components/Link";
import PlainButton from "@/components/PlainButton";
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
import BigMessage from "@/components/BigMessage";
import DynamicComponent, { registerComponent } from "@/components/DynamicComponent";
@@ -45,7 +46,7 @@ export const TYPES = mapValues(
NUMBER_FORMAT_SPECS: ["/user-guide/visualizations/formatting-numbers", "Formatting Numbers"],
GETTING_STARTED: ["/user-guide/getting-started", "Guide: Getting Started"],
DASHBOARDS: ["/user-guide/dashboards", "Guide: Dashboards"],
QUERIES: ["/help/user-guide/querying", "Guide: Queries"],
QUERIES: ["/user-guide/querying", "Guide: Queries"],
ALERTS: ["/user-guide/alerts", "Guide: Alerts"],
},
([url, title]) => [DOMAIN + HELP_PATH + url, title]
@@ -68,7 +69,7 @@ const HelpTriggerDefaultProps = {
className: null,
showTooltip: true,
renderAsLink: false,
children: <i className="fa fa-question-circle" />,
children: <i className="fa fa-question-circle" aria-hidden="true" />,
};
export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName = null) {
@@ -170,7 +171,13 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName
this.props.showTooltip ? (
<>
{tooltip}
{shouldRenderAsLink && <i className="fa fa-external-link" style={{ marginLeft: 5 }} />}
{shouldRenderAsLink && (
<>
{" "}
<i className="fa fa-external-link" style={{ marginLeft: 5 }} aria-hidden="true" />
<span className="sr-only">(opens in a new tab)</span>
</>
)}
</>
) : null
}>
@@ -197,14 +204,15 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName
<Tooltip title="Open page in a new window" placement="left">
{/* eslint-disable-next-line react/jsx-no-target-blank */}
<Link href={url} target="_blank">
<i className="fa fa-external-link" />
<i className="fa fa-external-link" aria-hidden="true" />
<span className="sr-only">(opens in a new tab)</span>
</Link>
</Tooltip>
)}
<Tooltip title="Close" placement="bottom">
<a onClick={this.closeDrawer}>
<PlainButton onClick={this.closeDrawer}>
<CloseOutlinedIcon />
</a>
</PlainButton>
</Tooltip>
</div>

View File

@@ -1,4 +1,4 @@
@import "~antd/lib/drawer/style/drawer";
@import (reference, less) "~@/assets/less/ant";
@help-doc-bg: #f7f7f7; // according to https://github.com/getredash/website/blob/13daff2d8b570956565f482236f6245042e8477f/src/scss/_components/_variables.scss#L15
@@ -38,7 +38,8 @@
border: 2px solid @help-doc-bg;
display: flex;
a {
a,
.plain-button {
height: 26px;
width: 26px;
display: flex;

View File

@@ -1,7 +1,8 @@
import React from "react";
import Input from "antd/lib/input";
import CopyOutlinedIcon from "@ant-design/icons/CopyOutlined";
import Tooltip from "antd/lib/tooltip";
import Tooltip from "@/components/Tooltip";
import PlainButton from "./PlainButton";
export default class InputWithCopy extends React.Component {
constructor(props) {
@@ -42,7 +43,10 @@ export default class InputWithCopy extends React.Component {
render() {
const copyButton = (
<Tooltip title={this.state.copied || "Copy"}>
<CopyOutlinedIcon style={{ cursor: "pointer" }} onClick={this.copy} />
<PlainButton onClick={this.copy}>
{/* TODO: lacks visual feedback */}
<CopyOutlinedIcon />
</PlainButton>
</Tooltip>
);

View File

@@ -1,26 +0,0 @@
import React from "react";
import Button from "antd/lib/button";
function DefaultLinkComponent(props) {
return <a {...props} />; // eslint-disable-line jsx-a11y/anchor-has-content
}
function Link(props) {
return <Link.Component {...props} />;
}
Link.Component = DefaultLinkComponent;
function DefaultButtonLinkComponent(props) {
return <Button role="button" {...props} />;
}
function ButtonLink(props) {
return <ButtonLink.Component {...props} />;
}
ButtonLink.Component = DefaultButtonLinkComponent;
Link.Button = ButtonLink;
export default Link;

View File

@@ -0,0 +1,61 @@
import React from "react";
import Button, { ButtonProps as AntdButtonProps } from "antd/lib/button";
function DefaultLinkComponent({ children, ...props }: React.AnchorHTMLAttributes<HTMLAnchorElement>) {
return <a {...props}>{children}</a>;
}
Link.Component = DefaultLinkComponent;
interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "role" | "type" | "target"> {
href: string;
}
function Link({ children, ...props }: LinkProps) {
return <Link.Component {...props}>{children}</Link.Component>;
}
interface LinkWithIconProps extends LinkProps {
children: string;
icon: JSX.Element;
alt: string;
target?: "_self" | "_blank" | "_parent" | "_top";
}
function LinkWithIcon({ icon, alt, children, ...props }: LinkWithIconProps) {
return (
<Link.Component {...props}>
{children} {icon} <span className="sr-only">{alt}</span>
</Link.Component>
);
}
Link.WithIcon = LinkWithIcon;
function ExternalLink({
icon = <i className="fa fa-external-link" aria-hidden="true" />,
alt = "(opens in a new tab)",
...props
}: Omit<LinkWithIconProps, "target">) {
return <Link.WithIcon target="_blank" rel="noopener noreferrer" icon={icon} alt={alt} {...props} />;
}
Link.External = ExternalLink;
// Ant Button will render an <a> if href is present.
function DefaultButtonLinkComponent(props: ButtonProps) {
return <Button {...props} />;
}
ButtonLink.Component = DefaultButtonLinkComponent;
interface ButtonProps extends AntdButtonProps {
href: string;
}
function ButtonLink(props: ButtonProps) {
return <ButtonLink.Component {...props} />;
}
Link.Button = ButtonLink;
export default Link;

View File

@@ -2,21 +2,26 @@ import React from "react";
import PropTypes from "prop-types";
import Button from "antd/lib/button";
import Badge from "antd/lib/badge";
import Tooltip from "antd/lib/tooltip";
import Tooltip from "@/components/Tooltip";
import KeyboardShortcuts from "@/services/KeyboardShortcuts";
function ParameterApplyButton({ paramCount, onClick }) {
// show spinner when count is empty so the fade out is consistent
const icon = !paramCount ? "spinner fa-pulse" : "check";
const icon = !paramCount ? (
<span role="status" aria-live="polite" aria-relevant="additions removals">
<i className="fa fa-spinner fa-pulse" aria-hidden="true" />
<span className="sr-only">Loading...</span>
</span>
) : (
<i className="fa fa-check" aria-hidden="true" />
);
return (
<div className="parameter-apply-button" data-show={!!paramCount} data-test="ParameterApplyButton">
<Badge count={paramCount}>
<Tooltip title={paramCount ? `${KeyboardShortcuts.modKey} + Enter` : null}>
<span>
<Button onClick={onClick}>
<i className={`fa fa-${icon}`} /> Apply Changes
</Button>
<Button onClick={onClick}>{icon} Apply Changes</Button>
</span>
</Tooltip>
</Badge>

View File

@@ -12,7 +12,7 @@ import Tag from "antd/lib/tag";
import Input from "antd/lib/input";
import Radio from "antd/lib/radio";
import Form from "antd/lib/form";
import Tooltip from "antd/lib/tooltip";
import Tooltip from "@/components/Tooltip";
import ParameterValueInput from "@/components/ParameterValueInput";
import { ParameterMappingType } from "@/services/widget";
import { Parameter, cloneParameter } from "@/services/parameters";
@@ -201,7 +201,13 @@ export class ParameterMappingInput extends React.Component {
const {
mapping: { mapTo },
} = this.props;
return <Input value={mapTo} onChange={e => this.updateParamMapping({ mapTo: e.target.value })} />;
return (
<Input
value={mapTo}
aria-label="Parameter name (key)"
onChange={e => this.updateParamMapping({ mapTo: e.target.value })}
/>
);
}
renderDashboardMapToExisting() {
@@ -420,6 +426,7 @@ class TitleEditor extends React.Component {
size="small"
value={this.state.title}
placeholder={paramTitle}
aria-label="Edit parameter title"
onChange={this.onEditingTitleChange}
onPressEnter={this.save}
maxLength={100}
@@ -440,7 +447,10 @@ class TitleEditor extends React.Component {
if (mapping.type === MappingType.StaticValue) {
return (
<Tooltip placement="right" title="Titles for static values don't appear in widgets">
<i className="fa fa-eye-slash" />
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
<span tabIndex={0}>
<i className="fa fa-eye-slash" aria-hidden="true" />
</span>
</Tooltip>
);
}

View File

@@ -1,4 +1,4 @@
@import '~antd/lib/modal/style/index'; // for ant @vars
@import (reference, less) "~@/assets/less/ant"; // for ant @vars
.parameters-mapping-list {
.keyword {
@@ -63,7 +63,8 @@
margin-right: 3px;
}
&.disabled, .fa {
&.disabled,
.fa {
color: #a4a4a4;
}

View File

@@ -101,7 +101,6 @@ class ParameterValueInput extends React.Component {
<SelectWithVirtualScroll
className={this.props.className}
mode={parameter.multiValuesOptions ? "multiple" : "default"}
optionFilterProp="children"
value={normalize(value)}
onChange={this.onSelect}
options={map(enumOptionsArray, opt => ({ label: String(opt), value: opt }))}
@@ -120,7 +119,6 @@ class ParameterValueInput extends React.Component {
<QueryBasedParameterInput
className={this.props.className}
mode={parameter.multiValuesOptions ? "multiple" : "default"}
optionFilterProp="children"
parameter={parameter}
value={value}
queryId={queryId}
@@ -138,7 +136,12 @@ class ParameterValueInput extends React.Component {
const normalize = val => (isNaN(val) ? undefined : val);
return (
<InputNumber className={className} value={normalize(value)} onChange={val => this.onSelect(normalize(val))} />
<InputNumber
className={className}
value={normalize(value)}
aria-label="Parameter number value"
onChange={val => this.onSelect(normalize(val))}
/>
);
}
@@ -150,6 +153,7 @@ class ParameterValueInput extends React.Component {
<Input
className={className}
value={value}
aria-label="Parameter text value"
data-test="TextParamInput"
onChange={e => this.onSelect(e.target.value)}
/>

View File

@@ -1,4 +1,4 @@
@import "~antd/lib/input-number/style/index"; // for ant @vars
@import (reference, less) "~@/assets/less/ant"; // for ant @vars
@input-dirty: #fffce1;

View File

@@ -1,4 +1,4 @@
import { size, filter, forEach, extend } from "lodash";
import { size, filter, forEach, extend, isEmpty } from "lodash";
import React from "react";
import PropTypes from "prop-types";
import { SortableContainer, SortableElement, DragHandle } from "@redash/viz/lib/components/sortable";
@@ -6,6 +6,7 @@ import location from "@/services/location";
import { Parameter, createParameter } from "@/services/parameters";
import ParameterApplyButton from "@/components/ParameterApplyButton";
import ParameterValueInput from "@/components/ParameterValueInput";
import PlainButton from "@/components/PlainButton";
import EditParameterSettingsDialog from "./EditParameterSettingsDialog";
import { toHuman } from "@/lib/utils";
@@ -23,28 +24,42 @@ export default class Parameters extends React.Component {
static propTypes = {
parameters: PropTypes.arrayOf(PropTypes.instanceOf(Parameter)),
editable: PropTypes.bool,
sortable: PropTypes.bool,
disableUrlUpdate: PropTypes.bool,
onValuesChange: PropTypes.func,
onPendingValuesChange: PropTypes.func,
onParametersEdit: PropTypes.func,
appendSortableToParent: PropTypes.bool,
};
static defaultProps = {
parameters: [],
editable: false,
sortable: false,
disableUrlUpdate: false,
onValuesChange: () => {},
onPendingValuesChange: () => {},
onParametersEdit: () => {},
appendSortableToParent: true,
};
toCamelCase = str => {
if (isEmpty(str)) {
return "";
}
return str.replace(/\s+/g, "").toLowerCase();
};
constructor(props) {
super(props);
const { parameters } = props;
const { parameters, disableUrlUpdate } = props;
this.state = { parameters };
if (!props.disableUrlUpdate) {
if (!disableUrlUpdate) {
updateUrl(parameters);
}
const hideRegex = /hide_filter=([^&]+)/g;
const matches = window.location.search.matchAll(hideRegex);
this.hideValues = Array.from(matches, match => match[1]);
}
componentDidUpdate = prevProps => {
@@ -85,7 +100,7 @@ export default class Parameters extends React.Component {
if (oldIndex !== newIndex) {
this.setState(({ parameters }) => {
parameters.splice(newIndex, 0, parameters.splice(oldIndex, 1)[0]);
onParametersEdit();
onParametersEdit(parameters);
return { parameters };
});
}
@@ -110,28 +125,36 @@ export default class Parameters extends React.Component {
this.setState(({ parameters }) => {
const updatedParameter = extend(parameter, updated);
parameters[index] = createParameter(updatedParameter, updatedParameter.parentQueryId);
onParametersEdit();
onParametersEdit(parameters);
return { parameters };
});
});
};
renderParameter(param, index) {
if (this.hideValues.some(value => this.toCamelCase(value) === this.toCamelCase(param.name))) {
return null;
}
const { editable } = this.props;
if (param.hidden) {
return null;
}
return (
<div key={param.name} className="di-block" data-test={`ParameterName-${param.name}`}>
<div className="parameter-heading">
<label>{param.title || toHuman(param.name)}</label>
{editable && (
<button
<PlainButton
className="btn btn-default btn-xs m-l-5"
aria-label="Edit"
onClick={() => this.showParameterSettings(param, index)}
data-test={`ParameterSettings-${param.name}`}
type="button">
<i className="fa fa-cog" />
</button>
<i className="fa fa-cog" aria-hidden="true" />
</PlainButton>
)}
</div>
<ParameterValueInput
type={param.type}
value={param.normalizedValue}
@@ -146,25 +169,30 @@ export default class Parameters extends React.Component {
render() {
const { parameters } = this.state;
const { editable } = this.props;
const { sortable, appendSortableToParent } = this.props;
const dirtyParamCount = size(filter(parameters, "hasPendingValue"));
return (
<SortableContainer
disabled={!editable}
disabled={!sortable}
axis="xy"
useDragHandle
lockToContainerEdges
helperClass="parameter-dragged"
helperContainer={containerEl => (appendSortableToParent ? containerEl : document.body)}
updateBeforeSortStart={this.onBeforeSortStart}
onSortEnd={this.moveParameter}
containerProps={{
className: "parameter-container",
onKeyDown: dirtyParamCount ? this.handleKeyDown : null,
}}>
{parameters.map((param, index) => (
{parameters &&
parameters.map((param, index) => (
<SortableElement key={param.name} index={index}>
<div className="parameter-block" data-editable={editable || null}>
{editable && <DragHandle data-test={`DragHandle-${param.name}`} />}
<div
className="parameter-block"
data-editable={sortable || null}
data-test={`ParameterBlock-${param.name}`}>
{sortable && <DragHandle data-test={`DragHandle-${param.name}`} />}
{this.renderParameter(param, index)}
</div>
</SortableElement>

View File

@@ -1,4 +1,4 @@
@import "../assets/less/ant";
@import (reference, less) "~@/assets/less/ant";
.parameter-block {
display: inline-block;
@@ -21,6 +21,8 @@
&.parameter-dragged {
z-index: 2;
margin: 4px 0 0 4px;
padding: 3px 6px 6px;
box-shadow: 0 4px 9px -3px rgba(102, 136, 153, 0.15);
}
}

View File

@@ -7,11 +7,12 @@ import List from "antd/lib/list";
import Modal from "antd/lib/modal";
import Select from "antd/lib/select";
import Tag from "antd/lib/tag";
import Tooltip from "antd/lib/tooltip";
import Tooltip from "@/components/Tooltip";
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
import { toHuman } from "@/lib/utils";
import HelpTrigger from "@/components/HelpTrigger";
import { UserPreviewCard } from "@/components/PreviewCard";
import PlainButton from "@/components/PlainButton";
import notification from "@/services/notification";
import User from "@/services/user";
@@ -102,7 +103,16 @@ function UserSelect({ onSelect, shouldShowUser }) {
placeholder="Add users..."
showSearch
onSearch={setSearchTerm}
suffixIcon={loadingUsers ? <i className="fa fa-spinner fa-pulse" /> : <i className="fa fa-search" />}
suffixIcon={
loadingUsers ? (
<span role="status" aria-live="polite" aria-relevant="additions removals">
<i className="fa fa-spinner fa-pulse" aria-hidden="true" />
<span className="sr-only">Loading...</span>
</span>
) : (
<i className="fa fa-search" aria-hidden="true" />
)
}
filterOption={false}
notFoundContent={null}
value={undefined}
@@ -156,7 +166,12 @@ function PermissionsEditorDialog({ dialog, author, context, aclUrl }) {
/>
<div className="d-flex align-items-center m-t-5">
<h5 className="flex-fill">Users with permissions</h5>
{loadingGrantees && <i className="fa fa-spinner fa-pulse" />}
{loadingGrantees && (
<span role="status" aria-live="polite" aria-relevant="additions removals">
<i className="fa fa-spinner fa-pulse" aria-hidden="true" />
<span className="sr-only">Loading...</span>
</span>
)}
</div>
<div className="scrollbox p-5" style={{ maxHeight: "40vh" }}>
<List
@@ -169,10 +184,11 @@ function PermissionsEditorDialog({ dialog, author, context, aclUrl }) {
<Tag className="m-0">Author</Tag>
) : (
<Tooltip title="Remove user permissions">
<i
className="fa fa-remove clickable"
onClick={() => removePermission(user.id).then(loadUsersWithPermissions)}
/>
<PlainButton
aria-label="Remove permissions"
onClick={() => removePermission(user.id).then(loadUsersWithPermissions)}>
<i className="fa fa-remove clickable" aria-hidden="true" />
</PlainButton>
</Tooltip>
)}
</UserPreviewCard>

View File

@@ -0,0 +1,22 @@
@import (reference, less) "~@/assets/less/ant";
.plain-button {
all: unset;
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
.@{dropdown-prefix-cls}-menu-item > & {
width: 100%;
margin: -5px -12px;
padding: 5px 12px;
}
.@{menu-prefix-cls}-item > & {
width: 100%;
margin: 0 -16px;
padding: 0 16px;
}
}
.plain-button-link {
.btn-link();
}

View File

@@ -0,0 +1,20 @@
import classNames from "classnames";
import React from "react";
import "./PlainButton.less";
export interface PlainButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
type?: "link" | "button";
}
function PlainButton({ className, type, ...rest }: PlainButtonProps) {
return (
<button
className={classNames("plain-button", "clickable", { "plain-button-link": type === "link" }, className)}
type="button"
{...rest}
/>
);
}
export default PlainButton;

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