bastion 6.1.11 → 6.1.12

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
  SHA256:
3
- metadata.gz: 9889fdb808921927c5fc4ed0f61ffac56e915a71fe47b5680ea0f7b12c0bb60d
4
- data.tar.gz: 4060e70a4d9e676d43b48c53358d5325ae165c7ba89750d2a868265cf712c3bd
3
+ metadata.gz: 6f11831c757e085964eec515d0098685f75cbb377e37f520d7cc491e241a3ef8
4
+ data.tar.gz: f8aa80f861bc4f05bdc2cf907650325907369eae257e1b4d71815fb80bdf85ae
5
5
  SHA512:
6
- metadata.gz: '097e6a1a94545947ddccc03ed51a0cb54989b66b1fe0125a32e1c05b4db89aa682e8813842dd6bb96e51811f936e3d51da347c74273b49e41331f14c991ee364'
7
- data.tar.gz: '0380613c1913046a1009364b848c599815fa0e0f0a3822bb6a51c386be3784cb902dd4ea9b63a3ab1d8eabdf14a1a3465b8567d90bb485d96ea5f545daa66eb8'
6
+ metadata.gz: 572b7dac5e2e6c73886d4af66cb1913f51af9091e3b014ca19dfc4e9b7e6905a2c78a417a7b3e1adbd3ba942c3775b0a0d35b23534efab033dca74fe41d94168
7
+ data.tar.gz: ae41ce75f9710d2021e26191ae466fed3c13aa7cd1f23896a8eb388bedbadc92b1f64415605da9309e55a6b4699f2e60e1e503b6adc1286014fdefc5afe5a678
@@ -31,15 +31,14 @@
31
31
  }
32
32
 
33
33
  scope.showSwitcher = function () {
34
- var tableHasRows, isNewPage;
35
-
34
+ var tableHasRows, isNewPage, hideSwitcher;
36
35
  // Must have at least two items to switch between them
37
36
  tableHasRows = scope.table && scope.table.rows.length > 1;
38
-
37
+ hideSwitcher = scope.hideSwitcher;
39
38
  // Don't show the switcher when creating a new product
40
39
  isNewPage = /new$/.test($location.path());
41
40
 
42
- return tableHasRows && !isNewPage;
41
+ return tableHasRows && !isNewPage && !hideSwitcher;
43
42
  };
44
43
 
45
44
  scope.changeResource = function (id) {
@@ -50,7 +49,7 @@
50
49
  };
51
50
 
52
51
  unregisterWatcher = scope.$watch('table.rows', function (rows) {
53
- var currentId = parseInt($location.path().match(/\d+/)[0], 10);
52
+ var currentId = $location.path().match(/\d+/) ? parseInt($location.path().match(/\d+/)[0], 10) : null;
54
53
 
55
54
  angular.forEach(rows, function (row) {
56
55
  if (row.id === currentId) {
@@ -97,11 +97,7 @@
97
97
  </li>
98
98
  </ul>
99
99
 
100
- <label for="currentPage" class="sr-only" translate>
101
- Current Page
102
- </label>
103
-
104
- <input id="currentPage" ng-show="table.resource.subtotal > 0" class="pagination-pf-page" type="text" ng-model="table.params.page"
100
+ <input ng-show="table.resource.subtotal > 0" class="pagination-pf-page" type="text" ng-model="table.params.page"
105
101
  ng-blur="table.changePage(table.params.page)" bst-on-enter="table.changePage(table.params.page)"/>
106
102
 
107
103
  <input ng-show="table.resource.subtotal === 0" class="pagination-pf-page" type="text" readonly="true" ng-value="table.resource.subtotal"/>
@@ -1,3 +1,3 @@
1
1
  module Bastion
2
- VERSION = "6.1.11"
2
+ VERSION = "6.1.12"
3
3
  end
@@ -35,7 +35,7 @@ describe('Directive: bstResourceSwitcher', function() {
35
35
  TableCache = {
36
36
  getTable: function () {}
37
37
  };
38
-
38
+ hideSwitcher = true;
39
39
  $provide.value('translateFilter', function(a) { return a; });
40
40
  $provide.value('$breadcrumb', $breadcrumb);
41
41
  $provide.value('$location', $location);
@@ -83,5 +83,27 @@ describe('Directive: bstResourceSwitcher', function() {
83
83
 
84
84
  expect($location.path).toHaveBeenCalledWith('/fake/2');
85
85
  });
86
+
87
+ it("be able to show the resource switcher", function () {
88
+ createDirective();
89
+ scope.table = {
90
+ rows : {
91
+ length : 5
92
+ }
93
+ };
94
+ scope.hideSwitcher = false;
95
+ expect(scope.showSwitcher()).toBe(true);
96
+ });
97
+
98
+ it("be able to hide the resource switcher", function () {
99
+ createDirective();
100
+ scope.table = {
101
+ rows : {
102
+ length : 5
103
+ }
104
+ };
105
+ scope.hideSwitcher = true;
106
+ expect(scope.showSwitcher()).toBe(false);
107
+ });
86
108
  });
87
109
  });
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: 6.1.11
4
+ version: 6.1.12
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: 2018-05-24 00:00:00.000000000 Z
12
+ date: 2018-06-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: angular-rails-templates