Types: Adds type safety to appEvents (#19418)

* Types: Add type safety to appEvents
This commit is contained in:
kay delaney
2019-10-14 09:27:47 +01:00
committed by GitHub
parent e7c37cc316
commit 99411bf37a
138 changed files with 991 additions and 508 deletions

View File

@@ -1,9 +1,10 @@
import { BackendSrv } from 'app/core/services/backend_srv';
import { NavModelSrv } from 'app/core/core';
import { Scope, CoreEvents, AppEventEmitter } from 'app/types';
export default class AdminListOrgsCtrl {
/** @ngInject */
constructor($scope: any, backendSrv: BackendSrv, navModelSrv: NavModelSrv) {
constructor($scope: Scope & AppEventEmitter, backendSrv: BackendSrv, navModelSrv: NavModelSrv) {
$scope.init = () => {
$scope.navModel = navModelSrv.getNav('admin', 'global-orgs', 0);
$scope.getOrgs();
@@ -16,9 +17,9 @@ export default class AdminListOrgsCtrl {
};
$scope.deleteOrg = (org: any) => {
$scope.appEvent('confirm-modal', {
$scope.appEvent(CoreEvents.showConfirmModal, {
title: 'Delete',
text: 'Do you want to delete organization ' + org.name + '?',
text: `Do you want to delete organization ${org.name}?`,
text2: 'All dashboards for this organization will be removed!',
icon: 'fa-trash',
yesText: 'Delete',