mirror of https://github.com/grafana/grafana.git
QueryLibrary: rename API from peakq to querylibrary (#100813)
This commit is contained in:
parent
7a6f4ced06
commit
78ef9fd9d9
|
@ -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), {}},
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue