bastion 6.1.15 → 6.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/bastion/components/bst-edit.directive.js +11 -2
- data/app/assets/javascripts/bastion/components/notification.service.js +9 -2
- data/app/assets/javascripts/bastion/components/nutupane.factory.js +1 -2
- data/app/assets/javascripts/bastion/components/views/bst-edit.html +4 -1
- data/app/assets/stylesheets/bastion/forms.scss +0 -4
- data/lib/bastion/version.rb +1 -1
- data/test/components/notification.service.test.js +10 -3
- data/test/components/nutupane.factory.test.js +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2607fab0f842cf9e2c34c584ff3a9859f1360d94
|
4
|
+
data.tar.gz: 15118cb3a4bfecc7545f62efc2a7522f63735f37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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,
|
20
|
-
|
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(
|
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
|
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">
|
data/lib/bastion/version.rb
CHANGED
@@ -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
|
-
|
41
|
+
options = {link: "", context: {ending: 'yay'}},
|
42
42
|
expectedMessage = 'Everything ran correctly yay!';
|
43
43
|
|
44
|
-
Notification.setSuccessMessage(message,
|
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.
|
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-
|
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
|