You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/02/11 17:01:37 UTC
[GitHub] [superset] ra002890 opened a new pull request #18682: feat: It is possible to pass attributes to embedded iframe
ra002890 opened a new pull request #18682:
URL: https://github.com/apache/superset/pull/18682
feat: It is possible to pass attributes to embedded iframe in embedded-sdk
### SUMMARY
It must be possible to control the embedded iframe inserted by the embedded-sdk. With this change we can pass any html attribute to it, including id.
### TESTING INSTRUCTIONS
1. Pass a map containing keys(html attribute names) and values(html attribute values) to the parameter iframeAttributes of EmbedDashboardParams.
2. Check on the rendered page if the iframe got passed attributes.
```javascript
embedDashboard({
id: "8", // given by the Superset embedding UI
supersetDomain: "http://127.0.0.1:9000",
mountPoint: document.getElementById("my-superset-container")!, // any html element that can contain an iframe
iframeAttributes: new Map<string, string>([["id", "my-test-frame"], ["className", "my-test-frame-class"]]),
fetchGuestToken: () => fetchGuestTokenFromBackend(),
});
```
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [X] Introduces new feature or API
- [ ] Removes existing feature or API
--
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
[GitHub] [superset] ra002890 closed pull request #18682: feat: It is possible to pass attributes to embedded iframe
Posted by GitBox <gi...@apache.org>.
ra002890 closed pull request #18682:
URL: https://github.com/apache/superset/pull/18682
--
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
[GitHub] [superset] ra002890 commented on pull request #18682: feat: It is possible to pass attributes to embedded iframe
Posted by GitBox <gi...@apache.org>.
ra002890 commented on pull request #18682:
URL: https://github.com/apache/superset/pull/18682#issuecomment-1046875601
> We'll also need to increase the version in package.json so that this gets built and released when merged. For now I've just been increasing the `-alpha.x` component of the version.
I think it is done!
--
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
[GitHub] [superset] ra002890 commented on a change in pull request #18682: feat: It is possible to pass attributes to embedded iframe
Posted by GitBox <gi...@apache.org>.
ra002890 commented on a change in pull request #18682:
URL: https://github.com/apache/superset/pull/18682#discussion_r808019660
##########
File path: superset-embedded-sdk/src/index.ts
##########
@@ -36,6 +36,8 @@ export type EmbedDashboardParams = {
supersetDomain: string
/** The html element within which to mount the iframe */
mountPoint: HTMLElement
+ /** An id to identify the create iframe that will embed Superset */
+ iframeAttributes: Map<string, string>
Review comment:
From the first time I was trying to force only Iframe related attributes to be passed here, and I was not able to find a good way to do that, but with your suggestion I have found the Partial type and I could implement it. What do you think about my new implementation where only valid iframe attributes can be passed to it?
--
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
[GitHub] [superset] ra002890 closed pull request #18682: feat: It is possible to pass attributes to embedded iframe
Posted by GitBox <gi...@apache.org>.
ra002890 closed pull request #18682:
URL: https://github.com/apache/superset/pull/18682
--
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
[GitHub] [superset] suddjian commented on a change in pull request #18682: feat: It is possible to pass attributes to embedded iframe
Posted by GitBox <gi...@apache.org>.
suddjian commented on a change in pull request #18682:
URL: https://github.com/apache/superset/pull/18682#discussion_r807333731
##########
File path: superset-embedded-sdk/src/index.ts
##########
@@ -36,6 +36,8 @@ export type EmbedDashboardParams = {
supersetDomain: string
/** The html element within which to mount the iframe */
mountPoint: HTMLElement
+ /** An id to identify the create iframe that will embed Superset */
+ iframeAttributes: Map<string, string>
Review comment:
This will require instantiating a `Map()` object. We should probably allow passing key-value pairs such as `{ class: "some-class" }`. Let's change the type to use `Record` which represents this. (This will also require changing the `forEach` construction below)
```suggestion
iframeAttributes: Record<string, string>
```
--
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
[GitHub] [superset] suddjian commented on a change in pull request #18682: feat: It is possible to pass attributes to embedded iframe
Posted by GitBox <gi...@apache.org>.
suddjian commented on a change in pull request #18682:
URL: https://github.com/apache/superset/pull/18682#discussion_r809297968
##########
File path: superset-embedded-sdk/src/index.ts
##########
@@ -36,6 +36,8 @@ export type EmbedDashboardParams = {
supersetDomain: string
/** The html element within which to mount the iframe */
mountPoint: HTMLElement
+ /** An id to identify the create iframe that will embed Superset */
+ iframeAttributes: Map<string, string>
Review comment:
Oh, cool idea
--
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
[GitHub] [superset] ra002890 commented on pull request #18682: feat: It is possible to pass attributes to embedded iframe
Posted by GitBox <gi...@apache.org>.
ra002890 commented on pull request #18682:
URL: https://github.com/apache/superset/pull/18682#issuecomment-1045980748
> We'll also need to increase the version in package.json so that this gets built and released when merged. For now I've just been increasing the `-alpha.x` component of the version.
I think it is done!
--
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
[GitHub] [superset] ra002890 commented on pull request #18682: feat: It is possible to pass attributes to embedded iframe
Posted by GitBox <gi...@apache.org>.
ra002890 commented on pull request #18682:
URL: https://github.com/apache/superset/pull/18682#issuecomment-1054076915
It took too long to be accepted and I made a mistake in rebase it in my fork...I will close it and open a new one!
--
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