Problem
When the AdHocFiltersSet is used as part of AdHocFiltersVariable, the label is rendered twice.
VariableValueSelectors is in charge of rendering the controls, including label and value control. But AdHocFiltersVariable is different since the AdHocFiltersSet can be rendered out of the variable, and it contains its own label and control rendering.
Solution
In the same way, every variables has a hide property to control the visibility, the AdHocFiltersSet should have its own, so we can decide what part of the control we want to render. This allows when using a AdHocFiltersSet as apart of AdHocFiltersVariable state, hiding the controls to not render them twice.
Notes
I also updated the AdHocFiltersVariable.create to create the filter set as hidden by default but get the hide value from the initial state.
Problem When the AdHocFiltersSet is used as part of AdHocFiltersVariable, the label is rendered twice.
VariableValueSelectors is in charge of rendering the controls, including label and value control. But AdHocFiltersVariable is different since the AdHocFiltersSet can be rendered out of the variable, and it contains its own label and control rendering.
Solution In the same way, every variables has a
hide
property to control the visibility, the AdHocFiltersSet should have its own, so we can decide what part of the control we want to render. This allows when using a AdHocFiltersSet as apart of AdHocFiltersVariable state, hiding the controls to not render them twice.Notes
TODO:
Related to #580 Part of https://github.com/grafana/grafana/pull/81318