bastion 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bad53e7a8ee82edce618781413b669de5b15686c
4
- data.tar.gz: 222ff135caa097efdc97a2e140314b5bb5bce55f
3
+ metadata.gz: 39736e486baa7a52fa022a34eac73d2b89663f37
4
+ data.tar.gz: 76967c212d01faba0a4a720ea7031b22edb04ff0
5
5
  SHA512:
6
- metadata.gz: b6c76b07b5709dbad9a786cd64e2c14db2a5816aa861f00424ed8e45df40ef6b7f866d95218690ff023a9bf6a72a21a75e423b5eef1ffbaf930d79b50d8af2e0
7
- data.tar.gz: ad4b90068267f8788fb0331f27dd09540bf9c962e3af7f3ea27e4dc5ed21e20e34a1321ea1dabdadeb25a66880d7c46d065a02861246383034ea5dafc6b4156f
6
+ metadata.gz: cd66d25b82f12bceb3fd6ccddf92de267399a958a7029f4b0325e24161bbe828a5816af5cd01e3e3d47ce31b9b715c4caa8bf0c719fc9e84d2de2e16832278e3
7
+ data.tar.gz: c488be0bbd988b1706af2f15b27a2cba0bbe885eb6afe34179b283aebdaf0d49e4ab6f1588023cefebce30b27bef67a18b166254fb79a5af92f464b6aa1b3d15
@@ -18,18 +18,26 @@
18
18
  angular.module('Bastion.components').directive('bstContainerScroll', ['$window', '$timeout', function ($window, $timeout) {
19
19
  return {
20
20
  restrict: 'A',
21
-
22
21
  compile: function (tElement) {
23
22
  tElement.addClass("container-scroll-wrapper");
23
+
24
24
  return function (scope, element) {
25
- var windowElement = angular.element($window);
26
- var addScroll = function () {
25
+ var windowElement = angular.element($window),
26
+ bottomPadding = parseInt(element.css('padding-bottom').replace('px', ''), 10),
27
+ addScroll;
28
+
29
+ addScroll = function () {
27
30
  var windowHeight = windowElement.height(),
28
31
  offset = element.offset().top;
29
32
 
33
+ if (bottomPadding) {
34
+ offset = offset + bottomPadding;
35
+ }
36
+
30
37
  element.outerHeight(windowHeight - offset);
31
38
  element.height(windowHeight - offset);
32
39
  };
40
+
33
41
  windowElement.bind('resize', addScroll);
34
42
  $timeout(function () {
35
43
  windowElement.trigger('resize');
@@ -6,6 +6,7 @@
6
6
  * @requires $q
7
7
  * @requires $timeout
8
8
  * @requires $rootScope
9
+ * @requires GlobalNotification
9
10
  *
10
11
  * @description
11
12
  * Defines the Nutupane factory for adding common functionality to the Nutupane master-detail
@@ -29,9 +30,10 @@
29
30
  </pre>
30
31
  */
31
32
  angular.module('Bastion.components').factory('Nutupane',
32
- ['$location', '$q', '$timeout', '$rootScope', function ($location, $q, $timeout, $rootScope) {
33
+ ['$location', '$q', '$timeout', '$rootScope', 'GlobalNotification', function ($location, $q, $timeout, $rootScope, GlobalNotification) {
33
34
  var Nutupane = function (resource, params, action) {
34
- var self = this;
35
+ var self = this,
36
+ orgSwitcherRegex = new RegExp("/(organizations|locations)/(.+/)*(select|clear)");
35
37
  params = params || {};
36
38
 
37
39
  self.searchKey = action ? action + 'Search' : 'search';
@@ -69,6 +71,10 @@ angular.module('Bastion.components').factory('Nutupane',
69
71
 
70
72
  resource[table.action](params, function (response) {
71
73
 
74
+ if (response.error) {
75
+ GlobalNotification.setErrorMessage(response.error);
76
+ }
77
+
72
78
  angular.forEach(response.results, function (row) {
73
79
  row.selected = table.allResultsSelected;
74
80
  });
@@ -358,6 +364,12 @@ angular.module('Bastion.components').factory('Nutupane',
358
364
  self.searchKey = newKey;
359
365
  self.table.searchTerm = $location.search()[self.searchKey];
360
366
  };
367
+
368
+ $rootScope.$on('$locationChangeStart', function (event, newUrl) {
369
+ if (newUrl.match(orgSwitcherRegex)) {
370
+ self.table.closeItem();
371
+ }
372
+ });
361
373
  };
362
374
  return Nutupane;
363
375
  }]
@@ -3,11 +3,9 @@
3
3
  <span class="pficon pficon-close"></span>
4
4
  </button>
5
5
  <span class="pficon-layered">
6
- <span ng-show="type === 'danger'" class="pficon pficon-error-octagon"></span>
7
- <span ng-show="type === 'danger'" class="pficon pficon-error-exclamation"></span>
6
+ <span ng-show="type === 'danger'" class="pficon pficon-error-circle-o"></span>
8
7
 
9
- <span ng-show="type === 'warning'" class="pficon pficon-warning-triangle"></span>
10
- <span ng-show="type === 'warning'" class="pficon pficon-warning-exclamation"></span>
8
+ <span ng-show="type === 'warning'" class="pficon pficon-warning-circle-o"></span>
11
9
 
12
10
  <span ng-show="type === 'info'" class="pficon pficon-info"></span>
13
11
 
@@ -42,6 +42,6 @@
42
42
  .module('Bastion.features')
43
43
  .directive('bstFeatureFlag', bstFeatureFlag);
44
44
 
45
- bstFeatureFlag.$injector = ['ngIfDirective', 'FeatureFlag'];
45
+ bstFeatureFlag.$inject = ['ngIfDirective', 'FeatureFlag'];
46
46
 
47
47
  })();
@@ -7,6 +7,6 @@
7
7
  * @description
8
8
  * Encode a url
9
9
  */
10
- angular.module('Bastion.utils').filter('urlencode', function ($window) {
10
+ angular.module('Bastion.utils').filter('urlencode', ['$window', function ($window) {
11
11
  return $window.encodeURIComponent;
12
- });
12
+ }]);
@@ -3,7 +3,7 @@
3
3
  color: inherit;
4
4
 
5
5
  &:after {
6
- content: "*";
6
+ content: "\00a0 *";
7
7
  }
8
8
  }
9
9
  }
@@ -139,7 +139,7 @@ td.row-select {
139
139
  }
140
140
 
141
141
  .dropdown-menu {
142
- width: 100%;
142
+ min-width: 100%;
143
143
  }
144
144
  }
145
145
 
@@ -398,3 +398,9 @@ div.alch-dialog.open.info-value {
398
398
  table .progress {
399
399
  margin-bottom: 0;
400
400
  }
401
+
402
+ .dropdown-menu {
403
+ max-height: 300px;
404
+ overflow-y: auto;
405
+ overflow-x: hidden;
406
+ }
@@ -15,6 +15,10 @@
15
15
  p {
16
16
  margin-bottom: 0;
17
17
  }
18
+
19
+ div {
20
+ display: inline;
21
+ }
18
22
  }
19
23
 
20
24
  // Patternfly Overrides
@@ -1,3 +1,3 @@
1
1
  module Bastion
2
- VERSION = "3.2.0"
2
+ VERSION = "3.2.1"
3
3
  end
@@ -1,15 +1,15 @@
1
1
  describe('Directive: bstContainerScroll', function() {
2
2
  var scope,
3
3
  compile,
4
- window,
4
+ windowElement,
5
5
  tableElement;
6
6
 
7
7
  beforeEach(module('Bastion.components'));
8
8
 
9
- beforeEach(inject(function(_$compile_, _$rootScope_, _$window_) {
9
+ beforeEach(inject(function(_$compile_, _$rootScope_, $window) {
10
10
  compile = _$compile_;
11
11
  scope = _$rootScope_;
12
- window = _$window_;
12
+ windowElement = angular.element($window)
13
13
  }));
14
14
 
15
15
  beforeEach(function() {
@@ -32,12 +32,21 @@ describe('Directive: bstContainerScroll', function() {
32
32
  });
33
33
 
34
34
  it("should adjust the table height on window resize", function() {
35
- var table = tableElement.find('table'),
36
- windowElement = angular.element(window);
37
-
38
35
  windowElement.height('100px');
39
36
  windowElement.trigger('resize');
40
37
 
41
38
  expect(tableElement.height()).toEqual(windowElement.height() - tableElement.offset().top);
42
39
  });
40
+
41
+ it("should add the nutupane details padding if it exists", function () {
42
+ tableElement.css('padding-bottom', '10px');
43
+
44
+ compile(tableElement)(scope);
45
+ scope.$digest();
46
+
47
+ windowElement.height('100px');
48
+ windowElement.trigger('resize');
49
+
50
+ expect(tableElement.height()).toEqual(windowElement.height() - (tableElement.offset().top + 10));
51
+ });
43
52
  });
@@ -1,6 +1,7 @@
1
1
  describe('Factory: Nutupane', function() {
2
2
  var $timeout,
3
3
  $location,
4
+ $rootScope,
4
5
  Resource,
5
6
  expectedResult,
6
7
  Nutupane;
@@ -28,10 +29,11 @@ describe('Factory: Nutupane', function() {
28
29
  };
29
30
  }));
30
31
 
31
- beforeEach(inject(function(_$location_, _$timeout_, _Nutupane_) {
32
+ beforeEach(inject(function(_$location_, _$timeout_, _Nutupane_, _$rootScope_) {
32
33
  $location = _$location_;
33
34
  $timeout = _$timeout_;
34
35
  Nutupane = _Nutupane_;
36
+ $rootScope = _$rootScope_;
35
37
  }));
36
38
 
37
39
  describe("adds additional functionality to the Nutupane table by", function() {
@@ -295,6 +297,23 @@ describe('Factory: Nutupane', function() {
295
297
  nutupane.table.sortBy({id: "name"});
296
298
  expect(nutupane.query).toHaveBeenCalled();
297
299
  });
300
+
301
+ describe("watches $locationChangeStart", function () {
302
+ beforeEach(function () {
303
+ nutupane.table.closeItem = function() {};
304
+ spyOn(nutupane.table, 'closeItem');
305
+ });
306
+
307
+ it("and closes the item pane if the url matches the org switcher url", function () {
308
+ $rootScope.$emit("$locationChangeStart", '/organizations/1-Default%20Organization/select');
309
+ expect(nutupane.table.closeItem).toHaveBeenCalled();
310
+ });
311
+
312
+ it("and does nothing if the URL does not match the org switcher url", function () {
313
+ $rootScope.$emit("$locationChangeStart", '/some-other-url/select');
314
+ expect(nutupane.table.closeItem).not.toHaveBeenCalled();
315
+ });
316
+ });
298
317
  });
299
318
  });
300
319
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bastion
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric D Helms
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-17 00:00:00.000000000 Z
12
+ date: 2016-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: angular-rails-templates
@@ -998,45 +998,46 @@ required_rubygems_version: !ruby/object:Gem::Requirement
998
998
  version: '0'
999
999
  requirements: []
1000
1000
  rubyforge_project:
1001
- rubygems_version: 2.4.8
1001
+ rubygems_version: 2.4.6
1002
1002
  signing_key:
1003
1003
  specification_version: 4
1004
1004
  summary: UI library of AngularJS based components for Foreman
1005
1005
  test_files:
1006
- - test/bastion/bastion-resource.factory.test.js
1007
- - test/bastion/test-constants.js
1008
1006
  - test/features/bst-feature-flag.directive.test.js
1009
1007
  - test/features/feature-flag.service.test.js
1010
1008
  - test/auth/authorization.service.test.js
1011
- - test/i18n/translate.service.test.js
1009
+ - test/components/bst-form-group.directive.test.js
1010
+ - test/components/bst-table.directive.test.js
1011
+ - test/components/page-title.directive.test.js
1012
1012
  - test/components/bst-nutupane-table.directive.test.js
1013
- - test/components/bst-dropdown.directive.test.js
1014
- - test/components/bst-bookmark.factory.test.js
1015
- - test/components/bst-form-buttons.directive.test.js
1016
- - test/components/typeahead-empty.directive.test.js
1013
+ - test/components/bst-menu.directive.test.js
1017
1014
  - test/components/bst-alerts.directive.test.js
1018
1015
  - test/components/nutupane.factory.test.js
1019
- - test/components/page-title.directive.test.js
1020
- - test/components/bst-table.directive.test.js
1021
- - test/components/bst-container-scroll.directive.test.js
1022
- - test/components/global-notification.service.test.js
1023
- - test/components/formatters/capitalize.filter.test.js
1016
+ - test/components/path-selector.directive.test.js
1024
1017
  - test/components/formatters/array-to-string.filter.test.js
1025
- - test/components/formatters/boolean-to-yes-no.filter.test.js
1026
1018
  - test/components/formatters/unlimited-filter.filter.test.js
1019
+ - test/components/formatters/capitalize.filter.test.js
1027
1020
  - test/components/formatters/key-value-to-string.filter.test.js
1028
- - test/components/bst-menu.directive.test.js
1021
+ - test/components/formatters/boolean-to-yes-no.filter.test.js
1022
+ - test/components/page-title.service.test.js
1023
+ - test/components/bst-bookmark.factory.test.js
1024
+ - test/components/bst-alert.directive.test.js
1025
+ - test/components/bst-container-scroll.directive.test.js
1029
1026
  - test/components/bst-bookmark.directive.test.js
1027
+ - test/components/bst-global-notification.directive.test.js
1028
+ - test/components/bst-flyout.directive.test.js
1029
+ - test/components/bst-dropdown.directive.test.js
1030
+ - test/components/typeahead-empty.directive.test.js
1031
+ - test/components/bst-form-buttons.directive.test.js
1032
+ - test/components/global-notification.service.test.js
1030
1033
  - test/components/bst-edit.directive.test.js
1031
1034
  - test/components/bst-modal.directive.test.js
1032
- - test/components/bst-form-group.directive.test.js
1033
- - test/components/bst-flyout.directive.test.js
1034
- - test/components/bst-global-notification.directive.test.js
1035
- - test/components/page-title.service.test.js
1036
- - test/components/bst-alert.directive.test.js
1037
- - test/components/path-selector.directive.test.js
1038
- - test/utils/as.filter.test.js
1039
- - test/utils/form-utils.service.test.js
1040
- - test/utils/urlencode.filter.test.js
1041
1035
  - test/test-mocks.module.js
1042
1036
  - test/menu/menu-expander.service.test.js
1037
+ - test/i18n/translate.service.test.js
1038
+ - test/bastion/test-constants.js
1039
+ - test/bastion/bastion-resource.factory.test.js
1040
+ - test/utils/form-utils.service.test.js
1041
+ - test/utils/urlencode.filter.test.js
1042
+ - test/utils/as.filter.test.js
1043
+ has_rdoc: