QueryLibrary: rename API from peakq to querylibrary (#100813)

This commit is contained in:
Andrej Ocenas 2025-02-17 17:49:11 +01:00 committed by GitHub
parent 7a6f4ced06
commit 78ef9fd9d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 8 deletions

View File

@ -91,7 +91,7 @@ func (c *DashboardSearchClient) Search(ctx context.Context, req *resource.Resour
}
// if searching for tags, get those instead of the dashboards or folders
for facet, _ := range req.Facet {
for facet := range req.Facet {
if facet == resource.SEARCH_FIELD_TAGS {
tags, err := c.dashboardStore.GetDashboardTags(ctx, &dashboards.GetDashboardTagsQuery{
OrgID: user.GetOrgID(),
@ -102,7 +102,7 @@ func (c *DashboardSearchClient) Search(ctx context.Context, req *resource.Resour
list := &resource.ResourceSearchResponse{
Results: &resource.ResourceTable{},
Facet: map[string]*resource.ResourceSearchResponse_Facet{
"tags": &resource.ResourceSearchResponse_Facet{
"tags": {
Terms: []*resource.ResourceSearchResponse_TermFacet{},
},
},
@ -213,7 +213,7 @@ func (c *DashboardSearchClient) Search(ctx context.Context, req *resource.Resour
Key: getResourceKey(&dashboards.DashboardSearchProjection{
UID: dashboard.UID,
}, req.Options.Key.Namespace),
Cells: [][]byte{[]byte(dashboard.Title), []byte(dashboard.FolderUID), []byte{}},
Cells: [][]byte{[]byte(dashboard.Title), []byte(dashboard.FolderUID), {}},
})
}

View File

@ -115,7 +115,7 @@ func TestDashboardSearchClient_Search(t *testing.T) {
require.Equal(t, &resource.ResourceSearchResponse{
Results: &resource.ResourceTable{},
Facet: map[string]*resource.ResourceSearchResponse_Facet{
"tags": &resource.ResourceSearchResponse_Facet{
"tags": {
Terms: []*resource.ResourceSearchResponse_TermFacet{
{
Term: "tag1",

View File

@ -123,6 +123,7 @@ func (_m *FakeDashboardStore) CountInOrg(ctx context.Context, orgID int64) (int6
return r0, r1
}
// DeleteAllDashboards provides a mock function with given fields: ctx, orgID
func (_m *FakeDashboardStore) DeleteAllDashboards(ctx context.Context, orgID int64) error {
ret := _m.Called(ctx, orgID)

View File

@ -7,7 +7,7 @@ import { getTestQueryList } from './testdata/testQueryList';
// Enterprise and so we cannot import it here.
// We have some tests for testing QL inside Explore. The whole Explore setup is in OSS, and it needs these mocks but the
// test itself is in Enterprise. Ideally we would inject the mocks in the tests somehow.
export const BASE_URL = getAPIBaseURL('peakq.grafana.app', 'v0alpha1');
export const BASE_URL = getAPIBaseURL('querylibrary.grafana.app', 'v0alpha1');
export const mockData = {
all: {

View File

@ -1,6 +1,6 @@
export const getTestQueryList = () => ({
kind: 'QueryTemplateList',
apiVersion: 'peakq.grafana.app/v0alpha1',
apiVersion: 'querylibrary.grafana.app/v0alpha1',
metadata: {
resourceVersion: '1783293408052252672',
remainingItemCount: 0,
@ -8,7 +8,7 @@ export const getTestQueryList = () => ({
items: [
{
kind: 'QueryTemplate',
apiVersion: 'peakq.grafana.app/v0alpha1',
apiVersion: 'querylibrary.grafana.app/v0alpha1',
metadata: {
name: 'AElastic2nkf9',
generateName: 'AElastic',
@ -55,7 +55,7 @@ export const getTestQueryList = () => ({
},
{
kind: 'QueryTemplate',
apiVersion: 'peakq.grafana.app/v0alpha1',
apiVersion: 'querylibrary.grafana.app/v0alpha1',
metadata: {
name: 'ALoki296tj',
generateName: 'ALoki',