redash/client/app/pages/groups/list.js

36 lines
768 B
JavaScript
Raw Normal View History

2016-11-09 12:38:02 +00:00
import { Paginator } from '../../utils';
import template from './list.html';
function GroupsCtrl($scope, $uibModal, currentUser, Events, Group) {
Events.record('view', 'page', 'groups');
2016-11-09 12:38:02 +00:00
$scope.currentUser = currentUser;
$scope.groups = new Paginator([], { itemsPerPage: 20 });
Group.query((groups) => {
$scope.groups.updateRows(groups);
});
$scope.newGroup = () => {
$uibModal.open({
component: 'editGroupDialog',
size: 'sm',
resolve: {
group() {
return new Group({});
},
},
});
};
}
export default function init(ngModule) {
2016-11-09 12:38:02 +00:00
ngModule.controller('GroupsCtrl', GroupsCtrl);
2016-11-09 13:50:18 +00:00
2016-11-09 12:38:02 +00:00
return {
'/groups': {
template,
controller: 'GroupsCtrl',
2016-11-27 13:49:17 +00:00
title: 'Groups',
2016-11-09 12:38:02 +00:00
},
};
}