mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Inspector: remove feature flag and angular "Export CSV" menu option (#23160)
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
import angular from 'angular';
|
||||
import * as fileExport from 'app/core/utils/file_export';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { DashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
||||
import { CoreEvents } from 'app/types';
|
||||
|
||||
export class ExportDataModalCtrl {
|
||||
private data: any;
|
||||
private panel: string;
|
||||
asRows = true;
|
||||
dateTimeFormat = 'YYYY-MM-DDTHH:mm:ssZ';
|
||||
excel = false;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private dashboardSrv: DashboardSrv) {}
|
||||
|
||||
export() {
|
||||
const timezone = this.dashboardSrv.getCurrent().timezone;
|
||||
const options = {
|
||||
excel: this.excel,
|
||||
dateTimeFormat: this.dateTimeFormat,
|
||||
timezone,
|
||||
};
|
||||
if (this.panel === 'table') {
|
||||
fileExport.exportTableDataToCsv(this.data, this.excel);
|
||||
} else {
|
||||
if (this.asRows) {
|
||||
fileExport.exportSeriesListToCsv(this.data, options);
|
||||
} else {
|
||||
fileExport.exportSeriesListToCsvColumns(this.data, options);
|
||||
}
|
||||
}
|
||||
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
dismiss() {
|
||||
appEvents.emit(CoreEvents.hideModal);
|
||||
}
|
||||
}
|
||||
|
||||
export function exportDataModal() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'public/app/features/dashboard/components/ExportDataModal/template.html',
|
||||
controller: ExportDataModalCtrl,
|
||||
controllerAs: 'ctrl',
|
||||
scope: {
|
||||
panel: '<',
|
||||
data: '<', // The difference to '=' is that the bound properties are not watched
|
||||
},
|
||||
bindToController: true,
|
||||
};
|
||||
}
|
||||
|
||||
angular.module('grafana.directives').directive('exportDataModal', exportDataModal);
|
||||
@@ -1 +0,0 @@
|
||||
export { ExportDataModalCtrl } from './ExportDataModalCtrl';
|
||||
@@ -1,36 +0,0 @@
|
||||
<div class="modal-body">
|
||||
<div class="modal-header">
|
||||
<h2 class="modal-header-title">
|
||||
Export CSV
|
||||
</h2>
|
||||
|
||||
<a class="modal-header-close" ng-click="ctrl.dismiss();">
|
||||
<i class="fa fa-remove"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="p-t-2">
|
||||
<div class="gf-form" ng-hide="ctrl.panel === 'table'">
|
||||
<label class="gf-form-label width-10">Mode</label>
|
||||
<div class="gf-form-select-wrapper">
|
||||
<select class="gf-form-input" ng-model="ctrl.asRows" ng-options="f.value as f.text for f in [{text: 'Series as rows', value: true}, {text: 'Series as columns', value: false}]">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gf-form" ng-hide="ctrl.panel === 'table'">
|
||||
<label class="gf-form-label width-10">Date Time Format</label>
|
||||
<input type="text" class="gf-form-input" ng-model="ctrl.dateTimeFormat">
|
||||
</div>
|
||||
<gf-form-switch class="gf-form"
|
||||
label="Excel CSV Dialect" label-class="width-10" switch-class="max-width-6"
|
||||
checked="ctrl.excel">
|
||||
</gf-form-switch>
|
||||
</div>
|
||||
|
||||
<div class="gf-form-button-row text-center">
|
||||
<a class="btn btn-primary" ng-click="ctrl.export();">Export</a>
|
||||
<a class="btn-text" ng-click="ctrl.dismiss();">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -7,7 +7,6 @@ import './services/DashboardSrv';
|
||||
import './components/DashLinks';
|
||||
import './components/DashExportModal';
|
||||
import './components/DashNav';
|
||||
import './components/ExportDataModal';
|
||||
import './components/VersionHistory';
|
||||
import './components/DashboardSettings';
|
||||
import './components/SubMenu';
|
||||
|
||||
@@ -27,6 +27,12 @@ describe('getPanelMenu', () => {
|
||||
"shortcut": "p s",
|
||||
"text": "Share",
|
||||
},
|
||||
Object {
|
||||
"iconClassName": "fa fa-fw fa-info-circle",
|
||||
"onClick": [Function],
|
||||
"shortcut": "p i",
|
||||
"text": "Inspect",
|
||||
},
|
||||
Object {
|
||||
"iconClassName": "fa fa-fw fa-cube",
|
||||
"onClick": [Function],
|
||||
|
||||
@@ -136,14 +136,12 @@ export function getPanelMenu(
|
||||
});
|
||||
}
|
||||
|
||||
if (config.featureToggles.inspect) {
|
||||
menu.push({
|
||||
text: 'Inspect',
|
||||
iconClassName: 'fa fa-fw fa-info-circle',
|
||||
onClick: onInspectPanel,
|
||||
shortcut: 'p i',
|
||||
});
|
||||
}
|
||||
menu.push({
|
||||
text: 'Inspect',
|
||||
iconClassName: 'fa fa-fw fa-info-circle',
|
||||
onClick: onInspectPanel,
|
||||
shortcut: 'p i',
|
||||
});
|
||||
|
||||
if (config.featureToggles.newEdit) {
|
||||
menu.push({
|
||||
|
||||
Reference in New Issue
Block a user