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

Outdated info in 'Add support for variables' topic #829

Open
josmperez opened this issue Mar 15, 2024 · 0 comments
Open

Outdated info in 'Add support for variables' topic #829

josmperez opened this issue Mar 15, 2024 · 0 comments
Assignees
Labels
type/docs Changes only affect the documentation

Comments

@josmperez
Copy link
Contributor

josmperez commented Mar 15, 2024

  1. There are some documentation sections that are outdated.

Example: Add support for variables. At the end of the page it mentions using setVariableQueryEditor for configuring plugin's query editor for variables. But actually it's deprecated (you get deprecation message when you start using it and it mentions the new way) and there is a new way of adding variables, which is not documented. Once you go to the code to understand this new method - it's also not clear, methods / properties are not documented, comments are not clear. So you need to check some examples and play around with it until you get something you want.

There is a slack thread I started a while ago, it has some more info.

  1. Incorrect docs. For example on the same page about adding support for variables, there is this:

The metricFindQuery function returns an array of MetricFindValue which has a single property, text:
async metricFindQuery(query: MyVariableQuery, options?: any) {
// Retrieve DataQueryResponse based on query.
const response = await this.fetchMetricNames(query.namespace, query.rawQuery);

// Convert query results to a MetricFindValue[]
const values = response.data.map(frame => ({ text: frame.name }));

return values;
}

But in reality MetricFindValue has not only text, it also has value and expandable :
interface MetricFindValue {
text: string;
value?: string | number;
expandable?: boolean;
}

Reported by Andriy Urbanas

@josmperez josmperez added the type/docs Changes only affect the documentation label Mar 15, 2024
@josmperez josmperez self-assigned this Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Changes only affect the documentation
Projects
Status: 📅 Planned
Development

No branches or pull requests

1 participant