diff --git a/bower.json b/bower.json index 45e54528..0677d331 100644 --- a/bower.json +++ b/bower.json @@ -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": [ "**/.*", diff --git a/gulp/build.js b/gulp/build.js index 82305a18..44ad1c03 100644 --- a/gulp/build.js +++ b/gulp/build.js @@ -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' ]; diff --git a/lemur/static/app/angular/app.js b/lemur/static/app/angular/app.js index 6b2f1049..11cc5823 100644 --- a/lemur/static/app/angular/app.js +++ b/lemur/static/app/angular/app.js @@ -17,7 +17,9 @@ 'satellizer', 'ngLetterAvatar', 'angular-clipboard', - 'ngFileSaver' + 'ngFileSaver', + 'ngSanitize', + 'selectize' ]); diff --git a/lemur/static/app/angular/authorities/authority/authority.js b/lemur/static/app/angular/authorities/authority/authority.js index 93b0aa6d..3b6ec544 100644 --- a/lemur/static/app/angular/authorities/authority/authority.js +++ b/lemur/static/app/angular/authorities/authority/authority.js @@ -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 + }; + }); diff --git a/lemur/static/app/angular/authorities/authority/tracking.tpl.html b/lemur/static/app/angular/authorities/authority/tracking.tpl.html index 8bf2aac3..f582d91d 100644 --- a/lemur/static/app/angular/authorities/authority/tracking.tpl.html +++ b/lemur/static/app/angular/authorities/authority/tracking.tpl.html @@ -1,107 +1,125 @@
-
-
- -
- -

You must enter a valid authority name, spaces are not allowed

-
-
-
- -
- -

You must enter an Certificate Authority owner

-
-
-
- -
- -

You must give a short description about this authority will be used for

-
-
-
- -
- -

You must enter a common name and it must be less than 64 characters in length

-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
+
+
+ +
+ +

You must + enter a valid authority name, spaces are not allowed

+
+
+
+ +
+ +

You must + enter an Certificate Authority owner

+
+
+
+ +
+ +

You must give a short description about this authority will be used for

+
+
+
+ +
+ +

+ You must enter a common name and it must be less than 64 characters in length

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
- or - -
-
-
- -

A start date is required!

- - - -
+
+
+ + + + +
+
+ +
+
+ + + + +
+
-
- -
-
-
- -

A end date is required!

- - - -
-
-
-
diff --git a/lemur/static/app/angular/authorities/view/view.js b/lemur/static/app/angular/authorities/view/view.js index a3544bc3..802779e0 100644 --- a/lemur/static/app/angular/authorities/view/view.js +++ b/lemur/static/app/angular/authorities/view/view.js @@ -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(); }); diff --git a/lemur/static/app/angular/certificates/certificate/certificate.js b/lemur/static/app/angular/certificates/certificate/certificate.js index 175cb4bd..be7155b7 100644 --- a/lemur/static/app/angular/certificates/certificate/certificate.js +++ b/lemur/static/app/angular/certificates/certificate/certificate.js @@ -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 + ' - ' + authority.description + ''; + 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; diff --git a/lemur/static/app/angular/certificates/certificate/destinations.tpl.html b/lemur/static/app/angular/certificates/certificate/destinations.tpl.html index 59cbe0b1..fc57ba0b 100644 --- a/lemur/static/app/angular/certificates/certificate/destinations.tpl.html +++ b/lemur/static/app/angular/certificates/certificate/destinations.tpl.html @@ -5,10 +5,11 @@
+ 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"> - + + - or - + +
+
+ + + +
- -
-
-
- - - - -
+ +
+
+ + + +
@@ -137,7 +137,7 @@ Certificate Signing Request (CSR)
- diff --git a/lemur/static/app/angular/certificates/certificate/upload.js b/lemur/static/app/angular/certificates/certificate/upload.js index a7a29837..6b4fd84a 100644 --- a/lemur/static/app/angular/certificates/certificate/upload.js +++ b/lemur/static/app/angular/certificates/certificate/upload.js @@ -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'); }; }); diff --git a/lemur/static/app/angular/certificates/certificate/upload.tpl.html b/lemur/static/app/angular/certificates/certificate/upload.tpl.html index a01aa196..e8497d06 100644 --- a/lemur/static/app/angular/certificates/certificate/upload.tpl.html +++ b/lemur/static/app/angular/certificates/certificate/upload.tpl.html @@ -21,7 +21,7 @@
-