cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Restoring timeframe and filter parameters when 'back' is pressed in a custom app

andycarlson
Participant

One of the main motivations for using a custom app (in preference to a dashboard) is slick navigation - in via Intents, out via Intents, click on graph dimension values to add filters and so on.

All of which works well, but if I navigate within the app or away from it into another app and then click the browser 'back' button... all of my filter parameters get reset to where they were when the page first loaded.

I have had some success using searchParams from React Router but this mechanism overlaps with the job that Dynatrace Intents are trying to do so making the two mechanisms play nicely together has been tricky - either missing updates, the wrong mechanism 'winning' or causing rerender loops. I now have it working in most cases (without causing the Intents to stop working)... but not all.

Dynatrace developed apps seem to have made this work. From what I can see they write the filter params into the URL... which is what searchParams does... but in a different encoding so I guess Dynatrace are not using searchParams.

So... what is the recommended way to restore filter params and timeframe on 'back' in a way that plays nicely with Intents and other parts of the Dynatrace component library?

 

1 REPLY 1

MaximilianoML
Helper

Hello, @andycarlson !

Your question is really good; I didn't find something about to persist these filters by User. But I found some "ways" to store User Data and then you can check if the user change, or leave the App.

Here is the doc Store user-generated data | Dynatrace Developer

 

Keep in mind, I'm not sure if this can, or is, the solution to your issue.

 

Regards,

Maximiliano Lopes

Fullstack developer | Tech Lover

Featured Posts