bastion 3.2.2 → 3.3.0
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/bastion.module.js +10 -3
- data/app/assets/javascripts/bastion/components/components.module.js +1 -1
- data/app/assets/javascripts/bastion/components/views/autocomplete-scoped-search.html +2 -2
- data/app/assets/javascripts/bastion/layouts/panel.html +5 -0
- data/bower.json +9 -9
- data/lib/bastion/version.rb +1 -1
- data/package.json +13 -12
- data/test/components/bst-bookmark.directive.test.js +2 -2
- data/test/components/bst-dropdown.directive.test.js +2 -2
- data/test/components/bst-edit.directive.test.js +5 -6
- data/test/components/bst-menu.directive.test.js +1 -1
- data/test/components/bst-modal.directive.test.js +3 -3
- data/test/components/nutupane.factory.test.js +4 -4
- data/test/i18n/translate.service.test.js +1 -1
- data/test/utils/urlencode.filter.test.js +2 -0
- data/vendor/assets/javascripts/bastion/angular/angular.js +22616 -12308
- data/vendor/assets/javascripts/bastion/angular-animate/angular-animate.js +3940 -1019
- data/vendor/assets/javascripts/bastion/angular-blocks/angular-blocks.js +7 -2
- data/vendor/assets/javascripts/bastion/angular-resource/angular-resource.js +471 -297
- data/vendor/assets/javascripts/bastion/angular-route/angular-route.js +369 -264
- data/vendor/assets/javascripts/bastion/angular-sanitize/angular-sanitize.js +412 -317
- data/vendor/assets/javascripts/bastion/ngUpload/ng-upload.js +63 -24
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7c7fe733a22410ca7cf6a17aaed71e8373efeb4
|
4
|
+
data.tar.gz: 2cd0cf452ca0000dd3643c4ed3b6b8603cc23fb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44a83fce72d0f3a18c8bcd3f5fbc78c18398fa178ee69023dc2201d7e7d5ee4de7b849a058b889e81a2cf3309be0ab896b1cf8c2f6355206f68a414ed8688598
|
7
|
+
data.tar.gz: de02c1e4d11ee3a8e1553388a6143fc8bf35495f987086de2fb6df3a46dc4eac36b7ab33705ef13ad1b9b310579d7c4d8a8457a433a355ce8e9a0c38dff24219
|
@@ -59,6 +59,8 @@ angular.module('Bastion').config(
|
|
59
59
|
|
60
60
|
$urlRouterProvider.otherwise(function ($injector, $location) {
|
61
61
|
var $window = $injector.get('$window'),
|
62
|
+
$state = $injector.get('$state'),
|
63
|
+
parentState = $location.path().split('/')[1].replace('_', '-'),
|
62
64
|
url = $location.absUrl();
|
63
65
|
|
64
66
|
// ensure we don't double encode +s
|
@@ -67,10 +69,15 @@ angular.module('Bastion').config(
|
|
67
69
|
// Remove the old browser path if present
|
68
70
|
url = url.replace(oldBrowserBastionPath, '');
|
69
71
|
|
70
|
-
$
|
72
|
+
if ($state.get(parentState)) {
|
73
|
+
$window.location.href = '/404';
|
74
|
+
} else {
|
75
|
+
$window.location.href = url;
|
76
|
+
}
|
77
|
+
return $location.path();
|
71
78
|
});
|
72
79
|
|
73
|
-
$locationProvider.html5Mode(true);
|
80
|
+
$locationProvider.html5Mode({enabled: true, requireBase: false});
|
74
81
|
|
75
82
|
$provide.factory('PrefixInterceptor', ['$q', '$templateCache', function ($q, $templateCache) {
|
76
83
|
return {
|
@@ -185,7 +192,7 @@ angular.module('Bastion').run(['$rootScope', '$state', '$stateParams', 'gettextC
|
|
185
192
|
);
|
186
193
|
|
187
194
|
// Prevent angular from handling org/location switcher URLs
|
188
|
-
orgSwitcherRegex = new RegExp("/(organizations|locations)
|
195
|
+
orgSwitcherRegex = new RegExp("/(organizations|locations)");
|
189
196
|
$rootScope.$on('$locationChangeStart', function (event, newUrl) {
|
190
197
|
if (newUrl.match(orgSwitcherRegex)) {
|
191
198
|
event.preventDefault();
|
data/bower.json
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
"dependencies": {
|
6
6
|
"json3": "~3.2.4",
|
7
7
|
"es5-shim": "~2.0.8",
|
8
|
-
"angular": "=1.
|
8
|
+
"angular": "=1.5.5",
|
9
9
|
"angular-bootstrap": "0.10.0",
|
10
|
-
"angular": "=1.
|
11
|
-
"angular-sanitize": "=1.
|
12
|
-
"angular-resource": "=1.
|
13
|
-
"angular-route": "=1.
|
10
|
+
"angular": "=1.5.5",
|
11
|
+
"angular-sanitize": "=1.5.5",
|
12
|
+
"angular-resource": "=1.5.5",
|
13
|
+
"angular-route": "=1.5.5",
|
14
14
|
"angular-gettext": "=1.0.0",
|
15
15
|
"angular-ui-router": "=0.2.10",
|
16
16
|
"angular-blocks": "~>0.1.8",
|
@@ -18,16 +18,16 @@
|
|
18
18
|
"underscore": "=1.5.2",
|
19
19
|
"ngInfiniteScroll": "1.2.1",
|
20
20
|
"ngUpload": "~0.5.5",
|
21
|
-
"angular-animate": "=1.
|
21
|
+
"angular-animate": "=1.5.5",
|
22
22
|
"angular-uuid4": "0.1.0"
|
23
23
|
},
|
24
24
|
"devDependencies": {
|
25
25
|
"jquery": "=1.9.1",
|
26
|
-
"angular-mocks": "=1.
|
27
|
-
"angular-scenario": "=1.
|
26
|
+
"angular-mocks": "=1.5.5",
|
27
|
+
"angular-scenario": "=1.5.5"
|
28
28
|
},
|
29
29
|
"resolutions": {
|
30
|
-
"angular": "1.
|
30
|
+
"angular": "1.5.5",
|
31
31
|
"jquery": "=1.9.1"
|
32
32
|
},
|
33
33
|
"exportsOverride": {
|
data/lib/bastion/version.rb
CHANGED
data/package.json
CHANGED
@@ -2,22 +2,23 @@
|
|
2
2
|
"name": "bastion",
|
3
3
|
"version": "0.1.0",
|
4
4
|
"dependencies": {
|
5
|
+
"eslint": "~0.14.1",
|
6
|
+
"eslint-plugin-angular": "0.0.3",
|
7
|
+
"generator-bastion": "~0.1.2",
|
5
8
|
"grunt": "~0.4.5",
|
9
|
+
"grunt-angular-gettext": "~0.2.15",
|
6
10
|
"grunt-bower-task": "~0.3.4",
|
7
|
-
"require-dir": "~0.1.0",
|
8
|
-
"karma": "~0.12.23",
|
9
|
-
"grunt-karma": "~0.9.0",
|
10
|
-
"karma-jasmine": "~0.1.5",
|
11
|
-
"karma-phantomjs-launcher": "~0.1.4",
|
12
|
-
"karma-ng-html2js-preprocessor": "~0.1.0",
|
13
|
-
"karma-coverage": "~0.2.6",
|
14
|
-
"grunt-htmlhint": "~0.4.1",
|
15
11
|
"grunt-concurrent": "~1.0.0",
|
16
|
-
"generator-bastion": "~0.1.2",
|
17
|
-
"grunt-angular-gettext": "~0.2.15",
|
18
12
|
"grunt-eslint": "~6.0.0",
|
19
|
-
"
|
20
|
-
"
|
13
|
+
"grunt-htmlhint": "~0.4.1",
|
14
|
+
"grunt-karma": "^1.0.0",
|
15
|
+
"jasmine-core": "^2.4.1",
|
16
|
+
"karma": "^0.13.22",
|
17
|
+
"karma-coverage": "^1.0.0",
|
18
|
+
"karma-jasmine": "^1.0.2",
|
19
|
+
"karma-ng-html2js-preprocessor": "^1.0.0",
|
20
|
+
"karma-phantomjs-launcher": "^1.0.0",
|
21
|
+
"require-dir": "~0.1.0"
|
21
22
|
},
|
22
23
|
"engines": {
|
23
24
|
"node": ">=0.8.0"
|
@@ -77,7 +77,7 @@ describe('Directive: bstBookmark', function() {
|
|
77
77
|
});
|
78
78
|
|
79
79
|
it("should set bookmarks on the scope", function () {
|
80
|
-
spyOn(BstBookmark, 'queryPaged').
|
80
|
+
spyOn(BstBookmark, 'queryPaged').and.callThrough();
|
81
81
|
compileDirective();
|
82
82
|
expect(BstBookmark.queryPaged).toHaveBeenCalled();
|
83
83
|
expect(elementScope.bookmarks).toEqual(['bookmark']);
|
@@ -112,7 +112,7 @@ describe('Directive: bstBookmark', function() {
|
|
112
112
|
controller: scope.controllerName
|
113
113
|
};
|
114
114
|
|
115
|
-
spyOn(BstBookmark, 'create').
|
115
|
+
spyOn(BstBookmark, 'create').and.callThrough();
|
116
116
|
spyOn(BstBookmark, 'queryPaged');
|
117
117
|
});
|
118
118
|
|
@@ -52,7 +52,7 @@ describe('Directive: bstDropdown', function() {
|
|
52
52
|
|
53
53
|
beforeEach(function() {
|
54
54
|
target = angular.element(element.find('li')[1]);
|
55
|
-
spyOn(elementScope, 'setHover').
|
55
|
+
spyOn(elementScope, 'setHover').and.callThrough();
|
56
56
|
});
|
57
57
|
|
58
58
|
it("by setting the item to active on mouse in", function() {
|
@@ -75,7 +75,7 @@ describe('Directive: bstDropdown', function() {
|
|
75
75
|
|
76
76
|
beforeEach(function() {
|
77
77
|
target = angular.element(element.find('li')[2]);
|
78
|
-
spyOn(elementScope, 'setHover').
|
78
|
+
spyOn(elementScope, 'setHover').and.callThrough();
|
79
79
|
});
|
80
80
|
|
81
81
|
it("by setting the item to active on mouse in", function() {
|
@@ -44,8 +44,7 @@ describe('Directive: bstEdit', function() {
|
|
44
44
|
}));
|
45
45
|
|
46
46
|
describe('bstEdit controller', function() {
|
47
|
-
var
|
48
|
-
editController;
|
47
|
+
var editController;
|
49
48
|
|
50
49
|
beforeEach(inject(function($controller) {
|
51
50
|
editController = $controller('BstEditController', {$scope: scope});
|
@@ -205,9 +204,9 @@ describe('Directive: bstEdit', function() {
|
|
205
204
|
|
206
205
|
it("should display an input with type of number on editable click", function() {
|
207
206
|
editableElement = angular.element(
|
208
|
-
'<span bst-edit-number="
|
207
|
+
'<span bst-edit-number="number"></span>');
|
209
208
|
|
210
|
-
scope.
|
209
|
+
scope.number = 3;
|
211
210
|
|
212
211
|
compile(editableElement)(scope);
|
213
212
|
scope.$digest();
|
@@ -222,9 +221,9 @@ describe('Directive: bstEdit', function() {
|
|
222
221
|
|
223
222
|
it("should display an input with type of number on editable click with min and max", function() {
|
224
223
|
editableElement = angular.element(
|
225
|
-
'<span bst-edit-number="
|
224
|
+
'<span bst-edit-number="number" min=123 max=456></span>');
|
226
225
|
|
227
|
-
scope.
|
226
|
+
scope.number = 123;
|
228
227
|
|
229
228
|
compile(editableElement)(scope);
|
230
229
|
scope.$digest();
|
@@ -58,7 +58,7 @@ describe('Directive: bstMenu', function() {
|
|
58
58
|
|
59
59
|
beforeEach(function() {
|
60
60
|
target = angular.element(element.find('li')[2]);
|
61
|
-
spyOn(elementScope, 'handleHover').
|
61
|
+
spyOn(elementScope, 'handleHover').and.callThrough();
|
62
62
|
});
|
63
63
|
|
64
64
|
it("by setting the item to active on mouse in", function() {
|
@@ -49,13 +49,13 @@ describe('Directive: bstModal', function() {
|
|
49
49
|
'</span>';
|
50
50
|
|
51
51
|
element = angular.element(html);
|
52
|
-
spyOn($templateCache, 'put').
|
52
|
+
spyOn($templateCache, 'put').and.callThrough();
|
53
53
|
|
54
54
|
compile(element)(scope);
|
55
55
|
scope.$digest();
|
56
56
|
|
57
57
|
elementScope = element.scope();
|
58
|
-
modalId = $templateCache.put.
|
58
|
+
modalId = $templateCache.put.calls.mostRecent().args[0];
|
59
59
|
});
|
60
60
|
|
61
61
|
it("uses angular-blocks to extend a modal template", function () {
|
@@ -68,7 +68,7 @@ describe('Directive: bstModal', function() {
|
|
68
68
|
});
|
69
69
|
|
70
70
|
it("allows the opening of a modal dialog via bootstrap ui", function() {
|
71
|
-
spyOn($modal, 'open').
|
71
|
+
spyOn($modal, 'open').and.callThrough();
|
72
72
|
|
73
73
|
elementScope.openModal();
|
74
74
|
|
@@ -54,7 +54,7 @@ describe('Factory: Nutupane', function() {
|
|
54
54
|
it("providing a method to fetch records for the table", function() {
|
55
55
|
var expected = nutupane.table.rows.concat(expectedResult);
|
56
56
|
|
57
|
-
spyOn(Resource, 'queryPaged').
|
57
|
+
spyOn(Resource, 'queryPaged').and.callThrough();
|
58
58
|
nutupane.query();
|
59
59
|
|
60
60
|
expect(Resource.queryPaged).toHaveBeenCalled();
|
@@ -65,7 +65,7 @@ describe('Factory: Nutupane', function() {
|
|
65
65
|
});
|
66
66
|
|
67
67
|
it("providing a method to refresh the table", function() {
|
68
|
-
spyOn(Resource, 'queryPaged').
|
68
|
+
spyOn(Resource, 'queryPaged').and.callThrough();
|
69
69
|
nutupane.refresh();
|
70
70
|
|
71
71
|
expect(Resource.queryPaged).toHaveBeenCalled();
|
@@ -243,7 +243,7 @@ describe('Factory: Nutupane', function() {
|
|
243
243
|
it("autocompletes using the original resource if possible", function() {
|
244
244
|
var data;
|
245
245
|
Resource.autocomplete = function() {return ["foo"]};
|
246
|
-
spyOn(Resource, 'autocomplete').
|
246
|
+
spyOn(Resource, 'autocomplete').and.callThrough();
|
247
247
|
|
248
248
|
data = nutupane.table.autocomplete();
|
249
249
|
expect(Resource.autocomplete).toHaveBeenCalled();
|
@@ -253,7 +253,7 @@ describe('Factory: Nutupane', function() {
|
|
253
253
|
it("autocompletes using fetchAutocomplete if resource doesn't support autocomplete", function() {
|
254
254
|
var data;
|
255
255
|
nutupane.table.fetchAutocomplete = function() {return ['bar']};
|
256
|
-
spyOn(nutupane.table, 'fetchAutocomplete').
|
256
|
+
spyOn(nutupane.table, 'fetchAutocomplete').and.callThrough();
|
257
257
|
|
258
258
|
data = nutupane.table.autocomplete();
|
259
259
|
expect(nutupane.table.fetchAutocomplete).toHaveBeenCalled();
|
@@ -10,7 +10,7 @@ describe('Service: translate', function() {
|
|
10
10
|
|
11
11
|
it('passes through to the gettextCatalog.getString', function() {
|
12
12
|
var string = 'lalala';
|
13
|
-
spyOn(gettextCatalog, 'getString').
|
13
|
+
spyOn(gettextCatalog, 'getString').and.returnValue(string);
|
14
14
|
expect(translate(string)).toBe(string);
|
15
15
|
expect(gettextCatalog.getString).toHaveBeenCalledWith(string);
|
16
16
|
});
|