awslabs / amazon-quicksight-embedding-sdk

A SDK to help users embed QuickSight dashboards on other pages.
Apache License 2.0
172 stars 40 forks source link

.reset() does not work when bookmarks enabled #149

Open arnoldomarin opened 1 year ago

arnoldomarin commented 1 year ago

I noticed that when bookmarks are enabled, they also enable statePersistence and consequently, when these two are enabled the embeddedDashboardExperience.reset() function does not work. If I try to set statePersistence to false while bookmarks are enabled, I get an error that it needs to be enabled when bookmarks are enabled. I believe this is a bug because if I enable the reset button within the toolbar, it does work but having a custom button triggering embeddedDashboardExperience.reset() does not while bookmarks are enabled.

bwelkin commented 1 year ago

Failure on enabling the bookmarks but disabling the state persistence is the expected behavior while requesting the embed url. The bookmarks feature works with the state persistence feature.

What response do you get when you call reset action?

const result = await embeddedDashboardExperience.reset();

Or could you please share any error message you see on browser console after you invoke the reset action?

arnoldomarin commented 1 year ago

I printed out the result but and I got 'success: true' but it does not actually reset the parameters. This is all while bookmarks and statePersistance are enabled.

bwelkin commented 1 year ago

The Embedding SDK seems to be working as expected: sending the reset request and handling the response. The issue might be within the embedded iframe. We will continue investigating it.

bwelkin commented 1 year ago

Could you please provide your repro steps for the issue?

When I

Step 1: generate an embed url with bookmarks feature enabled Step 2: set contentOptions.toolbarOptions.bookmarks true while embedding, Step 3: make changes in parameter values after embedded page is loaded, and then Step 4: click reset,

reset action works. Are you navigating to a bookmarked dashboard, or taking any other action in between the steps i listed above?

arnoldomarin commented 1 year ago

Hi again!

That way it does work. If I enable the reset button within the toolbar and use it, it does reset the embedded dashboard.

The problem is when I try to use embeddedDashboardExperience.reset() with a custom button, it does not reset the embbeded dashboard when Bookmarks are enabled. Other functions do work (embeddedDashboardExperience.toggleBookmarksPane(), embeddedDashboardExperience.initiatePrint()) with custom buttons.

Prefer refer to the image attached as an example of functions for custom buttons in our app.

Thank you!

image