diff --git a/pkg/registry/apis/dashboard/legacysearcher/search_client.go b/pkg/registry/apis/dashboard/legacysearcher/search_client.go index c108814a553..565d7448e1f 100644 --- a/pkg/registry/apis/dashboard/legacysearcher/search_client.go +++ b/pkg/registry/apis/dashboard/legacysearcher/search_client.go @@ -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), {}}, }) } diff --git a/pkg/registry/apis/dashboard/legacysearcher/search_client_test.go b/pkg/registry/apis/dashboard/legacysearcher/search_client_test.go index 76afb49f70b..d923e27b837 100644 --- a/pkg/registry/apis/dashboard/legacysearcher/search_client_test.go +++ b/pkg/registry/apis/dashboard/legacysearcher/search_client_test.go @@ -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", diff --git a/pkg/services/dashboards/store_mock.go b/pkg/services/dashboards/store_mock.go index 508fece061c..10a41e691c1 100644 --- a/pkg/services/dashboards/store_mock.go +++ b/pkg/services/dashboards/store_mock.go @@ -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) diff --git a/public/app/features/explore/spec/helper/mocks.ts b/public/app/features/explore/spec/helper/mocks.ts index 160762f25e2..fddd823240a 100644 --- a/public/app/features/explore/spec/helper/mocks.ts +++ b/public/app/features/explore/spec/helper/mocks.ts @@ -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: { diff --git a/public/app/features/explore/spec/helper/testdata/testQueryList.ts b/public/app/features/explore/spec/helper/testdata/testQueryList.ts index c6efa9b93bd..7a730bb2c6c 100644 --- a/public/app/features/explore/spec/helper/testdata/testQueryList.ts +++ b/public/app/features/explore/spec/helper/testdata/testQueryList.ts @@ -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',