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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTA4MmYzNTczZGJlMmI3ZTQzOGM1N2E0ODI1YWFhZWJkODkzNjAxZA==
4
+ ZDZmYjQ1YTVjZTdlNTY3Yjc0ZDRlYTUyMzgxYWExMzZjNzg5ZGJhMQ==
5
5
  data.tar.gz: !binary |-
6
- ZTY3MTA2ZjBhMTU3ZjJiMDdjYWQzYzNlMjIzYWQzZjI1OTIxMGU4Ng==
6
+ ZDc1ZDkwMmY4OTMzNzg3ZWEwNDk0NjRjMDJhM2RjMzgxZDA1NDI4Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTRmOTQyODE1MWU0NDBlNTEyYTI2MzcwM2NmZWQ2NjNiYTYyZWMyYWI3ZDRh
10
- ZjA4NmRkZTU5OGEyOTlkMmFhOTdmYjY4NTIyMGIzYzU1MzgzZmI0YzNhYjBh
11
- OWQxZjI5M2RmN2QwYjI0YmE1ZGNkYTdkMDFmOWUwMTI5ZThlZTI=
9
+ YTk3NzhkNmJlY2I3MmJiYTE5MWY5NGM2OTI4NmUyYWUyNzg4ZDliN2ZlMmZj
10
+ ZjFkNDRlOTFhYTQ2NWEyNDgzYTIxNzYwMjEwOWJhNzk2NTMzNTcwNDVhNjVm
11
+ ZmY0ZTdmNDUzNDc3MmVlYTVjNmFiMTg2NDljMGM2ZTZmZTIzYTg=
12
12
  data.tar.gz: !binary |-
13
- ODQxZTM4NjliNGQ4YTFmZTg3ODkwMDVmNTI4MDExMTcxMTY0M2MzOTg5NDIx
14
- MzY5OWNkMzJjZDM2ZjRmZWViZTRhZjA3MTkxZjhlMWM3NDA2NDhmZTU2ZWI2
15
- MTRmMzBlZmE2ZDkzNjk1ZWRmZTg4YzY2ZjhmYmIyZjczNTgzYTM=
13
+ NDMyM2IwMzEzYzU1YWIyM2UyNjM0ZjRlN2Q2NmE3NDBjYTEzOGFlZTAyNjJh
14
+ NzVhYmEzNmVhNGZjZjJlNzFiZjIyNDY3MTlhYjE2OTUzYzFhNThkYzNhNzI0
15
+ NmI3ZmExN2Y4NGU0NzgzMTEwMWVmYTY2MTcyODAxM2YxNzdjMDM=
data/Gruntfile.js CHANGED
@@ -15,11 +15,4 @@ module.exports = function (grunt) {
15
15
  var bastion = require('./bastion.js');
16
16
 
17
17
  bastion(grunt);
18
-
19
- grunt.registerTask('ci', [
20
- 'eslint',
21
- 'jshint',
22
- 'htmlhint',
23
- 'karma:ci'
24
- ]);
25
18
  };
@@ -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, permitted;
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', ['$window', function ($window) {
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
- 'jshint',
15
+ 'eslint',
17
16
  'htmlhint',
18
17
  'karma:ci'
19
18
  ]);
@@ -1,3 +1,3 @@
1
1
  module Bastion
2
- VERSION = "0.3.3"
2
+ VERSION = "1.0.0"
3
3
  end
data/package.json CHANGED
@@ -3,7 +3,6 @@
3
3
  "version": "0.1.0",
4
4
  "dependencies": {
5
5
  "grunt": "~0.4.5",
6
- "grunt-contrib-jshint": "~0.1.1-rc6",
7
6
  "grunt-bower-task": "~0.3.4",
8
7
  "require-dir": "~0.1.0",
9
8
  "karma": "~0.12.23",
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.3.3
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-19 00:00:00.000000000 Z
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
data/grunt/jshint.js DELETED
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- options: {
3
- jshintrc: __dirname + '/../.jshintrc'
4
- },
5
- all: [
6
- 'Gruntfile.js',
7
- 'app/assets/javascripts/**/*.js',
8
- '!app/assets/javascripts/bastion/i18n/translations.js'
9
- ]
10
- };