mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Upgrades jQuery and @types/jQuery (#25651)
* Chore: upgrades jQuery and @types/jQuery * Chore: reduce strict null errors * Fixed issue in graphite func editor Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This commit is contained in:
parent
eb792490d6
commit
e2ba0731e2
@ -84,7 +84,7 @@
|
|||||||
"@types/hoist-non-react-statics": "3.3.0",
|
"@types/hoist-non-react-statics": "3.3.0",
|
||||||
"@types/is-hotkey": "0.1.1",
|
"@types/is-hotkey": "0.1.1",
|
||||||
"@types/jest": "26.0.0",
|
"@types/jest": "26.0.0",
|
||||||
"@types/jquery": "3.3.32",
|
"@types/jquery": "3.3.38",
|
||||||
"@types/lodash": "4.14.149",
|
"@types/lodash": "4.14.149",
|
||||||
"@types/lru-cache": "^5.1.0",
|
"@types/lru-cache": "^5.1.0",
|
||||||
"@types/marked": "0.6.5",
|
"@types/marked": "0.6.5",
|
||||||
@ -232,7 +232,7 @@
|
|||||||
"hoist-non-react-statics": "3.3.0",
|
"hoist-non-react-statics": "3.3.0",
|
||||||
"immutable": "3.8.2",
|
"immutable": "3.8.2",
|
||||||
"is-hotkey": "0.1.6",
|
"is-hotkey": "0.1.6",
|
||||||
"jquery": "3.4.1",
|
"jquery": "3.5.1",
|
||||||
"jsurl": "^0.1.5",
|
"jsurl": "^0.1.5",
|
||||||
"lodash": "4.17.15",
|
"lodash": "4.17.15",
|
||||||
"lru-cache": "^5.1.1",
|
"lru-cache": "^5.1.1",
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
"@rollup/plugin-node-resolve": "7.1.1",
|
"@rollup/plugin-node-resolve": "7.1.1",
|
||||||
"@types/braintree__sanitize-url": "4.0.0",
|
"@types/braintree__sanitize-url": "4.0.0",
|
||||||
"@types/jest": "23.3.14",
|
"@types/jest": "23.3.14",
|
||||||
"@types/jquery": "1.10.35",
|
"@types/jquery": "3.3.38",
|
||||||
"@types/lodash": "4.14.123",
|
"@types/lodash": "4.14.123",
|
||||||
"@types/node": "10.14.1",
|
"@types/node": "10.14.1",
|
||||||
"@types/papaparse": "4.5.9",
|
"@types/papaparse": "4.5.9",
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
"d3": "5.15.0",
|
"d3": "5.15.0",
|
||||||
"emotion": "10.0.27",
|
"emotion": "10.0.27",
|
||||||
"immutable": "3.8.2",
|
"immutable": "3.8.2",
|
||||||
"jquery": "3.4.1",
|
"jquery": "3.5.1",
|
||||||
"lodash": "4.17.15",
|
"lodash": "4.17.15",
|
||||||
"moment": "2.24.0",
|
"moment": "2.24.0",
|
||||||
"papaparse": "4.6.3",
|
"papaparse": "4.6.3",
|
||||||
@ -83,7 +83,7 @@
|
|||||||
"@types/common-tags": "^1.8.0",
|
"@types/common-tags": "^1.8.0",
|
||||||
"@types/d3": "5.7.2",
|
"@types/d3": "5.7.2",
|
||||||
"@types/jest": "23.3.14",
|
"@types/jest": "23.3.14",
|
||||||
"@types/jquery": "1.10.35",
|
"@types/jquery": "3.3.38",
|
||||||
"@types/lodash": "4.14.123",
|
"@types/lodash": "4.14.123",
|
||||||
"@types/node": "10.14.1",
|
"@types/node": "10.14.1",
|
||||||
"@types/papaparse": "4.5.9",
|
"@types/papaparse": "4.5.9",
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { createRootReducer, recursiveCleanState } from './root';
|
import { createRootReducer, recursiveCleanState } from './root';
|
||||||
import { describe, expect } from '../../../test/lib/common';
|
import { describe, expect } from '../../../test/lib/common';
|
||||||
import { NavModelItem } from '@grafana/data';
|
|
||||||
import { reducerTester } from '../../../test/core/redux/reducerTester';
|
import { reducerTester } from '../../../test/core/redux/reducerTester';
|
||||||
import { StoreState } from '../../types/store';
|
import { StoreState } from '../../types/store';
|
||||||
import { Team } from '../../types';
|
import { Team } from '../../types';
|
||||||
@ -8,10 +7,10 @@ import { cleanUpAction } from '../actions/cleanUp';
|
|||||||
import { initialTeamsState, teamsLoaded } from '../../features/teams/state/reducers';
|
import { initialTeamsState, teamsLoaded } from '../../features/teams/state/reducers';
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
config: {
|
config: {
|
||||||
bootData: {
|
bootData: {
|
||||||
navTree: [] as NavModelItem[],
|
navTree: [],
|
||||||
user: {},
|
user: {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -8,6 +8,10 @@ import { createConstantVariableAdapter } from '../../../variables/constant/adapt
|
|||||||
import { createQueryVariableAdapter } from '../../../variables/query/adapter';
|
import { createQueryVariableAdapter } from '../../../variables/query/adapter';
|
||||||
import { createDataSourceVariableAdapter } from '../../../variables/datasource/adapter';
|
import { createDataSourceVariableAdapter } from '../../../variables/datasource/adapter';
|
||||||
|
|
||||||
|
function getStub(arg: string) {
|
||||||
|
return Promise.resolve(stubs[arg || 'gfdb']);
|
||||||
|
}
|
||||||
|
|
||||||
jest.mock('app/core/store', () => {
|
jest.mock('app/core/store', () => {
|
||||||
return {
|
return {
|
||||||
getBool: jest.fn(),
|
getBool: jest.fn(),
|
||||||
@ -16,7 +20,7 @@ jest.mock('app/core/store', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getDataSourceSrv: () => ({
|
getDataSourceSrv: () => ({
|
||||||
get: jest.fn(arg => getStub(arg)),
|
get: jest.fn(arg => getStub(arg)),
|
||||||
}),
|
}),
|
||||||
@ -269,7 +273,3 @@ stubs['-- Grafana --'] = {
|
|||||||
builtIn: true,
|
builtIn: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function getStub(arg: string) {
|
|
||||||
return Promise.resolve(stubs[arg || 'gfdb']);
|
|
||||||
}
|
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
import { PayloadAction } from '@reduxjs/toolkit';
|
import { PayloadAction } from '@reduxjs/toolkit';
|
||||||
import { DataQuery, DefaultTimeZone, ExploreMode, LogsDedupStrategy, RawTimeRange, toUtc } from '@grafana/data';
|
import { DataQuery, DefaultTimeZone, ExploreMode, LogsDedupStrategy, toUtc } from '@grafana/data';
|
||||||
|
|
||||||
import * as Actions from './actions';
|
import * as Actions from './actions';
|
||||||
import {
|
import {
|
||||||
|
cancelQueries,
|
||||||
changeDatasource,
|
changeDatasource,
|
||||||
|
changeMode,
|
||||||
loadDatasource,
|
loadDatasource,
|
||||||
navigateToExplore,
|
navigateToExplore,
|
||||||
refreshExplore,
|
refreshExplore,
|
||||||
cancelQueries,
|
|
||||||
changeMode,
|
|
||||||
} from './actions';
|
} from './actions';
|
||||||
import { ExploreId, ExploreUpdateState, ExploreUrlState } from 'app/types';
|
import { ExploreId, ExploreUpdateState, ExploreUrlState } from 'app/types';
|
||||||
import { thunkTester } from 'test/core/thunk/thunkTester';
|
import { thunkTester } from 'test/core/thunk/thunkTester';
|
||||||
import {
|
import {
|
||||||
|
cancelQueriesAction,
|
||||||
|
changeModeAction,
|
||||||
initializeExploreAction,
|
initializeExploreAction,
|
||||||
InitializeExplorePayload,
|
InitializeExplorePayload,
|
||||||
loadDatasourcePendingAction,
|
loadDatasourcePendingAction,
|
||||||
loadDatasourceReadyAction,
|
loadDatasourceReadyAction,
|
||||||
|
scanStopAction,
|
||||||
setQueriesAction,
|
setQueriesAction,
|
||||||
updateDatasourceInstanceAction,
|
updateDatasourceInstanceAction,
|
||||||
updateUIStateAction,
|
updateUIStateAction,
|
||||||
cancelQueriesAction,
|
|
||||||
scanStopAction,
|
|
||||||
changeModeAction,
|
|
||||||
} from './actionTypes';
|
} from './actionTypes';
|
||||||
import { Emitter } from 'app/core/core';
|
import { Emitter } from 'app/core/core';
|
||||||
import { makeInitialUpdateState } from './reducers';
|
import { makeInitialUpdateState } from './reducers';
|
||||||
@ -65,8 +65,8 @@ const testRange = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
jest.mock('app/core/utils/explore', () => ({
|
jest.mock('app/core/utils/explore', () => ({
|
||||||
...jest.requireActual('app/core/utils/explore'),
|
...((jest.requireActual('app/core/utils/explore') as unknown) as object),
|
||||||
getTimeRangeFromUrl: (range: RawTimeRange) => testRange,
|
getTimeRangeFromUrl: (range: any) => testRange,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const setup = (updateOverides?: Partial<ExploreUpdateState>) => {
|
const setup = (updateOverides?: Partial<ExploreUpdateState>) => {
|
||||||
|
@ -98,7 +98,7 @@ describe('ResultProcessor', () => {
|
|||||||
const valueField = dataFrames[0].fields[1];
|
const valueField = dataFrames[0].fields[1];
|
||||||
const theResult = resultProcessor.getGraphResult();
|
const theResult = resultProcessor.getGraphResult();
|
||||||
|
|
||||||
expect(theResult[0]).toEqual({
|
expect(theResult![0]).toEqual({
|
||||||
label: 'A-series',
|
label: 'A-series',
|
||||||
color: '#7EB26D',
|
color: '#7EB26D',
|
||||||
data: [
|
data: [
|
||||||
|
@ -51,7 +51,11 @@ describe('getFieldLinksForExplore', () => {
|
|||||||
'/explore?left={"range":{"from":"now-1h","to":"now"},"datasource":"test_ds","queries":[{"query":"query_1"}],"mode":"Metrics","ui":{"showingGraph":true,"showingTable":true,"showingLogs":true}}'
|
'/explore?left={"range":{"from":"now-1h","to":"now"},"datasource":"test_ds","queries":[{"query":"query_1"}],"mode":"Metrics","ui":{"showingGraph":true,"showingTable":true,"showingLogs":true}}'
|
||||||
);
|
);
|
||||||
expect(links[0].title).toBe('test_ds');
|
expect(links[0].title).toBe('test_ds');
|
||||||
links[0].onClick({});
|
|
||||||
|
if (links[0].onClick) {
|
||||||
|
links[0].onClick({});
|
||||||
|
}
|
||||||
|
|
||||||
expect(splitfn).toBeCalledWith({ datasourceUid: 'uid_1', query: 'query_1' });
|
expect(splitfn).toBeCalledWith({ datasourceUid: 'uid_1', query: 'query_1' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -14,7 +14,7 @@ describe('datasource', () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
} as any)) as any;
|
} as any)) as any;
|
||||||
expect(response.error.message).toBe('Log group is required');
|
expect(response.error?.message).toBe('Log group is required');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return empty response if queries are hidden', async () => {
|
it('should return empty response if queries are hidden', async () => {
|
||||||
|
@ -18,7 +18,7 @@ jest.mock('rxjs/operators', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -18,9 +18,12 @@ describe('DataLinks', () => {
|
|||||||
|
|
||||||
it('renders correctly when no fields', async () => {
|
it('renders correctly when no fields', async () => {
|
||||||
let wrapper: any;
|
let wrapper: any;
|
||||||
await act(async () => {
|
await act(
|
||||||
wrapper = await mount(<DataLinks onChange={() => {}} />);
|
// @ts-ignore we shouldn't use Promises in act => the "void | undefined" is here to forbid any sneaky "Promise" returns.
|
||||||
});
|
async () => {
|
||||||
|
wrapper = await mount(<DataLinks onChange={() => {}} />);
|
||||||
|
}
|
||||||
|
);
|
||||||
expect(wrapper.find(Button).length).toBe(1);
|
expect(wrapper.find(Button).length).toBe(1);
|
||||||
expect(wrapper.find(Button).contains('Add')).toBeTruthy();
|
expect(wrapper.find(Button).contains('Add')).toBeTruthy();
|
||||||
expect(wrapper.find(DataLink).length).toBe(0);
|
expect(wrapper.find(DataLink).length).toBe(0);
|
||||||
@ -28,9 +31,12 @@ describe('DataLinks', () => {
|
|||||||
|
|
||||||
it('renders correctly when there are fields', async () => {
|
it('renders correctly when there are fields', async () => {
|
||||||
let wrapper: any;
|
let wrapper: any;
|
||||||
await act(async () => {
|
await act(
|
||||||
wrapper = await mount(<DataLinks value={testValue} onChange={() => {}} />);
|
// @ts-ignore we shouldn't use Promises in act => the "void | undefined" is here to forbid any sneaky "Promise" returns.
|
||||||
});
|
async () => {
|
||||||
|
wrapper = await mount(<DataLinks value={testValue} onChange={() => {}} />);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
expect(wrapper.find(Button).filterWhere((button: any) => button.contains('Add')).length).toBe(1);
|
expect(wrapper.find(Button).filterWhere((button: any) => button.contains('Add')).length).toBe(1);
|
||||||
expect(wrapper.find(DataLink).length).toBe(2);
|
expect(wrapper.find(DataLink).length).toBe(2);
|
||||||
@ -39,9 +45,12 @@ describe('DataLinks', () => {
|
|||||||
it('adds new field', async () => {
|
it('adds new field', async () => {
|
||||||
const onChangeMock = jest.fn();
|
const onChangeMock = jest.fn();
|
||||||
let wrapper: any;
|
let wrapper: any;
|
||||||
await act(async () => {
|
await act(
|
||||||
wrapper = await mount(<DataLinks onChange={onChangeMock} />);
|
// @ts-ignore we shouldn't use Promises in act => the "void | undefined" is here to forbid any sneaky "Promise" returns.
|
||||||
});
|
async () => {
|
||||||
|
wrapper = await mount(<DataLinks onChange={onChangeMock} />);
|
||||||
|
}
|
||||||
|
);
|
||||||
const addButton = wrapper.find(Button).filterWhere((button: any) => button.contains('Add'));
|
const addButton = wrapper.find(Button).filterWhere((button: any) => button.contains('Add'));
|
||||||
addButton.simulate('click');
|
addButton.simulate('click');
|
||||||
expect(onChangeMock.mock.calls[0][0].length).toBe(1);
|
expect(onChangeMock.mock.calls[0][0].length).toBe(1);
|
||||||
@ -50,9 +59,12 @@ describe('DataLinks', () => {
|
|||||||
it('removes field', async () => {
|
it('removes field', async () => {
|
||||||
const onChangeMock = jest.fn();
|
const onChangeMock = jest.fn();
|
||||||
let wrapper: any;
|
let wrapper: any;
|
||||||
await act(async () => {
|
await act(
|
||||||
wrapper = await mount(<DataLinks value={testValue} onChange={onChangeMock} />);
|
// @ts-ignore we shouldn't use Promises in act => the "void | undefined" is here to forbid any sneaky "Promise" returns.
|
||||||
});
|
async () => {
|
||||||
|
wrapper = await mount(<DataLinks value={testValue} onChange={onChangeMock} />);
|
||||||
|
}
|
||||||
|
);
|
||||||
const removeButton = wrapper
|
const removeButton = wrapper
|
||||||
.find(DataLink)
|
.find(DataLink)
|
||||||
.at(0)
|
.at(0)
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import { CoreApp, DataQueryRequest, dateMath, Field } from '@grafana/data';
|
import { CoreApp, DataQueryRequest, DataSourceInstanceSettings, dateMath, dateTime, Field, toUtc } from '@grafana/data';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { ElasticDatasource } from './datasource';
|
import { ElasticDatasource } from './datasource';
|
||||||
import { toUtc, dateTime } from '@grafana/data';
|
|
||||||
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
||||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||||
import { DataSourceInstanceSettings } from '@grafana/data';
|
|
||||||
import { ElasticsearchOptions, ElasticsearchQuery } from './types';
|
import { ElasticsearchOptions, ElasticsearchQuery } from './types';
|
||||||
|
|
||||||
const ELASTICSEARCH_MOCK_URL = 'http://elasticsearch.local';
|
const ELASTICSEARCH_MOCK_URL = 'http://elasticsearch.local';
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import Datasource from '../datasource';
|
import Datasource from '../datasource';
|
||||||
import { DataFrame, toUtc, getFrameDisplayName } from '@grafana/data';
|
import { DataFrame, getFrameDisplayName, toUtc } from '@grafana/data';
|
||||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||||
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
||||||
|
|
||||||
const templateSrv = new TemplateSrv();
|
const templateSrv = new TemplateSrv();
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
getTemplateSrv: () => templateSrv,
|
getTemplateSrv: () => templateSrv,
|
||||||
}));
|
}));
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import AzureMonitorDatasource from '../datasource';
|
import AzureMonitorDatasource from '../datasource';
|
||||||
import FakeSchemaData from './__mocks__/schema';
|
import FakeSchemaData from './__mocks__/schema';
|
||||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||||
import { KustoSchema, AzureLogsVariable } from '../types';
|
import { AzureLogsVariable, KustoSchema } from '../types';
|
||||||
import { toUtc } from '@grafana/data';
|
import { toUtc } from '@grafana/data';
|
||||||
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
||||||
|
|
||||||
const templateSrv = new TemplateSrv();
|
const templateSrv = new TemplateSrv();
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
getTemplateSrv: () => templateSrv,
|
getTemplateSrv: () => templateSrv,
|
||||||
}));
|
}));
|
||||||
|
@ -8,7 +8,7 @@ import { AzureDataSourceJsonData } from '../types';
|
|||||||
const templateSrv = new TemplateSrv();
|
const templateSrv = new TemplateSrv();
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
getTemplateSrv: () => templateSrv,
|
getTemplateSrv: () => templateSrv,
|
||||||
}));
|
}));
|
||||||
|
@ -4,7 +4,7 @@ import { backendSrv } from 'app/core/services/backend_srv'; // will use the vers
|
|||||||
import { GrafanaDatasource } from '../datasource';
|
import { GrafanaDatasource } from '../datasource';
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -10,8 +10,9 @@ export function graphiteFuncEditor($compile: any, templateSrv: TemplateSrv) {
|
|||||||
func="func"
|
func="func"
|
||||||
onRemove="ctrl.handleRemoveFunction"
|
onRemove="ctrl.handleRemoveFunction"
|
||||||
onMoveLeft="ctrl.handleMoveLeft"
|
onMoveLeft="ctrl.handleMoveLeft"
|
||||||
onMoveRight="ctrl.handleMoveRight"
|
onMoveRight="ctrl.handleMoveRight">
|
||||||
/><span>(</span>
|
</function-editor>
|
||||||
|
<span>(</span>
|
||||||
`;
|
`;
|
||||||
const paramTemplate =
|
const paramTemplate =
|
||||||
'<input type="text" style="display:none"' + ' class="input-small tight-form-func-param"></input>';
|
'<input type="text" style="display:none"' + ' class="input-small tight-form-func-param"></input>';
|
||||||
|
@ -6,7 +6,7 @@ import { dateTime, getFrameDisplayName } from '@grafana/data';
|
|||||||
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ describe('when rendering func instance', () => {
|
|||||||
it('should handle function with no metric param', () => {
|
it('should handle function with no metric param', () => {
|
||||||
const func = gfunc.createFuncInstance('randomWalk');
|
const func = gfunc.createFuncInstance('randomWalk');
|
||||||
func.params[0] = 'test';
|
func.params[0] = 'test';
|
||||||
expect(func.render(undefined, replaceVariablesDummy)).toEqual("randomWalk('test')");
|
expect(func.render((undefined as unknown) as string, replaceVariablesDummy)).toEqual("randomWalk('test')");
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle function multiple series params', () => {
|
it('should handle function multiple series params', () => {
|
||||||
|
@ -7,7 +7,7 @@ import { backendSrv } from 'app/core/services/backend_srv'; // will use the vers
|
|||||||
const templateSrv = new TemplateSrvStub();
|
const templateSrv = new TemplateSrvStub();
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
getTemplateSrv: () => templateSrv,
|
getTemplateSrv: () => templateSrv,
|
||||||
}));
|
}));
|
||||||
|
@ -19,7 +19,7 @@ import { CustomVariableModel } from '../../../features/variables/types';
|
|||||||
import { initialCustomVariableModelState } from '../../../features/variables/custom/reducer'; // will use the version in __mocks__
|
import { initialCustomVariableModelState } from '../../../features/variables/custom/reducer'; // will use the version in __mocks__
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import { backendSrv } from 'app/core/services/backend_srv';
|
|||||||
import { initialCustomVariableModelState } from '../../../../features/variables/custom/reducer'; // will use the version in __mocks__
|
import { initialCustomVariableModelState } from '../../../../features/variables/custom/reducer'; // will use the version in __mocks__
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import { TemplateSrv } from 'app/features/templating/template_srv';
|
|||||||
import { initialCustomVariableModelState } from '../../../../features/variables/custom/reducer';
|
import { initialCustomVariableModelState } from '../../../../features/variables/custom/reducer';
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import OpenTsDatasource from '../datasource';
|
|||||||
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import { TemplateSrv } from 'app/features/templating/template_srv';
|
|||||||
import { initialCustomVariableModelState } from '../../../../features/variables/custom/reducer';
|
import { initialCustomVariableModelState } from '../../../../features/variables/custom/reducer';
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { PrometheusDatasource } from './datasource';
|
import { PrometheusDatasource } from './datasource';
|
||||||
import PrometheusMetricFindQuery from './metric_find_query';
|
import PrometheusMetricFindQuery from './metric_find_query';
|
||||||
import { toUtc, DataSourceInstanceSettings } from '@grafana/data';
|
import { DataSourceInstanceSettings, toUtc } from '@grafana/data';
|
||||||
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
||||||
import { PromOptions } from './types';
|
import { PromOptions } from './types';
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ jest.mock('app/features/templating/template_srv', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { backendSrv } from 'app/core/services/backend_srv'; // will use the vers
|
|||||||
import { SelectableValue } from '@grafana/data';
|
import { SelectableValue } from '@grafana/data';
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import { CustomVariableModel } from '../../../../features/variables/types';
|
|||||||
import { initialCustomVariableModelState } from '../../../../features/variables/custom/reducer';
|
import { initialCustomVariableModelState } from '../../../../features/variables/custom/reducer';
|
||||||
|
|
||||||
jest.mock('@grafana/runtime', () => ({
|
jest.mock('@grafana/runtime', () => ({
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
||||||
getBackendSrv: () => backendSrv,
|
getBackendSrv: () => backendSrv,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
18
yarn.lock
18
yarn.lock
@ -6085,15 +6085,10 @@
|
|||||||
jest-diff "^25.2.1"
|
jest-diff "^25.2.1"
|
||||||
pretty-format "^25.2.1"
|
pretty-format "^25.2.1"
|
||||||
|
|
||||||
"@types/jquery@1.10.35":
|
"@types/jquery@3.3.38":
|
||||||
version "1.10.35"
|
version "3.3.38"
|
||||||
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-1.10.35.tgz#4e5c2b1e5b3bf0b863efb8c5e70081f52e6c9518"
|
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.3.38.tgz#6385f1e1b30bd2bff55ae8ee75ea42a999cc3608"
|
||||||
integrity sha512-SVtqEcudm7yjkTwoRA1gC6CNMhGDdMx4Pg8BPdiqI7bXXdCn1BPmtxgeWYQOgDxrq53/5YTlhq5ULxBEAlWIBg==
|
integrity sha512-nkDvmx7x/6kDM5guu/YpXkGZ/Xj/IwGiLDdKM99YA5Vag7pjGyTJ8BNUh/6hxEn/sEu5DKtyRgnONJ7EmOoKrA==
|
||||||
|
|
||||||
"@types/jquery@3.3.32":
|
|
||||||
version "3.3.32"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.3.32.tgz#93e27fdc45dd38ee07f2f0acf34b59c1ccee036f"
|
|
||||||
integrity sha512-UKoof2mnV/X1/Ix2g+V2Ny5sgHjV8nK/UJbiYxuo4zPwzGyFlZ/mp4KaePb2VqQrqJctmcDQNA57buU84/2uIw==
|
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/sizzle" "*"
|
"@types/sizzle" "*"
|
||||||
|
|
||||||
@ -16699,6 +16694,11 @@ jquery@3.4.1:
|
|||||||
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"
|
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"
|
||||||
integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==
|
integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==
|
||||||
|
|
||||||
|
jquery@3.5.1:
|
||||||
|
version "3.5.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.1.tgz#d7b4d08e1bfdb86ad2f1a3d039ea17304717abb5"
|
||||||
|
integrity sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==
|
||||||
|
|
||||||
js-base64@^2.1.8:
|
js-base64@^2.1.8:
|
||||||
version "2.5.1"
|
version "2.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121"
|
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121"
|
||||||
|
Loading…
Reference in New Issue
Block a user