mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Types: Adds type safety to appEvents (#19418)
* Types: Add type safety to appEvents
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user