bastion 5.0.3 → 5.0.4

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: 9b152a3b4bfbdb32c9f4ac9060877a5773fe8f40
4
- data.tar.gz: 21a44d2a76ba96a13237feec8b01d220fab6181d
3
+ metadata.gz: 0b38acac7159ccc6fd0448faa66044035a94c42c
4
+ data.tar.gz: f3721642acc5343d5d92f31c505aaa24120ca368
5
5
  SHA512:
6
- metadata.gz: 36221d147c3b0a107a5d88c619d0c94c2adc8d6e581dd9c6efac570ac6fc55a96303f904319d81eb22566a9278775bc4f242b952aa1aa46cf6d66aa58b9e00c2
7
- data.tar.gz: 3ad28ea75a26b8c23071e73c35f533032308ce64a57cb96279207561e6db08fd10da734ea765f31f28dfb19c66caca5e5fa9e13f320b92b9e77da819cf6d0e10
6
+ metadata.gz: f795bad41b47115b0f7a05bb5e088c1f18ead3c9c55f3e12ba29e45d6b8701c7fa181aab004a461cafe94585d171e6b534e454f02db46c46cdd0aefbd8d72a39
7
+ data.tar.gz: a426352d760c209b2b720e14c72ab7c29e126eeba35f819d1fc850671fbe8888a064030f3d090bf2b7e358e0e06ff1c78de4c767aaab3c3a3ef5987831fe2f83
@@ -34,41 +34,37 @@ angular.module('Bastion.components').factory('Nutupane',
34
34
  var Nutupane = function (resource, params, action) {
35
35
  var self = this;
36
36
 
37
- // TODO: remove me
38
- // http://projects.theforeman.org/issues/18079
39
- TableCache.setTable = function () {};
40
-
41
37
  function getTableName() {
42
38
  return $location.path().split('/').join('-').slice(1);
43
39
  }
44
40
 
45
41
  function setQueryStrings() {
46
- if (params.paged) {
47
- $location.search("page", params.page).replace();
48
- $location.search("per_page", params['per_page']).replace();
42
+ if (self.table.params.paged) {
43
+ $location.search("page", self.table.params.page).replace();
44
+ $location.search("per_page", self.table.params['per_page']).replace();
49
45
  }
50
46
 
51
- if (params.search) {
52
- $location.search(self.searchKey, params.search).replace();
47
+ if (self.table.params.search) {
48
+ $location.search(self.searchKey, self.table.params.search).replace();
53
49
  }
54
50
 
55
- if (params.sort_by) {
56
- $location.search("sortBy", params['sort_by']).replace();
51
+ if (self.table.params.sort_by) {
52
+ $location.search("sortBy", self.table.params['sort_by']).replace();
57
53
  }
58
54
 
59
- if (params['sort_order']) {
60
- $location.search("sortOrder", params['sort_order']).replace();
55
+ if (self.table.params['sort_order']) {
56
+ $location.search("sortOrder", self.table.params['sort_order']).replace();
61
57
  }
62
58
  }
63
59
 
64
60
  params = params || {};
65
61
  params.paged = true;
66
62
  params.page = $location.search().page || 1;
67
- params['per_page'] = $location.search().perPage || entriesPerPage;
63
+ params['per_page'] = $location.search()['per_page'] || entriesPerPage;
68
64
 
69
65
  self.searchKey = action ? action + 'Search' : 'search';
70
66
 
71
- self.table = TableCache.getTable(getTableName()) || {
67
+ self.table = {
72
68
  action: action || 'queryPaged',
73
69
  params: params,
74
70
  resource: resource,
@@ -77,18 +73,28 @@ angular.module('Bastion.components').factory('Nutupane',
77
73
  initialLoad: true
78
74
  };
79
75
 
76
+ self.loadParamsFromExistingTable = function (existingTable) {
77
+ params = existingTable.params;
78
+ self.table.params = existingTable.params;
79
+ self.table.searchTerm = existingTable.searchTerm;
80
+ };
81
+
80
82
  self.load = function () {
81
83
  var deferred = $q.defer(),
82
- table = self.table;
84
+ table = self.table,
85
+ existingTable = TableCache.getTable(getTableName());
83
86
 
84
87
  table.working = true;
85
88
 
86
89
  if (table.initialLoad) {
87
90
  table.refreshing = true;
88
- table.initialLoad = false;
89
91
  table.searchCompleted = false;
90
92
  }
91
93
 
94
+ if (existingTable) {
95
+ self.loadParamsFromExistingTable(existingTable);
96
+ }
97
+
92
98
  params.search = table.searchTerm || "";
93
99
  params.search = self.searchTransform(params.search);
94
100
 
@@ -103,7 +109,9 @@ angular.module('Bastion.components').factory('Nutupane',
103
109
  });
104
110
 
105
111
  table.rows = response.results;
112
+
106
113
  table.resource.page = parseInt(response.page, 10);
114
+ table.params.page = parseInt(response.page, 10);
107
115
 
108
116
  if (table.initialSelectAll) {
109
117
  table.selectAll(true);
@@ -129,6 +137,7 @@ angular.module('Bastion.components').factory('Nutupane',
129
137
 
130
138
  table.working = false;
131
139
  table.refreshing = false;
140
+ table.initialLoad = false;
132
141
  });
133
142
 
134
143
  return deferred.promise;
@@ -206,11 +215,15 @@ angular.module('Bastion.components').factory('Nutupane',
206
215
  };
207
216
 
208
217
  self.refresh = function () {
209
- self.invalidate();
218
+ var existingTable = TableCache.getTable(getTableName());
219
+
220
+ if (existingTable) {
221
+ self.loadParamsFromExistingTable(existingTable);
222
+ }
223
+
210
224
  self.table.refreshing = true;
211
- self.table.resource.page = 0;
212
225
  self.table.numSelected = 0;
213
- return self.load(true);
226
+ return self.load();
214
227
  };
215
228
 
216
229
  self.invalidate = function () {
@@ -1,3 +1,3 @@
1
1
  module Bastion
2
- VERSION = "5.0.3"
2
+ VERSION = "5.0.4"
3
3
  end
@@ -130,11 +130,9 @@ describe('Factory: Nutupane', function() {
130
130
 
131
131
  it("providing a method to refresh the table", function() {
132
132
  spyOn(Resource, 'queryPaged').and.callThrough();
133
- spyOn(TableCache, 'removeTable');
134
133
 
135
134
  nutupane.refresh();
136
135
 
137
- expect(TableCache.removeTable).toHaveBeenCalled();
138
136
  expect(Resource.queryPaged).toHaveBeenCalled();
139
137
  expect(nutupane.table.rows).toBe(expectedResult);
140
138
  });
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: 5.0.3
4
+ version: 5.0.4
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: 2017-04-26 00:00:00.000000000 Z
12
+ date: 2017-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: angular-rails-templates
@@ -29,14 +29,14 @@ dependencies:
29
29
  name: uglifier
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - '>='
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  description: Bastion provides a UI library of AngularJS based components designed
@@ -48,12 +48,6 @@ executables: []
48
48
  extensions: []
49
49
  extra_rdoc_files: []
50
50
  files:
51
- - ".eslintignore"
52
- - ".jshintrc"
53
- - Gruntfile.js
54
- - LICENSE
55
- - README.md
56
- - Rakefile
57
51
  - app/assets/javascripts/bastion/auth/auth.module.js
58
52
  - app/assets/javascripts/bastion/auth/authorization.service.js
59
53
  - app/assets/javascripts/bastion/bastion-bootstrap.js
@@ -119,10 +113,8 @@ files:
119
113
  - app/assets/javascripts/bastion/features/feature-flag.service.js
120
114
  - app/assets/javascripts/bastion/features/features.module.js
121
115
  - app/assets/javascripts/bastion/features/features.service.js
122
- - app/assets/javascripts/bastion/i18n/README
123
116
  - app/assets/javascripts/bastion/i18n/bastion.pot
124
117
  - app/assets/javascripts/bastion/i18n/i18n.module.js
125
- - app/assets/javascripts/bastion/i18n/locale/README
126
118
  - app/assets/javascripts/bastion/i18n/locale/de.po
127
119
  - app/assets/javascripts/bastion/i18n/locale/es.po
128
120
  - app/assets/javascripts/bastion/i18n/locale/fr.po
@@ -130,9 +122,11 @@ files:
130
122
  - app/assets/javascripts/bastion/i18n/locale/ja.po
131
123
  - app/assets/javascripts/bastion/i18n/locale/ko.po
132
124
  - app/assets/javascripts/bastion/i18n/locale/pt_BR.po
125
+ - app/assets/javascripts/bastion/i18n/locale/README
133
126
  - app/assets/javascripts/bastion/i18n/locale/ru.po
134
127
  - app/assets/javascripts/bastion/i18n/locale/zh_CN.po
135
128
  - app/assets/javascripts/bastion/i18n/locale/zh_TW.po
129
+ - app/assets/javascripts/bastion/i18n/README
136
130
  - app/assets/javascripts/bastion/i18n/translate.service.js
137
131
  - app/assets/javascripts/bastion/i18n/translations.js
138
132
  - app/assets/javascripts/bastion/i18n/zanata.xml
@@ -174,60 +168,12 @@ files:
174
168
  - app/views/bastion/layouts/application.html.erb
175
169
  - app/views/bastion/layouts/application_ie.html.erb
176
170
  - app/views/bastion/layouts/assets.html.erb
177
- - bastion.js
178
- - bower.json
179
- - config/routes.rb
180
171
  - config/routes/mount_engine.rb
181
- - eslint.yaml
182
- - grunt/bower.js
183
- - grunt/eslint.js
184
- - grunt/htmlhint.js
185
- - grunt/karma.js
186
- - grunt/nggettext_compile.js
187
- - grunt/nggettext_extract.js
188
- - lib/bastion.rb
172
+ - config/routes.rb
189
173
  - lib/bastion/engine.rb
190
174
  - lib/bastion/version.rb
191
- - package.json
192
- - test/auth/authorization.service.test.js
193
- - test/bastion/test-constants.js
194
- - test/components/bst-alert.directive.test.js
195
- - test/components/bst-alerts.directive.test.js
196
- - test/components/bst-bookmark.directive.test.js
197
- - test/components/bst-bookmark.factory.test.js
198
- - test/components/bst-dropdown.directive.test.js
199
- - test/components/bst-edit.directive.test.js
200
- - test/components/bst-flyout.directive.test.js
201
- - test/components/bst-form-buttons.directive.test.js
202
- - test/components/bst-form-group.directive.test.js
203
- - test/components/bst-global-notification.directive.test.js
204
- - test/components/bst-menu.directive.test.js
205
- - test/components/bst-modal.directive.test.js
206
- - test/components/bst-table.directive.test.js
207
- - test/components/formatters/array-to-string.filter.test.js
208
- - test/components/formatters/boolean-to-yes-no.filter.test.js
209
- - test/components/formatters/capitalize.filter.test.js
210
- - test/components/formatters/key-value-to-string.filter.test.js
211
- - test/components/formatters/unlimited-filter.filter.test.js
212
- - test/components/global-notification.service.test.js
213
- - test/components/nutupane.factory.test.js
214
- - test/components/page-title.directive.test.js
215
- - test/components/page-title.service.test.js
216
- - test/components/path-selector.directive.test.js
217
- - test/components/table-cache.service.test.js
218
- - test/components/typeahead-empty.directive.test.js
219
- - test/features/bst-feature-flag.directive.test.js
220
- - test/features/feature-flag.service.test.js
221
- - test/i18n/translate.service.test.js
222
- - test/menu/menu-expander.service.test.js
223
- - test/routing.module.test.js
224
- - test/test-mocks.module.js
225
- - test/utils/bastion-resource.factory.test.js
226
- - test/utils/disable-link.directive.test.js
227
- - test/utils/form-utils.service.test.js
228
- - test/utils/round-up.filter.test.js
229
- - test/utils/stop-event.directive.test.js
230
- - test/utils/urlencode.filter.test.js
175
+ - lib/bastion.rb
176
+ - vendor/assets/javascripts/bastion/angular/angular.js
231
177
  - vendor/assets/javascripts/bastion/angular-animate/angular-animate.js
232
178
  - vendor/assets/javascripts/bastion/angular-blocks/angular-blocks.js
233
179
  - vendor/assets/javascripts/bastion/angular-bootstrap/ui-bootstrap-tpls.js
@@ -1738,9 +1684,63 @@ files:
1738
1684
  - vendor/assets/javascripts/bastion/angular-ui-bootstrap/timepicker.js
1739
1685
  - vendor/assets/javascripts/bastion/angular-ui-router/angular-ui-router.js
1740
1686
  - vendor/assets/javascripts/bastion/angular-uuid4/angular-uuid4.js
1741
- - vendor/assets/javascripts/bastion/angular/angular.js
1742
1687
  - vendor/assets/javascripts/bastion/json3/json3.js
1743
1688
  - vendor/assets/javascripts/bastion/ngUpload/ng-upload.js
1689
+ - grunt/bower.js
1690
+ - grunt/eslint.js
1691
+ - grunt/htmlhint.js
1692
+ - grunt/karma.js
1693
+ - grunt/nggettext_compile.js
1694
+ - grunt/nggettext_extract.js
1695
+ - Rakefile
1696
+ - README.md
1697
+ - Gruntfile.js
1698
+ - package.json
1699
+ - bower.json
1700
+ - bastion.js
1701
+ - eslint.yaml
1702
+ - .eslintignore
1703
+ - LICENSE
1704
+ - .jshintrc
1705
+ - test/auth/authorization.service.test.js
1706
+ - test/bastion/test-constants.js
1707
+ - test/components/bst-alert.directive.test.js
1708
+ - test/components/bst-alerts.directive.test.js
1709
+ - test/components/bst-bookmark.directive.test.js
1710
+ - test/components/bst-bookmark.factory.test.js
1711
+ - test/components/bst-dropdown.directive.test.js
1712
+ - test/components/bst-edit.directive.test.js
1713
+ - test/components/bst-flyout.directive.test.js
1714
+ - test/components/bst-form-buttons.directive.test.js
1715
+ - test/components/bst-form-group.directive.test.js
1716
+ - test/components/bst-global-notification.directive.test.js
1717
+ - test/components/bst-menu.directive.test.js
1718
+ - test/components/bst-modal.directive.test.js
1719
+ - test/components/bst-table.directive.test.js
1720
+ - test/components/formatters/array-to-string.filter.test.js
1721
+ - test/components/formatters/boolean-to-yes-no.filter.test.js
1722
+ - test/components/formatters/capitalize.filter.test.js
1723
+ - test/components/formatters/key-value-to-string.filter.test.js
1724
+ - test/components/formatters/unlimited-filter.filter.test.js
1725
+ - test/components/global-notification.service.test.js
1726
+ - test/components/nutupane.factory.test.js
1727
+ - test/components/page-title.directive.test.js
1728
+ - test/components/page-title.service.test.js
1729
+ - test/components/path-selector.directive.test.js
1730
+ - test/components/table-cache.service.test.js
1731
+ - test/components/typeahead-empty.directive.test.js
1732
+ - test/features/bst-feature-flag.directive.test.js
1733
+ - test/features/feature-flag.service.test.js
1734
+ - test/i18n/translate.service.test.js
1735
+ - test/menu/menu-expander.service.test.js
1736
+ - test/routing.module.test.js
1737
+ - test/test-mocks.module.js
1738
+ - test/utils/bastion-resource.factory.test.js
1739
+ - test/utils/disable-link.directive.test.js
1740
+ - test/utils/form-utils.service.test.js
1741
+ - test/utils/round-up.filter.test.js
1742
+ - test/utils/stop-event.directive.test.js
1743
+ - test/utils/urlencode.filter.test.js
1744
1744
  homepage: http://www.github.com/Katello/bastion
1745
1745
  licenses: []
1746
1746
  metadata: {}
@@ -1750,57 +1750,57 @@ require_paths:
1750
1750
  - lib
1751
1751
  required_ruby_version: !ruby/object:Gem::Requirement
1752
1752
  requirements:
1753
- - - ">="
1753
+ - - '>='
1754
1754
  - !ruby/object:Gem::Version
1755
1755
  version: '0'
1756
1756
  required_rubygems_version: !ruby/object:Gem::Requirement
1757
1757
  requirements:
1758
- - - ">="
1758
+ - - '>='
1759
1759
  - !ruby/object:Gem::Version
1760
1760
  version: '0'
1761
1761
  requirements: []
1762
1762
  rubyforge_project:
1763
- rubygems_version: 2.4.6
1763
+ rubygems_version: 2.0.14
1764
1764
  signing_key:
1765
1765
  specification_version: 4
1766
1766
  summary: UI library of AngularJS based components for Foreman
1767
1767
  test_files:
1768
- - test/features/bst-feature-flag.directive.test.js
1769
- - test/features/feature-flag.service.test.js
1770
1768
  - test/auth/authorization.service.test.js
1769
+ - test/bastion/test-constants.js
1770
+ - test/components/bst-alert.directive.test.js
1771
+ - test/components/bst-alerts.directive.test.js
1772
+ - test/components/bst-bookmark.directive.test.js
1773
+ - test/components/bst-bookmark.factory.test.js
1774
+ - test/components/bst-dropdown.directive.test.js
1775
+ - test/components/bst-edit.directive.test.js
1776
+ - test/components/bst-flyout.directive.test.js
1777
+ - test/components/bst-form-buttons.directive.test.js
1771
1778
  - test/components/bst-form-group.directive.test.js
1772
- - test/components/bst-table.directive.test.js
1773
- - test/components/page-title.directive.test.js
1779
+ - test/components/bst-global-notification.directive.test.js
1774
1780
  - test/components/bst-menu.directive.test.js
1775
- - test/components/bst-alerts.directive.test.js
1776
- - test/components/nutupane.factory.test.js
1777
- - test/components/path-selector.directive.test.js
1781
+ - test/components/bst-modal.directive.test.js
1782
+ - test/components/bst-table.directive.test.js
1778
1783
  - test/components/formatters/array-to-string.filter.test.js
1779
- - test/components/formatters/unlimited-filter.filter.test.js
1784
+ - test/components/formatters/boolean-to-yes-no.filter.test.js
1780
1785
  - test/components/formatters/capitalize.filter.test.js
1781
1786
  - test/components/formatters/key-value-to-string.filter.test.js
1782
- - test/components/formatters/boolean-to-yes-no.filter.test.js
1787
+ - test/components/formatters/unlimited-filter.filter.test.js
1788
+ - test/components/global-notification.service.test.js
1789
+ - test/components/nutupane.factory.test.js
1790
+ - test/components/page-title.directive.test.js
1783
1791
  - test/components/page-title.service.test.js
1784
- - test/components/bst-bookmark.factory.test.js
1785
- - test/components/bst-alert.directive.test.js
1786
- - test/components/bst-bookmark.directive.test.js
1787
- - test/components/bst-global-notification.directive.test.js
1788
- - test/components/bst-flyout.directive.test.js
1792
+ - test/components/path-selector.directive.test.js
1789
1793
  - test/components/table-cache.service.test.js
1790
- - test/components/bst-dropdown.directive.test.js
1791
1794
  - test/components/typeahead-empty.directive.test.js
1792
- - test/components/bst-form-buttons.directive.test.js
1793
- - test/components/global-notification.service.test.js
1794
- - test/components/bst-edit.directive.test.js
1795
- - test/components/bst-modal.directive.test.js
1795
+ - test/features/bst-feature-flag.directive.test.js
1796
+ - test/features/feature-flag.service.test.js
1797
+ - test/i18n/translate.service.test.js
1798
+ - test/menu/menu-expander.service.test.js
1796
1799
  - test/routing.module.test.js
1797
1800
  - test/test-mocks.module.js
1798
- - test/menu/menu-expander.service.test.js
1799
- - test/i18n/translate.service.test.js
1800
- - test/bastion/test-constants.js
1801
- - test/utils/form-utils.service.test.js
1801
+ - test/utils/bastion-resource.factory.test.js
1802
1802
  - test/utils/disable-link.directive.test.js
1803
+ - test/utils/form-utils.service.test.js
1804
+ - test/utils/round-up.filter.test.js
1803
1805
  - test/utils/stop-event.directive.test.js
1804
- - test/utils/bastion-resource.factory.test.js
1805
1806
  - test/utils/urlencode.filter.test.js
1806
- - test/utils/round-up.filter.test.js