Repository navigation
fix: build the Share embed snippet for a view - #1933
Open
ranjithguggilla wants to merge 1 commit into
Open
ranjithguggilla wants to merge 1 commit into
ranjithguggilla wants to merge 1 commit into
Conversation
The REST API does not return the embed HTML from the Share button. views.embed_code builds it from the view URL: the Embedding API v3 component on REST API 3.13 and later, and the JavaScript API object embed on older servers.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #996
Motivation
There is no REST method that returns the embed HTML from a view's Share button. The snippet is built from the view URL. Jac Fitzgerald noted that adding it would be useful. The issue is labeled
ui-existsbecause the UI has the snippet and the REST API does not.Behavior change
views.embed_code(view)returns that HTML for the signed-in site.tableau-vizelement andtableau.embedding.3.latest.min.js, which is what the Share button copies from Tableau 2022.3 onward.viz_v1.js.A named site uses
/t/{site}/views/{workbook}/{view}. The default site uses/views/{workbook}/{view}.Test plan
Three tests cover the legacy snippet, the v3 snippet on the default site, and the v3 snippet on a named site.
Not covered: pasting the snippet into a browser against a Tableau site.