bastion 6.1.15 → 6.1.16

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: 13ffc69e73030b57a5fff08b7e9c528c0b7cb4fd
4
- data.tar.gz: 1efff373737cada489cbe63ece5ac05387d6c7ce
3
+ metadata.gz: 2607fab0f842cf9e2c34c584ff3a9859f1360d94
4
+ data.tar.gz: 15118cb3a4bfecc7545f62efc2a7522f63735f37
5
5
  SHA512:
6
- metadata.gz: 9e1a8af65eea0bb9eacf9294a74f7d3aead0538ce200354f8d9fd6942c2fca6a664f83c39c94f9b99b344e4591adc5e71432ffaa41901221f25a5af15766f07d
7
- data.tar.gz: c0ed8bb2304d11043be9fc722d5ad46b005904f3ddb15a57f340c75412908824e2adc404cba6e90f2715522c69b53a5a52a752df584a2c8fcb472f9dd271aff9
6
+ metadata.gz: c9f0d1cdf94458f08fb1c34246986c45ab812ae87435a9ae1605eb76a77f923e7872f4dcccc68d4e43304f58827d28297bf8d6921228a6de16d2cb8c8f2dbece
7
+ data.tar.gz: d96035fb9a5eba057d27bef4f5b6f1b93f7727ea75d798b41142450ca68f5bca334649d461c1c33445c98f83aed354af9cf1715a156da28e6424da322ac00a58
@@ -244,6 +244,8 @@ angular.module('Bastion.components')
244
244
  model: '=bstEditSelect',
245
245
  displayValueDefault: '=displayValueDefault',
246
246
  formatter: '@formatter',
247
+ iconClass: '=iconClass',
248
+ iconShow: '=iconShow',
247
249
  readonly: '=',
248
250
  selector: '=',
249
251
  handleOptions: '&options',
@@ -268,6 +270,8 @@ angular.module('Bastion.components')
268
270
  templateUrl: 'components/views/bst-edit-multiselect.html',
269
271
  scope: {
270
272
  model: '=bstEditMultiselect',
273
+ iconClass: '=iconClass',
274
+ iconShow: '=iconShow',
271
275
  formatter: '@formatter',
272
276
  formatterOptions: '@formatterOptions',
273
277
  handleOptions: '&options',
@@ -287,12 +291,17 @@ angular.module('Bastion.components')
287
291
 
288
292
  getIds = function (models) {
289
293
  models = models || [];
290
- return _.map(models, "id");
294
+ return _.chain(models).map("id").without(undefined).value();
291
295
  };
292
296
 
293
297
  checkPrevious = function () {
298
+ var appliedIds = getIds($scope.model);
299
+
300
+ if (_.isEmpty(appliedIds)) {
301
+ return;
302
+ }
303
+
294
304
  _.each($scope.options, function (tag) {
295
- var appliedIds = getIds($scope.model);
296
305
  if (_.includes(appliedIds, tag.id, 0)) {
297
306
  tag.selected = true;
298
307
  } else {
@@ -16,8 +16,15 @@ angular.module('Bastion.components').service("Notification", ['$interpolate', 'f
16
16
  return result;
17
17
  }
18
18
 
19
- this.setSuccessMessage = function (message, context) {
20
- foreman.toastNotifications.notify({message: interpolateIfNeeded(message, context), type: 'success'});
19
+ this.setSuccessMessage = function (message, options) {
20
+ var baseOptions, fullOptions;
21
+ /* eslint-disable no-unused-expressions */
22
+ (angular.isUndefined(options)) && (options = {});
23
+ /* eslint-enable no-unused-expressions */
24
+ baseOptions = { message: interpolateIfNeeded(message, options.context), type: 'success' };
25
+ delete options.context;
26
+ fullOptions = _.extend(baseOptions, options);
27
+ foreman.toastNotifications.notify(fullOptions);
21
28
  };
22
29
 
23
30
  this.setWarningMessage = function (message, context) {
@@ -81,8 +81,7 @@ angular.module('Bastion.components').factory('Nutupane',
81
81
  };
82
82
 
83
83
  self.loadParamsFromExistingTable = function (existingTable) {
84
- _.extend(existingTable.params, params);
85
- self.params = existingTable.params;
84
+ _.extend(params, existingTable.params);
86
85
  if (!self.table.searchTerm) {
87
86
  self.table.searchTerm = existingTable.searchTerm;
88
87
  }
@@ -4,7 +4,10 @@
4
4
  <i class="fa fa-edit inline-icon"></i>
5
5
  <i class="fa fa-remove inline-icon" ng-click="delete($event)" ng-show="deletable"></i>
6
6
  </span>
7
- <span class="editable-value">{{ displayValue }}</span>
7
+ <span>
8
+ <i class="{{ iconClass }}" ng-show="iconShow && displayValue"></i>
9
+ <span class="editable-value">{{ displayValue }}</span>
10
+ </span>
8
11
  </div>
9
12
 
10
13
  <span ng-switch on="buttonConfig">
@@ -37,7 +37,3 @@
37
37
  height: auto;
38
38
  max-width: 100%;
39
39
  }
40
-
41
- .editable-value {
42
- white-space: pre-line;
43
- }
@@ -1,3 +1,3 @@
1
1
  module Bastion
2
- VERSION = "6.1.15"
2
+ VERSION = "6.1.16"
3
3
  end
@@ -38,10 +38,17 @@ describe('Factory: Nofification', function() {
38
38
 
39
39
  it("allows message context to be specified for interpolation", function () {
40
40
  var message = "Everything ran correctly {{ ending }}!",
41
- $scope = {ending: 'yay'},
41
+ options = {link: "", context: {ending: 'yay'}},
42
42
  expectedMessage = 'Everything ran correctly yay!';
43
43
 
44
- Notification.setSuccessMessage(message, $scope);
45
- expect(foreman.toastNotifications.notify).toHaveBeenCalledWith({message: expectedMessage, type: 'success'});
44
+ Notification.setSuccessMessage(message, options);
45
+ expect(foreman.toastNotifications.notify).toHaveBeenCalledWith({message: expectedMessage, type: 'success', link: options.link});
46
+ });
47
+
48
+ it("provides link to success task", function () {
49
+ var message = "Everything ran correctly!";
50
+ options = {link: "www.redhat.com"};
51
+ Notification.setSuccessMessage(message, options);
52
+ expect(foreman.toastNotifications.notify).toHaveBeenCalledWith({message: message, type: 'success', link: options.link});
46
53
  });
47
54
  });
@@ -114,6 +114,13 @@ describe('Factory: Nutupane', function() {
114
114
  expect($location.search).toHaveBeenCalledWith('per_page', 20);
115
115
  });
116
116
 
117
+ it("from existing table", function () {
118
+ table = {params: {per_page: 30}};
119
+ expect(nutupane.table.params.per_page).toBe(20);
120
+ nutupane.loadParamsFromExistingTable(table);
121
+ expect(nutupane.table.params.per_page).toBe(30);
122
+ });
123
+
117
124
  it("but does not include page information if not paged", function () {
118
125
  nutupane.table.params.paged = false;
119
126
  nutupane.load();
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.15
4
+ version: 6.1.16
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-10-03 00:00:00.000000000 Z
12
+ date: 2018-10-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: angular-rails-templates