feat(export): began working on export modal

This commit is contained in:
Torkel Ödegaard
2016-05-17 10:29:57 +02:00
parent 7cd663bbe8
commit ad7a1e15b4
10 changed files with 131 additions and 15 deletions

View File

@@ -4,7 +4,7 @@ import _ from 'lodash';
import moment from 'moment';
import angular from 'angular';
import {DashboardExporter} from '../exporter';
import {DashboardExporter} from '../export/exporter';
export class DashNavCtrl {
@@ -14,7 +14,6 @@ export class DashNavCtrl {
$scope.init = function() {
$scope.onAppEvent('save-dashboard', $scope.saveDashboard);
$scope.onAppEvent('delete-dashboard', $scope.deleteDashboard);
$scope.onAppEvent('export-dashboard', $scope.snapshot);
$scope.onAppEvent('quick-snapshot', $scope.quickSnapshot);
$scope.showSettingsMenu = $scope.dashboardMeta.canEdit || $scope.contextSrv.isEditor;
@@ -60,6 +59,12 @@ export class DashNavCtrl {
$scope.shareDashboard(1);
};
$scope.shareExport = function() {
$scope.appEvent('show-modal', {
templateHtml: '<dash-export-modal></dash-export-modal>',
});
};
$scope.openSearch = function() {
$scope.appEvent('show-dash-search');
};
@@ -181,7 +186,6 @@ export class DashNavCtrl {
$rootScope.$broadcast('refresh');
$timeout(function() {
$scope.exportDashboard();
$scope.dashboard.snapshot = false;
$scope.appEvent('dashboard-snapshot-cleanup');
}, 1000);