Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prometheus: Add default editor configuration #61510

Merged
merged 2 commits into from Jan 17, 2023

Conversation

itsmylife
Copy link
Contributor

What is this feature?

We show builder mode by default for Prometheus. When you switch it to code mode it stays this way for you only. Some of our users want to configure this in the settings of datasource. So this PR adds this functionality. It has backward compatibility so if that setting is not specified nothing will happen. The selection you made while querying will override this setting only for the user.

image

Why do we need this feature?

Some people want to set the default editor option for their datasources. This PR gives that flexibility to them.

Who is this feature for?

Anyone who uses Prometheus and wants to set the default editor for the datasource

Which issue(s) does this PR fix?:

Fixes #57366

Special notes for your reviewer:

@bohandley
Copy link
Contributor

bohandley commented Jan 14, 2023

Awesome! I remember back to the Porto offsite when we were talking about this. I created a new datasource with a 'code' default editor and opened up explore and it was in the code editor. I changed the mode to 'builder' in the editor and this overrode the default editor configuration, so when I navigated away and then returned to explore with the same datasource, 'builder' was selected.

One thing that confused me was that when I went into a previously created datasource plugin and changed the default editor to 'code', if I had previously clicked 'builder' in the editor before changing the configuration, this overrode the default editor configuration. So when I navigated away from the configuration page to explore, I saw the builder. Does the editor toggle always override? Is it possible to get the default editor from a datasource that had been created before this feature?

defaultEditorMode.mov

@itsmylife
Copy link
Contributor Author

@bohandley editor toggle has priority always. That was intended. So if you decide on something you will get it always no matter what the configuration was.

Copy link
Contributor

@bohandley bohandley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@itsmylife itsmylife merged commit 6dcc94e into main Jan 17, 2023
@itsmylife itsmylife deleted the ismail/add-prom-default-editor-option branch January 17, 2023 14:39
@hoepfnerj
Copy link

It looks like this feature did not make it into release 9.3.4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a settings option to set the default editor (code/builder) option for Prometheus
5 participants