bastion 0.3.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gruntfile.js +0 -7
- data/app/assets/javascripts/bastion/auth/auth.module.js +2 -16
- data/app/assets/javascripts/bastion/components/bst-table.directive.js +2 -19
- data/app/assets/javascripts/bastion/components/nutupane-table.directive.js +14 -0
- data/bastion.js +1 -2
- data/lib/bastion/version.rb +1 -1
- data/package.json +0 -1
- metadata +2 -3
- data/grunt/jshint.js +0 -10
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDZmYjQ1YTVjZTdlNTY3Yjc0ZDRlYTUyMzgxYWExMzZjNzg5ZGJhMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDc1ZDkwMmY4OTMzNzg3ZWEwNDk0NjRjMDJhM2RjMzgxZDA1NDI4Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTk3NzhkNmJlY2I3MmJiYTE5MWY5NGM2OTI4NmUyYWUyNzg4ZDliN2ZlMmZj
|
10
|
+
ZjFkNDRlOTFhYTQ2NWEyNDgzYTIxNzYwMjEwOWJhNzk2NTMzNTcwNDVhNjVm
|
11
|
+
ZmY0ZTdmNDUzNDc3MmVlYTVjNmFiMTg2NDljMGM2ZTZmZTIzYTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDMyM2IwMzEzYzU1YWIyM2UyNjM0ZjRlN2Q2NmE3NDBjYTEzOGFlZTAyNjJh
|
14
|
+
NzVhYmEzNmVhNGZjZjJlNzFiZjIyNDY3MTlhYjE2OTUzYzFhNThkYzNhNzI0
|
15
|
+
NmI3ZmExN2Y4NGU0NzgzMTEwMWVmYTY2MTcyODAxM2YxNzdjMDM=
|
data/Gruntfile.js
CHANGED
@@ -79,23 +79,9 @@ angular.module('Bastion.auth').config(['$httpProvider', '$provide',
|
|
79
79
|
*/
|
80
80
|
angular.module('Bastion.auth').run(['$rootScope', '$window', 'Authorization',
|
81
81
|
function ($rootScope, $window, Authorization) {
|
82
|
-
|
83
|
-
function isAuthorized(permission) {
|
84
|
-
return !(permission !== false && (angular.isUndefined(permission) || Authorization.denied(permission)));
|
85
|
-
}
|
86
|
-
|
87
82
|
$rootScope.$on('$stateChangeStart', function (event, toState) {
|
88
|
-
var permission = toState.permission
|
89
|
-
|
90
|
-
if (!(permission instanceof Array)) {
|
91
|
-
permission = [permission];
|
92
|
-
}
|
93
|
-
|
94
|
-
permitted = _.find(permission, function (perm) {
|
95
|
-
return isAuthorized(perm);
|
96
|
-
});
|
97
|
-
|
98
|
-
if (angular.isUndefined(permitted)) {
|
83
|
+
var permission = toState.permission;
|
84
|
+
if (permission !== false && (angular.isUndefined(permission) || Authorization.denied(permission))) {
|
99
85
|
$window.location.href = '/katello/403';
|
100
86
|
}
|
101
87
|
});
|
@@ -3,14 +3,12 @@
|
|
3
3
|
* @name Bastion.components.directive:bstTable
|
4
4
|
* @restrict A
|
5
5
|
*
|
6
|
-
* @requires $window
|
7
|
-
*
|
8
6
|
* @description
|
9
7
|
*
|
10
8
|
* @example
|
11
9
|
*/
|
12
10
|
angular.module('Bastion.components')
|
13
|
-
.directive('bstTable', [
|
11
|
+
.directive('bstTable', [function () {
|
14
12
|
return {
|
15
13
|
restrict: 'A',
|
16
14
|
replace: true,
|
@@ -19,22 +17,7 @@ angular.module('Bastion.components')
|
|
19
17
|
'rowSelect': '@',
|
20
18
|
'rowChoice': '@'
|
21
19
|
},
|
22
|
-
controller: 'BstTableController'
|
23
|
-
link: function (scope) {
|
24
|
-
var resize = function () {
|
25
|
-
angular.element($window).trigger('resize');
|
26
|
-
};
|
27
|
-
|
28
|
-
// Trigger resize after resource $promise is resolved
|
29
|
-
scope.$watch('table.resource', function (resource) {
|
30
|
-
if (resource && resource.hasOwnProperty('$promise')) {
|
31
|
-
resource.$promise.then(resize);
|
32
|
-
}
|
33
|
-
});
|
34
|
-
|
35
|
-
// Trigger resize when rows change
|
36
|
-
scope.$watch('table.rows', resize);
|
37
|
-
}
|
20
|
+
controller: 'BstTableController'
|
38
21
|
};
|
39
22
|
}])
|
40
23
|
.controller('BstTableController', ['$scope', function ($scope) {
|
@@ -14,6 +14,7 @@ angular.module('Bastion.components').directive('nutupaneTable', ['$compile', '$w
|
|
14
14
|
restrict: 'A',
|
15
15
|
link: function (scope, element) {
|
16
16
|
var originalTable, clonedTable, clonedThs,
|
17
|
+
bstTableName = element.attr('bst-table'),
|
17
18
|
windowElement = angular.element($window);
|
18
19
|
|
19
20
|
function buildTable() {
|
@@ -24,6 +25,11 @@ angular.module('Bastion.components').directive('nutupaneTable', ['$compile', '$w
|
|
24
25
|
originalTable = element.find('table');
|
25
26
|
clonedTable = originalTable.clone();
|
26
27
|
|
28
|
+
if (!bstTableName) {
|
29
|
+
bstTableName = element.find('[bst-table]').attr('bst-table');
|
30
|
+
}
|
31
|
+
|
32
|
+
clonedTable.attr('ng-show', bstTableName + '.rows.length > 0');
|
27
33
|
clonedTable.removeAttr("nutupane-table");
|
28
34
|
clonedTable.addClass("cloned-nutupane-table");
|
29
35
|
clonedTable.find('tbody').remove();
|
@@ -52,6 +58,14 @@ angular.module('Bastion.components').directive('nutupaneTable', ['$compile', '$w
|
|
52
58
|
angular.forEach(originalTable.find('th'), function (th, index) {
|
53
59
|
$compile(clonedThs[index])(angular.element(th).scope());
|
54
60
|
});
|
61
|
+
|
62
|
+
originalTable.bind("DOMNodeInserted", function () {
|
63
|
+
windowElement.trigger('resize');
|
64
|
+
});
|
65
|
+
|
66
|
+
originalTable.bind("DOMNodeInsertedIntoDocument", function () {
|
67
|
+
windowElement.trigger('resize');
|
68
|
+
});
|
55
69
|
}
|
56
70
|
|
57
71
|
scope.$on("$stateChangeSuccess", function (event, newState, newParams, oldState) {
|
data/bastion.js
CHANGED
@@ -3,7 +3,6 @@ var requireDir = require('require-dir');
|
|
3
3
|
module.exports = function (grunt) {
|
4
4
|
var configs = requireDir('./grunt');
|
5
5
|
|
6
|
-
grunt.loadTasks(__dirname + '/node_modules/grunt-contrib-jshint/tasks');
|
7
6
|
grunt.loadTasks(__dirname + '/node_modules/grunt-eslint/tasks');
|
8
7
|
grunt.loadTasks(__dirname + '/node_modules/grunt-htmlhint/tasks');
|
9
8
|
grunt.loadTasks(__dirname + '/node_modules/grunt-bower-task/tasks');
|
@@ -13,7 +12,7 @@ module.exports = function (grunt) {
|
|
13
12
|
grunt.initConfig(configs);
|
14
13
|
|
15
14
|
grunt.registerTask('ci', [
|
16
|
-
'
|
15
|
+
'eslint',
|
17
16
|
'htmlhint',
|
18
17
|
'karma:ci'
|
19
18
|
]);
|
data/lib/bastion/version.rb
CHANGED
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bastion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katello
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: angular-rails-templates
|
@@ -162,7 +162,6 @@ files:
|
|
162
162
|
- grunt/bower.js
|
163
163
|
- grunt/eslint.js
|
164
164
|
- grunt/htmlhint.js
|
165
|
-
- grunt/jshint.js
|
166
165
|
- grunt/karma.js
|
167
166
|
- grunt/nggettext_compile.js
|
168
167
|
- grunt/nggettext_extract.js
|