mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
Compare commits
40 Commits
user-and-o
...
v10.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c928bd1d3 | ||
|
|
f312adf77b | ||
|
|
92e5d78dde | ||
|
|
0983e6926f | ||
|
|
dec88799ab | ||
|
|
64a1d7a6cd | ||
|
|
041b184d37 | ||
|
|
5085495dd4 | ||
|
|
e62de4e4c3 | ||
|
|
8cac6b555c | ||
|
|
e4e567bbb9 | ||
|
|
8e728308ab | ||
|
|
7ec86cf4bd | ||
|
|
1c3f724f3e | ||
|
|
9c8c1bfa9a | ||
|
|
f21f7e211f | ||
|
|
a70eeb9530 | ||
|
|
427c005c04 | ||
|
|
d8d7c78992 | ||
|
|
23ced5db50 | ||
|
|
f018c0a7b7 | ||
|
|
67263e1b0f | ||
|
|
bb1f8cbcf5 | ||
|
|
a61a25dd32 | ||
|
|
21ea72fdc5 | ||
|
|
fa8b24ea01 | ||
|
|
a2c96c1e6d | ||
|
|
44178d9908 | ||
|
|
6228f4cf71 | ||
|
|
c8df7a1c8a | ||
|
|
a665253f50 | ||
|
|
70681294a3 | ||
|
|
fb90b501cb | ||
|
|
0560e2410e | ||
|
|
a5ec506b60 | ||
|
|
d4f363854d | ||
|
|
9fdf1f341d | ||
|
|
10bce2d1ac | ||
|
|
b2636deef4 | ||
|
|
6cc69ec2c1 |
124
CHANGELOG.md
124
CHANGELOG.md
@@ -1,5 +1,129 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## 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 user’s session expires for inactivity, they are prompted to log-in with a pop-up so they don’t lose their place in the app
|
||||||
|
- Numerous accessibility changes towards the a11y standard
|
||||||
|
- Hide the “Create” menu button if current user doesn’t 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 wasn’t 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 couldn’t 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
|
## v9.0.0-beta - 2020-06-11
|
||||||
|
|
||||||
This release was long time in the making and has several major changes:
|
This release was long time in the making and has several major changes:
|
||||||
|
|||||||
24
Dockerfile
24
Dockerfile
@@ -22,7 +22,8 @@ RUN if [ "x$skip_frontend_build" = "x" ] ; then npm ci --unsafe-perm; fi
|
|||||||
COPY --chown=redash client /frontend/client
|
COPY --chown=redash client /frontend/client
|
||||||
COPY --chown=redash webpack.config.js /frontend/
|
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
|
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
|
|
||||||
|
FROM python:3.7-slim-buster
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
@@ -66,8 +67,9 @@ RUN apt-get update && \
|
|||||||
rm -rf /var/lib/apt/lists/*
|
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
|
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 wget --quiet $databricks_odbc_driver_url -O /tmp/simba_odbc.zip \
|
||||||
RUN unzip /tmp/simba_odbc.zip -d /tmp/ \
|
&& chmod 600 /tmp/simba_odbc.zip \
|
||||||
|
&& unzip /tmp/simba_odbc.zip -d /tmp/ \
|
||||||
&& dpkg -i /tmp/SimbaSparkODBC-*/*.deb \
|
&& dpkg -i /tmp/SimbaSparkODBC-*/*.deb \
|
||||||
&& echo "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini \
|
&& echo "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini \
|
||||||
&& rm /tmp/simba_odbc.zip \
|
&& rm /tmp/simba_odbc.zip \
|
||||||
@@ -79,15 +81,19 @@ WORKDIR /app
|
|||||||
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||||
ENV PIP_NO_CACHE_DIR=1
|
ENV PIP_NO_CACHE_DIR=1
|
||||||
|
|
||||||
# Use legacy resolver to work around broken build due to resolver changes in pip
|
# rollback pip version to avoid legacy resolver problem
|
||||||
ENV PIP_USE_DEPRECATED=legacy-resolver
|
RUN pip install pip==20.2.4;
|
||||||
|
|
||||||
# We first copy only the requirements file, to avoid rebuilding on every file
|
# We first copy only the requirements file, to avoid rebuilding on every file change.
|
||||||
# change.
|
COPY requirements_all_ds.txt ./
|
||||||
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
|
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 requirements_bundles.txt requirements_dev.txt ./
|
||||||
|
RUN if [ "x$skip_dev_deps" = "x" ] ; then pip install -r requirements_dev.txt ; fi
|
||||||
|
|
||||||
|
COPY requirements.txt ./
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
COPY --from=frontend-builder /frontend/client/dist /app/client/dist
|
COPY --from=frontend-builder /frontend/client/dist /app/client/dist
|
||||||
RUN chown -R redash /app
|
RUN chown -R redash /app
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help
|
|||||||
- Shell Scripts
|
- Shell Scripts
|
||||||
- Snowflake
|
- Snowflake
|
||||||
- SQLite
|
- SQLite
|
||||||
|
- TiDB
|
||||||
- TreasureData
|
- TreasureData
|
||||||
- Vertica
|
- Vertica
|
||||||
- Yandex AppMetrrica
|
- Yandex AppMetrrica
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ module.exports = {
|
|||||||
"react-app",
|
"react-app",
|
||||||
"plugin:compat/recommended",
|
"plugin:compat/recommended",
|
||||||
"prettier",
|
"prettier",
|
||||||
|
"plugin:jsx-a11y/recommended",
|
||||||
// Remove any typescript-eslint rules that would conflict with prettier
|
// Remove any typescript-eslint rules that would conflict with prettier
|
||||||
"prettier/@typescript-eslint",
|
"prettier/@typescript-eslint",
|
||||||
],
|
],
|
||||||
plugins: ["jest", "compat", "no-only-tests", "@typescript-eslint"],
|
plugins: ["jest", "compat", "no-only-tests", "@typescript-eslint", "jsx-a11y"],
|
||||||
settings: {
|
settings: {
|
||||||
"import/resolver": "webpack",
|
"import/resolver": "webpack",
|
||||||
},
|
},
|
||||||
@@ -19,7 +20,19 @@ module.exports = {
|
|||||||
rules: {
|
rules: {
|
||||||
// allow debugger during development
|
// allow debugger during development
|
||||||
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
|
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
|
||||||
"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-console": ["warn", { allow: ["warn", "error"] }],
|
||||||
"no-restricted-imports": [
|
"no-restricted-imports": [
|
||||||
"error",
|
"error",
|
||||||
|
|||||||
BIN
client/app/assets/images/db-logos/corporate_memory.png
Normal file
BIN
client/app/assets/images/db-logos/corporate_memory.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
client/app/assets/images/db-logos/excel.png
Normal file
BIN
client/app/assets/images/db-logos/excel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
BIN
client/app/assets/images/db-logos/sparql_endpoint.png
Normal file
BIN
client/app/assets/images/db-logos/sparql_endpoint.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
BIN
client/app/assets/images/db-logos/trino.png
Normal file
BIN
client/app/assets/images/db-logos/trino.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -225,6 +225,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-tbody > tr&-row {
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
& > td {
|
||||||
|
background: @table-row-hover-bg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Custom styles
|
// Custom styles
|
||||||
|
|
||||||
&-headerless &-tbody > tr:first-child > td {
|
&-headerless &-tbody > tr:first-child > td {
|
||||||
@@ -391,6 +401,18 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
color: @menu-highlight-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{dropdown-prefix-cls}-menu-item {
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
background-color: @item-hover-bg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,10 @@ strong {
|
|||||||
|
|
||||||
.clickable {
|
.clickable {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
button&:disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.resize-vertical {
|
.resize-vertical {
|
||||||
|
|||||||
@@ -1,26 +1,23 @@
|
|||||||
.edit-in-place span {
|
.edit-in-place {
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.edit-in-place span.editable {
|
.editable {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
|
||||||
|
|
||||||
.edit-in-place span.editable:hover {
|
&:hover {
|
||||||
background: @redash-yellow;
|
background: @redash-yellow;
|
||||||
border-radius: @redash-radius;
|
border-radius: @redash-radius;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.edit-in-place.active input,
|
&.active input,
|
||||||
.edit-in-place.active textarea {
|
&.active textarea {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-in-place {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,163 +2,218 @@
|
|||||||
Generate Margin Classes (0px - 25px)
|
Generate Margin Classes (0px - 25px)
|
||||||
margin, margin-top, margin-bottom, margin-left, margin-right
|
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} {
|
.m-@{key} {
|
||||||
margin: @size !important;
|
margin: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.m-t-@{key} {
|
.m-t-@{key} {
|
||||||
margin-top: @size !important;
|
margin-top: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.m-b-@{key} {
|
.m-b-@{key} {
|
||||||
margin-bottom: @size !important;
|
margin-bottom: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.m-l-@{key} {
|
.m-l-@{key} {
|
||||||
margin-left: @size !important;
|
margin-left: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.m-r-@{key} {
|
.m-r-@{key} {
|
||||||
margin-right: @size !important;
|
margin-right: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.margin(@label - 5; @size + 5; @key + 5);
|
.margin(@label - 5; @size + 5; @key + 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.margin(25, 0px, 0);
|
.margin(25, 0px, 0);
|
||||||
|
|
||||||
.m-2{
|
.m-2 {
|
||||||
margin:2px;
|
margin: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Generate Padding Classes (0px - 25px)
|
Generate Padding Classes (0px - 25px)
|
||||||
padding, padding-top, padding-bottom, padding-left, padding-right
|
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} {
|
.p-@{key} {
|
||||||
padding: @size !important;
|
padding: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-t-@{key} {
|
.p-t-@{key} {
|
||||||
padding-top: @size !important;
|
padding-top: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-b-@{key} {
|
.p-b-@{key} {
|
||||||
padding-bottom: @size !important;
|
padding-bottom: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-l-@{key} {
|
.p-l-@{key} {
|
||||||
padding-left: @size !important;
|
padding-left: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-r-@{key} {
|
.p-r-@{key} {
|
||||||
padding-right: @size !important;
|
padding-right: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.padding(@label - 5; @size + 5; @key + 5);
|
.padding(@label - 5; @size + 5; @key + 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.padding(25, 0px, 0);
|
.padding(25, 0px, 0);
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Generate Font-Size Classes (8px - 20px)
|
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} {
|
.f-@{key} {
|
||||||
font-size: @size !important;
|
font-size: @size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.font-size(@label - 1; @size + 1; @key + 1);
|
.font-size(@label - 1; @size + 1; @key + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.font-size(20, 8px, 8);
|
.font-size(20, 8px, 8);
|
||||||
|
|
||||||
.f-inherit { font-size: inherit !important; }
|
.f-inherit {
|
||||||
|
font-size: inherit !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Font Weight
|
Font Weight
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
.f-300 { font-weight: 300 !important; }
|
.f-300 {
|
||||||
.f-400 { font-weight: 400 !important; }
|
font-weight: 300 !important;
|
||||||
.f-500 { font-weight: 500 !important; }
|
}
|
||||||
.f-700 { font-weight: 700 !important; }
|
.f-400 {
|
||||||
|
font-weight: 400 !important;
|
||||||
|
}
|
||||||
|
.f-500 {
|
||||||
|
font-weight: 500 !important;
|
||||||
|
}
|
||||||
|
.f-700 {
|
||||||
|
font-weight: 700 !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Position
|
Position
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
.p-relative { position: relative !important; }
|
.p-relative {
|
||||||
.p-absolute { position: absolute !important; }
|
position: relative !important;
|
||||||
.p-fixed { position: fixed !important; }
|
}
|
||||||
.p-static { position: static !important; }
|
.p-absolute {
|
||||||
|
position: absolute !important;
|
||||||
|
}
|
||||||
|
.p-fixed {
|
||||||
|
position: fixed !important;
|
||||||
|
}
|
||||||
|
.p-static {
|
||||||
|
position: static !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Overflow
|
Overflow
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
.o-hidden { overflow: hidden !important; }
|
.o-hidden {
|
||||||
.o-visible { overflow: visible !important; }
|
overflow: hidden !important;
|
||||||
.o-auto { overflow: auto !important; }
|
}
|
||||||
|
.o-visible {
|
||||||
|
overflow: visible !important;
|
||||||
|
}
|
||||||
|
.o-auto {
|
||||||
|
overflow: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Display
|
Display
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
.di-block { display: inline-block !important; }
|
.di-block {
|
||||||
.d-block { display: block; }
|
display: inline-block !important;
|
||||||
|
}
|
||||||
|
.d-block {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Background Colors and Colors
|
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);
|
||||||
@name: extract(@value, 1);
|
.-each(@value) {
|
||||||
@name2: extract(@value, 2);
|
@name: extract(@value, 1);
|
||||||
@color: extract(@value, 3);
|
@name2: extract(@value, 2);
|
||||||
&.@{name2} {
|
@color: extract(@value, 3);
|
||||||
background-color: @color !important;
|
&.@{name2} {
|
||||||
}
|
background-color: @color !important;
|
||||||
|
}
|
||||||
&.@{name} {
|
|
||||||
color: @color !important;
|
&.@{name} {
|
||||||
}
|
color: @color !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Background Colors
|
Background Colors
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
.bg-brand { background-color: @brand-bg; }
|
.bg-brand {
|
||||||
.bg-black-trp { background-color: rgba(0,0,0,0.12) !important; }
|
background-color: @brand-bg;
|
||||||
|
}
|
||||||
|
.bg-black-trp {
|
||||||
|
background-color: rgba(0, 0, 0, 0.12) !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Borders
|
Borders
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
.b-0 { border: 0 !important; }
|
.b-0 {
|
||||||
|
border: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Width
|
Width
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
.w-100 { width: 100% !important; }
|
.w-100 {
|
||||||
.w-50 { width: 50% !important; }
|
width: 100% !important;
|
||||||
.w-25 { width: 25% !important; }
|
}
|
||||||
|
.w-50 {
|
||||||
|
width: 50% !important;
|
||||||
|
}
|
||||||
|
.w-25 {
|
||||||
|
width: 25% !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Border Radius
|
Border Radius
|
||||||
-----------------------------------------------------------*/
|
-----------------------------------------------------------*/
|
||||||
.brd-2 { border-radius: 2px; }
|
.brd-2 {
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------
|
/* --------------------------------------------------------
|
||||||
Alignment
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,102 +1,107 @@
|
|||||||
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 {
|
.schema-container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
|
||||||
|
|
||||||
.schema-browser {
|
.schema-browser {
|
||||||
overflow: hidden;
|
|
||||||
border: none;
|
|
||||||
padding-top: 10px;
|
|
||||||
position: relative;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.schema-loading-state {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.collapse.in {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.copy-to-editor {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-open {
|
|
||||||
padding: 0 22px 0 26px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
border: none;
|
||||||
white-space: nowrap;
|
padding-top: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 18px;
|
height: 100%;
|
||||||
|
|
||||||
.column-type {
|
.schema-loading-state {
|
||||||
color: fade(@text-color, 80%);
|
display: flex;
|
||||||
font-size: 10px;
|
align-items: center;
|
||||||
margin-left: 2px;
|
justify-content: center;
|
||||||
text-transform: uppercase;
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse.in {
|
||||||
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy-to-editor {
|
.copy-to-editor {
|
||||||
display: none;
|
visibility: hidden;
|
||||||
|
color: fade(@redash-gray, 90%);
|
||||||
|
width: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
.schema-list-item {
|
||||||
background: fade(@redash-gray, 10%);
|
display: flex;
|
||||||
|
border-radius: @redash-radius;
|
||||||
|
height: 22px;
|
||||||
|
|
||||||
.copy-to-editor {
|
.table-name {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
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;
|
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%);
|
||||||
|
font-size: 10px;
|
||||||
|
margin-left: 2px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
background: fade(@redash-gray, 10%);
|
||||||
|
|
||||||
|
.copy-to-editor {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.schema-control {
|
.schema-control {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
.ant-btn {
|
.ant-btn {
|
||||||
height: auto;
|
height: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.parameter-label {
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.parameter-label {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
padding-top: 5px !important;
|
padding-top: 5px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-favourite,
|
.btn-favorite,
|
||||||
.btn-archive {
|
.btn-archive {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
@@ -114,18 +114,23 @@
|
|||||||
line-height: 1.7 !important;
|
line-height: 1.7 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-favourite {
|
.btn-favorite {
|
||||||
color: #d4d4d4;
|
color: #d4d4d4;
|
||||||
transition: all 0.25s ease-in-out;
|
transition: all 0.25s ease-in-out;
|
||||||
|
|
||||||
|
.fa-star {
|
||||||
|
color: @yellow-darker;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&:focus {
|
&:focus {
|
||||||
color: @yellow-darker;
|
color: @yellow-darker;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
|
||||||
|
|
||||||
.fa-star {
|
.fa-star {
|
||||||
color: @yellow-darker;
|
filter: saturate(75%);
|
||||||
|
opacity: 0.75;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,11 +127,13 @@ body.fixed-layout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a.label-tag {
|
.label-tag {
|
||||||
background: fade(@redash-gray, 15%);
|
background: fade(@redash-gray, 15%);
|
||||||
color: darken(@redash-gray, 15%);
|
color: darken(@redash-gray, 15%);
|
||||||
|
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:active {
|
||||||
color: darken(@redash-gray, 15%);
|
color: darken(@redash-gray, 15%);
|
||||||
background: fade(@redash-gray, 25%);
|
background: fade(@redash-gray, 25%);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React, { useMemo } from "react";
|
|||||||
import { first, includes } from "lodash";
|
import { first, includes } from "lodash";
|
||||||
import Menu from "antd/lib/menu";
|
import Menu from "antd/lib/menu";
|
||||||
import Link from "@/components/Link";
|
import Link from "@/components/Link";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import HelpTrigger from "@/components/HelpTrigger";
|
import HelpTrigger from "@/components/HelpTrigger";
|
||||||
import CreateDashboardDialog from "@/components/dashboards/CreateDashboardDialog";
|
import CreateDashboardDialog from "@/components/dashboards/CreateDashboardDialog";
|
||||||
import { useCurrentRoute } from "@/components/ApplicationArea/Router";
|
import { useCurrentRoute } from "@/components/ApplicationArea/Router";
|
||||||
@@ -15,8 +16,8 @@ import AlertOutlinedIcon from "@ant-design/icons/AlertOutlined";
|
|||||||
import PlusOutlinedIcon from "@ant-design/icons/PlusOutlined";
|
import PlusOutlinedIcon from "@ant-design/icons/PlusOutlined";
|
||||||
import QuestionCircleOutlinedIcon from "@ant-design/icons/QuestionCircleOutlined";
|
import QuestionCircleOutlinedIcon from "@ant-design/icons/QuestionCircleOutlined";
|
||||||
import SettingOutlinedIcon from "@ant-design/icons/SettingOutlined";
|
import SettingOutlinedIcon from "@ant-design/icons/SettingOutlined";
|
||||||
|
|
||||||
import VersionInfo from "./VersionInfo";
|
import VersionInfo from "./VersionInfo";
|
||||||
|
|
||||||
import "./DesktopNavbar.less";
|
import "./DesktopNavbar.less";
|
||||||
|
|
||||||
function NavbarSection({ children, ...props }) {
|
function NavbarSection({ children, ...props }) {
|
||||||
@@ -71,9 +72,9 @@ export default function DesktopNavbar() {
|
|||||||
const canCreateAlert = currentUser.hasPermission("list_alerts");
|
const canCreateAlert = currentUser.hasPermission("list_alerts");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="desktop-navbar">
|
<nav className="desktop-navbar">
|
||||||
<NavbarSection className="desktop-navbar-logo">
|
<NavbarSection className="desktop-navbar-logo">
|
||||||
<div>
|
<div role="menuitem">
|
||||||
<Link href="./">
|
<Link href="./">
|
||||||
<img src={logoUrl} alt="Redash" />
|
<img src={logoUrl} alt="Redash" />
|
||||||
</Link>
|
</Link>
|
||||||
@@ -84,7 +85,7 @@ export default function DesktopNavbar() {
|
|||||||
{currentUser.hasPermission("list_dashboards") && (
|
{currentUser.hasPermission("list_dashboards") && (
|
||||||
<Menu.Item key="dashboards" className={activeState.dashboards ? "navbar-active-item" : null}>
|
<Menu.Item key="dashboards" className={activeState.dashboards ? "navbar-active-item" : null}>
|
||||||
<Link href="dashboards">
|
<Link href="dashboards">
|
||||||
<DesktopOutlinedIcon />
|
<DesktopOutlinedIcon aria-label="Dashboard navigation button" />
|
||||||
<span className="desktop-navbar-label">Dashboards</span>
|
<span className="desktop-navbar-label">Dashboards</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
@@ -92,7 +93,7 @@ export default function DesktopNavbar() {
|
|||||||
{currentUser.hasPermission("view_query") && (
|
{currentUser.hasPermission("view_query") && (
|
||||||
<Menu.Item key="queries" className={activeState.queries ? "navbar-active-item" : null}>
|
<Menu.Item key="queries" className={activeState.queries ? "navbar-active-item" : null}>
|
||||||
<Link href="queries">
|
<Link href="queries">
|
||||||
<CodeOutlinedIcon />
|
<CodeOutlinedIcon aria-label="Queries navigation button" />
|
||||||
<span className="desktop-navbar-label">Queries</span>
|
<span className="desktop-navbar-label">Queries</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
@@ -100,7 +101,7 @@ export default function DesktopNavbar() {
|
|||||||
{currentUser.hasPermission("list_alerts") && (
|
{currentUser.hasPermission("list_alerts") && (
|
||||||
<Menu.Item key="alerts" className={activeState.alerts ? "navbar-active-item" : null}>
|
<Menu.Item key="alerts" className={activeState.alerts ? "navbar-active-item" : null}>
|
||||||
<Link href="alerts">
|
<Link href="alerts">
|
||||||
<AlertOutlinedIcon />
|
<AlertOutlinedIcon aria-label="Alerts navigation button" />
|
||||||
<span className="desktop-navbar-label">Alerts</span>
|
<span className="desktop-navbar-label">Alerts</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
@@ -113,6 +114,7 @@ export default function DesktopNavbar() {
|
|||||||
key="create"
|
key="create"
|
||||||
popupClassName="desktop-navbar-submenu"
|
popupClassName="desktop-navbar-submenu"
|
||||||
data-test="CreateButton"
|
data-test="CreateButton"
|
||||||
|
tabIndex={0}
|
||||||
title={
|
title={
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<PlusOutlinedIcon />
|
<PlusOutlinedIcon />
|
||||||
@@ -128,9 +130,9 @@ export default function DesktopNavbar() {
|
|||||||
)}
|
)}
|
||||||
{canCreateDashboard && (
|
{canCreateDashboard && (
|
||||||
<Menu.Item key="new-dashboard">
|
<Menu.Item key="new-dashboard">
|
||||||
<a data-test="CreateDashboardMenuItem" onMouseUp={() => CreateDashboardDialog.showModal()}>
|
<PlainButton data-test="CreateDashboardMenuItem" onClick={() => CreateDashboardDialog.showModal()}>
|
||||||
New Dashboard
|
New Dashboard
|
||||||
</a>
|
</PlainButton>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
)}
|
)}
|
||||||
{canCreateAlert && (
|
{canCreateAlert && (
|
||||||
@@ -146,7 +148,7 @@ export default function DesktopNavbar() {
|
|||||||
|
|
||||||
<NavbarSection>
|
<NavbarSection>
|
||||||
<Menu.Item key="help">
|
<Menu.Item key="help">
|
||||||
<HelpTrigger showTooltip={false} type="HOME">
|
<HelpTrigger showTooltip={false} type="HOME" tabIndex={0}>
|
||||||
<QuestionCircleOutlinedIcon />
|
<QuestionCircleOutlinedIcon />
|
||||||
<span className="desktop-navbar-label">Help</span>
|
<span className="desktop-navbar-label">Help</span>
|
||||||
</HelpTrigger>
|
</HelpTrigger>
|
||||||
@@ -165,6 +167,7 @@ export default function DesktopNavbar() {
|
|||||||
<Menu.SubMenu
|
<Menu.SubMenu
|
||||||
key="profile"
|
key="profile"
|
||||||
popupClassName="desktop-navbar-submenu"
|
popupClassName="desktop-navbar-submenu"
|
||||||
|
tabIndex={0}
|
||||||
title={
|
title={
|
||||||
<span data-test="ProfileDropdown" className="desktop-navbar-profile-menu-title">
|
<span data-test="ProfileDropdown" className="desktop-navbar-profile-menu-title">
|
||||||
<img className="profile__image_thumb" src={currentUser.profile_image_url} alt={currentUser.name} />
|
<img className="profile__image_thumb" src={currentUser.profile_image_url} alt={currentUser.name} />
|
||||||
@@ -180,16 +183,16 @@ export default function DesktopNavbar() {
|
|||||||
)}
|
)}
|
||||||
<Menu.Divider />
|
<Menu.Divider />
|
||||||
<Menu.Item key="logout">
|
<Menu.Item key="logout">
|
||||||
<a data-test="LogOutButton" onClick={() => Auth.logout()}>
|
<PlainButton data-test="LogOutButton" onClick={() => Auth.logout()}>
|
||||||
Log out
|
Log out
|
||||||
</a>
|
</PlainButton>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Divider />
|
<Menu.Divider />
|
||||||
<Menu.Item key="version" disabled className="version-info">
|
<Menu.Item key="version" role="presentation" disabled className="version-info">
|
||||||
<VersionInfo />
|
<VersionInfo />
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
</NavbarSection>
|
</NavbarSection>
|
||||||
</div>
|
</nav>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,9 @@
|
|||||||
&.ant-menu-submenu-open,
|
&.ant-menu-submenu-open,
|
||||||
&.ant-menu-submenu-active,
|
&.ant-menu-submenu-active,
|
||||||
&:hover,
|
&:hover,
|
||||||
&:active {
|
&:active,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +133,9 @@
|
|||||||
color: @textColor;
|
color: @textColor;
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&:active {
|
&:active,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +160,9 @@
|
|||||||
color: rgba(255, 255, 255, 0.8);
|
color: rgba(255, 255, 255, 0.8);
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&:active {
|
&:active,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ export default function VersionInfo() {
|
|||||||
<div className="m-t-10">
|
<div className="m-t-10">
|
||||||
{/* eslint-disable react/jsx-no-target-blank */}
|
{/* eslint-disable react/jsx-no-target-blank */}
|
||||||
<Link href="https://version.redash.io/" className="update-available" target="_blank" rel="noopener">
|
<Link href="https://version.redash.io/" className="update-available" target="_blank" rel="noopener">
|
||||||
Update Available
|
Update Available <i className="fa fa-external-link m-l-5" aria-hidden="true" />
|
||||||
<i className="fa fa-external-link m-l-5" />
|
<span className="sr-only">(opens in a new tab)</span>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export default function ErrorMessage({ error, message }) {
|
|||||||
<div className="error-message-container" data-test="ErrorMessage" role="alert">
|
<div className="error-message-container" data-test="ErrorMessage" role="alert">
|
||||||
<div className="error-state bg-white tiled">
|
<div className="error-state bg-white tiled">
|
||||||
<div className="error-state__icon">
|
<div className="error-state__icon">
|
||||||
<i className="zmdi zmdi-alert-circle-o" />
|
<i className="zmdi zmdi-alert-circle-o" aria-hidden="true" />
|
||||||
</div>
|
</div>
|
||||||
<div className="error-state__details">
|
<div className="error-state__details">
|
||||||
<DynamicComponent
|
<DynamicComponent
|
||||||
|
|||||||
@@ -64,9 +64,11 @@ export function UserSessionWrapper<P>({ bodyClass, currentRoute, render }: UserS
|
|||||||
{/* @ts-expect-error FIXME */}
|
{/* @ts-expect-error FIXME */}
|
||||||
<ErrorBoundary renderError={(error: Error) => <ErrorMessage error={error} />}>
|
<ErrorBoundary renderError={(error: Error) => <ErrorMessage error={error} />}>
|
||||||
<ErrorBoundaryContext.Consumer>
|
<ErrorBoundaryContext.Consumer>
|
||||||
{({ handleError } /* : { handleError: UserSessionWrapperRenderChildrenProps<P>["onError"] } FIXME bring back type */) =>
|
{(
|
||||||
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>
|
</ErrorBoundaryContext.Consumer>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
import { useUniqueId } from "@/lib/hooks/useUniqueId";
|
||||||
|
import cx from "classnames";
|
||||||
|
|
||||||
function BigMessage({ message, icon, children, className }) {
|
function BigMessage({ message, icon, children, className }) {
|
||||||
|
const messageId = useUniqueId("bm-message");
|
||||||
return (
|
return (
|
||||||
<div className={"p-15 text-center " + className}>
|
<div
|
||||||
<h3 className="m-t-0 m-b-0">
|
className={"big-message p-15 text-center " + className}
|
||||||
<i className={"fa " + icon} />
|
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>
|
</h3>
|
||||||
<br />
|
<br />
|
||||||
{message}
|
<span id={messageId}>{message}</span>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import Button from "antd/lib/button";
|
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 CopyOutlinedIcon from "@ant-design/icons/CopyOutlined";
|
||||||
import "./CodeBlock.less";
|
import "./CodeBlock.less";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
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 Button from "antd/lib/button";
|
||||||
import List from "antd/lib/list";
|
import List from "antd/lib/list";
|
||||||
import Modal from "antd/lib/modal";
|
import Modal from "antd/lib/modal";
|
||||||
@@ -45,6 +45,8 @@ class CreateSourceDialog extends React.Component {
|
|||||||
currentStep: StepEnum.SELECT_TYPE,
|
currentStep: StepEnum.SELECT_TYPE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
formId = uniqueId("sourceForm");
|
||||||
|
|
||||||
selectType = selectedType => {
|
selectType = selectedType => {
|
||||||
this.setState({ selectedType, currentStep: StepEnum.CONFIGURE_IT });
|
this.setState({ selectedType, currentStep: StepEnum.CONFIGURE_IT });
|
||||||
};
|
};
|
||||||
@@ -82,6 +84,7 @@ class CreateSourceDialog extends React.Component {
|
|||||||
<div className="m-t-10">
|
<div className="m-t-10">
|
||||||
<Search
|
<Search
|
||||||
placeholder="Search..."
|
placeholder="Search..."
|
||||||
|
aria-label="Search"
|
||||||
onChange={e => this.setState({ searchText: e.target.value })}
|
onChange={e => this.setState({ searchText: e.target.value })}
|
||||||
autoFocus
|
autoFocus
|
||||||
data-test="SearchSource"
|
data-test="SearchSource"
|
||||||
@@ -111,11 +114,12 @@ class CreateSourceDialog extends React.Component {
|
|||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
{HELP_TRIGGER_TYPES[helpTriggerType] && (
|
{HELP_TRIGGER_TYPES[helpTriggerType] && (
|
||||||
<HelpTrigger className="f-13" type={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>
|
</HelpTrigger>
|
||||||
)}
|
)}
|
||||||
</div>
|
</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" && (
|
{selectedType.type === "databricks" && (
|
||||||
<small>
|
<small>
|
||||||
By using the Databricks Data Source you agree to the Databricks JDBC/ODBC{" "}
|
By using the Databricks Data Source you agree to the Databricks JDBC/ODBC{" "}
|
||||||
@@ -139,7 +143,7 @@ class CreateSourceDialog extends React.Component {
|
|||||||
roundedImage={false}
|
roundedImage={false}
|
||||||
data-test="PreviewItem"
|
data-test="PreviewItem"
|
||||||
data-test-type={item.type}>
|
data-test-type={item.type}>
|
||||||
<i className="fa fa-angle-double-right" />
|
<i className="fa fa-angle-double-right" aria-hidden="true" />
|
||||||
</PreviewCard>
|
</PreviewCard>
|
||||||
</List.Item>
|
</List.Item>
|
||||||
);
|
);
|
||||||
@@ -169,7 +173,7 @@ class CreateSourceDialog extends React.Component {
|
|||||||
<Button
|
<Button
|
||||||
key="submit"
|
key="submit"
|
||||||
htmlType="submit"
|
htmlType="submit"
|
||||||
form="sourceForm"
|
form={this.formId}
|
||||||
type="primary"
|
type="primary"
|
||||||
loading={savingSource}
|
loading={savingSource}
|
||||||
data-test="CreateSourceSaveButton">
|
data-test="CreateSourceSaveButton">
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ export default class EditInPlace extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<InputComponent
|
<InputComponent
|
||||||
defaultValue={value}
|
defaultValue={value}
|
||||||
|
aria-label="Editing"
|
||||||
onBlur={e => this.stopEditing(e.target.value)}
|
onBlur={e => this.stopEditing(e.target.value)}
|
||||||
onKeyDown={this.handleKeyDown}
|
onKeyDown={this.handleKeyDown}
|
||||||
autoFocus
|
autoFocus
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import Divider from "antd/lib/divider";
|
|||||||
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
||||||
import QuerySelector from "@/components/QuerySelector";
|
import QuerySelector from "@/components/QuerySelector";
|
||||||
import { Query } from "@/services/query";
|
import { Query } from "@/services/query";
|
||||||
|
import { useUniqueId } from "@/lib/hooks/useUniqueId";
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
const formItemProps = { labelCol: { span: 6 }, wrapperCol: { span: 16 } };
|
const formItemProps = { labelCol: { span: 6 }, wrapperCol: { span: 16 } };
|
||||||
@@ -111,6 +112,8 @@ function EditParameterSettingsDialog(props) {
|
|||||||
props.dialog.close(param);
|
props.dialog.close(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const paramFormId = useUniqueId("paramForm");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
{...props.dialog.props}
|
{...props.dialog.props}
|
||||||
@@ -125,12 +128,12 @@ function EditParameterSettingsDialog(props) {
|
|||||||
htmlType="submit"
|
htmlType="submit"
|
||||||
disabled={!isFulfilled()}
|
disabled={!isFulfilled()}
|
||||||
type="primary"
|
type="primary"
|
||||||
form="paramForm"
|
form={paramFormId}
|
||||||
data-test="SaveParameterSettings">
|
data-test="SaveParameterSettings">
|
||||||
{isNew ? "Add Parameter" : "OK"}
|
{isNew ? "Add Parameter" : "OK"}
|
||||||
</Button>,
|
</Button>,
|
||||||
]}>
|
]}>
|
||||||
<Form layout="horizontal" onFinish={onConfirm} id="paramForm">
|
<Form layout="horizontal" onFinish={onConfirm} id={paramFormId}>
|
||||||
{isNew && (
|
{isNew && (
|
||||||
<NameInput
|
<NameInput
|
||||||
name={param.name}
|
name={param.name}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import PropTypes from "prop-types";
|
|||||||
import Dropdown from "antd/lib/dropdown";
|
import Dropdown from "antd/lib/dropdown";
|
||||||
import Menu from "antd/lib/menu";
|
import Menu from "antd/lib/menu";
|
||||||
import Button from "antd/lib/button";
|
import Button from "antd/lib/button";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import { clientConfig } from "@/services/auth";
|
import { clientConfig } from "@/services/auth";
|
||||||
|
|
||||||
import PlusCircleFilledIcon from "@ant-design/icons/PlusCircleFilled";
|
import PlusCircleFilledIcon from "@ant-design/icons/PlusCircleFilled";
|
||||||
@@ -18,16 +19,18 @@ export default function QueryControlDropdown(props) {
|
|||||||
<Menu>
|
<Menu>
|
||||||
{!props.query.isNew() && (!props.query.is_draft || !props.query.is_archived) && (
|
{!props.query.isNew() && (!props.query.is_draft || !props.query.is_archived) && (
|
||||||
<Menu.Item>
|
<Menu.Item>
|
||||||
<a target="_self" onClick={() => props.openAddToDashboardForm(props.selectedTab)}>
|
<PlainButton onClick={() => props.openAddToDashboardForm(props.selectedTab)}>
|
||||||
<PlusCircleFilledIcon /> Add to Dashboard
|
<PlusCircleFilledIcon /> Add to Dashboard
|
||||||
</a>
|
</PlainButton>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
)}
|
)}
|
||||||
{!clientConfig.disablePublicUrls && !props.query.isNew() && (
|
{!clientConfig.disablePublicUrls && !props.query.isNew() && (
|
||||||
<Menu.Item>
|
<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
|
<ShareAltOutlinedIcon /> Embed Elsewhere
|
||||||
</a>
|
</PlainButton>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
)}
|
)}
|
||||||
<Menu.Item>
|
<Menu.Item>
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import cx from "classnames";
|
|
||||||
import { clientConfig, currentUser } from "@/services/auth";
|
import { clientConfig, currentUser } from "@/services/auth";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import Alert from "antd/lib/alert";
|
import Alert from "antd/lib/alert";
|
||||||
import HelpTrigger from "@/components/HelpTrigger";
|
import HelpTrigger from "@/components/HelpTrigger";
|
||||||
|
import { useUniqueId } from "@/lib/hooks/useUniqueId";
|
||||||
|
|
||||||
export default function EmailSettingsWarning({ featureName, className, mode, adminOnly }) {
|
export default function EmailSettingsWarning({ featureName, className, mode, adminOnly }) {
|
||||||
|
const messageDescriptionId = useUniqueId("sr-mail-description");
|
||||||
|
|
||||||
if (!clientConfig.mailSettingsMissing) {
|
if (!clientConfig.mailSettingsMissing) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -16,7 +18,7 @@ export default function EmailSettingsWarning({ featureName, className, mode, adm
|
|||||||
}
|
}
|
||||||
|
|
||||||
const message = (
|
const message = (
|
||||||
<span>
|
<span id={messageDescriptionId}>
|
||||||
Your mail server isn't configured correctly, and is needed for {featureName} to work.{" "}
|
Your mail server isn't configured correctly, and is needed for {featureName} to work.{" "}
|
||||||
<HelpTrigger type="MAIL_CONFIG" className="f-inherit" />
|
<HelpTrigger type="MAIL_CONFIG" className="f-inherit" />
|
||||||
</span>
|
</span>
|
||||||
@@ -24,8 +26,11 @@ export default function EmailSettingsWarning({ featureName, className, mode, adm
|
|||||||
|
|
||||||
if (mode === "icon") {
|
if (mode === "icon") {
|
||||||
return (
|
return (
|
||||||
<Tooltip title={message}>
|
<Tooltip title={message} placement="topRight" arrowPointAtCenter>
|
||||||
<i className={cx("fa fa-exclamation-triangle", className)} />
|
{/* 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>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
|
|
||||||
export default class FavoritesControl extends React.Component {
|
export default class FavoritesControl extends React.Component {
|
||||||
static propTypes = {
|
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 icon = item.is_favorite ? "fa fa-star" : "fa fa-star-o";
|
||||||
const title = item.is_favorite ? "Remove from favorites" : "Add to favorites";
|
const title = item.is_favorite ? "Remove from favorites" : "Add to favorites";
|
||||||
return (
|
return (
|
||||||
<a
|
<PlainButton
|
||||||
title={title}
|
title={title}
|
||||||
className="favorites-control btn-favourite"
|
aria-label={title}
|
||||||
|
className="favorites-control btn-favorite"
|
||||||
onClick={event => this.toggleItem(event, item, onChange)}>
|
onClick={event => this.toggleItem(event, item, onChange)}>
|
||||||
<i className={icon} aria-hidden="true" />
|
<i className={icon} aria-hidden="true" />
|
||||||
</a>
|
</PlainButton>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,11 +112,11 @@ function Filters({ filters, onChange }) {
|
|||||||
{!filter.multiple && options}
|
{!filter.multiple && options}
|
||||||
{filter.multiple && [
|
{filter.multiple && [
|
||||||
<Select.Option key={NONE_VALUES} data-test="ClearOption">
|
<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
|
Clear
|
||||||
</Select.Option>,
|
</Select.Option>,
|
||||||
<Select.Option key={ALL_VALUES} data-test="SelectAllOption">
|
<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 All
|
||||||
</Select.Option>,
|
</Select.Option>,
|
||||||
<Select.OptGroup key="Values" title="Values">
|
<Select.OptGroup key="Values" title="Values">
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ import { startsWith, get, some, mapValues } from "lodash";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import cx from "classnames";
|
import cx from "classnames";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import Drawer from "antd/lib/drawer";
|
import Drawer from "antd/lib/drawer";
|
||||||
import Link from "@/components/Link";
|
import Link from "@/components/Link";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
||||||
import BigMessage from "@/components/BigMessage";
|
import BigMessage from "@/components/BigMessage";
|
||||||
import DynamicComponent, { registerComponent } from "@/components/DynamicComponent";
|
import DynamicComponent, { registerComponent } from "@/components/DynamicComponent";
|
||||||
@@ -68,7 +69,7 @@ const HelpTriggerDefaultProps = {
|
|||||||
className: null,
|
className: null,
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
renderAsLink: false,
|
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) {
|
export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName = null) {
|
||||||
@@ -170,7 +171,13 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName
|
|||||||
this.props.showTooltip ? (
|
this.props.showTooltip ? (
|
||||||
<>
|
<>
|
||||||
{tooltip}
|
{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
|
) : null
|
||||||
}>
|
}>
|
||||||
@@ -197,14 +204,15 @@ export function helpTriggerWithTypes(types, allowedDomains = [], drawerClassName
|
|||||||
<Tooltip title="Open page in a new window" placement="left">
|
<Tooltip title="Open page in a new window" placement="left">
|
||||||
{/* eslint-disable-next-line react/jsx-no-target-blank */}
|
{/* eslint-disable-next-line react/jsx-no-target-blank */}
|
||||||
<Link href={url} 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>
|
</Link>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
<Tooltip title="Close" placement="bottom">
|
<Tooltip title="Close" placement="bottom">
|
||||||
<a onClick={this.closeDrawer}>
|
<PlainButton onClick={this.closeDrawer}>
|
||||||
<CloseOutlinedIcon />
|
<CloseOutlinedIcon />
|
||||||
</a>
|
</PlainButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,8 @@
|
|||||||
border: 2px solid @help-doc-bg;
|
border: 2px solid @help-doc-bg;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
a {
|
a,
|
||||||
|
.plain-button {
|
||||||
height: 26px;
|
height: 26px;
|
||||||
width: 26px;
|
width: 26px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import Input from "antd/lib/input";
|
import Input from "antd/lib/input";
|
||||||
import CopyOutlinedIcon from "@ant-design/icons/CopyOutlined";
|
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 {
|
export default class InputWithCopy extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -42,7 +43,10 @@ export default class InputWithCopy extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
const copyButton = (
|
const copyButton = (
|
||||||
<Tooltip title={this.state.copied || "Copy"}>
|
<Tooltip title={this.state.copied || "Copy"}>
|
||||||
<CopyOutlinedIcon style={{ cursor: "pointer" }} onClick={this.copy} />
|
<PlainButton onClick={this.copy}>
|
||||||
|
{/* TODO: lacks visual feedback */}
|
||||||
|
<CopyOutlinedIcon />
|
||||||
|
</PlainButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
|
||||||
61
client/app/components/Link.tsx
Normal file
61
client/app/components/Link.tsx
Normal 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;
|
||||||
@@ -2,21 +2,26 @@ import React from "react";
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import Button from "antd/lib/button";
|
import Button from "antd/lib/button";
|
||||||
import Badge from "antd/lib/badge";
|
import Badge from "antd/lib/badge";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import KeyboardShortcuts from "@/services/KeyboardShortcuts";
|
import KeyboardShortcuts from "@/services/KeyboardShortcuts";
|
||||||
|
|
||||||
function ParameterApplyButton({ paramCount, onClick }) {
|
function ParameterApplyButton({ paramCount, onClick }) {
|
||||||
// show spinner when count is empty so the fade out is consistent
|
// 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 (
|
return (
|
||||||
<div className="parameter-apply-button" data-show={!!paramCount} data-test="ParameterApplyButton">
|
<div className="parameter-apply-button" data-show={!!paramCount} data-test="ParameterApplyButton">
|
||||||
<Badge count={paramCount}>
|
<Badge count={paramCount}>
|
||||||
<Tooltip title={paramCount ? `${KeyboardShortcuts.modKey} + Enter` : null}>
|
<Tooltip title={paramCount ? `${KeyboardShortcuts.modKey} + Enter` : null}>
|
||||||
<span>
|
<span>
|
||||||
<Button onClick={onClick}>
|
<Button onClick={onClick}>{icon} Apply Changes</Button>
|
||||||
<i className={`fa fa-${icon}`} /> Apply Changes
|
|
||||||
</Button>
|
|
||||||
</span>
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import Tag from "antd/lib/tag";
|
|||||||
import Input from "antd/lib/input";
|
import Input from "antd/lib/input";
|
||||||
import Radio from "antd/lib/radio";
|
import Radio from "antd/lib/radio";
|
||||||
import Form from "antd/lib/form";
|
import Form from "antd/lib/form";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import ParameterValueInput from "@/components/ParameterValueInput";
|
import ParameterValueInput from "@/components/ParameterValueInput";
|
||||||
import { ParameterMappingType } from "@/services/widget";
|
import { ParameterMappingType } from "@/services/widget";
|
||||||
import { Parameter, cloneParameter } from "@/services/parameters";
|
import { Parameter, cloneParameter } from "@/services/parameters";
|
||||||
@@ -201,7 +201,13 @@ export class ParameterMappingInput extends React.Component {
|
|||||||
const {
|
const {
|
||||||
mapping: { mapTo },
|
mapping: { mapTo },
|
||||||
} = this.props;
|
} = 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() {
|
renderDashboardMapToExisting() {
|
||||||
@@ -420,6 +426,7 @@ class TitleEditor extends React.Component {
|
|||||||
size="small"
|
size="small"
|
||||||
value={this.state.title}
|
value={this.state.title}
|
||||||
placeholder={paramTitle}
|
placeholder={paramTitle}
|
||||||
|
aria-label="Edit parameter title"
|
||||||
onChange={this.onEditingTitleChange}
|
onChange={this.onEditingTitleChange}
|
||||||
onPressEnter={this.save}
|
onPressEnter={this.save}
|
||||||
maxLength={100}
|
maxLength={100}
|
||||||
@@ -440,7 +447,10 @@ class TitleEditor extends React.Component {
|
|||||||
if (mapping.type === MappingType.StaticValue) {
|
if (mapping.type === MappingType.StaticValue) {
|
||||||
return (
|
return (
|
||||||
<Tooltip placement="right" title="Titles for static values don't appear in widgets">
|
<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>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,12 @@ class ParameterValueInput extends React.Component {
|
|||||||
const normalize = val => (isNaN(val) ? undefined : val);
|
const normalize = val => (isNaN(val) ? undefined : val);
|
||||||
|
|
||||||
return (
|
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))}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +153,7 @@ class ParameterValueInput extends React.Component {
|
|||||||
<Input
|
<Input
|
||||||
className={className}
|
className={className}
|
||||||
value={value}
|
value={value}
|
||||||
|
aria-label="Parameter text value"
|
||||||
data-test="TextParamInput"
|
data-test="TextParamInput"
|
||||||
onChange={e => this.onSelect(e.target.value)}
|
onChange={e => this.onSelect(e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import location from "@/services/location";
|
|||||||
import { Parameter, createParameter } from "@/services/parameters";
|
import { Parameter, createParameter } from "@/services/parameters";
|
||||||
import ParameterApplyButton from "@/components/ParameterApplyButton";
|
import ParameterApplyButton from "@/components/ParameterApplyButton";
|
||||||
import ParameterValueInput from "@/components/ParameterValueInput";
|
import ParameterValueInput from "@/components/ParameterValueInput";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import EditParameterSettingsDialog from "./EditParameterSettingsDialog";
|
import EditParameterSettingsDialog from "./EditParameterSettingsDialog";
|
||||||
import { toHuman } from "@/lib/utils";
|
import { toHuman } from "@/lib/utils";
|
||||||
|
|
||||||
@@ -127,13 +128,14 @@ export default class Parameters extends React.Component {
|
|||||||
<div className="parameter-heading">
|
<div className="parameter-heading">
|
||||||
<label>{param.title || toHuman(param.name)}</label>
|
<label>{param.title || toHuman(param.name)}</label>
|
||||||
{editable && (
|
{editable && (
|
||||||
<button
|
<PlainButton
|
||||||
className="btn btn-default btn-xs m-l-5"
|
className="btn btn-default btn-xs m-l-5"
|
||||||
|
aria-label="Edit"
|
||||||
onClick={() => this.showParameterSettings(param, index)}
|
onClick={() => this.showParameterSettings(param, index)}
|
||||||
data-test={`ParameterSettings-${param.name}`}
|
data-test={`ParameterSettings-${param.name}`}
|
||||||
type="button">
|
type="button">
|
||||||
<i className="fa fa-cog" />
|
<i className="fa fa-cog" aria-hidden="true" />
|
||||||
</button>
|
</PlainButton>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<ParameterValueInput
|
<ParameterValueInput
|
||||||
|
|||||||
@@ -7,11 +7,12 @@ import List from "antd/lib/list";
|
|||||||
import Modal from "antd/lib/modal";
|
import Modal from "antd/lib/modal";
|
||||||
import Select from "antd/lib/select";
|
import Select from "antd/lib/select";
|
||||||
import Tag from "antd/lib/tag";
|
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 { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
||||||
import { toHuman } from "@/lib/utils";
|
import { toHuman } from "@/lib/utils";
|
||||||
import HelpTrigger from "@/components/HelpTrigger";
|
import HelpTrigger from "@/components/HelpTrigger";
|
||||||
import { UserPreviewCard } from "@/components/PreviewCard";
|
import { UserPreviewCard } from "@/components/PreviewCard";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import notification from "@/services/notification";
|
import notification from "@/services/notification";
|
||||||
import User from "@/services/user";
|
import User from "@/services/user";
|
||||||
|
|
||||||
@@ -102,7 +103,16 @@ function UserSelect({ onSelect, shouldShowUser }) {
|
|||||||
placeholder="Add users..."
|
placeholder="Add users..."
|
||||||
showSearch
|
showSearch
|
||||||
onSearch={setSearchTerm}
|
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}
|
filterOption={false}
|
||||||
notFoundContent={null}
|
notFoundContent={null}
|
||||||
value={undefined}
|
value={undefined}
|
||||||
@@ -156,7 +166,12 @@ function PermissionsEditorDialog({ dialog, author, context, aclUrl }) {
|
|||||||
/>
|
/>
|
||||||
<div className="d-flex align-items-center m-t-5">
|
<div className="d-flex align-items-center m-t-5">
|
||||||
<h5 className="flex-fill">Users with permissions</h5>
|
<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>
|
||||||
<div className="scrollbox p-5" style={{ maxHeight: "40vh" }}>
|
<div className="scrollbox p-5" style={{ maxHeight: "40vh" }}>
|
||||||
<List
|
<List
|
||||||
@@ -169,10 +184,11 @@ function PermissionsEditorDialog({ dialog, author, context, aclUrl }) {
|
|||||||
<Tag className="m-0">Author</Tag>
|
<Tag className="m-0">Author</Tag>
|
||||||
) : (
|
) : (
|
||||||
<Tooltip title="Remove user permissions">
|
<Tooltip title="Remove user permissions">
|
||||||
<i
|
<PlainButton
|
||||||
className="fa fa-remove clickable"
|
aria-label="Remove permissions"
|
||||||
onClick={() => removePermission(user.id).then(loadUsersWithPermissions)}
|
onClick={() => removePermission(user.id).then(loadUsersWithPermissions)}>
|
||||||
/>
|
<i className="fa fa-remove clickable" aria-hidden="true" />
|
||||||
|
</PlainButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</UserPreviewCard>
|
</UserPreviewCard>
|
||||||
|
|||||||
22
client/app/components/PlainButton.less
Normal file
22
client/app/components/PlainButton.less
Normal 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();
|
||||||
|
}
|
||||||
20
client/app/components/PlainButton.tsx
Normal file
20
client/app/components/PlainButton.tsx
Normal 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;
|
||||||
@@ -21,10 +21,12 @@ function QueryLink({ query, visualization, readOnly }) {
|
|||||||
return query.getUrl(false, hash);
|
return query.getUrl(false, hash);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const QueryLinkWrapper = props => (readOnly ? <span {...props} /> : <Link href={getUrl()} {...props} />);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={readOnly ? null : getUrl()} className="query-link">
|
<QueryLinkWrapper className="query-link">
|
||||||
<VisualizationName visualization={visualization} /> <span>{query.name}</span>
|
<VisualizationName visualization={visualization} /> <span>{query.name}</span>
|
||||||
</Link>
|
</QueryLinkWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cx from "classnames";
|
|||||||
import Input from "antd/lib/input";
|
import Input from "antd/lib/input";
|
||||||
import Select from "antd/lib/select";
|
import Select from "antd/lib/select";
|
||||||
import { Query } from "@/services/query";
|
import { Query } from "@/services/query";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import notification from "@/services/notification";
|
import notification from "@/services/notification";
|
||||||
import { QueryTagsControl } from "@/components/tags-control/TagsControl";
|
import { QueryTagsControl } from "@/components/tags-control/TagsControl";
|
||||||
import useSearchResults from "@/lib/hooks/useSearchResults";
|
import useSearchResults from "@/lib/hooks/useSearchResults";
|
||||||
@@ -30,8 +31,21 @@ export default function QuerySelector(props) {
|
|||||||
const [doSearch, searchResults, searching] = useSearchResults(search, { initialResults: [] });
|
const [doSearch, searchResults, searching] = useSearchResults(search, { initialResults: [] });
|
||||||
|
|
||||||
const placeholder = "Search a query by name";
|
const placeholder = "Search a query by name";
|
||||||
const clearIcon = <i className="fa fa-times hide-in-percy" onClick={() => selectQuery(null)} />;
|
const clearIcon = (
|
||||||
const spinIcon = <i className={cx("fa fa-spinner fa-pulse hide-in-percy", { hidden: !searching })} />;
|
<i
|
||||||
|
className="fa fa-times hide-in-percy"
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
|
aria-label="Clear"
|
||||||
|
onClick={() => selectQuery(null)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
const spinIcon = (
|
||||||
|
<span role="status" aria-live="polite" aria-relevant="additions removals">
|
||||||
|
<i className={cx("fa fa-spinner fa-pulse hide-in-percy", { hidden: !searching })} aria-hidden="true" />
|
||||||
|
<span className="sr-only">Searching...</span>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
doSearch(searchTerm);
|
doSearch(searchTerm);
|
||||||
@@ -65,22 +79,25 @@ export default function QuerySelector(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="list-group">
|
<ul className="list-group">
|
||||||
{searchResults.map(q => (
|
{searchResults.map(q => (
|
||||||
<a
|
<PlainButton
|
||||||
className={cx("query-selector-result", "list-group-item", { inactive: q.is_draft })}
|
className={cx("query-selector-result", "list-group-item", { inactive: q.is_draft })}
|
||||||
key={q.id}
|
key={q.id}
|
||||||
|
role="listitem"
|
||||||
onClick={() => selectQuery(q.id)}
|
onClick={() => selectQuery(q.id)}
|
||||||
data-test={`QueryId${q.id}`}>
|
data-test={`QueryId${q.id}`}>
|
||||||
{q.name} <QueryTagsControl isDraft={q.is_draft} tags={q.tags} className="inline-tags-control" />
|
{q.name} <QueryTagsControl isDraft={q.is_draft} tags={q.tags} className="inline-tags-control" />
|
||||||
</a>
|
</PlainButton>
|
||||||
))}
|
))}
|
||||||
</div>
|
</ul>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.disabled) {
|
if (props.disabled) {
|
||||||
return <Input value={selectedQuery && selectedQuery.name} placeholder={placeholder} disabled />;
|
return (
|
||||||
|
<Input value={selectedQuery && selectedQuery.name} aria-label="Tied query" placeholder={placeholder} disabled />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.type === "select") {
|
if (props.type === "select") {
|
||||||
@@ -127,11 +144,12 @@ export default function QuerySelector(props) {
|
|||||||
return (
|
return (
|
||||||
<span data-test="QuerySelector">
|
<span data-test="QuerySelector">
|
||||||
{selectedQuery ? (
|
{selectedQuery ? (
|
||||||
<Input value={selectedQuery.name} suffix={clearIcon} readOnly />
|
<Input value={selectedQuery.name} aria-label="Tied query" suffix={clearIcon} readOnly />
|
||||||
) : (
|
) : (
|
||||||
<Input
|
<Input
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
value={searchTerm}
|
value={searchTerm}
|
||||||
|
aria-label="Tied query"
|
||||||
onChange={e => setSearchTerm(e.target.value)}
|
onChange={e => setSearchTerm(e.target.value)}
|
||||||
suffix={spinIcon}
|
suffix={spinIcon}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -51,9 +51,12 @@ export default function Resizable({ toggleShortcut, direction, sizeAttribute, ch
|
|||||||
|
|
||||||
const resizeHandle = useMemo(
|
const resizeHandle = useMemo(
|
||||||
() => (
|
() => (
|
||||||
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
||||||
<span
|
<span
|
||||||
className={`react-resizable-handle react-resizable-handle-${direction}`}
|
className={`react-resizable-handle react-resizable-handle-${direction}`}
|
||||||
|
role="separator"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
// TODO: add key controls
|
||||||
// On desktops resize uses `mousedown`/`mousemove`/`mouseup` events, and there is a conflict
|
// On desktops resize uses `mousedown`/`mousemove`/`mouseup` events, and there is a conflict
|
||||||
// with this `click` handler: after user releases mouse - this handler will be executed.
|
// with this `click` handler: after user releases mouse - this handler will be executed.
|
||||||
// So we use `wasResized` flag to check if there was actual resize or user just pressed and released
|
// So we use `wasResized` flag to check if there was actual resize or user just pressed and released
|
||||||
|
|||||||
@@ -12,13 +12,16 @@ import LoadingState from "@/components/items-list/components/LoadingState";
|
|||||||
import notification from "@/services/notification";
|
import notification from "@/services/notification";
|
||||||
import useSearchResults from "@/lib/hooks/useSearchResults";
|
import useSearchResults from "@/lib/hooks/useSearchResults";
|
||||||
|
|
||||||
|
import "./SelectItemsDialog.less";
|
||||||
|
|
||||||
function ItemsList({ items, renderItem, onItemClick }) {
|
function ItemsList({ items, renderItem, onItemClick }) {
|
||||||
const renderListItem = useCallback(
|
const renderListItem = useCallback(
|
||||||
item => {
|
item => {
|
||||||
const { content, className, isDisabled } = renderItem(item);
|
const { content, className, isDisabled } = renderItem(item);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<List.Item
|
<List.Item
|
||||||
className={classNames("p-l-10", "p-r-10", { clickable: !isDisabled, disabled: isDisabled }, className)}
|
className={classNames("select-items-list", "w-100", "p-l-10", "p-r-10", { disabled: isDisabled }, className)}
|
||||||
onClick={isDisabled ? null : () => onItemClick(item)}>
|
onClick={isDisabled ? null : () => onItemClick(item)}>
|
||||||
{content}
|
{content}
|
||||||
</List.Item>
|
</List.Item>
|
||||||
@@ -117,7 +120,12 @@ function SelectItemsDialog({
|
|||||||
}>
|
}>
|
||||||
<div className="d-flex align-items-center m-b-10">
|
<div className="d-flex align-items-center m-b-10">
|
||||||
<div className="flex-fill">
|
<div className="flex-fill">
|
||||||
<Input.Search onChange={event => search(event.target.value)} placeholder={inputPlaceholder} autoFocus />
|
<Input.Search
|
||||||
|
onChange={event => search(event.target.value)}
|
||||||
|
placeholder={inputPlaceholder}
|
||||||
|
aria-label={inputPlaceholder}
|
||||||
|
autoFocus
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
{renderStagedItem && (
|
{renderStagedItem && (
|
||||||
<div className="w-50 m-l-20">
|
<div className="w-50 m-l-20">
|
||||||
|
|||||||
9
client/app/components/SelectItemsDialog.less
Normal file
9
client/app/components/SelectItemsDialog.less
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
.select-items-list {
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
color: #555;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
transition: all 150ms ease-in-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,13 +7,14 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
label {
|
.tags-list-label {
|
||||||
display: block;
|
display: block;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a,
|
||||||
|
.plain-button {
|
||||||
display: block;
|
display: block;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -43,5 +44,15 @@
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-menu-item {
|
||||||
|
&:hover,
|
||||||
|
&:active,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
color: @primary-color;
|
||||||
|
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import Badge from "antd/lib/badge";
|
|||||||
import Menu from "antd/lib/menu";
|
import Menu from "antd/lib/menu";
|
||||||
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
||||||
import getTags from "@/services/getTags";
|
import getTags from "@/services/getTags";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
|
|
||||||
import "./TagsList.less";
|
import "./TagsList.less";
|
||||||
|
|
||||||
@@ -77,12 +78,12 @@ function TagsList({ tagsUrl, showUnselectAll = false, onUpdate }: TagsListProps)
|
|||||||
return (
|
return (
|
||||||
<div className="tags-list">
|
<div className="tags-list">
|
||||||
<div className="tags-list-title">
|
<div className="tags-list-title">
|
||||||
<label>Tags</label>
|
<span className="tags-list-label">Tags</span>
|
||||||
{showUnselectAll && selectedTags.length > 0 && (
|
{showUnselectAll && selectedTags.length > 0 && (
|
||||||
<a onClick={unselectAll}>
|
<PlainButton type="link" onClick={unselectAll}>
|
||||||
<CloseOutlinedIcon />
|
<CloseOutlinedIcon />
|
||||||
clear selection
|
clear selection
|
||||||
</a>
|
</PlainButton>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -90,12 +91,12 @@ function TagsList({ tagsUrl, showUnselectAll = false, onUpdate }: TagsListProps)
|
|||||||
<Menu className="invert-stripe-position" mode="inline" selectedKeys={selectedTags}>
|
<Menu className="invert-stripe-position" mode="inline" selectedKeys={selectedTags}>
|
||||||
{map(allTags, tag => (
|
{map(allTags, tag => (
|
||||||
<Menu.Item key={tag.name} className="m-0">
|
<Menu.Item key={tag.name} className="m-0">
|
||||||
<a
|
<PlainButton
|
||||||
className="d-flex align-items-center justify-content-between"
|
className="d-flex align-items-center justify-content-between"
|
||||||
onClick={event => toggleTag(event, tag.name)}>
|
onClick={event => toggleTag(event, tag.name)}>
|
||||||
<span className="max-character col-xs-11">{tag.name}</span>
|
<span className="max-character col-xs-11">{tag.name}</span>
|
||||||
<Badge count={tag.count} />
|
<Badge count={tag.count} />
|
||||||
</a>
|
</PlainButton>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
))}
|
))}
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import React, { useEffect, useMemo, useState } from "react";
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { Moment } from "@/components/proptypes";
|
import { Moment } from "@/components/proptypes";
|
||||||
import { clientConfig } from "@/services/auth";
|
import { clientConfig } from "@/services/auth";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
|
|
||||||
function toMoment(value) {
|
function toMoment(value) {
|
||||||
value = !isNil(value) ? moment(value) : null;
|
value = !isNil(value) ? moment(value) : null;
|
||||||
|
|||||||
13
client/app/components/Tooltip.tsx
Normal file
13
client/app/components/Tooltip.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import React from "react";
|
||||||
|
import AntTooltip, { TooltipProps } from "antd/lib/tooltip";
|
||||||
|
import { isNil } from "lodash";
|
||||||
|
|
||||||
|
export default function Tooltip({ title, ...restProps }: TooltipProps) {
|
||||||
|
const liveTitle = !isNil(title) ? (
|
||||||
|
<span role="status" aria-live="assertive" aria-relevant="additions">
|
||||||
|
{title}
|
||||||
|
</span>
|
||||||
|
) : null;
|
||||||
|
|
||||||
|
return <AntTooltip trigger={["hover", "focus"]} title={liveTitle} {...restProps} />;
|
||||||
|
}
|
||||||
@@ -21,7 +21,9 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
box-shadow: rgba(102, 136, 153, 0.15) 0px 4px 9px -3px;
|
box-shadow: rgba(102, 136, 153, 0.15) 0px 4px 9px -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import PropTypes from "prop-types";
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import Input from "antd/lib/input";
|
import Input from "antd/lib/input";
|
||||||
import Link from "@/components/Link";
|
import Link from "@/components/Link";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import EmptyState from "@/components/items-list/components/EmptyState";
|
import EmptyState from "@/components/items-list/components/EmptyState";
|
||||||
|
|
||||||
import "./CardsList.less";
|
import "./CardsList.less";
|
||||||
@@ -10,8 +11,8 @@ import "./CardsList.less";
|
|||||||
export interface CardsListItem {
|
export interface CardsListItem {
|
||||||
title: string;
|
title: string;
|
||||||
imgSrc: string;
|
imgSrc: string;
|
||||||
onClick?: () => void;
|
|
||||||
href?: string;
|
href?: string;
|
||||||
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CardsListProps {
|
export interface CardsListProps {
|
||||||
@@ -25,12 +26,19 @@ interface ListItemProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ListItem({ item, keySuffix }: ListItemProps) {
|
function ListItem({ item, keySuffix }: ListItemProps) {
|
||||||
return (
|
const commonProps = {
|
||||||
<Link key={`card${keySuffix}`} className="visual-card" onClick={item.onClick} href={item.href}>
|
key: `card${keySuffix}`,
|
||||||
<img alt={item.title} src={item.imgSrc} />
|
className: "visual-card",
|
||||||
<h3>{item.title}</h3>
|
onClick: item.onClick,
|
||||||
</Link>
|
children: (
|
||||||
);
|
<>
|
||||||
|
<img alt={item.title} src={item.imgSrc} />
|
||||||
|
<h3>{item.title}</h3>
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
return item.href ? <Link href={item.href} {...commonProps} /> : <PlainButton type="link" {...commonProps} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function CardsList({ items = [], showSearch = false }: CardsListProps) {
|
export default function CardsList({ items = [], showSearch = false }: CardsListProps) {
|
||||||
@@ -46,6 +54,7 @@ export default function CardsList({ items = [], showSearch = false }: CardsListP
|
|||||||
<div className="col-md-4 col-md-offset-4">
|
<div className="col-md-4 col-md-offset-4">
|
||||||
<Input.Search
|
<Input.Search
|
||||||
placeholder="Search..."
|
placeholder="Search..."
|
||||||
|
aria-label="Search cards"
|
||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSearchText(e.target.value)}
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSearchText(e.target.value)}
|
||||||
autoFocus
|
autoFocus
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -8,12 +8,15 @@ import { MappingType, ParameterMappingListInput } from "@/components/ParameterMa
|
|||||||
import QuerySelector from "@/components/QuerySelector";
|
import QuerySelector from "@/components/QuerySelector";
|
||||||
import notification from "@/services/notification";
|
import notification from "@/services/notification";
|
||||||
import { Query } from "@/services/query";
|
import { Query } from "@/services/query";
|
||||||
|
import { useUniqueId } from "@/lib/hooks/useUniqueId";
|
||||||
|
|
||||||
function VisualizationSelect({ query, visualization, onChange }) {
|
function VisualizationSelect({ query, visualization, onChange }) {
|
||||||
const visualizationGroups = useMemo(() => {
|
const visualizationGroups = useMemo(() => {
|
||||||
return query ? groupBy(query.visualizations, "type") : {};
|
return query ? groupBy(query.visualizations, "type") : {};
|
||||||
}, [query]);
|
}, [query]);
|
||||||
|
|
||||||
|
const vizSelectId = useUniqueId("visualization-select");
|
||||||
|
|
||||||
const handleChange = useCallback(
|
const handleChange = useCallback(
|
||||||
visualizationId => {
|
visualizationId => {
|
||||||
const selectedVisualization = query ? find(query.visualizations, { id: visualizationId }) : null;
|
const selectedVisualization = query ? find(query.visualizations, { id: visualizationId }) : null;
|
||||||
@@ -29,9 +32,9 @@ function VisualizationSelect({ query, visualization, onChange }) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label htmlFor="choose-visualization">Choose Visualization</label>
|
<label htmlFor={vizSelectId}>Choose Visualization</label>
|
||||||
<Select
|
<Select
|
||||||
id="choose-visualization"
|
id={vizSelectId}
|
||||||
className="w-100"
|
className="w-100"
|
||||||
value={visualization ? visualization.id : undefined}
|
value={visualization ? visualization.id : undefined}
|
||||||
onChange={handleChange}>
|
onChange={handleChange}>
|
||||||
@@ -108,6 +111,7 @@ function AddWidgetDialog({ dialog, dashboard }) {
|
|||||||
}, [dialog, selectedVisualization, parameterMappings]);
|
}, [dialog, selectedVisualization, parameterMappings]);
|
||||||
|
|
||||||
const existingParams = dashboard.getParametersDefs();
|
const existingParams = dashboard.getParametersDefs();
|
||||||
|
const parameterMappingsId = useUniqueId("parameter-mappings");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
@@ -132,12 +136,12 @@ function AddWidgetDialog({ dialog, dashboard }) {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{parameterMappings.length > 0 && [
|
{parameterMappings.length > 0 && [
|
||||||
<label key="parameters-title" htmlFor="parameter-mappings">
|
<label key="parameters-title" htmlFor={parameterMappingsId}>
|
||||||
Parameters
|
Parameters
|
||||||
</label>,
|
</label>,
|
||||||
<ParameterMappingListInput
|
<ParameterMappingListInput
|
||||||
key="parameters-list"
|
key="parameters-list"
|
||||||
id="parameter-mappings"
|
id={parameterMappingsId}
|
||||||
mappings={parameterMappings}
|
mappings={parameterMappings}
|
||||||
existingParams={existingParams}
|
existingParams={existingParams}
|
||||||
onChange={setParameterMappings}
|
onChange={setParameterMappings}
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ function CreateDashboardDialog({ dialog }) {
|
|||||||
onChange={handleNameChange}
|
onChange={handleNameChange}
|
||||||
onPressEnter={save}
|
onPressEnter={save}
|
||||||
placeholder="Dashboard Name"
|
placeholder="Dashboard Name"
|
||||||
|
aria-label="Dashboard name"
|
||||||
disabled={saveInProgress}
|
disabled={saveInProgress}
|
||||||
autoFocus
|
autoFocus
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import PropTypes from "prop-types";
|
|||||||
import { useDebouncedCallback } from "use-debounce";
|
import { useDebouncedCallback } from "use-debounce";
|
||||||
import Modal from "antd/lib/modal";
|
import Modal from "antd/lib/modal";
|
||||||
import Input from "antd/lib/input";
|
import Input from "antd/lib/input";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import Divider from "antd/lib/divider";
|
import Divider from "antd/lib/divider";
|
||||||
import Link from "@/components/Link";
|
import Link from "@/components/Link";
|
||||||
import HtmlContent from "@redash/viz/lib/components/HtmlContent";
|
import HtmlContent from "@redash/viz/lib/components/HtmlContent";
|
||||||
@@ -73,6 +73,7 @@ function TextboxDialog({ dialog, isNew, ...props }) {
|
|||||||
className="resize-vertical"
|
className="resize-vertical"
|
||||||
rows="5"
|
rows="5"
|
||||||
value={text}
|
value={text}
|
||||||
|
aria-label="Textbox widget content"
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
autoFocus
|
autoFocus
|
||||||
placeholder="This is where you write some text"
|
placeholder="This is where you write some text"
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ import Timer from "@/components/Timer";
|
|||||||
import { Moment } from "@/components/proptypes";
|
import { Moment } from "@/components/proptypes";
|
||||||
import QueryLink from "@/components/QueryLink";
|
import QueryLink from "@/components/QueryLink";
|
||||||
import { FiltersType } from "@/components/Filters";
|
import { FiltersType } from "@/components/Filters";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import ExpandedWidgetDialog from "@/components/dashboards/ExpandedWidgetDialog";
|
import ExpandedWidgetDialog from "@/components/dashboards/ExpandedWidgetDialog";
|
||||||
import EditParameterMappingsDialog from "@/components/dashboards/EditParameterMappingsDialog";
|
import EditParameterMappingsDialog from "@/components/dashboards/EditParameterMappingsDialog";
|
||||||
import VisualizationRenderer from "@/components/visualizations/VisualizationRenderer";
|
import VisualizationRenderer from "@/components/visualizations/VisualizationRenderer";
|
||||||
|
|
||||||
import Widget from "./Widget";
|
import Widget from "./Widget";
|
||||||
|
|
||||||
function visualizationWidgetMenuOptions({ widget, canEditDashboard, onParametersEdit }) {
|
function visualizationWidgetMenuOptions({ widget, canEditDashboard, onParametersEdit }) {
|
||||||
@@ -74,7 +76,8 @@ function RefreshIndicator({ refreshStartedAt }) {
|
|||||||
return (
|
return (
|
||||||
<div className="refresh-indicator">
|
<div className="refresh-indicator">
|
||||||
<div className="refresh-icon">
|
<div className="refresh-icon">
|
||||||
<i className="zmdi zmdi-refresh zmdi-hc-spin" />
|
<i className="zmdi zmdi-refresh zmdi-hc-spin" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Refreshing...</span>
|
||||||
</div>
|
</div>
|
||||||
<Timer from={refreshStartedAt} />
|
<Timer from={refreshStartedAt} />
|
||||||
</div>
|
</div>
|
||||||
@@ -157,34 +160,40 @@ function VisualizationWidgetFooter({ widget, isPublic, onRefresh, onExpand }) {
|
|||||||
<>
|
<>
|
||||||
<span>
|
<span>
|
||||||
{!isPublic && !!widgetQueryResult && (
|
{!isPublic && !!widgetQueryResult && (
|
||||||
<a
|
<PlainButton
|
||||||
className="refresh-button hidden-print btn btn-sm btn-default btn-transparent"
|
className="refresh-button hidden-print btn btn-sm btn-default btn-transparent"
|
||||||
onClick={() => refreshWidget(1)}
|
onClick={() => refreshWidget(1)}
|
||||||
data-test="RefreshButton">
|
data-test="RefreshButton">
|
||||||
<i className={cx("zmdi zmdi-refresh", { "zmdi-hc-spin": refreshClickButtonId === 1 })} />{" "}
|
<i className={cx("zmdi zmdi-refresh", { "zmdi-hc-spin": refreshClickButtonId === 1 })} aria-hidden="true" />
|
||||||
|
<span className="sr-only">
|
||||||
|
{refreshClickButtonId === 1 ? "Refreshing, please wait. " : "Press to refresh. "}
|
||||||
|
</span>{" "}
|
||||||
<TimeAgo date={updatedAt} />
|
<TimeAgo date={updatedAt} />
|
||||||
</a>
|
</PlainButton>
|
||||||
)}
|
)}
|
||||||
<span className="visible-print">
|
<span className="visible-print">
|
||||||
<i className="zmdi zmdi-time-restore" /> {formatDateTime(updatedAt)}
|
<i className="zmdi zmdi-time-restore" aria-hidden="true" /> {formatDateTime(updatedAt)}
|
||||||
</span>
|
</span>
|
||||||
{isPublic && (
|
{isPublic && (
|
||||||
<span className="small hidden-print">
|
<span className="small hidden-print">
|
||||||
<i className="zmdi zmdi-time-restore" /> <TimeAgo date={updatedAt} />
|
<i className="zmdi zmdi-time-restore" aria-hidden="true" /> <TimeAgo date={updatedAt} />
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
{!isPublic && (
|
{!isPublic && (
|
||||||
<a
|
<PlainButton
|
||||||
className="btn btn-sm btn-default hidden-print btn-transparent btn__refresh"
|
className="btn btn-sm btn-default hidden-print btn-transparent btn__refresh"
|
||||||
onClick={() => refreshWidget(2)}>
|
onClick={() => refreshWidget(2)}>
|
||||||
<i className={cx("zmdi zmdi-refresh", { "zmdi-hc-spin": refreshClickButtonId === 2 })} />
|
<i className={cx("zmdi zmdi-refresh", { "zmdi-hc-spin": refreshClickButtonId === 2 })} aria-hidden="true" />
|
||||||
</a>
|
<span className="sr-only">
|
||||||
|
{refreshClickButtonId === 2 ? "Refreshing, please wait." : "Press to refresh."}
|
||||||
|
</span>
|
||||||
|
</PlainButton>
|
||||||
)}
|
)}
|
||||||
<a className="btn btn-sm btn-default hidden-print btn-transparent btn__refresh" onClick={onExpand}>
|
<PlainButton className="btn btn-sm btn-default hidden-print btn-transparent btn__refresh" onClick={onExpand}>
|
||||||
<i className="zmdi zmdi-fullscreen" />
|
<i className="zmdi zmdi-fullscreen" aria-hidden="true" />
|
||||||
</a>
|
</PlainButton>
|
||||||
</span>
|
</span>
|
||||||
</>
|
</>
|
||||||
) : null;
|
) : null;
|
||||||
@@ -293,9 +302,14 @@ class VisualizationWidget extends React.Component {
|
|||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
return (
|
return (
|
||||||
<div className="body-row-auto spinner-container">
|
<div
|
||||||
|
className="body-row-auto spinner-container"
|
||||||
|
role="status"
|
||||||
|
aria-live="polite"
|
||||||
|
aria-relevant="additions removals">
|
||||||
<div className="spinner">
|
<div className="spinner">
|
||||||
<i className="zmdi zmdi-refresh zmdi-hc-spin zmdi-hc-5x" />
|
<i className="zmdi zmdi-refresh zmdi-hc-spin zmdi-hc-5x" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import Modal from "antd/lib/modal";
|
|||||||
import Menu from "antd/lib/menu";
|
import Menu from "antd/lib/menu";
|
||||||
import recordEvent from "@/services/recordEvent";
|
import recordEvent from "@/services/recordEvent";
|
||||||
import { Moment } from "@/components/proptypes";
|
import { Moment } from "@/components/proptypes";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
|
|
||||||
import "./Widget.less";
|
import "./Widget.less";
|
||||||
|
|
||||||
@@ -22,9 +23,9 @@ function WidgetDropdownButton({ extraOptions, showDeleteOption, onDelete }) {
|
|||||||
return (
|
return (
|
||||||
<div className="widget-menu-regular">
|
<div className="widget-menu-regular">
|
||||||
<Dropdown overlay={WidgetMenu} placement="bottomRight" trigger={["click"]}>
|
<Dropdown overlay={WidgetMenu} placement="bottomRight" trigger={["click"]}>
|
||||||
<a className="action p-l-15 p-r-15" data-test="WidgetDropdownButton">
|
<PlainButton className="action p-l-15 p-r-15" data-test="WidgetDropdownButton" aria-label="More options">
|
||||||
<i className="zmdi zmdi-more-vert" />
|
<i className="zmdi zmdi-more-vert" aria-hidden="true" />
|
||||||
</a>
|
</PlainButton>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -45,9 +46,14 @@ WidgetDropdownButton.defaultProps = {
|
|||||||
function WidgetDeleteButton({ onClick }) {
|
function WidgetDeleteButton({ onClick }) {
|
||||||
return (
|
return (
|
||||||
<div className="widget-menu-remove">
|
<div className="widget-menu-remove">
|
||||||
<a className="action" title="Remove From Dashboard" onClick={onClick} data-test="WidgetDeleteButton">
|
<PlainButton
|
||||||
<i className="zmdi zmdi-close" />
|
className="action"
|
||||||
</a>
|
title="Remove From Dashboard"
|
||||||
|
onClick={onClick}
|
||||||
|
data-test="WidgetDeleteButton"
|
||||||
|
aria-label="Close">
|
||||||
|
<i className="zmdi zmdi-close" aria-hidden="true" />
|
||||||
|
</PlainButton>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
@import (reference, less) "~@/assets/less/inc/variables";
|
@import (reference, less) "~@/assets/less/inc/variables";
|
||||||
|
|
||||||
.tile .t-header .th-title a.query-link {
|
|
||||||
color: rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.th-title p.hidden-print {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-wrapper {
|
.widget-wrapper {
|
||||||
.widget-actions {
|
.widget-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -22,10 +14,19 @@
|
|||||||
line-height: 100%;
|
line-height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 4px 10px 3px;
|
padding: 4px 10px 3px;
|
||||||
}
|
|
||||||
|
|
||||||
.action:hover {
|
&:focus {
|
||||||
background-color: rgba(0, 0, 0, 0.1);
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
color: @blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
filter: brightness(75%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +84,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.query-link {
|
.query-link {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
}
|
}
|
||||||
@@ -190,10 +191,18 @@
|
|||||||
.th-title {
|
.th-title {
|
||||||
padding-right: 23px; // no overlap on RefreshIndicator
|
padding-right: 23px; // no overlap on RefreshIndicator
|
||||||
|
|
||||||
a {
|
.hidden-print {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-link {
|
||||||
color: fade(@redash-black, 80%);
|
color: fade(@redash-black, 80%);
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
|
&:not(.visualization-name) {
|
||||||
|
color: fade(@redash-black, 50%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +221,10 @@
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:active,
|
||||||
|
&:focus-within {
|
||||||
.widget-menu-regular,
|
.widget-menu-regular,
|
||||||
.btn__refresh {
|
.btn__refresh {
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
@@ -240,10 +252,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a,
|
||||||
|
.plain-button {
|
||||||
color: fade(@redash-black, 65%);
|
color: fade(@redash-black, 65%);
|
||||||
|
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&:focus {
|
||||||
color: fade(@redash-black, 95%);
|
color: fade(@redash-black, 95%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,7 +201,10 @@ export default function DynamicForm({
|
|||||||
className="extra-options-button"
|
className="extra-options-button"
|
||||||
onClick={() => setShowExtraFields(currentShowExtraFields => !currentShowExtraFields)}>
|
onClick={() => setShowExtraFields(currentShowExtraFields => !currentShowExtraFields)}>
|
||||||
Additional Settings
|
Additional Settings
|
||||||
<i className={cx("fa m-l-5", { "fa-caret-up": showExtraFields, "fa-caret-down": !showExtraFields })} />
|
<i
|
||||||
|
className={cx("fa m-l-5", { "fa-caret-up": showExtraFields, "fa-caret-down": !showExtraFields })}
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<Collapse collapsed={!showExtraFields} className="extra-options-content">
|
<Collapse collapsed={!showExtraFields} className="extra-options-content">
|
||||||
<DynamicFormFields fields={extraFields} feedbackIcons={feedbackIcons} form={form} />
|
<DynamicFormFields fields={extraFields} feedbackIcons={feedbackIcons} form={form} />
|
||||||
|
|||||||
@@ -23,7 +23,13 @@ const DYNAMIC_DATE_OPTIONS = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
function DateParameter(props) {
|
function DateParameter(props) {
|
||||||
return <DynamicDatePicker dynamicButtonOptions={{ options: DYNAMIC_DATE_OPTIONS }} {...props} />;
|
return (
|
||||||
|
<DynamicDatePicker
|
||||||
|
dynamicButtonOptions={{ options: DYNAMIC_DATE_OPTIONS }}
|
||||||
|
{...props}
|
||||||
|
dateOptions={{ "aria-label": "Parameter date value" }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
DateParameter.propTypes = {
|
DateParameter.propTypes = {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ function DynamicButton({ options, selectedDynamicValue, onSelect, enabled, stati
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={containerRef}>
|
<div ref={containerRef}>
|
||||||
<a onClick={e => e.stopPropagation()}>
|
<div role="presentation" onClick={e => e.stopPropagation()}>
|
||||||
<Dropdown.Button
|
<Dropdown.Button
|
||||||
overlay={menu}
|
overlay={menu}
|
||||||
className="dynamic-button"
|
className="dynamic-button"
|
||||||
@@ -58,7 +58,7 @@ function DynamicButton({ options, selectedDynamicValue, onSelect, enabled, stati
|
|||||||
getPopupContainer={() => containerRef.current}
|
getPopupContainer={() => containerRef.current}
|
||||||
data-test="DynamicButton"
|
data-test="DynamicButton"
|
||||||
/>
|
/>
|
||||||
</a>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,23 +4,24 @@ import PropTypes from "prop-types";
|
|||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
||||||
import Link from "@/components/Link";
|
import Link from "@/components/Link";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import CreateDashboardDialog from "@/components/dashboards/CreateDashboardDialog";
|
import CreateDashboardDialog from "@/components/dashboards/CreateDashboardDialog";
|
||||||
import HelpTrigger from "@/components/HelpTrigger";
|
import HelpTrigger from "@/components/HelpTrigger";
|
||||||
import { currentUser } from "@/services/auth";
|
import { currentUser } from "@/services/auth";
|
||||||
import organizationStatus from "@/services/organizationStatus";
|
import organizationStatus from "@/services/organizationStatus";
|
||||||
|
|
||||||
import "./empty-state.less";
|
import "./empty-state.less";
|
||||||
|
|
||||||
export function Step({ show, completed, text, url, urlTarget, urlText, onClick }) {
|
export function Step({ show, completed, text, url, urlText, onClick }) {
|
||||||
if (!show) {
|
if (!show) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const commonProps = { children: urlText, onClick };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className={classNames({ done: completed })}>
|
<li className={classNames({ done: completed })}>
|
||||||
<Link href={url} onClick={onClick} target={urlTarget}>
|
{url ? <Link href={url} {...commonProps} /> : <PlainButton type="link" {...commonProps} />} {text}
|
||||||
{urlText}
|
|
||||||
</Link>{" "}
|
|
||||||
{text}
|
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -188,7 +189,7 @@ function EmptyState({
|
|||||||
<div className="empty-state__summary">
|
<div className="empty-state__summary">
|
||||||
{header && <h4>{header}</h4>}
|
{header && <h4>{header}</h4>}
|
||||||
<h2>
|
<h2>
|
||||||
<i className={icon} />
|
<i className={icon} aria-hidden="true" />
|
||||||
</h2>
|
</h2>
|
||||||
<p>{description}</p>
|
<p>{description}</p>
|
||||||
<img src={imageSource} alt={illustration + " Illustration"} width="75%" />
|
<img src={imageSource} alt={illustration + " Illustration"} width="75%" />
|
||||||
@@ -200,9 +201,9 @@ function EmptyState({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{closable && (
|
{closable && (
|
||||||
<a className="close-button" onClick={onClose}>
|
<PlainButton className="close-button" aria-label="Close" onClick={onClose}>
|
||||||
<CloseOutlinedIcon />
|
<CloseOutlinedIcon />
|
||||||
</a>
|
</PlainButton>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -86,8 +86,13 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: color @animation-duration-slow;
|
transition: color @animation-duration-slow;
|
||||||
|
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&:focus {
|
||||||
color: @text-color;
|
color: @text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
filter: contrast(200%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class CreateGroupDialog extends React.Component {
|
|||||||
onChange={event => this.setState({ name: event.target.value })}
|
onChange={event => this.setState({ name: event.target.value })}
|
||||||
onPressEnter={() => this.save()}
|
onPressEnter={() => this.save()}
|
||||||
placeholder="Group Name"
|
placeholder="Group Name"
|
||||||
|
aria-label="Group name"
|
||||||
autoFocus
|
autoFocus
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from "react";
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import Button from "antd/lib/button";
|
import Button from "antd/lib/button";
|
||||||
import Modal from "antd/lib/modal";
|
import Modal from "antd/lib/modal";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import notification from "@/services/notification";
|
import notification from "@/services/notification";
|
||||||
import Group from "@/services/group";
|
import Group from "@/services/group";
|
||||||
|
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ export default function DetailsPageSidebar({
|
|||||||
<Sidebar.Menu items={items} selected={controller.params.currentPage} />
|
<Sidebar.Menu items={items} selected={controller.params.currentPage} />
|
||||||
{canAddMembers && (
|
{canAddMembers && (
|
||||||
<Button className="w-100 m-t-5" type="primary" onClick={onAddMembersClick}>
|
<Button className="w-100 m-t-5" type="primary" onClick={onAddMembersClick}>
|
||||||
<i className="fa fa-plus m-r-5" />
|
<i className="fa fa-plus m-r-5" aria-hidden="true" />
|
||||||
Add Members
|
Add Members
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{canAddDataSources && (
|
{canAddDataSources && (
|
||||||
<Button className="w-100 m-t-5" type="primary" onClick={onAddDataSourcesClick}>
|
<Button className="w-100 m-t-5" type="primary" onClick={onAddDataSourcesClick}>
|
||||||
<i className="fa fa-plus m-r-5" />
|
<i className="fa fa-plus m-r-5" aria-hidden="true" />
|
||||||
Add Data Sources
|
Add Data Sources
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,19 +1,38 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
|
|
||||||
export default function ListItemAddon({ isSelected, isStaged, alreadyInGroup, deselectedIcon }) {
|
export default function ListItemAddon({ isSelected, isStaged, alreadyInGroup, deselectedIcon }) {
|
||||||
if (isStaged) {
|
if (isStaged) {
|
||||||
return <i className="fa fa-remove" />;
|
return (
|
||||||
|
<>
|
||||||
|
<i className="fa fa-remove" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Remove</span>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (alreadyInGroup) {
|
if (alreadyInGroup) {
|
||||||
return (
|
return (
|
||||||
<Tooltip title="Already selected">
|
<Tooltip title="Already selected">
|
||||||
<i className="fa fa-check" />
|
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
|
||||||
|
<span tabIndex={0}>
|
||||||
|
<i className="fa fa-check" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Already selected</span>
|
||||||
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return isSelected ? <i className="fa fa-check" /> : <i className={`fa ${deselectedIcon}`} />;
|
return isSelected ? (
|
||||||
|
<>
|
||||||
|
<i className="fa fa-check" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Selected</span>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<i className={`fa ${deselectedIcon}`} aria-hidden="true" />
|
||||||
|
<span className="sr-only">Select</span>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ListItemAddon.propTypes = {
|
ListItemAddon.propTypes = {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import TagsList from "@/components/TagsList";
|
|||||||
SearchInput
|
SearchInput
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export function SearchInput({ placeholder, value, showIcon, onChange }) {
|
export function SearchInput({ placeholder, value, showIcon, onChange, label }) {
|
||||||
const [currentValue, setCurrentValue] = useState(value);
|
const [currentValue, setCurrentValue] = useState(value);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -29,21 +29,29 @@ export function SearchInput({ placeholder, value, showIcon, onChange }) {
|
|||||||
const InputControl = showIcon ? Input.Search : Input;
|
const InputControl = showIcon ? Input.Search : Input;
|
||||||
return (
|
return (
|
||||||
<div className="m-b-10">
|
<div className="m-b-10">
|
||||||
<InputControl className="form-control" placeholder={placeholder} value={currentValue} onChange={onInputChange} />
|
<InputControl
|
||||||
|
className="form-control"
|
||||||
|
placeholder={placeholder}
|
||||||
|
value={currentValue}
|
||||||
|
aria-label={label}
|
||||||
|
onChange={onInputChange}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchInput.propTypes = {
|
SearchInput.propTypes = {
|
||||||
placeholder: PropTypes.string,
|
|
||||||
value: PropTypes.string.isRequired,
|
value: PropTypes.string.isRequired,
|
||||||
|
placeholder: PropTypes.string,
|
||||||
showIcon: PropTypes.bool,
|
showIcon: PropTypes.bool,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
|
label: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
SearchInput.defaultProps = {
|
SearchInput.defaultProps = {
|
||||||
placeholder: "Search...",
|
placeholder: "Search...",
|
||||||
showIcon: false,
|
showIcon: false,
|
||||||
|
label: "Search",
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -62,7 +70,7 @@ export function Menu({ items, selected }) {
|
|||||||
<AntdMenu.Item key={item.key} className="m-0">
|
<AntdMenu.Item key={item.key} className="m-0">
|
||||||
<Link href={item.href}>
|
<Link href={item.href}>
|
||||||
{isString(item.icon) && item.icon !== "" && (
|
{isString(item.icon) && item.icon !== "" && (
|
||||||
<span className="btn-favourite m-r-5">
|
<span className="btn-favorite m-r-5">
|
||||||
<i className={item.icon} aria-hidden="true" />
|
<i className={item.icon} aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@@ -100,7 +108,7 @@ Menu.defaultProps = {
|
|||||||
|
|
||||||
export function MenuIcon({ icon }) {
|
export function MenuIcon({ icon }) {
|
||||||
return (
|
return (
|
||||||
<span className="btn-favourite m-r-5">
|
<span className="btn-favorite m-r-5">
|
||||||
<i className={icon} aria-hidden="true" />
|
<i className={icon} aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import Modal from "antd/lib/modal";
|
|||||||
import Input from "antd/lib/input";
|
import Input from "antd/lib/input";
|
||||||
import List from "antd/lib/list";
|
import List from "antd/lib/list";
|
||||||
import Link from "@/components/Link";
|
import Link from "@/components/Link";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
||||||
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
||||||
import { QueryTagsControl } from "@/components/tags-control/TagsControl";
|
import { QueryTagsControl } from "@/components/tags-control/TagsControl";
|
||||||
@@ -89,7 +90,9 @@ function AddToDashboardDialog({ dialog, visualization }) {
|
|||||||
value={searchTerm}
|
value={searchTerm}
|
||||||
onChange={event => setSearchTerm(event.target.value)}
|
onChange={event => setSearchTerm(event.target.value)}
|
||||||
suffix={
|
suffix={
|
||||||
<CloseOutlinedIcon className={searchTerm === "" ? "hidden" : null} onClick={() => setSearchTerm("")} />
|
<PlainButton className={searchTerm === "" ? "hidden" : null} onClick={() => setSearchTerm("")}>
|
||||||
|
<CloseOutlinedIcon />
|
||||||
|
</PlainButton>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -104,7 +107,15 @@ function AddToDashboardDialog({ dialog, visualization }) {
|
|||||||
renderItem={d => (
|
renderItem={d => (
|
||||||
<List.Item
|
<List.Item
|
||||||
key={`dashboard-${d.id}`}
|
key={`dashboard-${d.id}`}
|
||||||
actions={selectedDashboard ? [<CloseOutlinedIcon onClick={() => setSelectedDashboard(null)} />] : []}
|
actions={
|
||||||
|
selectedDashboard
|
||||||
|
? [
|
||||||
|
<PlainButton onClick={() => setSelectedDashboard(null)}>
|
||||||
|
<CloseOutlinedIcon />
|
||||||
|
</PlainButton>,
|
||||||
|
]
|
||||||
|
: []
|
||||||
|
}
|
||||||
onClick={selectedDashboard ? null : () => setSelectedDashboard(d)}>
|
onClick={selectedDashboard ? null : () => setSelectedDashboard(d)}>
|
||||||
<div className="add-to-dashboard-dialog-item-content">
|
<div className="add-to-dashboard-dialog-item-content">
|
||||||
{d.name}
|
{d.name}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import CodeBlock from "@/components/CodeBlock";
|
|||||||
import { axios } from "@/services/axios";
|
import { axios } from "@/services/axios";
|
||||||
import { clientConfig } from "@/services/auth";
|
import { clientConfig } from "@/services/auth";
|
||||||
import notification from "@/services/notification";
|
import notification from "@/services/notification";
|
||||||
|
import { useUniqueId } from "@/lib/hooks/useUniqueId";
|
||||||
|
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
import { policy } from "@/services/policy";
|
import { policy } from "@/services/policy";
|
||||||
@@ -39,13 +40,16 @@ function ApiKeyDialog({ dialog, ...props }) {
|
|||||||
[query.id, query.api_key]
|
[query.id, query.api_key]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const csvResultsLabelId = useUniqueId("csv-results-label");
|
||||||
|
const jsonResultsLabelId = useUniqueId("json-results-label");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal {...dialog.props} width={600} footer={<Button onClick={() => dialog.close(query)}>Close</Button>}>
|
<Modal {...dialog.props} width={600} footer={<Button onClick={() => dialog.close(query)}>Close</Button>}>
|
||||||
<div className="query-api-key-dialog-wrapper">
|
<div className="query-api-key-dialog-wrapper">
|
||||||
<h5>API Key</h5>
|
<h5>API Key</h5>
|
||||||
<div className="m-b-20">
|
<div className="m-b-20">
|
||||||
<Input.Group compact>
|
<Input.Group compact>
|
||||||
<Input readOnly value={query.api_key} />
|
<Input readOnly value={query.api_key} aria-label="Query API Key" />
|
||||||
{policy.canEdit(query) && (
|
{policy.canEdit(query) && (
|
||||||
<Button disabled={updatingApiKey} loading={updatingApiKey} onClick={regenerateQueryApiKey}>
|
<Button disabled={updatingApiKey} loading={updatingApiKey} onClick={regenerateQueryApiKey}>
|
||||||
Regenerate
|
Regenerate
|
||||||
@@ -56,12 +60,16 @@ function ApiKeyDialog({ dialog, ...props }) {
|
|||||||
|
|
||||||
<h5>Example API Calls:</h5>
|
<h5>Example API Calls:</h5>
|
||||||
<div className="m-b-10">
|
<div className="m-b-10">
|
||||||
<label>Results in CSV format:</label>
|
<span id={csvResultsLabelId}>Results in CSV format:</span>
|
||||||
<CodeBlock copyable>{csvUrl}</CodeBlock>
|
<CodeBlock aria-labelledby={csvResultsLabelId} copyable>
|
||||||
|
{csvUrl}
|
||||||
|
</CodeBlock>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label>Results in JSON format:</label>
|
<span id={jsonResultsLabelId}>Results in JSON format:</span>
|
||||||
<CodeBlock copyable>{jsonUrl}</CodeBlock>
|
<CodeBlock aria-labelledby={jsonResultsLabelId} copyable>
|
||||||
|
{jsonUrl}
|
||||||
|
</CodeBlock>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { uniqueId } from "lodash";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import Alert from "antd/lib/alert";
|
import Alert from "antd/lib/alert";
|
||||||
@@ -9,6 +10,7 @@ import Modal from "antd/lib/modal";
|
|||||||
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
||||||
import { clientConfig } from "@/services/auth";
|
import { clientConfig } from "@/services/auth";
|
||||||
import CodeBlock from "@/components/CodeBlock";
|
import CodeBlock from "@/components/CodeBlock";
|
||||||
|
|
||||||
import "./EmbedQueryDialog.less";
|
import "./EmbedQueryDialog.less";
|
||||||
|
|
||||||
class EmbedQueryDialog extends React.Component {
|
class EmbedQueryDialog extends React.Component {
|
||||||
@@ -36,6 +38,9 @@ class EmbedQueryDialog extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
urlEmbedLabelId = uniqueId("url-embed-label");
|
||||||
|
iframeEmbedLabelId = uniqueId("iframe-embed-label");
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { query, dialog } = this.props;
|
const { query, dialog } = this.props;
|
||||||
const { enableChangeIframeSize, iframeWidth, iframeHeight } = this.state;
|
const { enableChangeIframeSize, iframeWidth, iframeHeight } = this.state;
|
||||||
@@ -48,15 +53,19 @@ class EmbedQueryDialog extends React.Component {
|
|||||||
footer={<Button onClick={dialog.dismiss}>Close</Button>}>
|
footer={<Button onClick={dialog.dismiss}>Close</Button>}>
|
||||||
{query.is_safe ? (
|
{query.is_safe ? (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<h5 className="m-t-0">Public URL</h5>
|
<h5 id={this.urlEmbedLabelId} className="m-t-0">
|
||||||
|
Public URL
|
||||||
|
</h5>
|
||||||
<div className="m-b-30">
|
<div className="m-b-30">
|
||||||
<CodeBlock data-test="EmbedIframe" copyable>
|
<CodeBlock aria-labelledby={this.urlEmbedLabelId} data-test="EmbedIframe" copyable>
|
||||||
{this.embedUrl}
|
{this.embedUrl}
|
||||||
</CodeBlock>
|
</CodeBlock>
|
||||||
</div>
|
</div>
|
||||||
<h5 className="m-t-0">IFrame Embed</h5>
|
<h5 id={this.iframeEmbedLabelId} className="m-t-0">
|
||||||
|
IFrame Embed
|
||||||
|
</h5>
|
||||||
<div>
|
<div>
|
||||||
<CodeBlock copyable>
|
<CodeBlock aria-labelledby={this.iframeEmbedLabelId} copyable>
|
||||||
{`<iframe src="${this.embedUrl}" width="${iframeWidth}" height="${iframeHeight}"></iframe>`}
|
{`<iframe src="${this.embedUrl}" width="${iframeWidth}" height="${iframeHeight}"></iframe>`}
|
||||||
</CodeBlock>
|
</CodeBlock>
|
||||||
<Form className="m-t-10" layout="inline">
|
<Form className="m-t-10" layout="inline">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { useCallback } from "react";
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import recordEvent from "@/services/recordEvent";
|
import recordEvent from "@/services/recordEvent";
|
||||||
import Checkbox from "antd/lib/checkbox";
|
import Checkbox from "antd/lib/checkbox";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
|
|
||||||
export default function AutoLimitCheckbox({ available, checked, onChange }) {
|
export default function AutoLimitCheckbox({ available, checked, onChange }) {
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useCallback } from "react";
|
import React, { useCallback } from "react";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import Button from "antd/lib/button";
|
import Button from "antd/lib/button";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import "@/redash-font/style.less";
|
import "@/redash-font/style.less";
|
||||||
@@ -25,8 +25,12 @@ export default function AutocompleteToggle({ available, enabled, onToggle }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip placement="top" title={tooltipMessage}>
|
<Tooltip placement="top" title={tooltipMessage}>
|
||||||
<Button className="query-editor-controls-button m-r-5" disabled={!available} onClick={handleClick}>
|
<Button
|
||||||
<i className={"icon " + icon} />
|
className="query-editor-controls-button m-r-5"
|
||||||
|
disabled={!available}
|
||||||
|
onClick={handleClick}
|
||||||
|
aria-label={enabled ? "Disable live autocomplete" : "Enable live autocomplete"}>
|
||||||
|
<i className={"icon " + icon} aria-hidden="true" />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { isFunction, map, filter, fromPairs, noop } from "lodash";
|
import { isFunction, map, filter, fromPairs, noop } from "lodash";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import Button from "antd/lib/button";
|
import Button from "antd/lib/button";
|
||||||
import Select from "antd/lib/select";
|
import Select from "antd/lib/select";
|
||||||
import KeyboardShortcuts, { humanReadableShortcut } from "@/services/KeyboardShortcuts";
|
import KeyboardShortcuts, { humanReadableShortcut } from "@/services/KeyboardShortcuts";
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React, { useEffect, useMemo, useState, useCallback, useImperativeHandle }
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import cx from "classnames";
|
import cx from "classnames";
|
||||||
import { AceEditor, snippetsModule, updateSchemaCompleter } from "./ace";
|
import { AceEditor, snippetsModule, updateSchemaCompleter } from "./ace";
|
||||||
|
import { srNotify } from "@/lib/accessibility";
|
||||||
import { SchemaItemType } from "@/components/queries/SchemaBrowser";
|
import { SchemaItemType } from "@/components/queries/SchemaBrowser";
|
||||||
import resizeObserver from "@/services/resizeObserver";
|
import resizeObserver from "@/services/resizeObserver";
|
||||||
import QuerySnippet from "@/services/query-snippet";
|
import QuerySnippet from "@/services/query-snippet";
|
||||||
@@ -89,6 +90,25 @@ const QueryEditor = React.forwardRef(function(
|
|||||||
// Lineup only mac
|
// Lineup only mac
|
||||||
editor.commands.bindKey({ win: null, mac: "Ctrl+P" }, "golineup");
|
editor.commands.bindKey({ win: null, mac: "Ctrl+P" }, "golineup");
|
||||||
|
|
||||||
|
// Esc for exiting
|
||||||
|
editor.commands.bindKey({ win: "Esc", mac: "Esc" }, () => {
|
||||||
|
editor.blur();
|
||||||
|
});
|
||||||
|
|
||||||
|
let notificationCleanup = null;
|
||||||
|
editor.on("focus", () => {
|
||||||
|
notificationCleanup = srNotify({
|
||||||
|
text: "You've entered the SQL editor. To exit press the ESC key.",
|
||||||
|
politeness: "assertive",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.on("blur", () => {
|
||||||
|
if (notificationCleanup) {
|
||||||
|
notificationCleanup();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Reset Completer in case dot is pressed
|
// Reset Completer in case dot is pressed
|
||||||
editor.commands.on("afterExec", e => {
|
editor.commands.on("afterExec", e => {
|
||||||
if (e.command.name === "insertstring" && e.args === "." && editor.completer) {
|
if (e.command.name === "insertstring" && e.args === "." && editor.completer) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
import { localizeTime, durationHumanize } from "@/lib/utils";
|
import { localizeTime, durationHumanize } from "@/lib/utils";
|
||||||
import { RefreshScheduleType, RefreshScheduleDefault } from "../proptypes";
|
import { RefreshScheduleType, RefreshScheduleDefault } from "../proptypes";
|
||||||
|
|
||||||
@@ -51,9 +52,9 @@ export default class SchedulePhrase extends React.Component {
|
|||||||
const content = full ? <Tooltip title={full}>{short}</Tooltip> : short;
|
const content = full ? <Tooltip title={full}>{short}</Tooltip> : short;
|
||||||
|
|
||||||
return this.props.isLink ? (
|
return this.props.isLink ? (
|
||||||
<a className="schedule-phrase" onClick={this.props.onClick} data-test="EditSchedule">
|
<PlainButton type="link" className="schedule-phrase" onClick={this.props.onClick} data-test="EditSchedule">
|
||||||
{content}
|
{content}
|
||||||
</a>
|
</PlainButton>
|
||||||
) : (
|
) : (
|
||||||
content
|
content
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ import PropTypes from "prop-types";
|
|||||||
import { useDebouncedCallback } from "use-debounce";
|
import { useDebouncedCallback } from "use-debounce";
|
||||||
import Input from "antd/lib/input";
|
import Input from "antd/lib/input";
|
||||||
import Button from "antd/lib/button";
|
import Button from "antd/lib/button";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
|
||||||
import AutoSizer from "react-virtualized/dist/commonjs/AutoSizer";
|
import AutoSizer from "react-virtualized/dist/commonjs/AutoSizer";
|
||||||
import List from "react-virtualized/dist/commonjs/List";
|
import List from "react-virtualized/dist/commonjs/List";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
|
import Tooltip from "@/components/Tooltip";
|
||||||
import useDataSourceSchema from "@/pages/queries/hooks/useDataSourceSchema";
|
import useDataSourceSchema from "@/pages/queries/hooks/useDataSourceSchema";
|
||||||
import useImmutableCallback from "@/lib/hooks/useImmutableCallback";
|
import useImmutableCallback from "@/lib/hooks/useImmutableCallback";
|
||||||
import LoadingState from "../items-list/components/LoadingState";
|
import LoadingState from "../items-list/components/LoadingState";
|
||||||
@@ -45,23 +46,27 @@ function SchemaItem({ item, expanded, onToggle, onSelect, ...props }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div {...props}>
|
<div {...props}>
|
||||||
<div className="table-name" onClick={onToggle}>
|
<div className="schema-list-item">
|
||||||
<i className="fa fa-table m-r-5" />
|
<PlainButton className="table-name" onClick={onToggle}>
|
||||||
<strong>
|
<i className="fa fa-table m-r-5" aria-hidden="true" />
|
||||||
<span title={item.name}>{tableDisplayName}</span>
|
<strong>
|
||||||
{!isNil(item.size) && <span> ({item.size})</span>}
|
<span title={item.name}>{tableDisplayName}</span>
|
||||||
</strong>
|
{!isNil(item.size) && <span> ({item.size})</span>}
|
||||||
|
</strong>
|
||||||
<Tooltip title="Insert table name into query text" mouseEnterDelay={0} mouseLeaveDelay={0}>
|
</PlainButton>
|
||||||
<i
|
<Tooltip
|
||||||
className="fa fa-angle-double-right copy-to-editor"
|
title="Insert table name into query text"
|
||||||
aria-hidden="true"
|
mouseEnterDelay={0}
|
||||||
onClick={e => handleSelect(e, item.name)}
|
mouseLeaveDelay={0}
|
||||||
/>
|
placement="topRight"
|
||||||
|
arrowPointAtCenter>
|
||||||
|
<PlainButton className="copy-to-editor" onClick={e => handleSelect(e, item.name)}>
|
||||||
|
<i className="fa fa-angle-double-right" aria-hidden="true" />
|
||||||
|
</PlainButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
{expanded && (
|
{expanded && (
|
||||||
<div>
|
<div className="table-open">
|
||||||
{item.loading ? (
|
{item.loading ? (
|
||||||
<div className="table-open">Loading...</div>
|
<div className="table-open">Loading...</div>
|
||||||
) : (
|
) : (
|
||||||
@@ -69,16 +74,21 @@ function SchemaItem({ item, expanded, onToggle, onSelect, ...props }) {
|
|||||||
const columnName = get(column, "name");
|
const columnName = get(column, "name");
|
||||||
const columnType = get(column, "type");
|
const columnType = get(column, "type");
|
||||||
return (
|
return (
|
||||||
<div key={columnName} className="table-open">
|
<Tooltip
|
||||||
{columnName} {columnType && <span className="column-type">{columnType}</span>}
|
title="Insert column name into query text"
|
||||||
<Tooltip title="Insert column name into query text" mouseEnterDelay={0} mouseLeaveDelay={0}>
|
mouseEnterDelay={0}
|
||||||
<i
|
mouseLeaveDelay={0}
|
||||||
className="fa fa-angle-double-right copy-to-editor"
|
placement="rightTop">
|
||||||
aria-hidden="true"
|
<PlainButton key={columnName} className="table-open-item" onClick={e => handleSelect(e, columnName)}>
|
||||||
onClick={e => handleSelect(e, columnName)}
|
<div>
|
||||||
/>
|
{columnName} {columnType && <span className="column-type">{columnType}</span>}
|
||||||
</Tooltip>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div className="copy-to-editor">
|
||||||
|
<i className="fa fa-angle-double-right" aria-hidden="true" />
|
||||||
|
</div>
|
||||||
|
</PlainButton>
|
||||||
|
</Tooltip>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
)}
|
)}
|
||||||
@@ -231,13 +241,15 @@ export default function SchemaBrowser({
|
|||||||
<Input
|
<Input
|
||||||
className="m-r-5"
|
className="m-r-5"
|
||||||
placeholder="Search schema..."
|
placeholder="Search schema..."
|
||||||
|
aria-label="Search schema"
|
||||||
disabled={schema.length === 0}
|
disabled={schema.length === 0}
|
||||||
onChange={event => handleFilterChange(event.target.value)}
|
onChange={event => handleFilterChange(event.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Tooltip title="Refresh Schema">
|
<Tooltip title="Refresh Schema">
|
||||||
<Button onClick={() => refreshSchema(true)}>
|
<Button onClick={() => refreshSchema(true)}>
|
||||||
<i className={cx("zmdi zmdi-refresh", { "zmdi-hc-spin": isLoading })} />
|
<i className={cx("zmdi zmdi-refresh", { "zmdi-hc-spin": isLoading })} aria-hidden="true" />
|
||||||
|
<span className="sr-only">{isLoading ? "Loading, please wait." : "Press to refresh."}</span>
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import Button from "antd/lib/button";
|
|||||||
import SyncOutlinedIcon from "@ant-design/icons/SyncOutlined";
|
import SyncOutlinedIcon from "@ant-design/icons/SyncOutlined";
|
||||||
import Input from "antd/lib/input";
|
import Input from "antd/lib/input";
|
||||||
import Select from "antd/lib/select";
|
import Select from "antd/lib/select";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import { SchemaList, applyFilterOnSchema } from "@/components/queries/SchemaBrowser";
|
import { SchemaList, applyFilterOnSchema } from "@/components/queries/SchemaBrowser";
|
||||||
import useImmutableCallback from "@/lib/hooks/useImmutableCallback";
|
import useImmutableCallback from "@/lib/hooks/useImmutableCallback";
|
||||||
import useDatabricksSchema from "./useDatabricksSchema";
|
import useDatabricksSchema from "./useDatabricksSchema";
|
||||||
@@ -84,6 +84,7 @@ export default function DatabricksSchemaBrowser({
|
|||||||
<Input
|
<Input
|
||||||
className={isDatabaseSelectOpen ? "database-select-open" : ""}
|
className={isDatabaseSelectOpen ? "database-select-open" : ""}
|
||||||
placeholder="Filter tables & columns..."
|
placeholder="Filter tables & columns..."
|
||||||
|
aria-label="Search schema"
|
||||||
disabled={loadingDatabases || loadingSchema}
|
disabled={loadingDatabases || loadingSchema}
|
||||||
onChange={event => handleFilterChange(event.target.value)}
|
onChange={event => handleFilterChange(event.target.value)}
|
||||||
addonBefore={
|
addonBefore={
|
||||||
@@ -98,12 +99,12 @@ export default function DatabricksSchemaBrowser({
|
|||||||
onDropdownVisibleChange={setIsDatabaseSelectOpen}
|
onDropdownVisibleChange={setIsDatabaseSelectOpen}
|
||||||
placeholder={
|
placeholder={
|
||||||
<>
|
<>
|
||||||
<i className="fa fa-database m-r-5" /> Database
|
<i className="fa fa-database m-r-5" aria-hidden="true" /> Database
|
||||||
</>
|
</>
|
||||||
}>
|
}>
|
||||||
{filteredDatabases.map(database => (
|
{filteredDatabases.map(database => (
|
||||||
<Select.Option key={database}>
|
<Select.Option key={database}>
|
||||||
<i className="fa fa-database m-r-5" />
|
<i className="fa fa-database m-r-5" aria-hidden="true" />
|
||||||
{database}
|
{database}
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import Button from "antd/lib/button";
|
|||||||
import Modal from "antd/lib/modal";
|
import Modal from "antd/lib/modal";
|
||||||
import DynamicForm from "@/components/dynamic-form/DynamicForm";
|
import DynamicForm from "@/components/dynamic-form/DynamicForm";
|
||||||
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
|
||||||
|
import { useUniqueId } from "@/lib/hooks/useUniqueId";
|
||||||
|
|
||||||
function QuerySnippetDialog({ querySnippet, dialog, readOnly }) {
|
function QuerySnippetDialog({ querySnippet, dialog, readOnly }) {
|
||||||
const handleSubmit = useCallback(
|
const handleSubmit = useCallback(
|
||||||
@@ -31,6 +32,8 @@ function QuerySnippetDialog({ querySnippet, dialog, readOnly }) {
|
|||||||
{ name: "snippet", title: "Snippet", type: "ace", required: true },
|
{ name: "snippet", title: "Snippet", type: "ace", required: true },
|
||||||
].map(field => ({ ...field, readOnly, initialValue: get(querySnippet, field.name, "") }));
|
].map(field => ({ ...field, readOnly, initialValue: get(querySnippet, field.name, "") }));
|
||||||
|
|
||||||
|
const querySnippetsFormId = useUniqueId("querySnippetForm");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
{...dialog.props}
|
{...dialog.props}
|
||||||
@@ -46,7 +49,7 @@ function QuerySnippetDialog({ querySnippet, dialog, readOnly }) {
|
|||||||
disabled={readOnly || dialog.props.okButtonProps.disabled}
|
disabled={readOnly || dialog.props.okButtonProps.disabled}
|
||||||
htmlType="submit"
|
htmlType="submit"
|
||||||
type="primary"
|
type="primary"
|
||||||
form="querySnippetForm"
|
form={querySnippetsFormId}
|
||||||
data-test="SaveQuerySnippetButton">
|
data-test="SaveQuerySnippetButton">
|
||||||
{isEditing ? "Save" : "Create"}
|
{isEditing ? "Save" : "Create"}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -55,7 +58,13 @@ function QuerySnippetDialog({ querySnippet, dialog, readOnly }) {
|
|||||||
wrapProps={{
|
wrapProps={{
|
||||||
"data-test": "QuerySnippetDialog",
|
"data-test": "QuerySnippetDialog",
|
||||||
}}>
|
}}>
|
||||||
<DynamicForm id="querySnippetForm" fields={formFields} onSubmit={handleSubmit} hideSubmitButton feedbackIcons />
|
<DynamicForm
|
||||||
|
id={querySnippetsFormId}
|
||||||
|
fields={formFields}
|
||||||
|
onSubmit={handleSubmit}
|
||||||
|
hideSubmitButton
|
||||||
|
feedbackIcons
|
||||||
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { map, trim } from "lodash";
|
import { map, trim } from "lodash";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import EditTagsDialog from "./EditTagsDialog";
|
import EditTagsDialog from "./EditTagsDialog";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
|
|
||||||
export class TagsControl extends React.Component {
|
export class TagsControl extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@@ -34,19 +35,23 @@ export class TagsControl extends React.Component {
|
|||||||
renderEditButton() {
|
renderEditButton() {
|
||||||
const tags = map(this.props.tags, trim);
|
const tags = map(this.props.tags, trim);
|
||||||
return (
|
return (
|
||||||
<a
|
<PlainButton
|
||||||
className="label label-tag hidden-xs"
|
className="label label-tag hidden-xs"
|
||||||
role="none"
|
|
||||||
onClick={() => this.editTags(tags, this.props.getAvailableTags)}
|
onClick={() => this.editTags(tags, this.props.getAvailableTags)}
|
||||||
data-test="EditTagsButton">
|
data-test="EditTagsButton">
|
||||||
{tags.length === 0 && (
|
{tags.length === 0 && (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<i className="zmdi zmdi-plus m-r-5" />
|
<i className="zmdi zmdi-plus m-r-5" aria-hidden="true" />
|
||||||
Add tag
|
Add tag
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)}
|
)}
|
||||||
{tags.length > 0 && <i className="zmdi zmdi-edit" />}
|
{tags.length > 0 && (
|
||||||
</a>
|
<>
|
||||||
|
<i className="zmdi zmdi-edit" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Edit</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</PlainButton>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import notification from "@/services/notification";
|
|||||||
import Visualization from "@/services/visualization";
|
import Visualization from "@/services/visualization";
|
||||||
import recordEvent from "@/services/recordEvent";
|
import recordEvent from "@/services/recordEvent";
|
||||||
import useQueryResultData from "@/lib/useQueryResultData";
|
import useQueryResultData from "@/lib/useQueryResultData";
|
||||||
|
import { useUniqueId } from "@/lib/hooks/useUniqueId";
|
||||||
import {
|
import {
|
||||||
registeredVisualizations,
|
registeredVisualizations,
|
||||||
getDefaultVisualization,
|
getDefaultVisualization,
|
||||||
@@ -156,6 +157,9 @@ function EditVisualizationDialog({ dialog, visualization, query, queryResult })
|
|||||||
? filter(sortBy(registeredVisualizations, ["name"]), vis => !vis.isDeprecated)
|
? filter(sortBy(registeredVisualizations, ["name"]), vis => !vis.isDeprecated)
|
||||||
: pick(registeredVisualizations, [type]);
|
: pick(registeredVisualizations, [type]);
|
||||||
|
|
||||||
|
const vizTypeId = useUniqueId("visualization-type");
|
||||||
|
const vizNameId = useUniqueId("visualization-name");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
{...dialog.props}
|
{...dialog.props}
|
||||||
@@ -172,10 +176,10 @@ function EditVisualizationDialog({ dialog, visualization, query, queryResult })
|
|||||||
<div className="edit-visualization-dialog">
|
<div className="edit-visualization-dialog">
|
||||||
<div className="visualization-settings">
|
<div className="visualization-settings">
|
||||||
<div className="m-b-15">
|
<div className="m-b-15">
|
||||||
<label htmlFor="visualization-type">Visualization Type</label>
|
<label htmlFor={vizTypeId}>Visualization Type</label>
|
||||||
<Select
|
<Select
|
||||||
data-test="VisualizationType"
|
data-test="VisualizationType"
|
||||||
id="visualization-type"
|
id={vizTypeId}
|
||||||
className="w-100"
|
className="w-100"
|
||||||
disabled={!isNew}
|
disabled={!isNew}
|
||||||
value={type}
|
value={type}
|
||||||
@@ -188,10 +192,10 @@ function EditVisualizationDialog({ dialog, visualization, query, queryResult })
|
|||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
<div className="m-b-15">
|
<div className="m-b-15">
|
||||||
<label htmlFor="visualization-name">Visualization Name</label>
|
<label htmlFor={vizNameId}>Visualization Name</label>
|
||||||
<Input
|
<Input
|
||||||
data-test="VisualizationName"
|
data-test="VisualizationName"
|
||||||
id="visualization-name"
|
id={vizNameId}
|
||||||
className="w-100"
|
className="w-100"
|
||||||
value={name}
|
value={name}
|
||||||
onChange={event => onNameChanged(event.target.value)}
|
onChange={event => onNameChanged(event.target.value)}
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import Spin from "antd/lib/spin";
|
import Spin from "antd/lib/spin";
|
||||||
|
|
||||||
Spin.setDefaultIndicator(<i className="fa fa-spinner fa-pulse" />);
|
Spin.setDefaultIndicator(
|
||||||
|
<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>
|
||||||
|
);
|
||||||
|
|||||||
45
client/app/lib/accessibility.ts
Normal file
45
client/app/lib/accessibility.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import { HTMLAttributes } from "react";
|
||||||
|
|
||||||
|
interface SrNotifyProps {
|
||||||
|
text: string;
|
||||||
|
expiry: number;
|
||||||
|
container: HTMLElement;
|
||||||
|
politeness: HTMLAttributes<HTMLDivElement>["aria-live"];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function srNotify({ text, expiry = 1000, container = document.body, politeness = "polite" }: SrNotifyProps) {
|
||||||
|
const element = document.createElement("div");
|
||||||
|
const id = `speak-${Date.now()}`;
|
||||||
|
|
||||||
|
element.id = id;
|
||||||
|
element.className = "sr-only";
|
||||||
|
element.textContent = text;
|
||||||
|
|
||||||
|
element.setAttribute("role", "alert");
|
||||||
|
element.setAttribute("aria-live", politeness);
|
||||||
|
|
||||||
|
container.appendChild(element);
|
||||||
|
|
||||||
|
let timer: null | number = null;
|
||||||
|
let isDone = false;
|
||||||
|
const cleanupFn = () => {
|
||||||
|
if (isDone) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isDone = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
container.removeChild(element);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (timer) {
|
||||||
|
window.clearTimeout(timer);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
timer = window.setTimeout(cleanupFn, expiry);
|
||||||
|
|
||||||
|
return cleanupFn;
|
||||||
|
}
|
||||||
11
client/app/lib/hooks/useLazyRef.ts
Normal file
11
client/app/lib/hooks/useLazyRef.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { useRef } from "react";
|
||||||
|
|
||||||
|
export function useLazyRef<T>(getInitialValue: () => T) {
|
||||||
|
const lazyRef = useRef<T>(null) as React.MutableRefObject<T>;
|
||||||
|
|
||||||
|
if (lazyRef.current === null) {
|
||||||
|
lazyRef.current = getInitialValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
return lazyRef;
|
||||||
|
}
|
||||||
7
client/app/lib/hooks/useUniqueId.ts
Normal file
7
client/app/lib/hooks/useUniqueId.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { uniqueId } from "lodash";
|
||||||
|
import { useLazyRef } from "./useLazyRef";
|
||||||
|
|
||||||
|
export function useUniqueId(prefix: string) {
|
||||||
|
const { current: id } = useLazyRef(() => uniqueId(prefix));
|
||||||
|
return id;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { map } from "lodash";
|
import { map, uniqueId } from "lodash";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import Switch from "antd/lib/switch";
|
import Switch from "antd/lib/switch";
|
||||||
@@ -70,6 +70,7 @@ class OutdatedQueries extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_updateTimer = null;
|
_updateTimer = null;
|
||||||
|
autoUpdateSwitchId = uniqueId("auto-update-switch");
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
recordEvent("view", "page", "admin/queries/outdated");
|
recordEvent("view", "page", "admin/queries/outdated");
|
||||||
@@ -93,11 +94,11 @@ class OutdatedQueries extends React.Component {
|
|||||||
<Layout activeTab={controller.params.currentPage}>
|
<Layout activeTab={controller.params.currentPage}>
|
||||||
<div className="m-15">
|
<div className="m-15">
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="auto-update-switch" className="m-0">
|
<label htmlFor={this.autoUpdateSwitchId} className="m-0">
|
||||||
Auto update
|
Auto update
|
||||||
</label>
|
</label>
|
||||||
<Switch
|
<Switch
|
||||||
id="auto-update-switch"
|
id={this.autoUpdateSwitchId}
|
||||||
className="m-l-10"
|
className="m-l-10"
|
||||||
checked={this.state.autoUpdate}
|
checked={this.state.autoUpdate}
|
||||||
onChange={autoUpdate => this.setState({ autoUpdate })}
|
onChange={autoUpdate => this.setState({ autoUpdate })}
|
||||||
|
|||||||
@@ -55,11 +55,20 @@ export default class AlertEdit extends React.Component {
|
|||||||
<Title name={name} alert={alert} onChange={onNameChange} editMode>
|
<Title name={name} alert={alert} onChange={onNameChange} editMode>
|
||||||
<DynamicComponent name="AlertEdit.HeaderExtra" alert={alert} />
|
<DynamicComponent name="AlertEdit.HeaderExtra" alert={alert} />
|
||||||
<Button className="m-r-5" onClick={() => this.cancel()}>
|
<Button className="m-r-5" onClick={() => this.cancel()}>
|
||||||
<i className="fa fa-times m-r-5" />
|
<i className="fa fa-times m-r-5" aria-hidden="true" />
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="primary" onClick={() => this.save()}>
|
<Button type="primary" onClick={() => this.save()}>
|
||||||
{saving ? <i className="fa fa-spinner fa-pulse m-r-5" /> : <i className="fa fa-check m-r-5" />}
|
{saving ? (
|
||||||
|
<span role="status" aria-live="polite" aria-relevant="additions removals">
|
||||||
|
<i className="fa fa-spinner fa-pulse m-r-5" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Saving...</span>
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<i className="fa fa-check m-r-5" aria-hidden="true" />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
Save Changes
|
Save Changes
|
||||||
</Button>
|
</Button>
|
||||||
{menuButton}
|
{menuButton}
|
||||||
@@ -101,7 +110,8 @@ export default class AlertEdit extends React.Component {
|
|||||||
</Form>
|
</Form>
|
||||||
<div>
|
<div>
|
||||||
<HelpTrigger className="f-13" type="ALERT_SETUP">
|
<HelpTrigger className="f-13" type="ALERT_SETUP">
|
||||||
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>
|
</HelpTrigger>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -76,13 +76,19 @@ export default class AlertNew extends React.Component {
|
|||||||
)}
|
)}
|
||||||
<HorizontalFormItem>
|
<HorizontalFormItem>
|
||||||
<Button type="primary" onClick={this.save} disabled={!query} className="btn-create-alert">
|
<Button type="primary" onClick={this.save} disabled={!query} className="btn-create-alert">
|
||||||
{saving && <i className="fa fa-spinner fa-pulse m-r-5" />}
|
{saving && (
|
||||||
|
<span role="status" aria-live="polite" aria-relevant="additions removals">
|
||||||
|
<i className="fa fa-spinner fa-pulse m-r-5" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Saving...</span>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
Create Alert
|
Create Alert
|
||||||
</Button>
|
</Button>
|
||||||
</HorizontalFormItem>
|
</HorizontalFormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<HelpTrigger className="f-13" type="ALERT_SETUP">
|
<HelpTrigger className="f-13" type="ALERT_SETUP">
|
||||||
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>
|
</HelpTrigger>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Alert as AlertType } from "@/components/proptypes";
|
|||||||
|
|
||||||
import Form from "antd/lib/form";
|
import Form from "antd/lib/form";
|
||||||
import Button from "antd/lib/button";
|
import Button from "antd/lib/button";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
import AntAlert from "antd/lib/alert";
|
import AntAlert from "antd/lib/alert";
|
||||||
import * as Grid from "antd/lib/grid";
|
import * as Grid from "antd/lib/grid";
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ export default class AlertView extends React.Component {
|
|||||||
<DynamicComponent name="AlertView.HeaderExtra" alert={alert} />
|
<DynamicComponent name="AlertView.HeaderExtra" alert={alert} />
|
||||||
<Tooltip title={canEdit ? "" : "You do not have sufficient permissions to edit this alert"}>
|
<Tooltip title={canEdit ? "" : "You do not have sufficient permissions to edit this alert"}>
|
||||||
<Button type="default" onClick={canEdit ? onEdit : null} className={cx({ disabled: !canEdit })}>
|
<Button type="default" onClick={canEdit ? onEdit : null} className={cx({ disabled: !canEdit })}>
|
||||||
<i className="fa fa-edit m-r-5" />
|
<i className="fa fa-edit m-r-5" aria-hidden="true" />
|
||||||
Edit
|
Edit
|
||||||
</Button>
|
</Button>
|
||||||
{menuButton}
|
{menuButton}
|
||||||
@@ -111,7 +111,7 @@ export default class AlertView extends React.Component {
|
|||||||
className="m-b-20"
|
className="m-b-20"
|
||||||
message={
|
message={
|
||||||
<>
|
<>
|
||||||
<i className="fa fa-bell-slash-o" /> Notifications are muted
|
<i className="fa fa-bell-slash-o" aria-hidden="true" /> Notifications are muted
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
description={
|
description={
|
||||||
@@ -140,7 +140,8 @@ export default class AlertView extends React.Component {
|
|||||||
Destinations{" "}
|
Destinations{" "}
|
||||||
<Tooltip title="Open Alert Destinations page in a new tab.">
|
<Tooltip title="Open Alert Destinations page in a new tab.">
|
||||||
<Link href="destinations" target="_blank">
|
<Link href="destinations" target="_blank">
|
||||||
<i className="fa fa-external-link f-13" />
|
<i className="fa fa-external-link f-13" aria-hidden="true" />
|
||||||
|
<span className="sr-only">(opens in a new tab)</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</h4>
|
</h4>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import React from "react";
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Link from "@/components/Link";
|
import Link from "@/components/Link";
|
||||||
|
import Button from "antd/lib/button";
|
||||||
import SelectItemsDialog from "@/components/SelectItemsDialog";
|
import SelectItemsDialog from "@/components/SelectItemsDialog";
|
||||||
import { Destination as DestinationType, UserProfile as UserType } from "@/components/proptypes";
|
import { Destination as DestinationType, UserProfile as UserType } from "@/components/proptypes";
|
||||||
|
|
||||||
@@ -12,11 +13,11 @@ import { clientConfig, currentUser } from "@/services/auth";
|
|||||||
import notification from "@/services/notification";
|
import notification from "@/services/notification";
|
||||||
import ListItemAddon from "@/components/groups/ListItemAddon";
|
import ListItemAddon from "@/components/groups/ListItemAddon";
|
||||||
import EmailSettingsWarning from "@/components/EmailSettingsWarning";
|
import EmailSettingsWarning from "@/components/EmailSettingsWarning";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
|
import Tooltip from "@/components/Tooltip";
|
||||||
|
|
||||||
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
import CloseOutlinedIcon from "@ant-design/icons/CloseOutlined";
|
||||||
import Tooltip from "antd/lib/tooltip";
|
|
||||||
import Switch from "antd/lib/switch";
|
import Switch from "antd/lib/switch";
|
||||||
import Button from "antd/lib/button";
|
|
||||||
|
|
||||||
import "./AlertDestinations.less";
|
import "./AlertDestinations.less";
|
||||||
|
|
||||||
@@ -46,7 +47,10 @@ function ListItem({ destination: { name, type }, user, unsubscribe }) {
|
|||||||
)}
|
)}
|
||||||
{canUnsubscribe && (
|
{canUnsubscribe && (
|
||||||
<Tooltip title="Remove" mouseEnterDelay={0.5}>
|
<Tooltip title="Remove" mouseEnterDelay={0.5}>
|
||||||
<CloseOutlinedIcon className="remove-button" onClick={unsubscribe} />
|
<PlainButton className="remove-button" onClick={unsubscribe}>
|
||||||
|
{/* TODO: lacks visual feedback */}
|
||||||
|
<CloseOutlinedIcon />
|
||||||
|
</PlainButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</li>
|
</li>
|
||||||
@@ -88,7 +92,7 @@ export default class AlertDestinations extends React.Component {
|
|||||||
showCount: true,
|
showCount: true,
|
||||||
extraFooterContent: (
|
extraFooterContent: (
|
||||||
<>
|
<>
|
||||||
<i className="fa fa-info-circle" /> Create new destinations in{" "}
|
<i className="fa fa-info-circle" aria-hidden="true" /> Create new destinations in{" "}
|
||||||
<Tooltip title="Opens page in a new tab.">
|
<Tooltip title="Opens page in a new tab.">
|
||||||
<Link href="destinations/new" target="_blank">
|
<Link href="destinations/new" target="_blank">
|
||||||
Alert Destinations
|
Alert Destinations
|
||||||
@@ -190,12 +194,12 @@ export default class AlertDestinations extends React.Component {
|
|||||||
size="small"
|
size="small"
|
||||||
className="add-button"
|
className="add-button"
|
||||||
onClick={this.showAddAlertSubDialog}>
|
onClick={this.showAddAlertSubDialog}>
|
||||||
<i className="fa fa-plus f-12 m-r-5" /> Add
|
<i className="fa fa-plus f-12 m-r-5" aria-hidden="true" /> Add
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<ul>
|
<ul>
|
||||||
<li className="destination-wrapper">
|
<li className="destination-wrapper">
|
||||||
<i className="destination-icon fa fa-envelope" />
|
<i className="destination-icon fa fa-envelope" aria-hidden="true" />
|
||||||
<span className="flex-fill">{currentUser.email}</span>
|
<span className="flex-fill">{currentUser.email}</span>
|
||||||
<EmailSettingsWarning className="destination-warning" featureName="alert emails" mode="icon" />
|
<EmailSettingsWarning className="destination-warning" featureName="alert emails" mode="icon" />
|
||||||
{!mailSettingsMissing && (
|
{!mailSettingsMissing && (
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default function Criteria({ columnNames, resultValues, alertOptions, onCh
|
|||||||
return (
|
return (
|
||||||
<div data-test="Criteria">
|
<div data-test="Criteria">
|
||||||
<div className="input-title">
|
<div className="input-title">
|
||||||
<span>Value column</span>
|
<span className="input-label">Value column</span>
|
||||||
{editMode ? (
|
{editMode ? (
|
||||||
<Select
|
<Select
|
||||||
value={alertOptions.column}
|
value={alertOptions.column}
|
||||||
@@ -79,7 +79,7 @@ export default function Criteria({ columnNames, resultValues, alertOptions, onCh
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="input-title">
|
<div className="input-title">
|
||||||
<span>Condition</span>
|
<span className="input-label">Condition</span>
|
||||||
{editMode ? (
|
{editMode ? (
|
||||||
<Select
|
<Select
|
||||||
value={alertOptions.op}
|
value={alertOptions.op}
|
||||||
@@ -117,9 +117,16 @@ export default function Criteria({ columnNames, resultValues, alertOptions, onCh
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="input-title">
|
<div className="input-title">
|
||||||
<span>Threshold</span>
|
<label className="input-label" htmlFor="threshold-criterion">
|
||||||
|
Threshold
|
||||||
|
</label>
|
||||||
{editMode ? (
|
{editMode ? (
|
||||||
<Input style={{ width: 90 }} value={alertOptions.value} onChange={e => onChange({ value: e.target.value })} />
|
<Input
|
||||||
|
id="threshold-criterion"
|
||||||
|
style={{ width: 90 }}
|
||||||
|
value={alertOptions.value}
|
||||||
|
onChange={e => onChange({ value: e.target.value })}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<DisabledInput minWidth={50}>{alertOptions.value}</DisabledInput>
|
<DisabledInput minWidth={50}>{alertOptions.value}</DisabledInput>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
||||||
& > span {
|
& > .input-label {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -16px;
|
top: -16px;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import Button from "antd/lib/button";
|
|||||||
|
|
||||||
import LoadingOutlinedIcon from "@ant-design/icons/LoadingOutlined";
|
import LoadingOutlinedIcon from "@ant-design/icons/LoadingOutlined";
|
||||||
import EllipsisOutlinedIcon from "@ant-design/icons/EllipsisOutlined";
|
import EllipsisOutlinedIcon from "@ant-design/icons/EllipsisOutlined";
|
||||||
|
import PlainButton from "@/components/PlainButton";
|
||||||
|
|
||||||
export default function MenuButton({ doDelete, canEdit, mute, unmute, muted }) {
|
export default function MenuButton({ doDelete, canEdit, mute, unmute, muted }) {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@@ -46,17 +47,19 @@ export default function MenuButton({ doDelete, canEdit, mute, unmute, muted }) {
|
|||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item>
|
<Menu.Item>
|
||||||
{muted ? (
|
{muted ? (
|
||||||
<a onClick={() => execute(unmute)}>Unmute Notifications</a>
|
<PlainButton onClick={() => execute(unmute)}>Unmute Notifications</PlainButton>
|
||||||
) : (
|
) : (
|
||||||
<a onClick={() => execute(mute)}>Mute Notifications</a>
|
<PlainButton onClick={() => execute(mute)}>Mute Notifications</PlainButton>
|
||||||
)}
|
)}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Item>
|
<Menu.Item>
|
||||||
<a onClick={confirmDelete}>Delete</a>
|
<PlainButton onClick={confirmDelete}>Delete</PlainButton>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
}>
|
}>
|
||||||
<Button>{loading ? <LoadingOutlinedIcon /> : <EllipsisOutlinedIcon rotate={90} />}</Button>
|
<Button aria-label="More actions">
|
||||||
|
{loading ? <LoadingOutlinedIcon /> : <EllipsisOutlinedIcon rotate={90} aria-hidden="true" />}
|
||||||
|
</Button>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,21 +80,25 @@ function NotificationTemplate({ alert, query, columnNames, resultValues, subject
|
|||||||
Preview{" "}
|
Preview{" "}
|
||||||
<Switch size="small" className="alert-template-preview" value={showPreview} onChange={setShowPreview} />
|
<Switch size="small" className="alert-template-preview" value={showPreview} onChange={setShowPreview} />
|
||||||
</div>
|
</div>
|
||||||
|
{/* TODO: consider adding real labels (not clear for sighted users as well) */}
|
||||||
<Input
|
<Input
|
||||||
value={showPreview ? render(subject) : subject}
|
value={showPreview ? render(subject) : subject}
|
||||||
|
aria-label="Subject"
|
||||||
onChange={e => setSubject(e.target.value)}
|
onChange={e => setSubject(e.target.value)}
|
||||||
disabled={showPreview}
|
disabled={showPreview}
|
||||||
data-test="CustomSubject"
|
data-test="CustomSubject"
|
||||||
/>
|
/>
|
||||||
<Input.TextArea
|
<Input.TextArea
|
||||||
value={showPreview ? render(body) : body}
|
value={showPreview ? render(body) : body}
|
||||||
|
aria-label="Body"
|
||||||
autoSize={{ minRows: 9 }}
|
autoSize={{ minRows: 9 }}
|
||||||
onChange={e => setBody(e.target.value)}
|
onChange={e => setBody(e.target.value)}
|
||||||
disabled={showPreview}
|
disabled={showPreview}
|
||||||
data-test="CustomBody"
|
data-test="CustomBody"
|
||||||
/>
|
/>
|
||||||
<HelpTrigger type="ALERT_NOTIF_TEMPLATE_GUIDE" className="f-13">
|
<HelpTrigger type="ALERT_NOTIF_TEMPLATE_GUIDE" className="f-13">
|
||||||
<i className="fa fa-question-circle" /> Formatting guide
|
<i className="fa fa-question-circle" aria-hidden="true" /> Formatting guide{" "}
|
||||||
|
<span className="sr-only">(help)</span>
|
||||||
</HelpTrigger>
|
</HelpTrigger>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import QuerySelector from "@/components/QuerySelector";
|
|||||||
import SchedulePhrase from "@/components/queries/SchedulePhrase";
|
import SchedulePhrase from "@/components/queries/SchedulePhrase";
|
||||||
import { Query as QueryType } from "@/components/proptypes";
|
import { Query as QueryType } from "@/components/proptypes";
|
||||||
|
|
||||||
import Tooltip from "antd/lib/tooltip";
|
import Tooltip from "@/components/Tooltip";
|
||||||
|
|
||||||
import WarningFilledIcon from "@ant-design/icons/WarningFilled";
|
import WarningFilledIcon from "@ant-design/icons/WarningFilled";
|
||||||
import QuestionCircleTwoToneIcon from "@ant-design/icons/QuestionCircleTwoTone";
|
import QuestionCircleTwoToneIcon from "@ant-design/icons/QuestionCircleTwoTone";
|
||||||
@@ -27,7 +27,7 @@ export default function QueryFormItem({ query, queryResult, onChange, editMode }
|
|||||||
<small>
|
<small>
|
||||||
<WarningFilledIcon className="warning-icon-danger" /> This query has no <i>refresh schedule</i>.{" "}
|
<WarningFilledIcon className="warning-icon-danger" /> This query has no <i>refresh schedule</i>.{" "}
|
||||||
<Tooltip title="A query schedule is not necessary but is highly recommended for alerts. An Alert without a query schedule will only send notifications if a user in your organization manually executes this query.">
|
<Tooltip title="A query schedule is not necessary but is highly recommended for alerts. An Alert without a query schedule will only send notifications if a user in your organization manually executes this query.">
|
||||||
<a>
|
<a role="presentation">
|
||||||
Why it's recommended <QuestionCircleTwoToneIcon />
|
Why it's recommended <QuestionCircleTwoToneIcon />
|
||||||
</a>
|
</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@@ -41,8 +41,8 @@ export default function QueryFormItem({ query, queryResult, onChange, editMode }
|
|||||||
) : (
|
) : (
|
||||||
<Tooltip title="Open query in a new tab.">
|
<Tooltip title="Open query in a new tab.">
|
||||||
<Link href={`queries/${query.id}`} target="_blank" rel="noopener noreferrer" className="alert-query-link">
|
<Link href={`queries/${query.id}`} target="_blank" rel="noopener noreferrer" className="alert-query-link">
|
||||||
{query.name}
|
{query.name} <i className="fa fa-external-link" aria-hidden="true" />
|
||||||
<i className="fa fa-external-link" />
|
<span className="sr-only">(opens in a new tab)</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
.alert-query-link {
|
.alert-query-link {
|
||||||
font-weight: 600;
|
font-size: 14px;
|
||||||
text-decoration: underline;
|
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
top: -1px;
|
|
||||||
|
|
||||||
.fa-external-link {
|
.fa-external-link {
|
||||||
vertical-align: text-bottom;
|
vertical-align: text-bottom;
|
||||||
margin-left: 4px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,4 +18,4 @@
|
|||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,13 @@ export default function Title({ alert, editMode, name, onChange, children }) {
|
|||||||
<div className="alert-title">
|
<div className="alert-title">
|
||||||
<h3>
|
<h3>
|
||||||
{editMode && alert.query ? (
|
{editMode && alert.query ? (
|
||||||
|
// BUG: Input is not the same width as the container
|
||||||
|
// TODO: consider adding a label (not obvious for sighted users)
|
||||||
<Input
|
<Input
|
||||||
className="f-inherit"
|
className="f-inherit"
|
||||||
placeholder={defaultName}
|
placeholder={defaultName}
|
||||||
value={name}
|
value={name}
|
||||||
|
aria-label="Alert title"
|
||||||
onChange={e => onChange(e.target.value)}
|
onChange={e => onChange(e.target.value)}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -29,9 +29,19 @@ class AlertsList extends React.Component {
|
|||||||
|
|
||||||
listColumns = [
|
listColumns = [
|
||||||
Columns.custom.sortable(
|
Columns.custom.sortable(
|
||||||
(text, alert) => <i className={`fa fa-bell-${alert.options.muted ? "slash" : "o"} p-r-0`} />,
|
(text, alert) => (
|
||||||
|
<span title={alert.options.muted ? "Muted" : "Active"}>
|
||||||
|
<i className={`fa fa-bell-${alert.options.muted ? "slash" : "o"} p-r-0`} aria-hidden="true" />
|
||||||
|
<span className="sr-only">{alert.options.muted ? "Muted" : "Active"}</span>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
{
|
{
|
||||||
title: <i className="fa fa-bell p-r-0" />,
|
title: (
|
||||||
|
<>
|
||||||
|
<i className="fa fa-bell p-r-0" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Sort by notification status.</span>
|
||||||
|
</>
|
||||||
|
),
|
||||||
field: "muted",
|
field: "muted",
|
||||||
width: "1%",
|
width: "1%",
|
||||||
}
|
}
|
||||||
@@ -78,7 +88,7 @@ class AlertsList extends React.Component {
|
|||||||
actions={
|
actions={
|
||||||
currentUser.hasPermission("list_alerts") ? (
|
currentUser.hasPermission("list_alerts") ? (
|
||||||
<Link.Button block type="primary" href="alerts/new">
|
<Link.Button block type="primary" href="alerts/new">
|
||||||
<i className="fa fa-plus m-r-5" />
|
<i className="fa fa-plus m-r-5" aria-hidden="true" />
|
||||||
New Alert
|
New Alert
|
||||||
</Link.Button>
|
</Link.Button>
|
||||||
) : null
|
) : null
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ function DashboardList({ controller }) {
|
|||||||
actions={
|
actions={
|
||||||
currentUser.hasPermission("create_dashboard") ? (
|
currentUser.hasPermission("create_dashboard") ? (
|
||||||
<Button block type="primary" onClick={() => CreateDashboardDialog.showModal()}>
|
<Button block type="primary" onClick={() => CreateDashboardDialog.showModal()}>
|
||||||
<i className="fa fa-plus m-r-5" />
|
<i className="fa fa-plus m-r-5" aria-hidden="true" />
|
||||||
New Dashboard
|
New Dashboard
|
||||||
</Button>
|
</Button>
|
||||||
) : null
|
) : null
|
||||||
@@ -106,6 +106,7 @@ function DashboardList({ controller }) {
|
|||||||
<Layout.Sidebar className="m-b-0">
|
<Layout.Sidebar className="m-b-0">
|
||||||
<Sidebar.SearchInput
|
<Sidebar.SearchInput
|
||||||
placeholder="Search Dashboards..."
|
placeholder="Search Dashboards..."
|
||||||
|
label="Search dashboards"
|
||||||
value={controller.searchTerm}
|
value={controller.searchTerm}
|
||||||
onChange={controller.updateSearch}
|
onChange={controller.updateSearch}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ function AddWidgetContainer({ dashboardConfiguration, className, ...props }) {
|
|||||||
return (
|
return (
|
||||||
<div className={cx("add-widget-container", className)} {...props}>
|
<div className={cx("add-widget-container", className)} {...props}>
|
||||||
<h2>
|
<h2>
|
||||||
<i className="zmdi zmdi-widgets" />
|
<i className="zmdi zmdi-widgets" aria-hidden="true" />
|
||||||
<span className="hidden-xs hidden-sm">
|
<span className="hidden-xs hidden-sm">
|
||||||
Widgets are individual query visualizations or text boxes you can place on your dashboard in various
|
Widgets are individual query visualizations or text boxes you can place on your dashboard in various
|
||||||
arrangements.
|
arrangements.
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user