Following @rauchy’s PR to indicate unsaved changes when parameter settings are edited, I’d like to discuss the issue and offer some approaches.

Currently, there’s no indication at all that user should save query upon changing parameter settings. Low hanging fruit is to implement the current asterisk indication.
But since there isn’t a clear correlation between parameter editing and query save button, this indication might go unnoticed.

Suggestions:

  1. Change Save button color (yellowish?)

    25

  2. Show explicit text “unsaved changes”

  3. Auto save, with discard button.

The problem with 1 and 2 is that it’s too much distraction when just editing true query text.

The problem with 3 is the issues with auto save we discussed.

@arikfr #3 is overhaul query autosave - not only for parameters, but any query related change. No save, discard your changes to return to original state.
(I believe this is how periscope does it)

Notice I’m not suggesting a parameter specific solution - I think this should be approached holistically.

I know. But there are two things on this page that currently require explicit save that have their own life cycles: parameters and query text. They are also a bit connected, as parameters added by updating query text.

While parameters can work with auto save, query text does not (for various reasons).

How about the following option —

  1. If the query is unchanged and someone edits parameters: save the query.

  2. If the query is in dirty state and someone edits parameters: don’t save and let the user save on their own.

Another solution can be to always save parameters regardless of query state (by doing partial save of only parameters). But this has the downside of potential “garbage” in query object I form of irrelevant parameters.

1 Like
  1. If the query is unchanged and someone edits parameters: save the query.
  2. If the query is in dirty state and someone edits parameters: don’t save and let the user save on their own.

I love it. Plain and simple.

Implemented in https://github.com/getredash/redash/pull/3488