Cleaning up the way authorities are selected and upgrading uib dependencies.

This commit is contained in:
kevgliss 2016-05-09 17:17:00 -07:00
parent df0ad4d875
commit 78c8d12ad8
24 changed files with 401 additions and 291 deletions

View File

@ -6,43 +6,45 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"angular": "1.3", "jquery": "~2.2.0",
"json3": "~3.3",
"es5-shim": "~4.0",
"jquery": "~2.1",
"angular-resource": "1.2.15",
"angular-cookies": "1.2.15",
"angular-sanitize": "1.2.15",
"angular-route": "1.2.15",
"angular-strap": "~2.0.2",
"restangular": "~1.4.0",
"ng-table": "~0.5.4",
"ngAnimate": "*",
"moment": "~2.6.0",
"angular-animate": "~1.4.0",
"angular-loading-bar": "~0.6.0",
"fontawesome": "~4.2.0",
"angular-wizard": "~0.4.0", "angular-wizard": "~0.4.0",
"bootswatch": "3.3.1+2", "angular": "1.4.9",
"json3": "~3.3",
"es5-shim": "~4.5.0",
"bootstrap": "~3.3.6",
"angular-bootstrap": "~1.1.1",
"angular-animate": "~1.4.9",
"restangular": "~1.5.1",
"ng-table": "~0.8.3",
"moment": "~2.11.1",
"angular-loading-bar": "~0.8.0",
"angular-moment": "~0.10.3",
"moment-range": "~2.1.0",
"angular-spinkit": "~0.3.3", "angular-spinkit": "~0.3.3",
"angular-bootstrap": "~0.12.0", "angular-clipboard": "~1.3.0",
"angular-ui-switch": "~0.1.0",
"angular-chart.js": "~0.7.1",
"satellizer": "~0.9.4",
"angularjs-toaster": "~1.0.0", "angularjs-toaster": "~1.0.0",
"ngletteravatar": "~3.0.1", "angular-chart.js": "~0.8.8",
"ngletteravatar": "~4.0.0",
"bootswatch": "~3.3.6",
"fontawesome": "~4.5.0",
"satellizer": "~0.13.4",
"angular-ui-router": "~0.2.15", "angular-ui-router": "~0.2.15",
"angular-clipboard": "~1.1.1", "font-awesome": "~4.5.0",
"angular-file-saver": "~1.0.1" "lodash": "~4.0.1",
}, "underscore": "~1.8.3",
"devDependencies": { "angular-smart-table": "~2.1.6",
"angular-mocks": "~1.3", "angular-strap": ">= 2.2.2",
"angular-scenario": "~1.3", "angular-underscore": "^0.5.0",
"ngletteravatar": "~3.0.1" "angular-translate": "^2.9.0",
"angular-ui-switch": "~0.1.0",
"angular-sanitize": "^1.5.0",
"angular-file-saver": "~1.0.1",
"angular-selectize2": "^3.0.1"
}, },
"resolutions": { "resolutions": {
"bootstrap": "~3.3.1", "moment": ">=2.8.0 <2.11.0",
"angular": "1.3" "lodash": ">=1.3.0 <2.5.0",
"angular": "1.4.9"
}, },
"ignore": [ "ignore": [
"**/.*", "**/.*",

View File

@ -81,6 +81,7 @@ gulp.task('dev:styles', function () {
'bower_components/angular-wizard/dist/angular-wizard.css', 'bower_components/angular-wizard/dist/angular-wizard.css',
'bower_components/ng-table/ng-table.css', 'bower_components/ng-table/ng-table.css',
'bower_components/angularjs-toaster/toaster.css', 'bower_components/angularjs-toaster/toaster.css',
'bower_components/selectize/dist/css/selectize.bootstrap3.css',
'lemur/static/app/styles/lemur.css' 'lemur/static/app/styles/lemur.css'
]; ];

View File

@ -17,7 +17,9 @@
'satellizer', 'satellizer',
'ngLetterAvatar', 'ngLetterAvatar',
'angular-clipboard', 'angular-clipboard',
'ngFileSaver' 'ngFileSaver',
'ngSanitize',
'selectize'
]); ]);

View File

@ -2,7 +2,7 @@
angular.module('lemur') angular.module('lemur')
.controller('AuthorityEditController', function ($scope, $modalInstance, AuthorityApi, AuthorityService, RoleService, toaster, editId){ .controller('AuthorityEditController', function ($scope, $uibModalInstance, AuthorityApi, AuthorityService, RoleService, toaster, editId){
AuthorityApi.get(editId).then(function (authority) { AuthorityApi.get(editId).then(function (authority) {
$scope.authority = authority; $scope.authority = authority;
}); });
@ -17,7 +17,7 @@ angular.module('lemur')
title: authority.name, title: authority.name,
body: 'Successfully updated!' body: 'Successfully updated!'
}); });
$modalInstance.close(); $uibModalInstance.close();
}, },
function (response) { function (response) {
toaster.pop({ toaster.pop({
@ -30,18 +30,41 @@ angular.module('lemur')
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
}) })
.controller('AuthorityCreateController', function ($scope, $modalInstance, AuthorityService, LemurRestangular, RoleService, PluginService, WizardHandler, toaster) { .controller('AuthorityCreateController', function ($scope, $uibModalInstance, AuthorityService, AuthorityApi, LemurRestangular, RoleService, PluginService, WizardHandler, toaster) {
$scope.authority = LemurRestangular.restangularizeElement(null, {}, 'authorities'); $scope.authority = LemurRestangular.restangularizeElement(null, {}, 'authorities');
$scope.authorities = [];
AuthorityApi.getList().then(function (authorities) {
angular.extend($scope.authorities, authorities);
});
$scope.authorityConfig = {
valueField: 'id',
labelField: 'name',
placeholder: 'Select Authority',
maxItems: 1,
onChange: function (value) {
angular.forEach($scope.authorities, function (authority) {
if (authority.id === parseInt(value)) {
$scope.authority.authority = authority;
}
});
}
};
// set the defaults // set the defaults
AuthorityService.getDefaults($scope.authority); AuthorityService.getDefaults($scope.authority);
AuthorityApi.getList().then(function (authorities) {
$scope.authorities = authorities;
});
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
$scope.create = function (authority) { $scope.create = function (authority) {
@ -53,7 +76,7 @@ angular.module('lemur')
title: authority.name, title: authority.name,
body: 'Was created!' body: 'Was created!'
}); });
$modalInstance.close(); $uibModalInstance.close();
}, },
function (response) { function (response) {
toaster.pop({ toaster.pop({
@ -72,20 +95,38 @@ angular.module('lemur')
}); });
$scope.roleService = RoleService; $scope.roleService = RoleService;
$scope.authorityService = AuthorityService; $scope.authorityService = AuthorityService;
$scope.open = function($event) { $scope.dateOptions = {
$event.preventDefault(); formatYear: 'yy',
$event.stopPropagation(); maxDate: new Date(2020, 5, 22),
minDate: new Date(),
$scope.opened1 = true; startingDay: 1
}; };
$scope.open2 = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.opened2 = true; $scope.open1 = function() {
$scope.popup1.opened = true;
}; };
$scope.open2 = function() {
$scope.popup2.opened = true;
};
$scope.setDate = function(year, month, day) {
$scope.dt = new Date(year, month, day);
};
$scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
$scope.format = $scope.formats[0];
$scope.altInputFormats = ['M!/d!/yyyy'];
$scope.popup1 = {
opened: false
};
$scope.popup2 = {
opened: false
};
}); });

View File

@ -6,8 +6,11 @@
Name Name
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="name" ng-model="authority.name" placeholder="Name" tooltip="This will be the name of your authority, it is the name you will reference when creating new certificates" class="form-control" ng-pattern="/^[A-Za-z0-9_-]+$/" required/> <input name="name" ng-model="authority.name" placeholder="Name"
<p ng-show="trackingForm.name.$invalid && !trackingForm.name.$pristine" class="help-block">You must enter a valid authority name, spaces are not allowed</p> uib-tooltip="This will be the name of your authority, it is the name you will reference when creating new certificates"
class="form-control" ng-pattern="/^[A-Za-z0-9_-]+$/" required/>
<p ng-show="trackingForm.name.$invalid && !trackingForm.name.$pristine" class="help-block">You must
enter a valid authority name, spaces are not allowed</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -16,8 +19,11 @@
Owner Owner
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="email" name="owner" ng-model="authority.owner" placeholder="TeamDL@example.com" tooltip="This is the authorities team distribution list or the main point of contact for this authority" class="form-control" required/> <input type="email" name="owner" ng-model="authority.owner" placeholder="TeamDL@example.com"
<p ng-show="trackingForm.owner.$invalid && !trackingForm.owner.$pristine" class="help-block">You must enter an Certificate Authority owner</p> uib-tooltip="This is the authorities team distribution list or the main point of contact for this authority"
class="form-control" required/>
<p ng-show="trackingForm.owner.$invalid && !trackingForm.owner.$pristine" class="help-block">You must
enter an Certificate Authority owner</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -26,8 +32,10 @@
Description Description
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea name="description" ng-model="authority.description" placeholder="Something elegant" class="form-control" ng-maxlength="250" required></textarea> <textarea name="description" ng-model="authority.description" placeholder="Something elegant"
<p ng-show="trackingForm.description.$invalid && !trackingForm.description.$pristine" class="help-block">You must give a short description about this authority will be used for</p> class="form-control" ng-maxlength="250" required></textarea>
<p ng-show="trackingForm.description.$invalid && !trackingForm.description.$pristine"
class="help-block">You must give a short description about this authority will be used for</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -36,8 +44,10 @@
Common Name Common Name
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="commonName" ng-model="authority.commonName" placeholder="Common Name" class="form-control" ng-maxlength="64" required/> <input name="commonName" ng-model="authority.commonName" placeholder="Common Name" class="form-control"
<p ng-show="trackingForm.commonName.$invalid && !trackingForm.commonName.$pristine" class="help-block">You must enter a common name and it must be less than 64 characters in length</p> ng-maxlength="64" required/>
<p ng-show="trackingForm.commonName.$invalid && !trackingForm.commonName.$pristine" class="help-block">
You must enter a common name and it must be less than 64 characters in length</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -45,7 +55,9 @@
Type Type
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<select class="form-control" ng-model="authority.type" ng-options="option for option in ['root', 'subca']" ng-init="authority.type = 'root'"required></select> <select class="form-control" ng-model="authority.type"
ng-options="option for option in ['root', 'subca']" ng-init="authority.type = 'root'"
required></select>
</div> </div>
</div> </div>
<div ng-show="authority.type == 'subca'" class="form-group"> <div ng-show="authority.type == 'subca'" class="form-group">
@ -53,11 +65,8 @@
Parent Authority Parent Authority
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" ng-model="authority.authority" placeholder="Parent Authority Name" <selectize placeholder="Select an Authority..." options='authorities' config="authorityConfig"
typeahead="authority as authority.name for authority in authorityService.findAuthorityByName($viewValue)" typeahead-loading="loadingAuthorities" ng-model="authority.parent" ng-disabled='disable' required='true'></selectize>
class="form-control input-md" typeahead-min-wait="50"
tooltip="When you specify a subordinate certificate authority you must specify the parent authority"
tooltip-trigger="focus" tooltip-placement="top">
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -77,31 +86,40 @@
<strong>- or -</strong> <strong>- or -</strong>
</span> </span>
<div class="col-sm-3"> <div class="col-sm-3">
<div>
<div class="input-group"> <div class="input-group">
<input name="validityStart" tooltip="Starting Date" class="form-control" datepicker-popup="yyyy/MM/dd" is-open="opened1" ng-model="authority.validityStart" min-date="authority.authority.notBefore" <input type="text" class="form-control"
max-date="authority.authority.notAfter" required/> uib-datepicker-popup="yyyy/MM/dd"
<p ng-show="trackingForm.validityStart.$invalid && !trackingForm.validityStart.$pristine" class="help-block">A start date is required!</p> ng-model="authority.validityStart"
is-open="popup1.opened"
datepicker-options="dateOptions"
close-text="Close"
max-date="authority.authority.notAfter"
min-date="authority.authority.notBefore"
alt-input-formats="altInputFormats" />
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button> <button type="button" class="btn btn-default" ng-click="open1()"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
</div> </div>
</div> </div>
</div> <span style="padding-top: 15px" class="text-center col-sm-1"><label><span
<span style="padding-top: 15px" class="text-center col-sm-1"><label><span class="glyphicon glyphicon-resize-horizontal"></span></label></span> class="glyphicon glyphicon-resize-horizontal"></span></label></span>
<div class="col-sm-3"> <div class="col-sm-3">
<div>
<div class="input-group"> <div class="input-group">
<input name="validityEnd" tooltip="Ending Date" class="form-control" datepicker-popup="yyyy/MM/dd" is-open="opened2" ng-model="authority.validityEnd" min-date="authority.authority.notBefore" <input type="text" class="form-control"
max-date="authority.authority.notAfter" required/> uib-datepicker-popup="yyyy/MM/dd"
<p ng-show="trackingForm.validityEnd.$invalid && !trackingForm.validityEnd.$pristine" class="help-block">A end date is required!</p> ng-model="authority.validityEnd"
is-open="popup2.opened"
datepicker-options="dateOptions"
close-text="Close"
max-date="authority.authority.notAfter"
min-date="authority.authority.notBefore"
alt-input-formats="altInputFormats" />
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" ng-click="open2($event)"><i class="glyphicon glyphicon-calendar"></i></button> <button type="button" class="btn btn-default" ng-click="open2()"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</form> </form>

View File

@ -16,7 +16,7 @@ angular.module('lemur')
}); });
}) })
.controller('AuthoritiesViewController', function ($scope, $q, $modal, $stateParams, AuthorityApi, AuthorityService, ngTableParams, toaster) { .controller('AuthoritiesViewController', function ($scope, $q, $uibModal, $stateParams, AuthorityApi, AuthorityService, ngTableParams, toaster) {
$scope.filter = $stateParams; $scope.filter = $stateParams;
$scope.authoritiesTable = new ngTableParams({ $scope.authoritiesTable = new ngTableParams({
page: 1, // show first page page: 1, // show first page
@ -65,7 +65,7 @@ angular.module('lemur')
}; };
$scope.edit = function (authorityId) { $scope.edit = function (authorityId) {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
templateUrl: '/angular/authorities/authority/edit.tpl.html', templateUrl: '/angular/authorities/authority/edit.tpl.html',
controller: 'AuthorityEditController', controller: 'AuthorityEditController',
@ -78,14 +78,14 @@ angular.module('lemur')
} }
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.authoritiesTable.reload(); $scope.authoritiesTable.reload();
}); });
}; };
$scope.editRole = function (roleId) { $scope.editRole = function (roleId) {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
templateUrl: '/angular/roles/role/role.tpl.html', templateUrl: '/angular/roles/role/role.tpl.html',
controller: 'RolesEditController', controller: 'RolesEditController',
@ -98,14 +98,14 @@ angular.module('lemur')
} }
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.authoritiesTable.reload(); $scope.authoritiesTable.reload();
}); });
}; };
$scope.create = function () { $scope.create = function () {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
controller: 'AuthorityCreateController', controller: 'AuthorityCreateController',
templateUrl: '/angular/authorities/authority/authorityWizard.tpl.html', templateUrl: '/angular/authorities/authority/authorityWizard.tpl.html',
@ -113,7 +113,7 @@ angular.module('lemur')
backdrop: 'static', backdrop: 'static',
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.authoritiesTable.reload(); $scope.authoritiesTable.reload();
}); });

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('lemur') angular.module('lemur')
.controller('CertificateExportController', function ($scope, $modalInstance, CertificateApi, CertificateService, PluginService, FileSaver, Blob, toaster, editId) { .controller('CertificateExportController', function ($scope, $uibModalInstance, CertificateApi, CertificateService, PluginService, FileSaver, Blob, toaster, editId) {
CertificateApi.get(editId).then(function (certificate) { CertificateApi.get(editId).then(function (certificate) {
$scope.certificate = certificate; $scope.certificate = certificate;
}); });
@ -11,7 +11,7 @@ angular.module('lemur')
}); });
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
$scope.save = function (certificate) { $scope.save = function (certificate) {
@ -49,7 +49,7 @@ angular.module('lemur')
}); });
}; };
}) })
.controller('CertificateEditController', function ($scope, $modalInstance, CertificateApi, CertificateService, DestinationService, NotificationService, toaster, editId) { .controller('CertificateEditController', function ($scope, $uibModalInstance, CertificateApi, CertificateService, DestinationService, NotificationService, toaster, editId) {
CertificateApi.get(editId).then(function (certificate) { CertificateApi.get(editId).then(function (certificate) {
CertificateService.getNotifications(certificate); CertificateService.getNotifications(certificate);
CertificateService.getDestinations(certificate); CertificateService.getDestinations(certificate);
@ -58,7 +58,7 @@ angular.module('lemur')
}); });
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
$scope.save = function (certificate) { $scope.save = function (certificate) {
@ -69,7 +69,7 @@ angular.module('lemur')
title: certificate.name, title: certificate.name,
body: 'Successfully updated!' body: 'Successfully updated!'
}); });
$modalInstance.close(); $uibModalInstance.close();
}, },
function (response) { function (response) {
toaster.pop({ toaster.pop({
@ -88,16 +88,76 @@ angular.module('lemur')
$scope.notificationService = NotificationService; $scope.notificationService = NotificationService;
}) })
.controller('CertificateCreateController', function ($scope, $modalInstance, CertificateApi, CertificateService, DestinationService, AuthorityService, PluginService, MomentService, WizardHandler, LemurRestangular, NotificationService, toaster) { .controller('CertificateCreateController', function ($scope, $uibModalInstance, CertificateApi, CertificateService, DestinationService, AuthorityService, AuthorityApi, PluginService, MomentService, WizardHandler, LemurRestangular, NotificationService, toaster) {
$scope.certificate = LemurRestangular.restangularizeElement(null, {}, 'certificates'); $scope.certificate = LemurRestangular.restangularizeElement(null, {}, 'certificates');
// set the defaults // set the defaults
CertificateService.getDefaults($scope.certificate); CertificateService.getDefaults($scope.certificate);
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
$scope.authorities = [];
AuthorityApi.getList().then(function (authorities) {
angular.extend($scope.authorities, authorities);
});
$scope.authorityConfig = {
valueField: 'id',
labelField: 'name',
placeholder: 'Select Authority',
maxItems: 1,
onChange: function (value) {
angular.forEach($scope.authorities, function (authority) {
if (authority.id === parseInt(value)) {
$scope.certificate.authority = authority;
}
});
}
};
$scope.dateOptions = {
formatYear: 'yy',
maxDate: new Date(2020, 5, 22),
minDate: new Date(),
startingDay: 1
};
$scope.open1 = function() {
$scope.popup1.opened = true;
};
$scope.open2 = function() {
$scope.popup2.opened = true;
};
$scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
$scope.format = $scope.formats[0];
$scope.altInputFormats = ['M!/d!/yyyy'];
$scope.popup1 = {
opened: false
};
$scope.popup2 = {
opened: false
};
var formatAuthorities = function (authorities) {
var newAuthorities = [];
angular.forEach(authorities, function (authority) {
authority.formatted = authority.name + '<span class="text-muted"> - ' + authority.description + '</span>';
newAuthorities.push(authority);
});
return newAuthorities;
};
AuthorityService.findActiveAuthorityByName().then(function (authorities) {
$scope.authorities = formatAuthorities(authorities);
});
$scope.create = function (certificate) { $scope.create = function (certificate) {
WizardHandler.wizard().context.loading = true; WizardHandler.wizard().context.loading = true;
CertificateService.create(certificate).then( CertificateService.create(certificate).then(
@ -107,7 +167,7 @@ angular.module('lemur')
title: certificate.name, title: certificate.name,
body: 'Successfully created!' body: 'Successfully created!'
}); });
$modalInstance.close(); $uibModalInstance.close();
}, },
function (response) { function (response) {
toaster.pop({ toaster.pop({
@ -163,20 +223,6 @@ angular.module('lemur')
} }
]; ];
$scope.openNotBefore = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.openNotBefore.isOpen = true;
};
$scope.openNotAfter = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.openNotAfter.isOpen = true;
};
PluginService.getByType('destination').then(function (plugins) { PluginService.getByType('destination').then(function (plugins) {
$scope.plugins = plugins; $scope.plugins = plugins;

View File

@ -5,10 +5,11 @@
<div class="col-sm-10"> <div class="col-sm-10">
<div class="input-group"> <div class="input-group">
<input type="text" ng-model="certificate.selectedDestination" placeholder="AWS..." <input type="text" ng-model="certificate.selectedDestination" placeholder="AWS..."
typeahead="destination.label for destination in destinationService.findDestinationsByName($viewValue)" typeahead-loading="loadingDestinations" uib-typeahead="destination.label for destination in destinationService.findDestinationsByName($viewValue)" typeahead-loading="loadingDestinations"
class="form-control input-md" typeahead-on-select="certificate.attachDestination($item)" typeahead-min-wait="50" class="form-control input-md" typeahead-on-select="certificate.attachDestination($item)"
tooltip="Lemur can upload certificates to any pre-defined destination" uib-tooltip="Lemur can upload certificates to any pre-defined destination"
tooltip-trigger="focus" tooltip-placement="top"> uib-tooltip-trigger="focus" uib-tooltip-placement="top"
typeahead-wait-ms="500">
<span class="input-group-btn"> <span class="input-group-btn">
<button ng-model="destinations.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0"> <button ng-model="destinations.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0">
<span class="badge">{{ certificate.destinations.length || 0 }}</span> <span class="badge">{{ certificate.destinations.length || 0 }}</span>

View File

@ -5,10 +5,10 @@
<div class="col-sm-10"> <div class="col-sm-10">
<div class="input-group"> <div class="input-group">
<input type="text" ng-model="certificate.selectedNotification" placeholder="Email" <input type="text" ng-model="certificate.selectedNotification" placeholder="Email"
typeahead="notification.label for notification in notificationService.findNotificationsByName($viewValue)" typeahead-loading="loadingDestinations" uib-typeahead="notification.label for notification in notificationService.findNotificationsByName($viewValue)" typeahead-loading="loadingDestinations"
class="form-control input-md" typeahead-on-select="certificate.attachNotification($item)" typeahead-min-wait="50" class="form-control input-md" typeahead-on-select="certificate.attachNotification($item)"
tooltip="By default Lemur will always notify you about this certificate through Email notifications." uib-tooltip="By default Lemur will always notify you about this certificate through Email notifications."
tooltip-trigger="focus" tooltip-placement="top"> uib-tooltip-trigger="focus" tooltip-placement="top" typeahead-wait-ms="500">
<span class="input-group-btn"> <span class="input-group-btn">
<button ng-model="notifications.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0"> <button ng-model="notifications.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0">
<span class="badge">{{ certificate.notifications.length || 0 }}</span> <span class="badge">{{ certificate.notifications.length || 0 }}</span>

View File

@ -5,10 +5,10 @@
<div class="col-sm-10"> <div class="col-sm-10">
<div class="input-group"> <div class="input-group">
<input type="text" ng-model="certificate.selectedReplacement" placeholder="Certificate123..." <input type="text" ng-model="certificate.selectedReplacement" placeholder="Certificate123..."
typeahead="certificate.name for certificate in certificateService.findCertificatesByName($viewValue)" typeahead-loading="loadingCertificates" uib-typeahead="certificate.name for certificate in certificateService.findCertificatesByName($viewValue)" typeahead-loading="loadingCertificates"
class="form-control input-md" typeahead-on-select="certificate.attachReplacement($item)" typeahead-min-wait="100" class="form-control input-md" typeahead-on-select="certificate.attachReplacement($item)"
tooltip="Lemur will mark any certificates being replaced as 'inactive'" uib-tooltip="Lemur will mark any certificates being replaced as 'inactive'"
tooltip-trigger="focus" tooltip-placement="top"> uib-tooltip-trigger="focus" uib-tooltip-placement="top" typeahead-wait-ms="500">
<span class="input-group-btn"> <span class="input-group-btn">
<button ng-model="replacements.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0"> <button ng-model="replacements.show" class="btn btn-md btn-default" btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0">
<span class="badge">{{ certificate.replacements.length || 0 }}</span> <span class="badge">{{ certificate.replacements.length || 0 }}</span>

View File

@ -8,7 +8,7 @@
<div class="col-sm-10"> <div class="col-sm-10">
<input type="email" name="ownerEmail" ng-model="certificate.owner" placeholder="TeamDL@example.com" <input type="email" name="ownerEmail" ng-model="certificate.owner" placeholder="TeamDL@example.com"
tooltip="This is the certificates team distribution list or main point of contact" uib-tooltip="This is the certificates team distribution list or main point of contact"
class="form-control" class="form-control"
required/> required/>
@ -18,7 +18,7 @@
</div> </div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': trackingForm.name.$invalid, 'has-success': !trackingForm.name.$invalid&&trackingForm.name.$dirty}"> ng-class="{'has-error': trackingForm.name.$invalid, 'has-success': !trackingForm.name.$invalid&&trackingForm.name.$dirty}">
<label class="control-label col-sm-2" tooltip="If no name is provided, Lemur will generate a name for you"> <label class="control-label col-sm-2" uib-tooltip="If no name is provided, Lemur will generate a name for you">
Custom Name <span class="glyphicon glyphicon-question-sign"></span> Custom Name <span class="glyphicon glyphicon-question-sign"></span>
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
@ -35,7 +35,6 @@
<div class="col-sm-10"> <div class="col-sm-10">
<textarea name="description" ng-model="certificate.description" placeholder="Something elegant" <textarea name="description" ng-model="certificate.description" placeholder="Something elegant"
class="form-control" required></textarea> class="form-control" required></textarea>
<p ng-show="trackingForm.description.$invalid && !trackingForm.description.$pristine" <p ng-show="trackingForm.description.$invalid && !trackingForm.description.$pristine"
class="help-block">You class="help-block">You
must give a short description about this authority will be used for.</p> must give a short description about this authority will be used for.</p>
@ -46,18 +45,9 @@
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Certificate Authority Certificate Authority
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<div class="input-group col-sm-12"> <selectize name="selectedAuthority" placeholder="Select an Authority..." options="authorities" config="authorityConfig"
<input name="selectedAuthority" ng-model="certificate.selectedAuthority" required="true"></selectize>
tooltip="If you are unsure which authority you need; you most likely want to use 'verisign'"
type="text" ng-model="certificate.selectedAuthority" placeholder="Authority Name"
typeahead-on-select="certificate.attachAuthority($item)"
typeahead="authority.name for authority in authorityService.findActiveAuthorityByName($viewValue)"
typeahead-loading="loadingAuthorities"
class="form-control" typeahead-wait-ms="1000"
typeahead-template-url="angular/authorities/authority/select.tpl.html" required>
</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -78,7 +68,7 @@
<div class="col-sm-10"> <div class="col-sm-10">
<input name="commonName" <input name="commonName"
tooltip="If you need a certificate with multiple domains enter your primary domain here and the rest under 'Subject Alternate Names' in the next few panels" uib-tooltip="If you need a certificate with multiple domains enter your primary domain here and the rest under 'Subject Alternate Names' in the next few panels"
ng-model="certificate.commonName" placeholder="Common Name" class="form-control" ng-model="certificate.commonName" placeholder="Common Name" class="form-control"
ng-maxlength="64" ng-maxlength="64"
required/> required/>
@ -90,7 +80,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" <label class="control-label col-sm-2"
tooltip="If no date is selected Lemur attempts to issue a 2 year certificate"> uib-tooltip="If no date is selected Lemur attempts to issue a 2 year certificate">
Validity Range <span class="glyphicon glyphicon-question-sign"></span> Validity Range <span class="glyphicon glyphicon-question-sign"></span>
</label> </label>
<div class="col-sm-2"> <div class="col-sm-2">
@ -106,11 +96,17 @@
</span> </span>
<div class="col-sm-3"> <div class="col-sm-3">
<div class="input-group"> <div class="input-group">
<input tooltip="Starting Date (yyyy/MM/dd)" class="form-control" datepicker-popup="yyyy/MM/dd" <input type="text" class="form-control"
is-open="$parent.openNotBefore.isOpen" min-date="certificate.authority.notBefore" uib-datepicker-popup="yyyy/MM/dd"
max-date="certificate.authority.notAfter" ng-model="certificate.validityStart"/> ng-model="certificate.validityStart"
is-open="popup1.opened"
datepicker-options="dateOptions"
close-text="Close"
max-date="certificate.authority.notAfter"
min-date="certificate.authority.notBefore"
alt-input-formats="altInputFormats"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" ng-click="openNotBefore($event)"><i <button type="button" class="btn btn-default" ng-click="open1()"><i
class="glyphicon glyphicon-calendar"></i></button> class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
</div> </div>
@ -118,26 +114,30 @@
<span style="padding-top: 15px" class="text-center col-sm-1"><label><span <span style="padding-top: 15px" class="text-center col-sm-1"><label><span
class="glyphicon glyphicon-resize-horizontal"></span></label></span> class="glyphicon glyphicon-resize-horizontal"></span></label></span>
<div class="col-sm-3"> <div class="col-sm-3">
<div>
<div class="input-group"> <div class="input-group">
<input tooltip="Ending Date (yyyy/MM/dd)" class="form-control" datepicker-popup="yyyy/MM/dd" <input type="text" class="form-control"
is-open="$parent.openNotAfter.isOpen" min-date="certificate.authority.notBefore" uib-datepicker-popup="yyyy/MM/dd"
max-date="certificate.authority.notAfter" ng-model="certificate.validityEnd"/> ng-model="certificate.validityEnd"
is-open="popup2.opened"
datepicker-options="dateOptions"
close-text="Close"
max-date="certificate.authority.notAfter"
min-date="certificate.authority.notBefore"
alt-input-formats="altInputFormats"/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" ng-click="openNotAfter($event)"><i <button type="button" class="btn btn-default" ng-click="open2()"><i
class="glyphicon glyphicon-calendar"></i></button> class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': trackingForm.csr.$invalid&&trackingForm.csr.$dirty, 'has-success': !trackingForm.csr.$invalid&&trackingForm.csr.$dirty}"> ng-class="{'has-error': trackingForm.csr.$invalid&&trackingForm.csr.$dirty, 'has-success': !trackingForm.csr.$invalid&&trackingForm.csr.$dirty}">
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Certificate Signing Request (CSR) Certificate Signing Request (CSR)
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea tooltip="Values defined in the CSR will take precedence" name="certificate signing request" <textarea uib-tooltip="Values defined in the CSR will take precedence" name="certificate signing request"
ng-model="certificate.csr" ng-model="certificate.csr"
placeholder="PEM encoded string..." class="form-control" placeholder="PEM encoded string..." class="form-control"
ng-pattern="/^-----BEGIN CERTIFICATE REQUEST-----/"></textarea> ng-pattern="/^-----BEGIN CERTIFICATE REQUEST-----/"></textarea>

View File

@ -2,7 +2,7 @@
angular.module('lemur') angular.module('lemur')
.controller('CertificateUploadController', function ($scope, $modalInstance, CertificateService, LemurRestangular, DestinationService, NotificationService, PluginService, toaster) { .controller('CertificateUploadController', function ($scope, $uibModalInstance, CertificateService, LemurRestangular, DestinationService, NotificationService, PluginService, toaster) {
$scope.certificate = LemurRestangular.restangularizeElement(null, {}, 'certificates'); $scope.certificate = LemurRestangular.restangularizeElement(null, {}, 'certificates');
$scope.upload = CertificateService.upload; $scope.upload = CertificateService.upload;
@ -22,7 +22,7 @@ angular.module('lemur')
title: certificate.name, title: certificate.name,
body: 'Successfully uploaded!' body: 'Successfully uploaded!'
}); });
$modalInstance.close(); $uibModalInstance.close();
}, },
function (response) { function (response) {
toaster.pop({ toaster.pop({
@ -35,7 +35,7 @@ angular.module('lemur')
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
}); });

View File

@ -21,7 +21,7 @@
</div> </div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': uploadForm.name.$invalid, 'has-success': !uploadForm.name.$invalid&&uploadForm.name.$dirty}"> ng-class="{'has-error': uploadForm.name.$invalid, 'has-success': !uploadForm.name.$invalid&&uploadForm.name.$dirty}">
<label class="control-label col-sm-2" tooltip="If no name is provided, Lemur will generate a name for you"> <label class="control-label col-sm-2" uib-tooltip="If no name is provided, Lemur will generate a name for you">
Custom Name <span class="glyphicon glyphicon-question-sign"></span> Custom Name <span class="glyphicon glyphicon-question-sign"></span>
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">

View File

@ -17,7 +17,7 @@ angular.module('lemur')
}); });
}) })
.controller('CertificatesViewController', function ($q, $scope, $modal, $stateParams, CertificateApi, CertificateService, MomentService, ngTableParams, toaster) { .controller('CertificatesViewController', function ($q, $scope, $uibModal, $stateParams, CertificateApi, CertificateService, MomentService, ngTableParams, toaster) {
$scope.filter = $stateParams; $scope.filter = $stateParams;
$scope.certificateTable = new ngTableParams({ $scope.certificateTable = new ngTableParams({
page: 1, // show first page page: 1, // show first page
@ -121,7 +121,7 @@ angular.module('lemur')
}; };
$scope.create = function () { $scope.create = function () {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
controller: 'CertificateCreateController', controller: 'CertificateCreateController',
templateUrl: '/angular/certificates/certificate/certificateWizard.tpl.html', templateUrl: '/angular/certificates/certificate/certificateWizard.tpl.html',
@ -129,13 +129,13 @@ angular.module('lemur')
backdrop: 'static' backdrop: 'static'
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.certificateTable.reload(); $scope.certificateTable.reload();
}); });
}; };
$scope.edit = function (certificateId) { $scope.edit = function (certificateId) {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
controller: 'CertificateEditController', controller: 'CertificateEditController',
templateUrl: '/angular/certificates/certificate/edit.tpl.html', templateUrl: '/angular/certificates/certificate/edit.tpl.html',
@ -148,13 +148,13 @@ angular.module('lemur')
} }
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.certificateTable.reload(); $scope.certificateTable.reload();
}); });
}; };
$scope.import = function () { $scope.import = function () {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
controller: 'CertificateUploadController', controller: 'CertificateUploadController',
templateUrl: '/angular/certificates/certificate/upload.tpl.html', templateUrl: '/angular/certificates/certificate/upload.tpl.html',
@ -162,13 +162,13 @@ angular.module('lemur')
backdrop: 'static' backdrop: 'static'
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.certificateTable.reload(); $scope.certificateTable.reload();
}); });
}; };
$scope.export = function (certificateId) { $scope.export = function (certificateId) {
$modal.open({ $uibModal.open({
animation: true, animation: true,
controller: 'CertificateExportController', controller: 'CertificateExportController',
templateUrl: '/angular/certificates/certificate/export.tpl.html', templateUrl: '/angular/certificates/certificate/export.tpl.html',

View File

@ -2,32 +2,32 @@
angular.module('lemur') angular.module('lemur')
.controller('DomainsCreateController', function ($scope, $modalInstance, PluginService, DomainService, LemurRestangular){ .controller('DomainsCreateController', function ($scope, $uibModalInstance, PluginService, DomainService, LemurRestangular){
$scope.domain = LemurRestangular.restangularizeElement(null, {}, 'domains'); $scope.domain = LemurRestangular.restangularizeElement(null, {}, 'domains');
$scope.save = function (domain) { $scope.save = function (domain) {
DomainService.create(domain).then(function () { DomainService.create(domain).then(function () {
$modalInstance.close(); $uibModalInstance.close();
}); });
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
}) })
.controller('DomainsEditController', function ($scope, $modalInstance, DomainService, DomainApi, editId) { .controller('DomainsEditController', function ($scope, $uibModalInstance, DomainService, DomainApi, editId) {
DomainApi.get(editId).then(function (domain) { DomainApi.get(editId).then(function (domain) {
$scope.domain = domain; $scope.domain = domain;
}); });
$scope.save = function (domain) { $scope.save = function (domain) {
DomainService.update(domain).then(function () { DomainService.update(domain).then(function () {
$modalInstance.close(); $uibModalInstance.close();
}); });
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
}); });

View File

@ -10,7 +10,7 @@ angular.module('lemur')
}); });
}) })
.controller('DomainsViewController', function ($scope, $modal, DomainApi, DomainService, ngTableParams, toaster) { .controller('DomainsViewController', function ($scope, $uibModal, DomainApi, DomainService, ngTableParams, toaster) {
$scope.filter = {}; $scope.filter = {};
$scope.domainsTable = new ngTableParams({ $scope.domainsTable = new ngTableParams({
page: 1, // show first page page: 1, // show first page
@ -50,7 +50,7 @@ angular.module('lemur')
}; };
$scope.create = function () { $scope.create = function () {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
controller: 'DomainsCreateController', controller: 'DomainsCreateController',
templateUrl: '/angular/domains/domain/domain.tpl.html', templateUrl: '/angular/domains/domain/domain.tpl.html',
@ -58,7 +58,7 @@ angular.module('lemur')
backdrop: 'static' backdrop: 'static'
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.domainsTable.reload(); $scope.domainsTable.reload();
}); });

View File

@ -2,7 +2,7 @@
angular.module('lemur') angular.module('lemur')
.controller('NotificationsCreateController', function ($scope, $modalInstance, PluginService, NotificationService, CertificateService, LemurRestangular){ .controller('NotificationsCreateController', function ($scope, $uibModalInstance, PluginService, NotificationService, CertificateService, LemurRestangular){
$scope.notification = LemurRestangular.restangularizeElement(null, {}, 'notifications'); $scope.notification = LemurRestangular.restangularizeElement(null, {}, 'notifications');
PluginService.getByType('notification').then(function (plugins) { PluginService.getByType('notification').then(function (plugins) {
@ -11,7 +11,7 @@ angular.module('lemur')
$scope.save = function (notification) { $scope.save = function (notification) {
NotificationService.create(notification).then( NotificationService.create(notification).then(
function () { function () {
$modalInstance.close(); $uibModalInstance.close();
}, },
function () { function () {
@ -20,13 +20,13 @@ angular.module('lemur')
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
$scope.certificateService = CertificateService; $scope.certificateService = CertificateService;
}) })
.controller('NotificationsEditController', function ($scope, $modalInstance, NotificationService, NotificationApi, PluginService, CertificateService, editId) { .controller('NotificationsEditController', function ($scope, $uibModalInstance, NotificationService, NotificationApi, PluginService, CertificateService, editId) {
NotificationApi.get(editId).then(function (notification) { NotificationApi.get(editId).then(function (notification) {
$scope.notification = notification; $scope.notification = notification;
PluginService.getByType('notification').then(function (plugins) { PluginService.getByType('notification').then(function (plugins) {
@ -53,12 +53,12 @@ angular.module('lemur')
$scope.save = function (notification) { $scope.save = function (notification) {
NotificationService.update(notification).then(function () { NotificationService.update(notification).then(function () {
$modalInstance.close(); $uibModalInstance.close();
}); });
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
$scope.certificateService = CertificateService; $scope.certificateService = CertificateService;

View File

@ -10,7 +10,7 @@ angular.module('lemur')
}); });
}) })
.controller('NotificationsViewController', function ($q, $scope, $modal, NotificationApi, NotificationService, ngTableParams, toaster) { .controller('NotificationsViewController', function ($q, $scope, $uibModal, NotificationApi, NotificationService, ngTableParams, toaster) {
$scope.filter = {}; $scope.filter = {};
$scope.notificationsTable = new ngTableParams({ $scope.notificationsTable = new ngTableParams({
page: 1, // show first page page: 1, // show first page
@ -56,7 +56,7 @@ angular.module('lemur')
}; };
$scope.edit = function (notificationId) { $scope.edit = function (notificationId) {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
templateUrl: '/angular/notifications/notification/notification.tpl.html', templateUrl: '/angular/notifications/notification/notification.tpl.html',
controller: 'NotificationsEditController', controller: 'NotificationsEditController',
@ -69,14 +69,14 @@ angular.module('lemur')
} }
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.notificationsTable.reload(); $scope.notificationsTable.reload();
}); });
}; };
$scope.create = function () { $scope.create = function () {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
controller: 'NotificationsCreateController', controller: 'NotificationsCreateController',
templateUrl: '/angular/notifications/notification/notification.tpl.html', templateUrl: '/angular/notifications/notification/notification.tpl.html',
@ -84,7 +84,7 @@ angular.module('lemur')
backdrop: 'static' backdrop: 'static'
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.notificationsTable.reload(); $scope.notificationsTable.reload();
}); });

View File

@ -2,7 +2,7 @@
angular.module('lemur') angular.module('lemur')
.controller('RolesEditController', function ($scope, $modalInstance, RoleApi, RoleService, UserService, editId) { .controller('RolesEditController', function ($scope, $uibModalInstance, RoleApi, RoleService, UserService, editId) {
RoleApi.get(editId).then(function (role) { RoleApi.get(editId).then(function (role) {
$scope.role = role; $scope.role = role;
RoleService.getUsers(role); RoleService.getUsers(role);
@ -10,12 +10,12 @@ angular.module('lemur')
$scope.save = function (role) { $scope.save = function (role) {
RoleService.update(role).then(function () { RoleService.update(role).then(function () {
$modalInstance.close(); $uibModalInstance.close();
}); });
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
$scope.userPage = 1; $scope.userPage = 1;
@ -28,17 +28,17 @@ angular.module('lemur')
$scope.roleService = RoleService; $scope.roleService = RoleService;
}) })
.controller('RolesCreateController', function ($scope,$modalInstance, RoleApi, RoleService, UserService, LemurRestangular) { .controller('RolesCreateController', function ($scope,$uibModalInstance, RoleApi, RoleService, UserService, LemurRestangular) {
$scope.role = LemurRestangular.restangularizeElement(null, {}, 'roles'); $scope.role = LemurRestangular.restangularizeElement(null, {}, 'roles');
$scope.userService = UserService; $scope.userService = UserService;
$scope.save = function (role) { $scope.save = function (role) {
RoleService.create(role).then(function () { RoleService.create(role).then(function () {
$modalInstance.close(); $uibModalInstance.close();
}); });
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
}); });

View File

@ -10,7 +10,7 @@ angular.module('lemur')
}); });
}) })
.controller('RolesViewController', function ($scope, $modal, RoleApi, RoleService, ngTableParams) { .controller('RolesViewController', function ($scope, $uibModal, RoleApi, RoleService, ngTableParams) {
$scope.filter = {}; $scope.filter = {};
$scope.rolesTable = new ngTableParams({ $scope.rolesTable = new ngTableParams({
page: 1, // show first page page: 1, // show first page
@ -42,7 +42,7 @@ angular.module('lemur')
$scope.edit = function (roleId) { $scope.edit = function (roleId) {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
templateUrl: '/angular/roles/role/role.tpl.html', templateUrl: '/angular/roles/role/role.tpl.html',
controller: 'RolesEditController', controller: 'RolesEditController',
@ -55,14 +55,14 @@ angular.module('lemur')
} }
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.rolesTable.reload(); $scope.rolesTable.reload();
}); });
}; };
$scope.create = function () { $scope.create = function () {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
controller: 'RolesCreateController', controller: 'RolesCreateController',
templateUrl: '/angular/roles/role/role.tpl.html', templateUrl: '/angular/roles/role/role.tpl.html',
@ -70,7 +70,7 @@ angular.module('lemur')
backdrop: 'static' backdrop: 'static'
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.rolesTable.reload(); $scope.rolesTable.reload();
}); });

View File

@ -2,7 +2,7 @@
angular.module('lemur') angular.module('lemur')
.controller('SourcesCreateController', function ($scope, $modalInstance, PluginService, SourceService, LemurRestangular){ .controller('SourcesCreateController', function ($scope, $uibModalInstance, PluginService, SourceService, LemurRestangular){
$scope.source = LemurRestangular.restangularizeElement(null, {}, 'sources'); $scope.source = LemurRestangular.restangularizeElement(null, {}, 'sources');
PluginService.getByType('source').then(function (plugins) { PluginService.getByType('source').then(function (plugins) {
@ -11,16 +11,16 @@ angular.module('lemur')
$scope.save = function (source) { $scope.save = function (source) {
SourceService.create(source).then(function () { SourceService.create(source).then(function () {
$modalInstance.close(); $uibModalInstance.close();
}); });
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
}) })
.controller('SourcesEditController', function ($scope, $modalInstance, SourceService, SourceApi, PluginService, editId) { .controller('SourcesEditController', function ($scope, $uibModalInstance, SourceService, SourceApi, PluginService, editId) {
SourceApi.get(editId).then(function (source) { SourceApi.get(editId).then(function (source) {
$scope.source = source; $scope.source = source;
PluginService.getByType('source').then(function (plugins) { PluginService.getByType('source').then(function (plugins) {
@ -46,11 +46,11 @@ angular.module('lemur')
$scope.save = function (source) { $scope.save = function (source) {
SourceService.update(source).then(function () { SourceService.update(source).then(function () {
$modalInstance.close(); $uibModalInstance.close();
}); });
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
}); });

View File

@ -10,7 +10,7 @@ angular.module('lemur')
}); });
}) })
.controller('SourcesViewController', function ($scope, $modal, SourceApi, SourceService, ngTableParams, toaster) { .controller('SourcesViewController', function ($scope, $uibModal, SourceApi, SourceService, ngTableParams, toaster) {
$scope.filter = {}; $scope.filter = {};
$scope.sourcesTable = new ngTableParams({ $scope.sourcesTable = new ngTableParams({
page: 1, // show first page page: 1, // show first page
@ -50,7 +50,7 @@ angular.module('lemur')
}; };
$scope.edit = function (sourceId) { $scope.edit = function (sourceId) {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
templateUrl: '/angular/sources/source/source.tpl.html', templateUrl: '/angular/sources/source/source.tpl.html',
controller: 'SourcesEditController', controller: 'SourcesEditController',
@ -63,14 +63,14 @@ angular.module('lemur')
} }
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.sourcesTable.reload(); $scope.sourcesTable.reload();
}); });
}; };
$scope.create = function () { $scope.create = function () {
var modalInstance = $modal.open({ var uibModalInstance = $uibModal.open({
animation: true, animation: true,
controller: 'SourcesCreateController', controller: 'SourcesCreateController',
templateUrl: '/angular/sources/source/source.tpl.html', templateUrl: '/angular/sources/source/source.tpl.html',
@ -78,7 +78,7 @@ angular.module('lemur')
backdrop: 'static' backdrop: 'static'
}); });
modalInstance.result.then(function () { uibModalInstance.result.then(function () {
$scope.sourcesTable.reload(); $scope.sourcesTable.reload();
}); });

View File

@ -2,7 +2,7 @@
angular.module('lemur') angular.module('lemur')
.controller('UsersEditController', function ($scope, $modalInstance, UserApi, UserService, RoleService, editId) { .controller('UsersEditController', function ($scope, $uibModalInstance, UserApi, UserService, RoleService, editId) {
UserApi.get(editId).then(function (user) { UserApi.get(editId).then(function (user) {
UserService.getRoles(user); UserService.getRoles(user);
$scope.user = user; $scope.user = user;
@ -16,12 +16,12 @@ angular.module('lemur')
$scope.save = function (user) { $scope.save = function (user) {
UserService.update(user).then(function () { UserService.update(user).then(function () {
$modalInstance.close(); $uibModalInstance.close();
}); });
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
$scope.loadMoreRoles = function () { $scope.loadMoreRoles = function () {
@ -30,19 +30,19 @@ angular.module('lemur')
}; };
}) })
.controller('UsersCreateController', function ($scope, $modalInstance, UserService, LemurRestangular, RoleService) { .controller('UsersCreateController', function ($scope, $uibModalInstance, UserService, LemurRestangular, RoleService) {
$scope.user = LemurRestangular.restangularizeElement(null, {}, 'users'); $scope.user = LemurRestangular.restangularizeElement(null, {}, 'users');
$scope.save = UserService.create; $scope.save = UserService.create;
$scope.roleService = RoleService; $scope.roleService = RoleService;
$scope.create = function (user) { $scope.create = function (user) {
UserService.create(user).then(function () { UserService.create(user).then(function () {
$modalInstance.close(); $uibModalInstance.close();
}); });
}; };
$scope.cancel = function () { $scope.cancel = function () {
$modalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
}; };
}); });

View File

@ -178,4 +178,3 @@ a {
line-height: 1; line-height: 1;
} }