mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
InputDataSource: Fixed issue with config editor (#19818)
This commit is contained in:
@@ -271,6 +271,12 @@ export function toCSV(data: DataFrame[], config?: CSVConfig): string {
|
||||
|
||||
for (const series of data) {
|
||||
const { fields } = series;
|
||||
|
||||
// ignore frames with no fields
|
||||
if (fields.length === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (config.headerStyle === CSVHeaderStyle.full) {
|
||||
csv =
|
||||
csv +
|
||||
@@ -287,7 +293,9 @@ export function toCSV(data: DataFrame[], config?: CSVConfig): string {
|
||||
}
|
||||
csv += config.newline;
|
||||
}
|
||||
|
||||
const length = fields[0].values.length;
|
||||
|
||||
if (length > 0) {
|
||||
const writers = fields.map(field => makeFieldWriter(field, config!));
|
||||
for (let i = 0; i < length; i++) {
|
||||
|
@@ -141,6 +141,10 @@ export class DashboardImportCtrl {
|
||||
this.autoGenerateUidValue = 'value set';
|
||||
}
|
||||
|
||||
if (!this.dash.uid) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.backendSrv
|
||||
// @ts-ignore
|
||||
.getDashboardByUid(this.dash.uid)
|
||||
|
@@ -4,5 +4,5 @@ export function dataFrameToCSV(dto?: DataFrameDTO[]) {
|
||||
if (!dto || !dto.length) {
|
||||
return '';
|
||||
}
|
||||
return toCSV(dto.map(v => toDataFrame(dto)));
|
||||
return toCSV(dto.map(v => toDataFrame(v)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user