You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "krishanthvs (via GitHub)" <gi...@apache.org> on 2025/01/31 10:47:52 UTC
[I] Unable to run javascript in css editor [superset]
krishanthvs opened a new issue, #32060:
URL: https://github.com/apache/superset/issues/32060
### Bug description
Unable to run javascript in css editor
### Screenshots/recordings
_No response_
### Superset version
4.1.1
### Python version
3.11
### Node version
I don't know
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "krishanthvs (via GitHub)" <gi...@apache.org>.
krishanthvs commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2627003626
@dosu I want to dynamically select tabs based on the user. How can i achieve this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2626954226
<!-- Answer -->
The Superset CSS editor does not support JavaScript execution. Its primary function is for live CSS editing, allowing users to modify the appearance of dashboards with CSS, but it does not execute JavaScript <sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/dashboard/components/CssEditor/index.tsx)</sup>. If you need to integrate custom JavaScript into your Superset dashboards, you can do so by using the `superset/templates/tail_js_custom_extra.html` file or by modifying the `superset-frontend/src/setup/setupDashboardComponents.ts` file to include custom frontend code <sup>[[2]](https://github.com/apache/superset/blob/master/superset/templates/tail_js_custom_extra.html)</sup><sup>[[3]](https://github.com/apache/superset/blob/master/superset-frontend/src/setup/setupDashboardComponents.ts)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/a5f26fda-99c7-4f11-8260-8be082115289?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/a5f26fda-99c7-4f11-8260-8be082115289?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/a5f26fda-99c7-4f11-8260-8be082115289?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/a5f26fda-99c7-4f11-8260-8be082115289?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a5f26fda-99c7-4f11-8260-8be082115289?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/a5f26fda-99c7-4f11-8260-8be082115289?feedback_type=other)</sup>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #32060: Unable to run javascript in css editor
URL: https://github.com/apache/superset/issues/32060
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2640859093
The CSS editor does not support Javascript, so I wouldn't consider this a bug at all. There is no feature to dynamically select tabs based on user, but we would be open to a PR or a SIP proposal if you want to contribute such a feature. It's not currently on anyone's roadmap that I'm aware of, but we're welcoming to such contributions. I'll close this as a bug, but I'm happy to reopen it and move it to an "Ideas" discussion if you'd like.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "krishanthvs (via GitHub)" <gi...@apache.org>.
krishanthvs commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2626951753
@dosu can you please help me on this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2627028580
<!-- Answer -->
This is a tough nut to crack, could really use your help on this, @rusackas.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/400b32be-c3fe-4c8e-b430-7d60c22f8a64?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/400b32be-c3fe-4c8e-b430-7d60c22f8a64?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/400b32be-c3fe-4c8e-b430-7d60c22f8a64?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/400b32be-c3fe-4c8e-b430-7d60c22f8a64?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/400b32be-c3fe-4c8e-b430-7d60c22f8a64?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/400b32be-c3fe-4c8e-b430-7d60c22f8a64?feedback_type=other)</sup>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2627006421
<!-- Answer -->
To dynamically select tabs based on the user in Superset, you can customize the frontend by modifying the `superset-frontend/src/setup/setupDashboardComponents.ts` file. Here's a general approach:
1. **Create a Custom Component**: Develop a custom JavaScript component that handles dynamic tab selection logic based on user roles or attributes. This component should determine which tab to select based on the user's information.
2. **Register the Custom Component**: Modify the `setupDashboardComponents.ts` file to include your custom component. Here's an example of how you might do this:
```typescript
// Import the dashboard components registry
import dashboardComponentsRegistry from '../visualizations/presets/dashboardComponents';
// Import your custom component
import dynamicTabSelector from '../visualizations/dashboardComponents/DynamicTabSelector';
export default function setupDashboardComponents() {
// Register your custom component
dashboardComponentsRegistry.set('dynamicTabSelector', dynamicTabSelector);
}
```
3. **Implement User-Specific Logic**: Within your custom component, use Superset's hooks or APIs to access user roles or attributes. You can leverage the `usePermissions` hook to check user permissions and implement logic to select tabs accordingly <sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/setup/setupDashboardComponents.ts)</sup>.
By following these steps, you can achieve dynamic tab selection based on user-specific data.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/5e6303d6-1f84-49cc-9eb8-b2147a001515?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/5e6303d6-1f84-49cc-9eb8-b2147a001515?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/5e6303d6-1f84-49cc-9eb8-b2147a001515?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/5e6303d6-1f84-49cc-9eb8-b2147a001515?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5e6303d6-1f84-49cc-9eb8-b2147a001515?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/5e6303d6-1f84-49cc-9eb8-b2147a001515?feedback_type=other)</sup>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "krishanthvs (via GitHub)" <gi...@apache.org>.
krishanthvs commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2633058174
Hi @Rupantar-Borphukan any updates on this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "krishanthvs (via GitHub)" <gi...@apache.org>.
krishanthvs commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2633053814
Hi @rusackas any updates on this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "krishanthvs (via GitHub)" <gi...@apache.org>.
krishanthvs commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2627028103
@dosu can you assign a maintainer for this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "krishanthvs (via GitHub)" <gi...@apache.org>.
krishanthvs commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2627029846
@rusackas can you please help me on this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "krishanthvs (via GitHub)" <gi...@apache.org>.
krishanthvs commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2642086514
@rusackas can you reopen it and move it to an "Ideas" discussion
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "krishanthvs (via GitHub)" <gi...@apache.org>.
krishanthvs commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2627026246
@rusackas can you please help me on this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "Rupantar-Borphukan (via GitHub)" <gi...@apache.org>.
Rupantar-Borphukan commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2627766051
> [@rusackas](https://github.com/rusackas) can you please help me on this
Hi, I can contribute to this issue
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to run javascript in css editor [superset]
Posted by "krishanthvs (via GitHub)" <gi...@apache.org>.
krishanthvs commented on issue #32060:
URL: https://github.com/apache/superset/issues/32060#issuecomment-2633480194
@kayuzee can you please hep me on this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org