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,
"dependencies": {
"angular": "1.3",
"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",
"jquery": "~2.2.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-bootstrap": "~0.12.0",
"angular-ui-switch": "~0.1.0",
"angular-chart.js": "~0.7.1",
"satellizer": "~0.9.4",
"angular-clipboard": "~1.3.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-clipboard": "~1.1.1",
"angular-file-saver": "~1.0.1"
},
"devDependencies": {
"angular-mocks": "~1.3",
"angular-scenario": "~1.3",
"ngletteravatar": "~3.0.1"
"font-awesome": "~4.5.0",
"lodash": "~4.0.1",
"underscore": "~1.8.3",
"angular-smart-table": "~2.1.6",
"angular-strap": ">= 2.2.2",
"angular-underscore": "^0.5.0",
"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": {
"bootstrap": "~3.3.1",
"angular": "1.3"
"moment": ">=2.8.0 <2.11.0",
"lodash": ">=1.3.0 <2.5.0",
"angular": "1.4.9"
},
"ignore": [
"**/.*",

View File

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

View File

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

View File

@ -2,7 +2,7 @@
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) {
$scope.authority = authority;
});
@ -17,7 +17,7 @@ angular.module('lemur')
title: authority.name,
body: 'Successfully updated!'
});
$modalInstance.close();
$uibModalInstance.close();
},
function (response) {
toaster.pop({
@ -30,18 +30,41 @@ angular.module('lemur')
};
$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.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
AuthorityService.getDefaults($scope.authority);
AuthorityApi.getList().then(function (authorities) {
$scope.authorities = authorities;
});
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
$scope.create = function (authority) {
@ -53,7 +76,7 @@ angular.module('lemur')
title: authority.name,
body: 'Was created!'
});
$modalInstance.close();
$uibModalInstance.close();
},
function (response) {
toaster.pop({
@ -72,20 +95,38 @@ angular.module('lemur')
});
$scope.roleService = RoleService;
$scope.authorityService = AuthorityService;
$scope.open = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.opened1 = true;
$scope.dateOptions = {
formatYear: 'yy',
maxDate: new Date(2020, 5, 22),
minDate: new Date(),
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

@ -1,107 +1,125 @@
<form name="trackingForm" novalidate>
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error': trackingForm.name.$invalid, 'has-success': !trackingForm.name.$invalid&&trackingForm.name.$dirty}">
<label class="control-label col-sm-2">
Name
</label>
<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/>
<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 class="form-group"
ng-class="{'has-error': trackingForm.owner.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.owner.$dirty}">
<label class="control-label col-sm-2">
Owner
</label>
<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/>
<p ng-show="trackingForm.owner.$invalid && !trackingForm.owner.$pristine" class="help-block">You must enter an Certificate Authority owner</p>
</div>
</div>
<div class="form-group"
ng-class="{'has-error': trackingForm.description.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.description.$dirty}">
<label class="control-label col-sm-2">
Description
</label>
<div class="col-sm-10">
<textarea name="description" ng-model="authority.description" placeholder="Something elegant" 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 class="form-group"
ng-class="{'has-error': trackingForm.commonName.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.commonName.$dirty}">
<label class="control-label col-sm-2">
Common Name
</label>
<div class="col-sm-10">
<input name="commonName" ng-model="authority.commonName" placeholder="Common Name" class="form-control" 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 class="form-group">
<label class="control-label col-sm-2">
Type
</label>
<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>
</div>
</div>
<div ng-show="authority.type == 'subca'" class="form-group">
<label class="control-label col-sm-2">
Parent Authority
</label>
<div class="col-sm-10">
<input type="text" ng-model="authority.authority" placeholder="Parent Authority Name"
typeahead="authority as authority.name for authority in authorityService.findAuthorityByName($viewValue)" typeahead-loading="loadingAuthorities"
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 class="form-group"
ng-class="{'has-error': trackingForm.validityEnd.$invalid || trackingForm.validityStart.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.validityEnd.$dirty&&trackingForm.validityStart.$dirty}">
<label class="control-label col-sm-2">
Validity Range
</label>
<div class="col-sm-2">
<select ng-model="authority.validityYears" class="form-control">
<option value="5">5 years</option>
<option value="10">10 years</option>
<option value="20">20 years</option>
<option value="30">30 years</option>
</select>
</div>
<div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error': trackingForm.name.$invalid, 'has-success': !trackingForm.name.$invalid&&trackingForm.name.$dirty}">
<label class="control-label col-sm-2">
Name
</label>
<div class="col-sm-10">
<input name="name" ng-model="authority.name" placeholder="Name"
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 class="form-group"
ng-class="{'has-error': trackingForm.owner.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.owner.$dirty}">
<label class="control-label col-sm-2">
Owner
</label>
<div class="col-sm-10">
<input type="email" name="owner" ng-model="authority.owner" placeholder="TeamDL@example.com"
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 class="form-group"
ng-class="{'has-error': trackingForm.description.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.description.$dirty}">
<label class="control-label col-sm-2">
Description
</label>
<div class="col-sm-10">
<textarea name="description" ng-model="authority.description" placeholder="Something elegant"
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 class="form-group"
ng-class="{'has-error': trackingForm.commonName.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.commonName.$dirty}">
<label class="control-label col-sm-2">
Common Name
</label>
<div class="col-sm-10">
<input name="commonName" ng-model="authority.commonName" placeholder="Common Name" class="form-control"
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 class="form-group">
<label class="control-label col-sm-2">
Type
</label>
<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>
</div>
</div>
<div ng-show="authority.type == 'subca'" class="form-group">
<label class="control-label col-sm-2">
Parent Authority
</label>
<div class="col-sm-10">
<selectize placeholder="Select an Authority..." options='authorities' config="authorityConfig"
ng-model="authority.parent" ng-disabled='disable' required='true'></selectize>
</div>
</div>
<div class="form-group"
ng-class="{'has-error': trackingForm.validityEnd.$invalid || trackingForm.validityStart.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.validityEnd.$dirty&&trackingForm.validityStart.$dirty}">
<label class="control-label col-sm-2">
Validity Range
</label>
<div class="col-sm-2">
<select ng-model="authority.validityYears" class="form-control">
<option value="5">5 years</option>
<option value="10">10 years</option>
<option value="20">20 years</option>
<option value="30">30 years</option>
</select>
</div>
<span style="padding-top: 15px" class="text-center col-sm-1">
<strong>- or -</strong>
</span>
<div class="col-sm-3">
<div>
<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"
max-date="authority.authority.notAfter" required/>
<p ng-show="trackingForm.validityStart.$invalid && !trackingForm.validityStart.$pristine" class="help-block">A start date is required!</p>
<span class="input-group-btn">
<button class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</div>
<div class="col-sm-3">
<div class="input-group">
<input type="text" class="form-control"
uib-datepicker-popup="yyyy/MM/dd"
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">
<button type="button" class="btn btn-default" ng-click="open1()"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</div>
</div>
<span style="padding-top: 15px" class="text-center col-sm-1"><label><span
class="glyphicon glyphicon-resize-horizontal"></span></label></span>
<div class="col-sm-3">
<div class="input-group">
<input type="text" class="form-control"
uib-datepicker-popup="yyyy/MM/dd"
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">
<button type="button" class="btn btn-default" ng-click="open2()"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</div>
</div>
</div>
</div>
<span style="padding-top: 15px" class="text-center col-sm-1"><label><span class="glyphicon glyphicon-resize-horizontal"></span></label></span>
<div class="col-sm-3">
<div>
<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"
max-date="authority.authority.notAfter" required/>
<p ng-show="trackingForm.validityEnd.$invalid && !trackingForm.validityEnd.$pristine" class="help-block">A end date is required!</p>
<span class="input-group-btn">
<button class="btn btn-default" ng-click="open2($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</div>
</div>
</div>
</div>
</div>
</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.authoritiesTable = new ngTableParams({
page: 1, // show first page
@ -65,7 +65,7 @@ angular.module('lemur')
};
$scope.edit = function (authorityId) {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
templateUrl: '/angular/authorities/authority/edit.tpl.html',
controller: 'AuthorityEditController',
@ -78,14 +78,14 @@ angular.module('lemur')
}
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.authoritiesTable.reload();
});
};
$scope.editRole = function (roleId) {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
templateUrl: '/angular/roles/role/role.tpl.html',
controller: 'RolesEditController',
@ -98,14 +98,14 @@ angular.module('lemur')
}
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.authoritiesTable.reload();
});
};
$scope.create = function () {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
controller: 'AuthorityCreateController',
templateUrl: '/angular/authorities/authority/authorityWizard.tpl.html',
@ -113,7 +113,7 @@ angular.module('lemur')
backdrop: 'static',
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.authoritiesTable.reload();
});

View File

@ -1,7 +1,7 @@
'use strict';
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) {
$scope.certificate = certificate;
});
@ -11,7 +11,7 @@ angular.module('lemur')
});
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
$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) {
CertificateService.getNotifications(certificate);
CertificateService.getDestinations(certificate);
@ -58,7 +58,7 @@ angular.module('lemur')
});
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
$scope.save = function (certificate) {
@ -69,7 +69,7 @@ angular.module('lemur')
title: certificate.name,
body: 'Successfully updated!'
});
$modalInstance.close();
$uibModalInstance.close();
},
function (response) {
toaster.pop({
@ -88,16 +88,76 @@ angular.module('lemur')
$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');
// set the defaults
CertificateService.getDefaults($scope.certificate);
$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) {
WizardHandler.wizard().context.loading = true;
CertificateService.create(certificate).then(
@ -107,7 +167,7 @@ angular.module('lemur')
title: certificate.name,
body: 'Successfully created!'
});
$modalInstance.close();
$uibModalInstance.close();
},
function (response) {
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) {
$scope.plugins = plugins;

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@
<div class="col-sm-10">
<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"
required/>
@ -18,7 +18,7 @@
</div>
<div class="form-group"
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>
</label>
<div class="col-sm-10">
@ -35,7 +35,6 @@
<div class="col-sm-10">
<textarea name="description" ng-model="certificate.description" placeholder="Something elegant"
class="form-control" 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>
@ -46,18 +45,9 @@
<label class="control-label col-sm-2">
Certificate Authority
</label>
<div class="col-sm-10">
<div class="input-group col-sm-12">
<input name="selectedAuthority"
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>
<selectize name="selectedAuthority" placeholder="Select an Authority..." options="authorities" config="authorityConfig"
ng-model="certificate.selectedAuthority" required="true"></selectize>
</div>
</div>
<div class="form-group">
@ -78,7 +68,7 @@
<div class="col-sm-10">
<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-maxlength="64"
required/>
@ -90,7 +80,7 @@
</div>
<div class="form-group">
<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>
</label>
<div class="col-sm-2">
@ -101,33 +91,43 @@
<option value="4">4 years</option>
</select>
</div>
<span style="padding-top: 15px" class="text-center col-sm-1">
<strong>- or -</strong>
</span>
<div class="col-sm-3">
<div class="input-group">
<input tooltip="Starting Date (yyyy/MM/dd)" class="form-control" datepicker-popup="yyyy/MM/dd"
is-open="$parent.openNotBefore.isOpen" min-date="certificate.authority.notBefore"
max-date="certificate.authority.notAfter" ng-model="certificate.validityStart"/>
<span class="input-group-btn">
<button class="btn btn-default" ng-click="openNotBefore($event)"><i
class="glyphicon glyphicon-calendar"></i></button>
</span>
<span style="padding-top: 15px" class="text-center col-sm-1">
<strong>- or -</strong>
</span>
<div class="col-sm-3">
<div class="input-group">
<input type="text" class="form-control"
uib-datepicker-popup="yyyy/MM/dd"
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">
<button type="button" class="btn btn-default" ng-click="open1()"><i
class="glyphicon glyphicon-calendar"></i></button>
</span>
</div>
</div>
<span style="padding-top: 15px" class="text-center col-sm-1"><label><span
class="glyphicon glyphicon-resize-horizontal"></span></label></span>
<div class="col-sm-3">
<div>
<div class="input-group">
<input tooltip="Ending Date (yyyy/MM/dd)" class="form-control" datepicker-popup="yyyy/MM/dd"
is-open="$parent.openNotAfter.isOpen" min-date="certificate.authority.notBefore"
max-date="certificate.authority.notAfter" ng-model="certificate.validityEnd"/>
<span class="input-group-btn">
<button class="btn btn-default" ng-click="openNotAfter($event)"><i
class="glyphicon glyphicon-calendar"></i></button>
</span>
</div>
<span style="padding-top: 15px" class="text-center col-sm-1"><label><span
class="glyphicon glyphicon-resize-horizontal"></span></label></span>
<div class="col-sm-3">
<div class="input-group">
<input type="text" class="form-control"
uib-datepicker-popup="yyyy/MM/dd"
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">
<button type="button" class="btn btn-default" ng-click="open2()"><i
class="glyphicon glyphicon-calendar"></i></button>
</span>
</div>
</div>
</div>
@ -137,7 +137,7 @@
Certificate Signing Request (CSR)
</label>
<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"
placeholder="PEM encoded string..." class="form-control"
ng-pattern="/^-----BEGIN CERTIFICATE REQUEST-----/"></textarea>

View File

@ -2,7 +2,7 @@
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.upload = CertificateService.upload;
@ -22,7 +22,7 @@ angular.module('lemur')
title: certificate.name,
body: 'Successfully uploaded!'
});
$modalInstance.close();
$uibModalInstance.close();
},
function (response) {
toaster.pop({
@ -35,7 +35,7 @@ angular.module('lemur')
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
});

View File

@ -21,7 +21,7 @@
</div>
<div class="form-group"
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>
</label>
<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.certificateTable = new ngTableParams({
page: 1, // show first page
@ -121,7 +121,7 @@ angular.module('lemur')
};
$scope.create = function () {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
controller: 'CertificateCreateController',
templateUrl: '/angular/certificates/certificate/certificateWizard.tpl.html',
@ -129,13 +129,13 @@ angular.module('lemur')
backdrop: 'static'
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.certificateTable.reload();
});
};
$scope.edit = function (certificateId) {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
controller: 'CertificateEditController',
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.import = function () {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
controller: 'CertificateUploadController',
templateUrl: '/angular/certificates/certificate/upload.tpl.html',
@ -162,13 +162,13 @@ angular.module('lemur')
backdrop: 'static'
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.certificateTable.reload();
});
};
$scope.export = function (certificateId) {
$modal.open({
$uibModal.open({
animation: true,
controller: 'CertificateExportController',
templateUrl: '/angular/certificates/certificate/export.tpl.html',

View File

@ -2,32 +2,32 @@
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.save = function (domain) {
DomainService.create(domain).then(function () {
$modalInstance.close();
$uibModalInstance.close();
});
};
$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) {
$scope.domain = domain;
});
$scope.save = function (domain) {
DomainService.update(domain).then(function () {
$modalInstance.close();
$uibModalInstance.close();
});
};
$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.domainsTable = new ngTableParams({
page: 1, // show first page
@ -50,7 +50,7 @@ angular.module('lemur')
};
$scope.create = function () {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
controller: 'DomainsCreateController',
templateUrl: '/angular/domains/domain/domain.tpl.html',
@ -58,7 +58,7 @@ angular.module('lemur')
backdrop: 'static'
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.domainsTable.reload();
});

View File

@ -2,7 +2,7 @@
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');
PluginService.getByType('notification').then(function (plugins) {
@ -11,7 +11,7 @@ angular.module('lemur')
$scope.save = function (notification) {
NotificationService.create(notification).then(
function () {
$modalInstance.close();
$uibModalInstance.close();
},
function () {
@ -20,13 +20,13 @@ angular.module('lemur')
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
$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) {
$scope.notification = notification;
PluginService.getByType('notification').then(function (plugins) {
@ -53,12 +53,12 @@ angular.module('lemur')
$scope.save = function (notification) {
NotificationService.update(notification).then(function () {
$modalInstance.close();
$uibModalInstance.close();
});
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
$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.notificationsTable = new ngTableParams({
page: 1, // show first page
@ -56,7 +56,7 @@ angular.module('lemur')
};
$scope.edit = function (notificationId) {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
templateUrl: '/angular/notifications/notification/notification.tpl.html',
controller: 'NotificationsEditController',
@ -69,14 +69,14 @@ angular.module('lemur')
}
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.notificationsTable.reload();
});
};
$scope.create = function () {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
controller: 'NotificationsCreateController',
templateUrl: '/angular/notifications/notification/notification.tpl.html',
@ -84,7 +84,7 @@ angular.module('lemur')
backdrop: 'static'
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.notificationsTable.reload();
});

View File

@ -2,7 +2,7 @@
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) {
$scope.role = role;
RoleService.getUsers(role);
@ -10,12 +10,12 @@ angular.module('lemur')
$scope.save = function (role) {
RoleService.update(role).then(function () {
$modalInstance.close();
$uibModalInstance.close();
});
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
$scope.userPage = 1;
@ -28,17 +28,17 @@ angular.module('lemur')
$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.userService = UserService;
$scope.save = function (role) {
RoleService.create(role).then(function () {
$modalInstance.close();
$uibModalInstance.close();
});
};
$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.rolesTable = new ngTableParams({
page: 1, // show first page
@ -42,7 +42,7 @@ angular.module('lemur')
$scope.edit = function (roleId) {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
templateUrl: '/angular/roles/role/role.tpl.html',
controller: 'RolesEditController',
@ -55,14 +55,14 @@ angular.module('lemur')
}
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.rolesTable.reload();
});
};
$scope.create = function () {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
controller: 'RolesCreateController',
templateUrl: '/angular/roles/role/role.tpl.html',
@ -70,7 +70,7 @@ angular.module('lemur')
backdrop: 'static'
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.rolesTable.reload();
});

View File

@ -2,7 +2,7 @@
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');
PluginService.getByType('source').then(function (plugins) {
@ -11,16 +11,16 @@ angular.module('lemur')
$scope.save = function (source) {
SourceService.create(source).then(function () {
$modalInstance.close();
$uibModalInstance.close();
});
};
$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) {
$scope.source = source;
PluginService.getByType('source').then(function (plugins) {
@ -46,11 +46,11 @@ angular.module('lemur')
$scope.save = function (source) {
SourceService.update(source).then(function () {
$modalInstance.close();
$uibModalInstance.close();
});
};
$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.sourcesTable = new ngTableParams({
page: 1, // show first page
@ -50,7 +50,7 @@ angular.module('lemur')
};
$scope.edit = function (sourceId) {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
templateUrl: '/angular/sources/source/source.tpl.html',
controller: 'SourcesEditController',
@ -63,14 +63,14 @@ angular.module('lemur')
}
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.sourcesTable.reload();
});
};
$scope.create = function () {
var modalInstance = $modal.open({
var uibModalInstance = $uibModal.open({
animation: true,
controller: 'SourcesCreateController',
templateUrl: '/angular/sources/source/source.tpl.html',
@ -78,7 +78,7 @@ angular.module('lemur')
backdrop: 'static'
});
modalInstance.result.then(function () {
uibModalInstance.result.then(function () {
$scope.sourcesTable.reload();
});

View File

@ -2,7 +2,7 @@
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) {
UserService.getRoles(user);
$scope.user = user;
@ -16,12 +16,12 @@ angular.module('lemur')
$scope.save = function (user) {
UserService.update(user).then(function () {
$modalInstance.close();
$uibModalInstance.close();
});
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
$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.save = UserService.create;
$scope.roleService = RoleService;
$scope.create = function (user) {
UserService.create(user).then(function () {
$modalInstance.close();
$uibModalInstance.close();
});
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
$uibModalInstance.dismiss('cancel');
};
});

View File

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