-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Disable the download as image feature. #30513
Comments
To disable the "Download as image" feature for charts and dashboards in Superset version 4.0.2, you need to modify the code where the menu items are defined. Specifically, locate the following part of the code and remove or comment out the section related to the "DOWNLOAD_AS_IMAGE" menu key: <Menu.Item
key={MENU_KEYS.DOWNLOAD_AS_IMAGE}
icon={<Icons.FileImageOutlined css={iconReset} />}
>
{t('Download as image')}
</Menu.Item> This change will remove the "Download as image" option from the menu, effectively disabling the feature [1]. |
@dosu is there a way to disable it from the superset_config.py? |
There isn't a specific configuration option in |
@dosu please tell me a way to disable it if I'm running superset as a docker container? |
To disable the "Download as image" feature while running Superset as a Docker container, you will need to modify the frontend code within the Docker environment. Here's how you can do it:
By following these steps, you can disable the "Download as image" feature in a Dockerized Superset environment [1]. |
FROM apache/superset:4.0.2 USER root RUN apt-get update COPY ./docker-init.sh /superset-init.sh COPY zdnlk0yk.png /app/superset/static/assets/images/superset.png COPY superset_config.py /app/pythonpath/superset_config.py COPY utils.py /app/superset/connectors/sqla/utils.py ENV SUPERSET_CONFIG_PATH /app/superset_config.py USER superset CMD ["sh", "-c", "python /app/custom_scripts_rc/public_user_perms.py & /superset-init.sh"] |
To disable the "Download as image" feature in your Dockerized Superset setup, you need to modify the frontend code and rebuild it within the Docker container. Here’s how you can adjust your Dockerfile and process:
Your Dockerfile doesn't need changes for this specific task, as it already sets up the environment to build the frontend inside the container. Just ensure you follow the steps above to modify and rebuild the frontend code. |
@dosu but the container only has package.json under superset-frontend |
To modify the frontend code in your Dockerized Superset setup, you need to ensure that the full source code is available in the container. If only Here's how you can proceed:
If the source code is not included in the Docker image, you may need to build the image locally with the source code included or adjust your Docker setup to ensure the source files are available for modification. |
Sorry Dosu always wants people to edit the codebase. There is a permission named "can csv on Superset", try removing that from the role(s) that you want to modify in this way. |
Also this should not be a bug report as it is a question. Please post questions on Slack and/or GitHub Discussions. I found the answer searching Slack. I see you have opened a few bug reports today - please be judicious as the Superset project struggles when it comes to triaging bug reports. Valid, complete bug reports are welcome but it is a help if you keep them to a minimum. |
I understand. Thanks for the pointer, although we do want to export the data as csv as well as excel but we want to eliminate the option to export it as an image. But I'll post this as a discussion on GitHub. Thanks! |
Bug description
How can i disable the download as image feature for charts and dashboards?
Screenshots/recordings
No response
Superset version
4.0.2
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: