Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow CSV/TSV/Excel download from shared dashboards #7218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eradman
Copy link
Collaborator

@eradman eradman commented Nov 7, 2024

What type of PR is this?

  • Feature

Description

  • Always show dropdown menu for tables on shared dashboards
  • Append ?api_key for dashboards using the path /public/
  • Compare api_key with dashboard API keys associated with the requested query

How is this tested?

  • Unit tests (pytest, jest)
  • Manually

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

share-link-csv-tsv-downlod.mov

@@ -27,8 +27,12 @@ function visualizationWidgetMenuOptions({ widget, canEditDashboard, onParameters
const canEditParameters = canEditDashboard && !isEmpty(invoke(widget, "query.getParametersDefs"));
const widgetQueryResult = widget.getQueryResult();
const isQueryResultEmpty = !widgetQueryResult || !widgetQueryResult.isEmpty || widgetQueryResult.isEmpty();

const downloadLink = fileType => widgetQueryResult.getLink(widget.getQuery().id, fileType);
const parts = window.location.pathname.split('/').reverse()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These codes are unmaintainable and may not work in some browsers. I have mentioned this code before and it was rejected. If you want to do this function, I suggest rewriting a public page component to support it. It's my mind.

And i don't know parts[0].length === 40 meaning? i think it's unmaintaineable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my personal opinion.

- Always show dropdown menu
- Append ?api_key for dashboards using the path /public/
- Compare api_key with dashboard API keys associated with the requested query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants