diff --git a/public/app/core/routes/all.js b/public/app/core/routes/all.js index 6b3d708fe51..2f2a0b6fbde 100644 --- a/public/app/core/routes/all.js +++ b/public/app/core/routes/all.js @@ -132,12 +132,12 @@ define([ controller : 'ResetPasswordCtrl', }) .when('/org/apps', { - templateUrl: 'app/features/org/partials/apps.html', - controller: 'AppsCtrl', + templateUrl: 'app/features/org/partials/app_list.html', + controller: 'AppListCtrl', resolve: loadOrgBundle, }) .when('/org/apps/edit/:type', { - templateUrl: 'app/features/org/partials/appEdit.html', + templateUrl: 'app/features/org/partials/app_edit.html', controller: 'AppEditCtrl', resolve: loadOrgBundle, }) diff --git a/public/app/features/org/all.js b/public/app/features/org/all.js index 3c9e0a4453c..7f300064e5a 100644 --- a/public/app/features/org/all.js +++ b/public/app/features/org/all.js @@ -6,8 +6,8 @@ define([ './userInviteCtrl', './orgApiKeysCtrl', './orgDetailsCtrl', - './appsCtrl', - './appEditCtrl', + './app_list_ctrl', + './app_edit_ctrl', './app_srv', './app_directive', ], function () {}); diff --git a/public/app/features/org/appsCtrl.js b/public/app/features/org/app_list_ctrl.ts similarity index 56% rename from public/app/features/org/appsCtrl.js rename to public/app/features/org/app_list_ctrl.ts index 47e6dfcc5d4..92c1b65ea60 100644 --- a/public/app/features/org/appsCtrl.js +++ b/public/app/features/org/app_list_ctrl.ts @@ -1,13 +1,12 @@ -define([ - 'angular', - 'app/core/config', -], -function (angular, config) { - 'use strict'; +/// - var module = angular.module('grafana.controllers'); +import config = require('app/core/config'); +import angular from 'angular'; - module.controller('AppsCtrl', function($scope, $location, appSrv) { +export class AppListCtrl { + + /** @ngInject */ + constructor($scope: any, appSrv: any, $location: any) { $scope.init = function() { $scope.apps = {}; @@ -27,6 +26,7 @@ function (angular, config) { }; $scope.init(); + } +} - }); -}); \ No newline at end of file +angular.module('grafana.controllers').controller('AppListCtrl', AppListCtrl); diff --git a/public/app/features/org/app_srv.ts b/public/app/features/org/app_srv.ts index eeafe0d311e..2862ca689ea 100644 --- a/public/app/features/org/app_srv.ts +++ b/public/app/features/org/app_srv.ts @@ -30,10 +30,10 @@ export class AppSrv { } return this.backendSrv.get('api/org/apps').then(results => { - this.apps = results.reduce((prev, current) => { + return results.reduce((prev, current) => { prev[current.type] = current; - }, {}); - return this.apps; + return prev; + }, this.apps); }); } diff --git a/public/app/features/org/partials/app_list.html b/public/app/features/org/partials/app_list.html index cd65cdceec4..94044c00cf7 100644 --- a/public/app/features/org/partials/app_list.html +++ b/public/app/features/org/partials/app_list.html @@ -14,28 +14,23 @@ - + - -
TypeName
+   {{p.type}} - Edit + Configure - Enabled  - - -
- \ No newline at end of file +