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

Template Variables: Use Combobox behind toggle #1011

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tskarhed
Copy link
Contributor

It turns out that Combobox actually isn't exported until 11.5. I would really appreciate some feedback on the way of handling feature toggling here. This PR will likely be WIP until mid-January.

Try running with grafana/ui at 11.5.0-214403.


return (
<Combobox
id={'var-' + key}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure where this var- is added for the Select

let comboboxOptions = options.map((o) => ({ value: o.value.toString(), label: o.label }));

if (includeAll) {
comboboxOptions.unshift({ value: ALL_VARIABLE_VALUE, label: ALL_VARIABLE_TEXT });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are custom All values handled somewhere else?

@tskarhed tskarhed marked this pull request as ready for review January 22, 2025 15:28
function VariableValueCombobox({ model }: SceneComponentProps<MultiValueVariable>) {
const { value, key, options, includeAll, isReadOnly, allowCustomValue = true } = model.useState();

let comboboxOptions = options.map((o) => ({ value: o.value.toString(), label: o.label }));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do options always have a label in this context?

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

Successfully merging this pull request may close these issues.

2 participants