Skip to content
Snippets Groups Projects
Commit 3c2be31e authored by Allen Gilliland's avatar Allen Gilliland
Browse files

clearing out some old angular code that we don't use any more.

parent a6afc8ca
Branches
Tags
No related merge requests found
......@@ -41,32 +41,3 @@ DashboardControllers.controller('Dashboard', ['$scope', '$rootScope', '$routePar
$scope.store = finalCreateStore(reducer, { selectedDashboard: $routeParams.dashId });
// $scope.monitor = LogMonitor;
}]);
DashboardControllers.controller('DashList', ['$scope', '$location', 'Dashboard', function($scope, $location, Dashboard) {
$scope.dashboards = [];
var refreshListing = function() {
Dashboard.list({
'filterMode': 'all'
}, function (dashes) {
$scope.dashboards = dashes;
}, function (error) {
console.log('error getting dahsboards list', error);
});
};
$scope.$on("dashboard:create", function(event, dashboardId) {
refreshListing();
});
$scope.$on("dashboard:delete", function(event, dashboardId) {
refreshListing();
});
$scope.$on("dashboard:update", function(event, dashboardId) {
refreshListing();
});
// always initialize with a fresh listing
refreshListing();
}]);
'use strict';
import CreateDashboardModal from '../components/CreateDashboardModal.react';
var DashboardDirectives = angular.module('metabase.dashboard.directives', [
'metabase.metabase.services',
]);
DashboardDirectives.directive('mbDashboardCreate', ['Dashboard', '$modal', '$location', '$rootScope',
function(Dashboard, $modal, $location, $rootScope) {
function link(scope, element, attrs) {
var openModal = function() {
$modal.open({
template: '<div class="Modal" mb-react-component="CreateDashboardModal"></div>',
controller: ['$scope', '$modalInstance',
function($scope, $modalInstance) {
$scope.CreateDashboardModal = CreateDashboardModal;
$scope.createDashboardFn = async function(newDashboard) {
var dashboard = await Dashboard.create(newDashboard).$promise;
$modalInstance.close(dashboard);
$rootScope.$broadcast("dashboard:create", dashboard.id);
$location.path("/dash/" + dashboard.id);
}
$scope.closeFn = function() {
$modalInstance.dismiss('cancel');
};
}
]
});
};
element.bind('click', openModal);
}
return {
restrict: 'A',
link: link,
scope: {
callback: '=',
dashboard: '='
}
};
}
]);
......@@ -7,7 +7,6 @@ var Dashboard = angular.module('metabase.dashboard', [
'metabase.services',
'metabase.dashboard.services',
'metabase.dashboard.controllers',
'metabase.dashboard.directives',
'metabase.card.services'
]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment