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 enter a common name and it must be less than 64 characters in length
A start date is required!
A end date is required!
You must give a short description about this authority will be used for.