Skip to content

Commit 6444175

Browse files
committed
frontend fix
1 parent 0fd261a commit 6444175

File tree

5 files changed

+17
-25
lines changed

5 files changed

+17
-25
lines changed

Diff for: packages/grafana-ui/src/components/Select/Select.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ export function AsyncVirtualizedSelect<T, Rest = {}>(props: VirtualizedSelectAsy
3838
return <SelectBase virtualized {...props} />;
3939
}
4040

41-
export function AsyncVirtualizedSelect<T>(props: VirtualizedSelectAsyncProps<T>) {
42-
return <SelectBase virtualized {...props} />;
43-
}
44-
4541
interface AsyncMultiSelectProps<T> extends Omit<MultiSelectCommonProps<T>, 'options'>, SelectAsyncProps<T> {
4642
// AsyncSelect has options stored internally. We cannot enable plain values as we don't have access to the fetched options
4743
value?: Array<SelectableValue<T>>;

Diff for: public/app/features/explore/TraceView/components/utils/color-generator.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ export function getFilteredColors(colorsHex: string[], theme: GrafanaTheme2) {
138138
if (redIndex > -1) {
139139
filtered.splice(redIndex, 1);
140140
}
141-
const redIndex2 = colorsHex.indexOf('#BF1B00');
142-
if (redIndex2 > -1) {
143-
filtered.splice(redIndex2, 1);
144-
}
141+
145142
const redIndex2 = colorsHex.indexOf('#BF1B00');
146143
if (redIndex2 > -1) {
147144
colorsHex.splice(redIndex2, 1);

Diff for: public/app/plugins/datasource/fifemon-graphql-datasource/FN_DataSource.ts

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import _ from 'lodash';
2-
import { isEqual } from 'lodash';
3-
import defaults from 'lodash/defaults';
1+
import { isEqual, defaults, isNumber } from 'lodash';
42

53
import {
64
AnnotationEvent,
@@ -11,8 +9,11 @@ import {
119
DataSourceInstanceSettings,
1210
ScopedVars,
1311
TimeRange,
12+
MutableDataFrame,
13+
dateTime,
14+
DataFrame,
15+
FieldType,
1416
} from '@grafana/data';
15-
import { dateTime, MutableDataFrame, FieldType, DataFrame } from '@grafana/data';
1617
import { getTemplateSrv, DataSourceWithBackend } from '@grafana/runtime';
1718
import { BackendSrv, getBackendSrv } from 'app/core/services/backend_srv';
1819

@@ -42,6 +43,7 @@ export class FN_DataSource extends DataSourceWithBackend<MyQuery, MyDataSourceOp
4243
this.withCredentials = instanceSettings.withCredentials;
4344

4445
console.log({ instanceSettings });
46+
// @ts-ignore
4547
const url = instanceSettings.jsonData['connection.url'];
4648
// const url = "http://localhost:8081/api/query"
4749
this.url = url;
@@ -147,6 +149,7 @@ export class FN_DataSource extends DataSourceWithBackend<MyQuery, MyDataSourceOp
147149
return dataPathArray;
148150
}
149151

152+
// @ts-ignore
150153
async query(options: DataQueryRequest<MyQuery>): Promise<DataQueryResponse> {
151154
return Promise.all(
152155
options.targets.map((target) => {
@@ -190,7 +193,7 @@ export class FN_DataSource extends DataSourceWithBackend<MyQuery, MyDataSourceOp
190193
let t: FieldType = FieldType.string;
191194
if (fieldName === timePath || isRFC3339_ISO6801(String(doc[fieldName]))) {
192195
t = FieldType.time;
193-
} else if (_.isNumber(doc[fieldName])) {
196+
} else if (isNumber(doc[fieldName])) {
194197
t = FieldType.number;
195198
}
196199
let title;
@@ -215,6 +218,7 @@ export class FN_DataSource extends DataSourceWithBackend<MyQuery, MyDataSourceOp
215218
name: fieldName,
216219
type: t,
217220
config: { displayName: title },
221+
// @ts-ignore
218222
}).parse = (v: any) => {
219223
return v || '';
220224
};
@@ -234,6 +238,7 @@ export class FN_DataSource extends DataSourceWithBackend<MyQuery, MyDataSourceOp
234238
}
235239
annotationQuery(options: AnnotationQueryRequest<MyQuery>): Promise<AnnotationEvent[]> {
236240
const query = defaults(options.annotation, defaultQuery);
241+
// @ts-ignore
237242
return Promise.all([this.createQuery(query, options.range)]).then((results: any) => {
238243
const r: AnnotationEvent[] = [];
239244
for (const res of results) {
@@ -257,15 +262,15 @@ export class FN_DataSource extends DataSourceWithBackend<MyQuery, MyDataSourceOp
257262
const fieldValue = doc[fieldName];
258263
const replaceKey = 'field_' + fieldName;
259264
const regex = new RegExp('\\$' + replaceKey, 'g');
260-
title = title.replace(regex, fieldValue);
261-
text = text.replace(regex, fieldValue);
262-
tags = tags.replace(regex, fieldValue);
265+
title = title?.replace(regex, fieldValue);
266+
text = text?.replace(regex, fieldValue);
267+
tags = tags?.replace(regex, fieldValue);
263268
}
264269

265270
annotation.title = title;
266271
annotation.text = text;
267272
const tagsList: string[] = [];
268-
for (const element of tags.split(',')) {
273+
for (const element of (tags || '').split(',')) {
269274
const trimmed = element.trim();
270275
if (trimmed) {
271276
tagsList.push(trimmed);

Diff for: public/microfrontends/fn_dashboard/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
<script
2323
nonce=""
24-
src="../../../public/build/runtime~fn_dashboard.375a91acb85697a4dbda.js"
24+
src="../../../public/build/runtime~fn_dashboard.0b5ba2b612e02a26515d.js"
2525
type="text/javascript"
2626
></script>
2727

2828
<script
2929
nonce=""
30-
src="../../../public/build/fn_dashboard.cd8cde89e698ef2786eb.js"
30+
src="../../../public/build/fn_dashboard.742c500e788f62df8c85.js"
3131
type="text/javascript"
3232
></script>
3333

Diff for: public/test/mocks/datasource_srv.ts

-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ export class MockDataSourceApi extends DataSourceApi {
7070
this.meta.mixed = value;
7171
return this;
7272
}
73-
74-
setupMixed(value: boolean) {
75-
this.meta = this.meta || {};
76-
this.meta.mixed = value;
77-
return this;
78-
}
7973
}
8074

8175
export class MockObservableDataSourceApi extends DataSourceApi {

0 commit comments

Comments
 (0)