Tempo: Integrate context aware autocomplete API (#67845)

* Send query in search tag values call

* Make sure to send the full query when using the code editor

* Fix merge conflicts

* Remove unused params
This commit is contained in:
Andre Pereira
2023-08-11 10:31:09 +01:00
committed by GitHub
parent 84181eb613
commit 039ed7a5bd
10 changed files with 38 additions and 24 deletions

View File

@@ -117,8 +117,8 @@ export default class TempoLanguageProvider extends LanguageProvider {
return options;
}
async getOptionsV2(tag: string): Promise<Array<SelectableValue<string>>> {
const response = await this.request(`/api/v2/search/tag/${tag}/values`);
async getOptionsV2(tag: string, query: string): Promise<Array<SelectableValue<string>>> {
const response = await this.request(`/api/v2/search/tag/${tag}/values`, query ? { q: query } : {});
let options: Array<SelectableValue<string>> = [];
if (response && response.tagValues) {
options = response.tagValues.map((v: { type: string; value: string }) => ({