bastion 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/bastion/components/bst-container-scroll.directive.js +11 -3
- data/app/assets/javascripts/bastion/components/nutupane.factory.js +14 -2
- data/app/assets/javascripts/bastion/components/views/bst-alert.html +2 -4
- data/app/assets/javascripts/bastion/features/bst-feature-flag.directive.js +1 -1
- data/app/assets/javascripts/bastion/utils/urlencode.filter.js +2 -2
- data/app/assets/stylesheets/bastion/forms.scss +1 -1
- data/app/assets/stylesheets/bastion/nutupane.scss +7 -1
- data/app/assets/stylesheets/bastion/overrides.scss +4 -0
- data/lib/bastion/version.rb +1 -1
- data/test/components/bst-container-scroll.directive.test.js +15 -6
- data/test/components/nutupane.factory.test.js +20 -1
- metadata +27 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39736e486baa7a52fa022a34eac73d2b89663f37
|
4
|
+
data.tar.gz: 76967c212d01faba0a4a720ea7031b22edb04ff0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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-
|
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-
|
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
|
|
@@ -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
|
+
}
|
data/lib/bastion/version.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
describe('Directive: bstContainerScroll', function() {
|
2
2
|
var scope,
|
3
3
|
compile,
|
4
|
-
|
4
|
+
windowElement,
|
5
5
|
tableElement;
|
6
6
|
|
7
7
|
beforeEach(module('Bastion.components'));
|
8
8
|
|
9
|
-
beforeEach(inject(function(_$compile_, _$rootScope_,
|
9
|
+
beforeEach(inject(function(_$compile_, _$rootScope_, $window) {
|
10
10
|
compile = _$compile_;
|
11
11
|
scope = _$rootScope_;
|
12
|
-
|
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.
|
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-
|
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.
|
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/
|
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-
|
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/
|
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/
|
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:
|