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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb88de97c9f4c944ef8dc4bdaa2658887a649946
4
- data.tar.gz: eb1a8a31b204a4841e605eba9c887882b5436074
3
+ metadata.gz: b7c7fe733a22410ca7cf6a17aaed71e8373efeb4
4
+ data.tar.gz: 2cd0cf452ca0000dd3643c4ed3b6b8603cc23fb1
5
5
  SHA512:
6
- metadata.gz: 060854ddc47304d5814abe27b1c09e8f6fafba5c03833e44084ce94c8d7e4f7aa034c11ea6e55ce6751c6d6ab4b1808c4ac3e668edde9ae176885f55ac630be4
7
- data.tar.gz: 27bd7e7c4f50cacb71b4f3ef0a16f49b15cad9ead497aa475736727abc615fc425b50a3859ba6c09c3a3c5071c5c2f5ad32365c8d61b0d17a0a7ca0d1db18ff8
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
- $window.location.href = url;
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)/(.+/)*(select|clear)");
195
+ orgSwitcherRegex = new RegExp("/(organizations|locations)");
189
196
  $rootScope.$on('$locationChangeStart', function (event, newUrl) {
190
197
  if (newUrl.match(orgSwitcherRegex)) {
191
198
  event.preventDefault();
@@ -9,6 +9,6 @@
9
9
  * Cross application re-usable components
10
10
  */
11
11
  angular
12
- .module('Bastion.components', ['ngAnimate']);
12
+ .module('Bastion.components', []);
13
13
 
14
14
  })();
@@ -6,5 +6,5 @@
6
6
  <i class='ui-autocomplete-completed'>
7
7
  {{ match.model.completed }}
8
8
  </i>
9
- {{ match.model.part }}
10
- </a>
9
+ {{ match.model.label }}
10
+ </a>
@@ -0,0 +1,5 @@
1
+ <div class="loading-mask loading-mask-panel fa-3x" ng-show="panel.loading">
2
+ <i class="fa fa-spinner fa-spin"></i>
3
+ {{ "Loading..." | translate }}
4
+ </div>
5
+ <span ng-hide="panel.loading" data-block="panel"></span>
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.2.9",
8
+ "angular": "=1.5.5",
9
9
  "angular-bootstrap": "0.10.0",
10
- "angular": "=1.2.9",
11
- "angular-sanitize": "=1.2.9",
12
- "angular-resource": "=1.2.9",
13
- "angular-route": "=1.2.9",
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.2.0",
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.2.9",
27
- "angular-scenario": "=1.2.9"
26
+ "angular-mocks": "=1.5.5",
27
+ "angular-scenario": "=1.5.5"
28
28
  },
29
29
  "resolutions": {
30
- "angular": "1.2.9",
30
+ "angular": "1.5.5",
31
31
  "jquery": "=1.9.1"
32
32
  },
33
33
  "exportsOverride": {
@@ -1,3 +1,3 @@
1
1
  module Bastion
2
- VERSION = "3.2.2"
2
+ VERSION = "3.3.0"
3
3
  end
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
- "eslint": "~0.14.1",
20
- "eslint-plugin-angular": "0.0.3"
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').andCallThrough();
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').andCallThrough();
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').andCallThrough();
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').andCallThrough();
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 element,
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="item.name"></span>');
207
+ '<span bst-edit-number="number"></span>');
209
208
 
210
- scope.item = testItem;
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="item.name" min=123 max=456></span>');
224
+ '<span bst-edit-number="number" min=123 max=456></span>');
226
225
 
227
- scope.item = testItem;
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').andCallThrough();
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').andCallThrough();
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.mostRecentCall.args[0];
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').andCallThrough();
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').andCallThrough();
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').andCallThrough();
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').andCallThrough();
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').andCallThrough();
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').andReturn(string);
13
+ spyOn(gettextCatalog, 'getString').and.returnValue(string);
14
14
  expect(translate(string)).toBe(string);
15
15
  expect(gettextCatalog.getString).toHaveBeenCalledWith(string);
16
16
  });
@@ -1,4 +1,6 @@
1
1
  describe('Filter:urlencode', function() {
2
+ var urlencodeFilter;
3
+
2
4
  beforeEach(module('Bastion.utils'));
3
5
 
4
6
  beforeEach(inject(function($filter) {