3 angular.module('yardStickGui2App')
4 .controller('SuiteListController', ['$scope', '$state', '$stateParams', 'mainFactory', 'Upload', 'toaster', 'ngDialog', '$loading',
5 function($scope, $state, $stateParams, mainFactory, Upload, toaster, ngDialog, $loading) {
12 $scope.testsuitlist = [];
14 $scope.gotoDetail = gotoDetail;
15 $scope.gotoCreateSuite = gotoCreateSuite;
20 function getsuiteList() {
21 $loading.start('key');
22 mainFactory.suiteList().get({
24 }).$promise.then(function(response) {
25 $loading.finish('key');
26 if (response.status == 1) {
27 $scope.testsuitlist = response.result.testsuites;
31 $loading.finish('key');
41 function gotoDetail(name) {
42 var temp = name.split('.')[0];
44 $state.go('app.suitedetail', { name: temp })
48 function gotoCreateSuite() {
49 $state.go('app.suitcreate');
52 $scope.goBack = function goBack() {
53 $state.go('app.projectList');
57 $scope.openDeleteEnv = function openDeleteEnv(id, name) {
58 $scope.deleteName = name;
59 $scope.deleteId = id.split('.')[0];
61 template: 'views/modal/deleteConfirm.html',
63 className: 'ngdialog-theme-default',
66 closeByDocument: false
71 $scope.deleteSuite = function deleteSuite() {
72 mainFactory.deleteTestSuite().delete({ 'suite_name': $scope.deleteId }).$promise.then(function(response) {
73 if (response.status == 1) {
76 title: 'delete Test Suite success',
77 body: 'you can go next step',
86 body: response.result,